react-simple-formkit 2.1.4 → 2.1.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 +26 -6
- package/dist/react-simple-formkit.js +4 -4
- package/dist/react-simple-formkit.mjs +243 -239
- package/dist/react-simple-formkit.umd.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ Supports managing forms as uncontrolled. State updates only when watched. Simple
|
|
|
10
10
|
- [Core concepts](#core-concepts)
|
|
11
11
|
- [Modes of input field](#modes-of-input-field)
|
|
12
12
|
- [Watching for updates](#watching-for-updates)
|
|
13
|
+
- [The Power of watch (Unified Observation)](#the-power-of-watch-unified-observation)
|
|
13
14
|
- [Manage values](#manage-values)
|
|
14
15
|
- [Get value](#get-value)
|
|
15
16
|
- [Set value](#set-value)
|
|
@@ -186,11 +187,29 @@ return (
|
|
|
186
187
|
|
|
187
188
|
## Watching for updates
|
|
188
189
|
|
|
189
|
-
State updates only when observed via `watch()`, `useWatch()`, `subscribe()`, or by tracking changes through the Form component's `onChange`, `onBlur` callbacks.
|
|
190
|
+
State updates only when observed via `watch()`, `useWatch()`, `subscribe()`, or by tracking changes through the Form component's `onChange`, `onBlur` callbacks. You can watch Values, Form States, Field States, and Errors through the same interface.
|
|
190
191
|
|
|
191
192
|
- `watch()` will trigger a re-render at the form level.
|
|
192
193
|
- `useWatch()` will trigger a re-render only in the component where it is called.
|
|
193
194
|
- `onChange` is just a handler callback that is called when field values change.
|
|
195
|
+
- `onBlur` is just a handler callback that is called when field blurred.
|
|
196
|
+
|
|
197
|
+
> **Rule\*:** By default, onBlur works automatically for uncontrolled fields. However, for controlled fields, you must explicitly pass the onBlur prop when rendering the field. For captured fields, use actions.triggerFieldBlur(fieldName) to manually trigger the onBlur event.
|
|
198
|
+
|
|
199
|
+
### The Power of watch (Unified Observation)
|
|
200
|
+
|
|
201
|
+
The `watch` function (and `useWatch`, `subscribe`) is the "brain" of your form. Instead of having multiple hooks for different states, you can observe anything in the form using a unified dot-notation syntax:
|
|
202
|
+
|
|
203
|
+
| Target | Syntax Example | Description |
|
|
204
|
+
| :------------------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :------------------------------------------- |
|
|
205
|
+
| **All Values** | `watch()` | Observe every field value in the form. |
|
|
206
|
+
| **Specific Value** | `watch("email")` | Observe changes for a specific field. |
|
|
207
|
+
| **Form State** | `watch("formState")` <br/> `watch("formState.isDirty")` <br/> `watch("formState.isError")` <br/> `watch("formState.dirtyFields")` <br/> `watch("formState.touchedFields")` <br/> `watch("formState.errorFields")` | Track if the form has been modified. |
|
|
208
|
+
| **Field States** | `watch("fieldStates")` <br/> `watch("fieldStates.email")` <br/> `watch("fieldStates.email.isDirty")` <br/> `watch("fieldStates.email.isTouched")` <br/> `watch("fieldStates.email.isError")` <br/> `watch("fieldStates.email.customState")` <br/> | Monitor if a field has been interacted with. |
|
|
209
|
+
| **Errors** | `watch("errors")` <br/> `watch("errors.email")` <br/> | Get real-time validation error messages. |
|
|
210
|
+
| **Multiple values** | `watch(["email", "errors.email", "fieldStates.email", "formState.isDirty"])` <br/> | Get real-time validation error messages. |
|
|
211
|
+
|
|
212
|
+
> **💡Why it matters\*:** This unified approach ensures you only need to learn one API to track the entire lifecycle of your form.
|
|
194
213
|
|
|
195
214
|
# Manage values
|
|
196
215
|
|
|
@@ -373,6 +392,7 @@ Return:
|
|
|
373
392
|
- `actions.setValue()`: `(name: String, value: Any, options?: { shouldDirty?: Boolean, shouldTouched?: Boolean }) => void` [Example](#set-value)
|
|
374
393
|
- `actions.setError()`: `(name: String, error: Any) => void` [Example](#set-field-error)
|
|
375
394
|
- `actions.setFieldState()`: `(name: String, property: String, value: Any) => void` [Example](#set-field-states)
|
|
395
|
+
- `actions.triggerFieldBlur()`: `(name: String, value?: Any) => void`
|
|
376
396
|
- `actions.resetFieldState()`: `(name: String) => void`
|
|
377
397
|
- `actions.resetField()`: `(name: String) => void`
|
|
378
398
|
- `actions.clearError()`: `(name: String | Array) => void`
|
|
@@ -396,7 +416,7 @@ Generic props:
|
|
|
396
416
|
- `defaultValue`
|
|
397
417
|
- `render({name, value, onChange, onBlur, customState, setCustomState})`
|
|
398
418
|
|
|
399
|
-
## useController
|
|
419
|
+
## useController
|
|
400
420
|
|
|
401
421
|
Generic props:
|
|
402
422
|
|
|
@@ -405,7 +425,7 @@ Generic props:
|
|
|
405
425
|
|
|
406
426
|
Return: everything in render function above
|
|
407
427
|
|
|
408
|
-
## useWatch
|
|
428
|
+
## useWatch
|
|
409
429
|
|
|
410
430
|
[Example](#manage-values)
|
|
411
431
|
|
|
@@ -421,14 +441,14 @@ Return:
|
|
|
421
441
|
- if name is array: object of values of the fields
|
|
422
442
|
- if name is undefined: object of all input values
|
|
423
443
|
|
|
424
|
-
## useFormContext
|
|
444
|
+
## useFormContext
|
|
425
445
|
|
|
426
446
|
Return:
|
|
427
447
|
|
|
428
448
|
- `watch`
|
|
429
449
|
- `actions`
|
|
430
450
|
|
|
431
|
-
## watch
|
|
451
|
+
## watch
|
|
432
452
|
|
|
433
453
|
Arguments:
|
|
434
454
|
|
|
@@ -438,7 +458,7 @@ Return:
|
|
|
438
458
|
|
|
439
459
|
- same with useWatch()
|
|
440
460
|
|
|
441
|
-
## subscribe
|
|
461
|
+
## subscribe
|
|
442
462
|
|
|
443
463
|
Arguments:
|
|
444
464
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");var
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react");var oe={exports:{}},ee={};/**
|
|
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 ae;function Ee(){if(ae)return ee;ae=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function f(g,b,h){var E=null;if(h!==void 0&&(E=""+h),b.key!==void 0&&(E=""+b.key),"key"in b){h={};for(var p in b)p!=="key"&&(h[p]=b[p])}else h=b;return b=h.ref,{$$typeof:n,type:g,key:E,ref:b!==void 0?b:null,props:h}}return ee.Fragment=o,ee.jsx=f,ee.jsxs=f,ee}var re={};/**
|
|
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 ce;function ge(){return ce||(ce=1,process.env.NODE_ENV!=="production"&&function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case $:return"Profiler";case _:return"StrictMode";case te:return"Suspense";case se:return"SuspenseList";case j:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case i:return"Portal";case Y:return(e.displayName||"Context")+".Provider";case D:return(e._context.displayName||"Context")+".Consumer";case q:var a=e.render;return e=e.displayName,e||(e=a.displayName||a.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ne:return a=e.displayName||null,a!==null?a:n(e.type)||"Memo";case J:a=e._payload,e=e._init;try{return n(e(a))}catch{}}return null}function o(e){return""+e}function f(e){try{o(e);var a=!1}catch{a=!0}if(a){a=console;var R=a.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return R.call(a,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),o(e)}}function g(e){if(e===d)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===J)return"<...>";try{var a=n(e);return a?"<"+a+">":"<...>"}catch{return"<...>"}}function b(){var e=x.A;return e===null?null:e.getOwner()}function h(){return Error("react-stack-top-frame")}function E(e){if(W.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function p(e,a){function R(){G||(G=!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)",a))}R.isReactWarning=!0,Object.defineProperty(e,"key",{get:R,configurable:!0})}function v(){var e=n(this.type);return H[e]||(H[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function T(e,a,R,F,w,A,I,B){return R=A.ref,e={$$typeof:u,type:e,key:a,props:A,_owner:w},(R!==void 0?R:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:I}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:B}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function c(e,a,R,F,w,A,I,B){var k=a.children;if(k!==void 0)if(F)if(N(k)){for(F=0;F<k.length;F++)m(k[F]);Object.freeze&&Object.freeze(k)}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 m(k);if(W.call(a,"key")){k=n(e);var P=Object.keys(a).filter(function(r){return r!=="key"});F=0<P.length?"{key: someKey, "+P.join(": ..., ")+": ...}":"{key: someKey}",Z[k+F]||(P=0<P.length?"{"+P.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} />`,v,F,V,F),Z[F+v]=!0)}if(F=null,R!==void 0&&(f(R),F=""+R),E(a)&&(f(a.key),F=""+a.key),"key"in a){R={};for(var r in a)r!=="key"&&(R[r]=a[r])}else R=a;return F&&C(R,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,F,A,w,b(),R,L,D)}function m(e){typeof e=="object"&&e!==null&&e.$$typeof===u&&e._store&&(e._store.validated=1)}var l=t,u=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),I=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),re=Symbol.for("react.suspense"),te=Symbol.for("react.suspense_list"),se=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),P=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,x=Array.isArray,N=console.createTask?console.createTask:function(){return null};l={"react-stack-bottom-frame":function(e){return e()}};var G,H={},X=l["react-stack-bottom-frame"].bind(l,h)(),S=N(g(h)),Z={};ee.Fragment=d,ee.jsx=function(e,a,R,v,w){var A=1e4>P.recentlyCreatedOwnerStacks++;return c(e,a,R,!1,v,w,A?Error("react-stack-top-frame"):X,A?N(g(e)):S)},ee.jsxs=function(e,a,R,v,w){var A=1e4>P.recentlyCreatedOwnerStacks++;return c(e,a,R,!0,v,w,A?Error("react-stack-top-frame"):X,A?N(g(e)):S)}}()),ee}var ce;function ge(){return ce||(ce=1,process.env.NODE_ENV==="production"?ne.exports=me():ne.exports=Ee()),ne.exports}var le=ge();const k=()=>{},fe=t.createContext({ref:null,watch:k,actions:{reset:k,resetField:k,setValue:k,getValues:k,getErrors:k,getFieldStates:k,getFormStates:k,setError:k,clearError:k,clearErrors:k,checkValidity:k,getNumberFields:k,getFieldValidity:k,getDefaultValues:k,setFieldState:k,resetFieldState:k,getControlledFields:k},registerController:k,registerHookWatcher:k,lastReloadedAt:k,loadFormValues:k,getWatchValue:k,channels:{}}),oe=()=>t.useContext(fe),he=({id:n,control:o,method:f,action:g,children:b,onSubmit:h=()=>{},onInput:E=()=>{},onChange:C=()=>{},onBlur:p=()=>{},onReset:T=()=>{},numberFields:c=[],className:m,...l})=>(t.useEffect(()=>{const u=o.channels.subscribe("onChange",C),i=o.channels.subscribe("onBlur",p);return()=>{u(),i()}},[]),le.jsx(fe.Provider,{value:o,children:le.jsx("form",{id:n,ref:o.ref,action:g,method:f,className:m,onInput:E,onSubmit:u=>{f||u.preventDefault();const i=o.loadFormValues();h(i)},onChange:u=>{const i=u.target.name;o.actions.getControlledFields().has(i)||o.actions.setValue(i,u.target.value)},onBlur:u=>{const i=u.target.name;if(o.actions.getControlledFields().has(i))return;const d=u.target.value;o.channels.publish("onBlur",i,d,o.actions.getValues())},onReset:u=>{o.actions.reset(),T(u)},...l,children:b},o.lastReloadedAt)})),de=({control:n,name:o,compute:f})=>{const{getWatchValue:g,registerHookWatcher:b}=n||oe(),h=g({name:o,compute:f}),[E,C]=t.useState(h);return t.useEffect(()=>{const p=b({name:o,compute:f,value:E,setValue:C});return()=>p.forEach(T=>T())},[]),E},be=({name:n,defaultValue:o})=>{const{actions:f,registerController:g,channels:b}=oe(),h=t.useRef(),E=f.getDefaultValues()[n]||o,[C,p]=t.useState(E),T=de({name:`fieldStates.${n}.customState`}),c=t.useCallback(u=>{f.setFieldState(n,"customState",u)},[]),m=t.useCallback((u,{shouldDirty:i=!0,shouldOnChange:d=!0}={})=>{p(u),f.setValue(n,u,{shouldDirty:i,shouldOnChange:d})},[f.setValue]),l=t.useCallback(()=>{b.publish("onBlur",n,C,f.getValues())},[]);return t.useEffect(()=>g(n,p),[]),{ref:h,name:n,defaultValue:E,value:C,onChange:m,onBlur:l,customState:T,setCustomState:c}},Re=({name:n,defaultValue:o,render:f=({ref:g,name:b,defaultValue:h,value:E,onChange:C,onBlur:p,customState:T,setCustomState:c})=>null})=>{const g=be({name:n,defaultValue:o});return f(g)},ke=["errors","fieldStates","formState"],U=n=>ke.some(o=>n.startsWith(o))?n:"values."+n,Se=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],ie=n=>{typeof n.setCustomValidity=="function"&&n.setCustomValidity("");let o=n.validity,f=Se.find(g=>o[g]);if(f)return{type:f,message:n.validationMessage}};class Ce{constructor(){this.events=new Map}getEvents(){return this.events}subscribe(o,f){return this.events.has(o)||this.events.set(o,new Set),this.events.get(o).add(f),()=>{var g;return(g=this.events.get(o))==null?void 0:g.delete(f)}}publish(o,...f){const g=this.events.get(o);g&&g.forEach(b=>b(...f)),this.events.forEach((b,h)=>{o.includes(h)&&b.forEach(E=>E(...f))})}reset(){this.events.clear()}}const ye=()=>{const n=t.useRef(new Ce),o=t.useCallback((b,...h)=>{n.current.publish(b,...h)},[]),f=t.useCallback((b,h)=>n.current.subscribe(b,h),[]),g=t.useCallback(()=>{n.current.reset()},[]);return{publish:o,subscribe:f,reset:g}},pe=()=>{const[n,o]=t.useState(),f=t.useCallback(()=>o(new Date().toString()),[]);return[n,f]},ve=()=>{const[,n]=t.useState({});return t.useCallback(()=>n({}),[])},Fe=({channels:n,getValues:o,getErrors:f,getFieldStates:g,getFormState:b})=>{const h=ve(),E=t.useCallback(({name:c,compute:m})=>{if(typeof m=="function")return m(o());if(Array.isArray(c)){const l={};return c.forEach(u=>{l[u]=E({name:u})}),l}return c.replaceAll(/\[(\d+)\]/g,".$1").split(".").reduce((l,u)=>l&&l[u]!==void 0?l[u]:void 0,{...o(),errors:{...f()},formState:{...b()},fieldStates:{...g()}})},[]),C=t.useCallback(c=>{if(!c)return n.subscribe("values",()=>{h()}),o();if(typeof c=="string"){const m=U(c);return n.subscribe(m,()=>{h()}),E({name:c})}if(Array.isArray(c)){const m={};return c.forEach(l=>{const u=U(l);n.subscribe(u,()=>{h()}),m[l]=E({name:l})}),m}throw new Error("Parameters of watch must be string or array of string")},[]),p=t.useCallback(({name:c,compute:m,value:l,setValue:u})=>{if(typeof m=="function")return[n.subscribe("values",()=>{const d=E({compute:m});d!==l&&u(d)})];if(c)if(typeof c=="string"){const i=U(c);return[n.subscribe(i,()=>{const _=E({name:c});_!==l&&u(_)})]}else if(Array.isArray(c)){const i=E({name:c}),d=[];return c.forEach(_=>{const Y=U(_),W=n.subscribe(Y,()=>{const I=E({name:_});i[_]!==I&&(i[_]=I,u({...i}))});d.push(W)}),d}else throw new Error("Parameters of name must be string or array of string or compute must be a function");else return[n.subscribe("values",()=>{u(o())})]},[]),T=t.useCallback((c,m)=>{if(typeof c===void 0)return n.subscribe("values",m);if(typeof c=="string"){const l=U(c);return n.subscribe(l,m)}if(Array.isArray(c)){const l={},u=[];return c.forEach(i=>{const d=U(i),_=n.subscribe(d,()=>{l[i]=E({name:i}),m(l)});u.push(_)}),u}},[n]);return{watch:C,registerHookWatcher:p,getWatchValue:E,subscribe:T}},Te=[],_e={},Ae=({numberFields:n=Te,defaultValues:o=_e,shouldUnRegister:f=!1,shouldConvertNumber:g=!1}={})=>{const[b,h]=pe(),E=t.useRef(),C=t.useRef(!1),p=t.useRef(!1),T=t.useRef(n),c=t.useRef(new Map),m=t.useRef({}),l=t.useRef({}),u=t.useRef(o),i=t.useRef(o),d=ye(),_=t.useCallback(()=>{l.current=Object.keys(i.current).reduce((r,s)=>({...r,[s]:{isError:!1,isDirty:!1,isTouched:!1,customState:null}}),{})},[]),Y=t.useCallback((r={})=>{i.current={...i.current,...r},u.current={...i.current},c.current.forEach((s,y)=>{s(i.current[y])}),C.current=!1,m.current={},T.current=n,c.current=new Map,d.reset(),_(),n.length>0&&(g=!0),h()},[]),W=t.useCallback(()=>{const r=Object.fromEntries(new FormData(E.current));return c.current.forEach(y=>{r[y]=u.current[y]}),g&&T.current.forEach(y=>r.hasOwnProperty(y)&&(r[y]=Number(r[y])||0)),r},[]),I=t.useCallback(()=>!!Object.values(M()).find(r=>r.isDirty),[]),q=t.useCallback(()=>!!Object.values(P()).find(r=>!!r),[]),re=t.useCallback(r=>ie(r.target),[]),te=t.useCallback(()=>i.current,[]),se=t.useCallback(()=>T.current,[]),J=t.useCallback(()=>c.current,[]),j=t.useCallback((r,s)=>s?Array.isArray(s)?s.map(y=>r[y]):r[s]:{...r},[]),z=t.useCallback(r=>j(u.current,r),[j]),P=t.useCallback(r=>j(m.current,r),[j]),M=t.useCallback(r=>j(l.current,r),[j]),x=t.useCallback(r=>j({isDirty:C.current,isError:p.current,errorFields:Object.keys(m.current).filter(s=>!!m.current[s]),dirtyFields:Object.keys(l.current).filter(s=>l.current[s].isDirty),touchedFields:Object.keys(l.current).filter(s=>l.current[s].isTouched)},r),[j]),{watch:N,registerHookWatcher:G,getWatchValue:H,subscribe:X}=Fe({channels:d,getValues:z,getErrors:P,getFieldStates:M,getFormState:x}),S=t.useCallback((r,s,y)=>{const O=l.current[r];O[s]!==y&&(l.current[r]={...O,[s]:y},d.publish(`fieldStates.${r}.${s}`,y),s==="isError"&&d.publish("formState.errorFields",x("errorFields")),s==="isDirty"&&d.publish("formState.dirtyFields",x("dirtyFields")),s==="isTouched"&&d.publish("formState.touchedFields",x("touchedFields")))},[]),Z=t.useCallback(r=>{S(r,"isError",!1),S(r,"isDirty",!1),S(r,"isTouched",!1),S(r,"customState",null)},[S]),e=t.useCallback((r,s)=>{if(m.current[r]===s)return;m.current[r]=s,S(r,"isError",!!s),d.publish(`errors.${r}`,s);const O=q();p.current!==O&&(p.current=O,d.publish("formState.isError",O))},[S]),a=t.useCallback(r=>{if(!m.current[r])return;m.current[r]=null,S(r,"isError",!1),d.publish(`errors.${r}`,null);const s=q();p.current!==s&&(p.current=s,d.publish("formState.isError",s))},[S]),R=t.useCallback(()=>{if(Object.keys(m.current)===0)return;m.current={},d.publish("errors",m.current);const r=q();p.current!==r&&(p.current=r,d.publish("formState.isError",r))},[]),v=t.useCallback(r=>{const s=ie(r.target);s?e(r.target.name,s):a(r.target.name)},[e,a]),w=t.useCallback((r,s,{shouldDirty:y=!0,shouldOnChange:O=!0}={})=>{if(s===u.current[r])return;g&&T.current.includes(r)&&(s=Number(s)||void 0),S(r,"isTouched",!0);const Q=s!==i.current[r];y&&l.current[r].isDirty!==Q&&S(r,"isDirty",Q);const $=I();C.current!==$&&(C.current=$,d.publish("formState.isDirty",$)),u.current[r]=s;const B=c.current.get(r);B&&B(s),d.publish(`values.${r}`,s,{shouldDirty:y,shouldOnChange:O}),O&&d.publish("onChange",r,s,u.current)},[S]),A=t.useCallback((r,s)=>(c.current.set(r,s),()=>{f&&c.current.delete(r)}),[]),L=t.useCallback((r,{keepError:s,keepDirty:y,keepTouched:O,keepCustomState:Q,defaultValue:$})=>{const B=c.current.get(r);if(!B)throw new Error(`Cannot reset "${r}" because it's uncontrolled field`);i.current[r]=$,u.current[r]=$,B&&B($),s||a(r),y||S(r,"isDirty",!1),O||S(r,"isTouched",!1),Q||S(r,"customState",null)},[a,S]),D=t.useMemo(()=>({subscribe:X,reset:Y,resetField:L,setValue:w,getValues:z,getErrors:P,getFieldStates:M,getFormState:x,setError:e,clearError:a,clearErrors:R,checkValidity:v,getNumberFields:se,getFieldValidity:re,getDefaultValues:te,setFieldState:S,resetFieldState:Z,getControlledFields:J}),[X,Y,L,w,z,P,M,x,e,a,R,v,se,re,te,S,Z,J]),F=t.useMemo(()=>({ref:E,watch:N,actions:D,registerController:A,registerHookWatcher:G,lastReloadedAt:b,loadFormValues:W,getWatchValue:H,channels:d}),[E,N,D,A,G,b,W,H,d]),V=t.useMemo(()=>({control:F,actions:D,watch:N}),[b,F,D,N]);return t.useLayoutEffect(()=>{if([...E.current.querySelectorAll("[name]")].forEach(s=>{!s.defaultValue&&i.current[s.name]&&(s.defaultValue=i.current[s.name]),s.type==="number"&&!T.current.includes(s.name)&&T.current.push(s.name)}),E.current){const s=W();u.current={...s},i.current={...s}}},[b]),t.useLayoutEffect(()=>{_()},[]),V};exports.Controller=Re;exports.Form=he;exports.useController=be;exports.useForm=Ae;exports.useFormContext=oe;exports.useWatch=de;
|
|
22
|
+
<%s key={someKey} {...props} />`,F,k,P,k),Z[k+F]=!0)}if(k=null,R!==void 0&&(f(R),k=""+R),E(a)&&(f(a.key),k=""+a.key),"key"in a){R={};for(var Q in a)Q!=="key"&&(R[Q]=a[Q])}else R=a;return k&&p(R,typeof e=="function"?e.displayName||e.name||"Unknown":e),T(e,k,A,w,b(),R,I,B)}function m(e){typeof e=="object"&&e!==null&&e.$$typeof===u&&e._store&&(e._store.validated=1)}var l=t,u=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),$=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),Y=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),te=Symbol.for("react.suspense"),se=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),x=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=Object.prototype.hasOwnProperty,N=Array.isArray,V=console.createTask?console.createTask:function(){return null};l={"react-stack-bottom-frame":function(e){return e()}};var G,H={},X=l["react-stack-bottom-frame"].bind(l,h)(),C=V(g(h)),Z={};re.Fragment=d,re.jsx=function(e,a,R,F,w){var A=1e4>x.recentlyCreatedOwnerStacks++;return c(e,a,R,!1,F,w,A?Error("react-stack-top-frame"):X,A?V(g(e)):C)},re.jsxs=function(e,a,R,F,w){var A=1e4>x.recentlyCreatedOwnerStacks++;return c(e,a,R,!0,F,w,A?Error("react-stack-top-frame"):X,A?V(g(e)):C)}}()),re}var le;function he(){return le||(le=1,process.env.NODE_ENV==="production"?oe.exports=Ee():oe.exports=ge()),oe.exports}var ie=he();const S=()=>{},de=t.createContext({ref:null,watch:S,actions:{reset:S,resetField:S,setValue:S,getValues:S,getErrors:S,getFieldStates:S,getFormStates:S,setError:S,clearError:S,clearErrors:S,checkValidity:S,getNumberFields:S,getFieldValidity:S,getDefaultValues:S,setFieldState:S,resetFieldState:S,getControlledFields:S},registerController:S,registerHookWatcher:S,lastReloadedAt:S,loadFormValues:S,getWatchValue:S,channels:{}}),ue=()=>t.useContext(de),Re=({id:n,control:o,method:f,action:g,children:b,onSubmit:h=()=>{},onInput:E=()=>{},onChange:p=()=>{},onBlur:v=()=>{},onReset:T=()=>{},numberFields:c=[],className:m,...l})=>(t.useEffect(()=>{const u=o.channels.subscribe("onChange",p),i=o.channels.subscribe("onBlur",v);return()=>{u(),i()}},[]),ie.jsx(de.Provider,{value:o,children:ie.jsx("form",{id:n,ref:o.ref,action:g,method:f,className:m,onInput:E,onSubmit:u=>{f||u.preventDefault();const i=o.loadFormValues();h(i)},onChange:u=>{const i=u.target.name;o.actions.getControlledFields().has(i)||o.actions.setValue(i,u.target.value)},onBlur:u=>{const i=u.target.name;if(o.actions.getControlledFields().has(i))return;const d=u.target.value;o.channels.publish("onBlur",i,d,o.actions.getValues())},onReset:u=>{o.actions.reset(),T(u)},...l,children:b},o.lastReloadedAt)})),be=({control:n,name:o,compute:f})=>{const{getWatchValue:g,registerHookWatcher:b}=n||ue(),h=g({name:o,compute:f}),[E,p]=t.useState(h);return t.useEffect(()=>{const v=b({name:o,compute:f,value:E,setValue:p});return()=>v.forEach(T=>T())},[]),E},me=({name:n,defaultValue:o})=>{const{actions:f,registerController:g,channels:b}=ue(),h=t.useRef(),E=f.getDefaultValues()[n]||o,[p,v]=t.useState(E),T=be({name:`fieldStates.${n}.customState`}),c=t.useCallback(u=>{f.setFieldState(n,"customState",u)},[]),m=t.useCallback((u,{shouldDirty:i=!0,shouldOnChange:d=!0}={})=>{v(u),f.setValue(n,u,{shouldDirty:i,shouldOnChange:d})},[f.setValue]),l=t.useCallback(()=>{b.publish("onBlur",n,p,f.getValues())},[]);return t.useEffect(()=>g(n,v),[]),{ref:h,name:n,defaultValue:E,value:p,onChange:m,onBlur:l,customState:T,setCustomState:c}},ke=({name:n,defaultValue:o,render:f=({ref:g,name:b,defaultValue:h,value:E,onChange:p,onBlur:v,customState:T,setCustomState:c})=>null})=>{const g=me({name:n,defaultValue:o});return f(g)},Se=["errors","fieldStates","formState"],U=n=>Se.some(o=>n.startsWith(o))?n:"values."+n,Ce=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],fe=n=>{typeof n.setCustomValidity=="function"&&n.setCustomValidity("");let o=n.validity,f=Ce.find(g=>o[g]);if(f)return{type:f,message:n.validationMessage}};class pe{constructor(){this.events=new Map}getEvents(){return this.events}subscribe(o,f){return this.events.has(o)||this.events.set(o,new Set),this.events.get(o).add(f),()=>{var g;return(g=this.events.get(o))==null?void 0:g.delete(f)}}publish(o,...f){const g=this.events.get(o);g&&g.forEach(b=>b(...f)),this.events.forEach((b,h)=>{o.includes(h)&&b.forEach(E=>E(...f))})}reset(){this.events.clear()}}const ye=()=>{const n=t.useRef(new pe),o=t.useCallback((b,...h)=>{n.current.publish(b,...h)},[]),f=t.useCallback((b,h)=>n.current.subscribe(b,h),[]),g=t.useCallback(()=>{n.current.reset()},[]);return{publish:o,subscribe:f,reset:g}},ve=()=>{const[n,o]=t.useState(),f=t.useCallback(()=>o(new Date().toString()),[]);return[n,f]},Fe=()=>{const[,n]=t.useState({});return t.useCallback(()=>n({}),[])},Te=({channels:n,getValues:o,getErrors:f,getFieldStates:g,getFormState:b})=>{const h=Fe(),E=t.useCallback(({name:c,compute:m})=>{if(typeof m=="function")return m(o());if(Array.isArray(c)){const l={};return c.forEach(u=>{l[u]=E({name:u})}),l}return c.replaceAll(/\[(\d+)\]/g,".$1").split(".").reduce((l,u)=>l&&l[u]!==void 0?l[u]:void 0,{...o(),errors:{...f()},formState:{...b()},fieldStates:{...g()}})},[]),p=t.useCallback(c=>{if(!c)return n.subscribe("values",()=>{h()}),o();if(typeof c=="string"){const m=U(c);return n.subscribe(m,()=>{h()}),E({name:c})}if(Array.isArray(c)){const m={};return c.forEach(l=>{const u=U(l);n.subscribe(u,()=>{h()}),m[l]=E({name:l})}),m}throw new Error("Parameters of watch must be string or array of string")},[]),v=t.useCallback(({name:c,compute:m,value:l,setValue:u})=>{if(typeof m=="function")return[n.subscribe("values",()=>{const d=E({compute:m});d!==l&&u(d)})];if(c)if(typeof c=="string"){const i=U(c);return[n.subscribe(i,()=>{const _=E({name:c});_!==l&&u(_)})]}else if(Array.isArray(c)){const i=E({name:c}),d=[];return c.forEach(_=>{const $=U(_),D=n.subscribe($,()=>{const Y=E({name:_});i[_]!==Y&&(i[_]=Y,u({...i}))});d.push(D)}),d}else throw new Error("Parameters of name must be string or array of string or compute must be a function");else return[n.subscribe("values",()=>{u(o())})]},[]),T=t.useCallback((c,m)=>{if(typeof c===void 0)return n.subscribe("values",m);if(typeof c=="string"){const l=U(c);return n.subscribe(l,m)}if(Array.isArray(c)){const l={},u=[];return c.forEach(i=>{const d=U(i),_=n.subscribe(d,()=>{l[i]=E({name:i}),m(l)});u.push(_)}),u}},[n]);return{watch:p,registerHookWatcher:v,getWatchValue:E,subscribe:T}},_e=[],Ae={},we=({numberFields:n=_e,defaultValues:o=Ae,shouldUnRegister:f=!1,shouldConvertNumber:g=!1}={})=>{const[b,h]=ve(),E=t.useRef(),p=t.useRef(!1),v=t.useRef(!1),T=t.useRef(n),c=t.useRef(new Map),m=t.useRef({}),l=t.useRef({}),u=t.useRef(o),i=t.useRef(o),d=ye(),_=t.useCallback(()=>{l.current=Object.keys(i.current).reduce((r,s)=>({...r,[s]:{isError:!1,isDirty:!1,isTouched:!1,customState:null}}),{})},[]),$=t.useCallback((r={})=>{i.current={...i.current,...r},u.current={...i.current},c.current.forEach((s,y)=>{s(i.current[y])}),p.current=!1,m.current={},T.current=n,c.current=new Map,d.reset(),_(),n.length>0&&(g=!0),h()},[]),D=t.useCallback(()=>{const r=Object.fromEntries(new FormData(E.current));return c.current.forEach(y=>{r[y]=u.current[y]}),g&&T.current.forEach(y=>r.hasOwnProperty(y)&&(r[y]=Number(r[y])||0)),r},[]),Y=t.useCallback(()=>!!Object.values(W()).find(r=>r.isDirty),[]),q=t.useCallback(()=>!!Object.values(x()).find(r=>!!r),[]),te=t.useCallback(r=>fe(r.target),[]),se=t.useCallback(()=>i.current,[]),ne=t.useCallback(()=>T.current,[]),J=t.useCallback(()=>c.current,[]),j=t.useCallback((r,s)=>s?Array.isArray(s)?s.map(y=>r[y]):r[s]:{...r},[]),z=t.useCallback(r=>j(u.current,r),[j]),x=t.useCallback(r=>j(m.current,r),[j]),W=t.useCallback(r=>j(l.current,r),[j]),N=t.useCallback(r=>j({isDirty:p.current,isError:v.current,errorFields:Object.keys(m.current).filter(s=>!!m.current[s]),dirtyFields:Object.keys(l.current).filter(s=>l.current[s].isDirty),touchedFields:Object.keys(l.current).filter(s=>l.current[s].isTouched)},r),[j]),{watch:V,registerHookWatcher:G,getWatchValue:H,subscribe:X}=Te({channels:d,getValues:z,getErrors:x,getFieldStates:W,getFormState:N}),C=t.useCallback((r,s,y)=>{const O=l.current[r];O[s]!==y&&(l.current[r]={...O,[s]:y},d.publish(`fieldStates.${r}.${s}`,y),s==="isError"&&d.publish("formState.errorFields",N("errorFields")),s==="isDirty"&&d.publish("formState.dirtyFields",N("dirtyFields")),s==="isTouched"&&d.publish("formState.touchedFields",N("touchedFields")))},[]),Z=t.useCallback(r=>{C(r,"isError",!1),C(r,"isDirty",!1),C(r,"isTouched",!1),C(r,"customState",null)},[C]),e=t.useCallback((r,s)=>{if(m.current[r]===s)return;m.current[r]=s,C(r,"isError",!!s),d.publish(`errors.${r}`,s);const O=q();v.current!==O&&(v.current=O,d.publish("formState.isError",O))},[C]),a=t.useCallback(r=>{if(!m.current[r])return;m.current[r]=null,C(r,"isError",!1),d.publish(`errors.${r}`,null);const s=q();v.current!==s&&(v.current=s,d.publish("formState.isError",s))},[C]),R=t.useCallback(()=>{if(Object.keys(m.current)===0)return;m.current={},d.publish("errors",m.current);const r=q();v.current!==r&&(v.current=r,d.publish("formState.isError",r))},[]),F=t.useCallback(r=>{const s=fe(r.target);s?e(r.target.name,s):a(r.target.name)},[e,a]),w=t.useCallback((r,s,{shouldDirty:y=!0,shouldOnChange:O=!0}={})=>{if(s===u.current[r])return;g&&T.current.includes(r)&&(s=Number(s)||void 0),C(r,"isTouched",!0);const K=s!==i.current[r];y&&l.current[r].isDirty!==K&&C(r,"isDirty",K);const M=Y();p.current!==M&&(p.current=M,d.publish("formState.isDirty",M)),u.current[r]=s;const L=c.current.get(r);L&&L(s),d.publish(`values.${r}`,s,{shouldDirty:y,shouldOnChange:O}),O&&d.publish("onChange",r,s,u.current)},[C]),A=t.useCallback((r,s)=>(c.current.set(r,s),()=>{f&&c.current.delete(r)}),[]),I=t.useCallback((r,{keepError:s,keepDirty:y,keepTouched:O,keepCustomState:K,defaultValue:M})=>{const L=c.current.get(r);if(!L)throw new Error(`Cannot reset "${r}" because it's uncontrolled field`);i.current[r]=M,u.current[r]=M,L&&L(M),s||a(r),y||C(r,"isDirty",!1),O||C(r,"isTouched",!1),K||C(r,"customState",null)},[a,C]),B=t.useCallback((r,s=k.getValues(r))=>{d.publish("onBlur",r,s,k.getValues())},[]),k=t.useMemo(()=>({subscribe:X,reset:$,resetField:I,setValue:w,getValues:z,getErrors:x,getFieldStates:W,getFormState:N,setError:e,clearError:a,clearErrors:R,checkValidity:F,getNumberFields:ne,getFieldValidity:te,getDefaultValues:se,setFieldState:C,triggerFieldBlur:B,resetFieldState:Z,getControlledFields:J}),[X,$,I,w,z,x,W,N,e,a,R,F,ne,te,se,C,Z,B,J]),P=t.useMemo(()=>({ref:E,watch:V,actions:k,registerController:A,registerHookWatcher:G,lastReloadedAt:b,loadFormValues:D,getWatchValue:H,channels:d}),[E,V,k,A,G,b,D,H,d]),Q=t.useMemo(()=>({control:P,actions:k,watch:V}),[b,P,k,V]);return t.useLayoutEffect(()=>{if([...E.current.querySelectorAll("[name]")].forEach(s=>{!s.defaultValue&&i.current[s.name]&&(s.defaultValue=i.current[s.name]),s.type==="number"&&!T.current.includes(s.name)&&T.current.push(s.name)}),E.current){const s=D();u.current={...s},i.current={...s}}},[b]),t.useLayoutEffect(()=>{_()},[]),Q};exports.Controller=ke;exports.Form=Re;exports.useController=me;exports.useForm=we;exports.useFormContext=ue;exports.useWatch=be;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import Re, { createContext as Se, useContext as pe, useEffect as ie, useState as ce, useRef as j, useCallback as f, useMemo as ae, useLayoutEffect as le } from "react";
|
|
2
|
+
var ue = { exports: {} }, re = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var oe = { exports: {} }, ee = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
12
|
+
var fe;
|
|
13
|
+
function ye() {
|
|
14
|
+
if (fe) return re;
|
|
15
|
+
fe = 1;
|
|
16
16
|
var s = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
17
|
-
function l(
|
|
17
|
+
function l(g, b, h) {
|
|
18
18
|
var E = null;
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else
|
|
24
|
-
return b =
|
|
19
|
+
if (h !== void 0 && (E = "" + h), b.key !== void 0 && (E = "" + b.key), "key" in b) {
|
|
20
|
+
h = {};
|
|
21
|
+
for (var v in b)
|
|
22
|
+
v !== "key" && (h[v] = b[v]);
|
|
23
|
+
} else h = b;
|
|
24
|
+
return b = h.ref, {
|
|
25
25
|
$$typeof: s,
|
|
26
|
-
type:
|
|
26
|
+
type: g,
|
|
27
27
|
key: E,
|
|
28
28
|
ref: b !== void 0 ? b : null,
|
|
29
|
-
props:
|
|
29
|
+
props: h
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return re.Fragment = n, re.jsx = l, re.jsxs = l, re;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var te = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,9 +41,9 @@ var re = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
44
|
+
var de;
|
|
45
|
+
function ve() {
|
|
46
|
+
return de || (de = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
47
|
function s(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
@@ -52,13 +52,13 @@ function ye() {
|
|
|
52
52
|
switch (e) {
|
|
53
53
|
case d:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case Y:
|
|
56
56
|
return "Profiler";
|
|
57
57
|
case A:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case te:
|
|
60
|
-
return "Suspense";
|
|
61
59
|
case se:
|
|
60
|
+
return "Suspense";
|
|
61
|
+
case ne:
|
|
62
62
|
return "SuspenseList";
|
|
63
63
|
case P:
|
|
64
64
|
return "Activity";
|
|
@@ -69,14 +69,14 @@ function ye() {
|
|
|
69
69
|
), e.$$typeof) {
|
|
70
70
|
case i:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case I:
|
|
73
73
|
return (e.displayName || "Context") + ".Provider";
|
|
74
|
-
case
|
|
74
|
+
case W:
|
|
75
75
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
76
|
case J:
|
|
77
77
|
var u = e.render;
|
|
78
78
|
return e = e.displayName, e || (e = u.displayName || u.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case
|
|
79
|
+
case oe:
|
|
80
80
|
return u = e.displayName || null, u !== null ? u : s(e.type) || "Memo";
|
|
81
81
|
case z:
|
|
82
82
|
u = e._payload, e = e._init;
|
|
@@ -99,15 +99,15 @@ function ye() {
|
|
|
99
99
|
}
|
|
100
100
|
if (u) {
|
|
101
101
|
u = console;
|
|
102
|
-
var R = u.error,
|
|
102
|
+
var R = u.error, _ = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
103
|
return R.call(
|
|
104
104
|
u,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
|
-
|
|
106
|
+
_
|
|
107
107
|
), n(e);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function g(e) {
|
|
111
111
|
if (e === d) return "<>";
|
|
112
112
|
if (typeof e == "object" && e !== null && e.$$typeof === z)
|
|
113
113
|
return "<...>";
|
|
@@ -119,20 +119,20 @@ function ye() {
|
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
121
|
function b() {
|
|
122
|
-
var e =
|
|
122
|
+
var e = N.A;
|
|
123
123
|
return e === null ? null : e.getOwner();
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function h() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
128
|
function E(e) {
|
|
129
|
-
if (
|
|
129
|
+
if ($.call(e, "key")) {
|
|
130
130
|
var u = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
131
|
if (u && u.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function v(e, u) {
|
|
136
136
|
function R() {
|
|
137
137
|
H || (H = !0, console.error(
|
|
138
138
|
"%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)",
|
|
@@ -144,13 +144,13 @@ function ye() {
|
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function F() {
|
|
148
148
|
var e = s(this.type);
|
|
149
149
|
return X[e] || (X[e] = !0, console.error(
|
|
150
150
|
"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."
|
|
151
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function k(e, u, R,
|
|
153
|
+
function k(e, u, R, _, O, w, B, L) {
|
|
154
154
|
return R = w.ref, e = {
|
|
155
155
|
$$typeof: o,
|
|
156
156
|
type: e,
|
|
@@ -159,7 +159,7 @@ function ye() {
|
|
|
159
159
|
_owner: O
|
|
160
160
|
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
161
|
enumerable: !1,
|
|
162
|
-
get:
|
|
162
|
+
get: F
|
|
163
163
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
164
|
configurable: !1,
|
|
165
165
|
enumerable: !1,
|
|
@@ -174,68 +174,68 @@ function ye() {
|
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
|
-
value:
|
|
177
|
+
value: B
|
|
178
178
|
}), Object.defineProperty(e, "_debugTask", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
|
-
value:
|
|
182
|
+
value: L
|
|
183
183
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
184
|
}
|
|
185
|
-
function c(e, u, R,
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
188
|
-
if (
|
|
189
|
-
if (
|
|
190
|
-
for (
|
|
191
|
-
m(_
|
|
192
|
-
Object.freeze && Object.freeze(
|
|
185
|
+
function c(e, u, R, _, O, w, B, L) {
|
|
186
|
+
var S = u.children;
|
|
187
|
+
if (S !== void 0)
|
|
188
|
+
if (_)
|
|
189
|
+
if (V(S)) {
|
|
190
|
+
for (_ = 0; _ < S.length; _++)
|
|
191
|
+
m(S[_]);
|
|
192
|
+
Object.freeze && Object.freeze(S);
|
|
193
193
|
} else
|
|
194
194
|
console.error(
|
|
195
195
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
196
|
);
|
|
197
|
-
else m(
|
|
198
|
-
if (
|
|
199
|
-
|
|
200
|
-
var
|
|
201
|
-
return
|
|
197
|
+
else m(S);
|
|
198
|
+
if ($.call(u, "key")) {
|
|
199
|
+
S = s(e);
|
|
200
|
+
var x = Object.keys(u).filter(function(r) {
|
|
201
|
+
return r !== "key";
|
|
202
202
|
});
|
|
203
|
-
|
|
203
|
+
_ = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", Q[S + _] || (x = 0 < x.length ? "{" + x.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
204
|
`A props object containing a "key" prop is being spread into JSX:
|
|
205
205
|
let props = %s;
|
|
206
206
|
<%s {...props} />
|
|
207
207
|
React keys must be passed directly to JSX without using spread:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s key={someKey} {...props} />`,
|
|
210
|
-
F,
|
|
211
210
|
_,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
S,
|
|
212
|
+
x,
|
|
213
|
+
S
|
|
214
|
+
), Q[S + _] = !0);
|
|
215
215
|
}
|
|
216
|
-
if (
|
|
216
|
+
if (S = null, R !== void 0 && (l(R), S = "" + R), E(u) && (l(u.key), S = "" + u.key), "key" in u) {
|
|
217
217
|
R = {};
|
|
218
|
-
for (var
|
|
219
|
-
|
|
218
|
+
for (var K in u)
|
|
219
|
+
K !== "key" && (R[K] = u[K]);
|
|
220
220
|
} else R = u;
|
|
221
|
-
return
|
|
221
|
+
return S && v(
|
|
222
222
|
R,
|
|
223
223
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
224
|
), k(
|
|
225
225
|
e,
|
|
226
|
-
|
|
226
|
+
S,
|
|
227
227
|
w,
|
|
228
228
|
O,
|
|
229
229
|
b(),
|
|
230
230
|
R,
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
B,
|
|
232
|
+
L
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
235
|
function m(e) {
|
|
236
236
|
typeof e == "object" && e !== null && e.$$typeof === o && e._store && (e._store.validated = 1);
|
|
237
237
|
}
|
|
238
|
-
var a =
|
|
238
|
+
var a = Re, o = Symbol.for("react.transitional.element"), i = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), A = Symbol.for("react.strict_mode"), Y = Symbol.for("react.profiler"), W = Symbol.for("react.consumer"), I = Symbol.for("react.context"), J = Symbol.for("react.forward_ref"), se = Symbol.for("react.suspense"), ne = Symbol.for("react.suspense_list"), oe = Symbol.for("react.memo"), z = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), G = Symbol.for("react.client.reference"), N = a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, V = Array.isArray, D = console.createTask ? console.createTask : function() {
|
|
239
239
|
return null;
|
|
240
240
|
};
|
|
241
241
|
a = {
|
|
@@ -245,106 +245,106 @@ React keys must be passed directly to JSX without using spread:
|
|
|
245
245
|
};
|
|
246
246
|
var H, X = {}, Z = a["react-stack-bottom-frame"].bind(
|
|
247
247
|
a,
|
|
248
|
-
|
|
249
|
-
)(),
|
|
250
|
-
|
|
251
|
-
var w = 1e4 >
|
|
248
|
+
h
|
|
249
|
+
)(), y = D(g(h)), Q = {};
|
|
250
|
+
te.Fragment = d, te.jsx = function(e, u, R, _, O) {
|
|
251
|
+
var w = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
252
252
|
return c(
|
|
253
253
|
e,
|
|
254
254
|
u,
|
|
255
255
|
R,
|
|
256
256
|
!1,
|
|
257
|
-
|
|
257
|
+
_,
|
|
258
258
|
O,
|
|
259
259
|
w ? Error("react-stack-top-frame") : Z,
|
|
260
|
-
w ? D(
|
|
260
|
+
w ? D(g(e)) : y
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var w = 1e4 >
|
|
262
|
+
}, te.jsxs = function(e, u, R, _, O) {
|
|
263
|
+
var w = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
264
264
|
return c(
|
|
265
265
|
e,
|
|
266
266
|
u,
|
|
267
267
|
R,
|
|
268
268
|
!0,
|
|
269
|
-
|
|
269
|
+
_,
|
|
270
270
|
O,
|
|
271
271
|
w ? Error("react-stack-top-frame") : Z,
|
|
272
|
-
w ? D(
|
|
272
|
+
w ? D(g(e)) : y
|
|
273
273
|
);
|
|
274
274
|
};
|
|
275
|
-
}()),
|
|
275
|
+
}()), te;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
277
|
+
var be;
|
|
278
|
+
function Te() {
|
|
279
|
+
return be || (be = 1, process.env.NODE_ENV === "production" ? ue.exports = ye() : ue.exports = ve()), ue.exports;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
},
|
|
281
|
+
var me = Te();
|
|
282
|
+
const p = () => {
|
|
283
|
+
}, ge = Se({
|
|
284
284
|
ref: null,
|
|
285
|
-
watch:
|
|
285
|
+
watch: p,
|
|
286
286
|
actions: {
|
|
287
|
-
reset:
|
|
288
|
-
resetField:
|
|
289
|
-
setValue:
|
|
290
|
-
getValues:
|
|
291
|
-
getErrors:
|
|
292
|
-
getFieldStates:
|
|
293
|
-
getFormStates:
|
|
294
|
-
setError:
|
|
295
|
-
clearError:
|
|
296
|
-
clearErrors:
|
|
297
|
-
checkValidity:
|
|
298
|
-
getNumberFields:
|
|
299
|
-
getFieldValidity:
|
|
300
|
-
getDefaultValues:
|
|
301
|
-
setFieldState:
|
|
302
|
-
resetFieldState:
|
|
303
|
-
getControlledFields:
|
|
287
|
+
reset: p,
|
|
288
|
+
resetField: p,
|
|
289
|
+
setValue: p,
|
|
290
|
+
getValues: p,
|
|
291
|
+
getErrors: p,
|
|
292
|
+
getFieldStates: p,
|
|
293
|
+
getFormStates: p,
|
|
294
|
+
setError: p,
|
|
295
|
+
clearError: p,
|
|
296
|
+
clearErrors: p,
|
|
297
|
+
checkValidity: p,
|
|
298
|
+
getNumberFields: p,
|
|
299
|
+
getFieldValidity: p,
|
|
300
|
+
getDefaultValues: p,
|
|
301
|
+
setFieldState: p,
|
|
302
|
+
resetFieldState: p,
|
|
303
|
+
getControlledFields: p
|
|
304
304
|
},
|
|
305
|
-
registerController:
|
|
306
|
-
registerHookWatcher:
|
|
307
|
-
lastReloadedAt:
|
|
308
|
-
loadFormValues:
|
|
309
|
-
getWatchValue:
|
|
305
|
+
registerController: p,
|
|
306
|
+
registerHookWatcher: p,
|
|
307
|
+
lastReloadedAt: p,
|
|
308
|
+
loadFormValues: p,
|
|
309
|
+
getWatchValue: p,
|
|
310
310
|
channels: {}
|
|
311
|
-
}), he = () =>
|
|
311
|
+
}), he = () => pe(ge), We = ({
|
|
312
312
|
id: s,
|
|
313
313
|
control: n,
|
|
314
314
|
method: l,
|
|
315
|
-
action:
|
|
315
|
+
action: g,
|
|
316
316
|
children: b,
|
|
317
|
-
onSubmit:
|
|
317
|
+
onSubmit: h = () => {
|
|
318
318
|
},
|
|
319
319
|
onInput: E = () => {
|
|
320
320
|
},
|
|
321
|
-
onChange:
|
|
321
|
+
onChange: v = () => {
|
|
322
322
|
},
|
|
323
|
-
onBlur:
|
|
323
|
+
onBlur: F = () => {
|
|
324
324
|
},
|
|
325
325
|
onReset: k = () => {
|
|
326
326
|
},
|
|
327
327
|
numberFields: c = [],
|
|
328
328
|
className: m,
|
|
329
329
|
...a
|
|
330
|
-
}) => (
|
|
331
|
-
const o = n.channels.subscribe("onChange",
|
|
330
|
+
}) => (ie(() => {
|
|
331
|
+
const o = n.channels.subscribe("onChange", v), i = n.channels.subscribe("onBlur", F);
|
|
332
332
|
return () => {
|
|
333
333
|
o(), i();
|
|
334
334
|
};
|
|
335
|
-
}, []), /* @__PURE__ */
|
|
335
|
+
}, []), /* @__PURE__ */ me.jsx(ge.Provider, { value: n, children: /* @__PURE__ */ me.jsx(
|
|
336
336
|
"form",
|
|
337
337
|
{
|
|
338
338
|
id: s,
|
|
339
339
|
ref: n.ref,
|
|
340
|
-
action:
|
|
340
|
+
action: g,
|
|
341
341
|
method: l,
|
|
342
342
|
className: m,
|
|
343
343
|
onInput: E,
|
|
344
344
|
onSubmit: (o) => {
|
|
345
345
|
l || o.preventDefault();
|
|
346
346
|
const i = n.loadFormValues();
|
|
347
|
-
|
|
347
|
+
h(i);
|
|
348
348
|
},
|
|
349
349
|
onChange: (o) => {
|
|
350
350
|
const i = o.target.name;
|
|
@@ -363,32 +363,32 @@ const S = () => {
|
|
|
363
363
|
children: b
|
|
364
364
|
},
|
|
365
365
|
n.lastReloadedAt
|
|
366
|
-
) })),
|
|
367
|
-
const { getWatchValue:
|
|
368
|
-
return
|
|
369
|
-
const
|
|
370
|
-
return () =>
|
|
366
|
+
) })), Fe = ({ control: s, name: n, compute: l }) => {
|
|
367
|
+
const { getWatchValue: g, registerHookWatcher: b } = s || he(), h = g({ name: n, compute: l }), [E, v] = ce(h);
|
|
368
|
+
return ie(() => {
|
|
369
|
+
const F = b({ name: n, compute: l, value: E, setValue: v });
|
|
370
|
+
return () => F.forEach((k) => k());
|
|
371
371
|
}, []), E;
|
|
372
|
-
},
|
|
373
|
-
const { actions: l, registerController:
|
|
372
|
+
}, _e = ({ name: s, defaultValue: n }) => {
|
|
373
|
+
const { actions: l, registerController: g, channels: b } = he(), h = j(), E = l.getDefaultValues()[s] || n, [v, F] = ce(E), k = Fe({ name: `fieldStates.${s}.customState` }), c = f((o) => {
|
|
374
374
|
l.setFieldState(s, "customState", o);
|
|
375
375
|
}, []), m = f(
|
|
376
376
|
(o, { shouldDirty: i = !0, shouldOnChange: d = !0 } = {}) => {
|
|
377
|
-
|
|
377
|
+
F(o), l.setValue(s, o, { shouldDirty: i, shouldOnChange: d });
|
|
378
378
|
},
|
|
379
379
|
[l.setValue]
|
|
380
380
|
), a = f(() => {
|
|
381
|
-
b.publish("onBlur", s,
|
|
381
|
+
b.publish("onBlur", s, v, l.getValues());
|
|
382
382
|
}, []);
|
|
383
|
-
return
|
|
384
|
-
},
|
|
383
|
+
return ie(() => g(s, F), []), { ref: h, name: s, defaultValue: E, value: v, onChange: m, onBlur: a, customState: k, setCustomState: c };
|
|
384
|
+
}, $e = ({
|
|
385
385
|
name: s,
|
|
386
386
|
defaultValue: n,
|
|
387
|
-
render: l = ({ ref:
|
|
387
|
+
render: l = ({ ref: g, name: b, defaultValue: h, value: E, onChange: v, onBlur: F, customState: k, setCustomState: c }) => null
|
|
388
388
|
}) => {
|
|
389
|
-
const
|
|
390
|
-
return l(
|
|
391
|
-
},
|
|
389
|
+
const g = _e({ name: s, defaultValue: n });
|
|
390
|
+
return l(g);
|
|
391
|
+
}, ke = ["errors", "fieldStates", "formState"], q = (s) => ke.some((n) => s.startsWith(n)) ? s : "values." + s, Ae = [
|
|
392
392
|
"badInput",
|
|
393
393
|
"customError",
|
|
394
394
|
"patternMismatch",
|
|
@@ -399,12 +399,12 @@ const S = () => {
|
|
|
399
399
|
"tooShort",
|
|
400
400
|
"typeMismatch",
|
|
401
401
|
"valueMissing"
|
|
402
|
-
],
|
|
402
|
+
], Ee = (s) => {
|
|
403
403
|
typeof s.setCustomValidity == "function" && s.setCustomValidity("");
|
|
404
|
-
let n = s.validity, l =
|
|
404
|
+
let n = s.validity, l = Ae.find((g) => n[g]);
|
|
405
405
|
if (l) return { type: l, message: s.validationMessage };
|
|
406
406
|
};
|
|
407
|
-
class
|
|
407
|
+
class we {
|
|
408
408
|
constructor() {
|
|
409
409
|
this.events = /* @__PURE__ */ new Map();
|
|
410
410
|
}
|
|
@@ -413,35 +413,35 @@ class Ae {
|
|
|
413
413
|
}
|
|
414
414
|
subscribe(n, l) {
|
|
415
415
|
return this.events.has(n) || this.events.set(n, /* @__PURE__ */ new Set()), this.events.get(n).add(l), () => {
|
|
416
|
-
var
|
|
417
|
-
return (
|
|
416
|
+
var g;
|
|
417
|
+
return (g = this.events.get(n)) == null ? void 0 : g.delete(l);
|
|
418
418
|
};
|
|
419
419
|
}
|
|
420
420
|
publish(n, ...l) {
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
n.includes(
|
|
421
|
+
const g = this.events.get(n);
|
|
422
|
+
g && g.forEach((b) => b(...l)), this.events.forEach((b, h) => {
|
|
423
|
+
n.includes(h) && b.forEach((E) => E(...l));
|
|
424
424
|
});
|
|
425
425
|
}
|
|
426
426
|
reset() {
|
|
427
427
|
this.events.clear();
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
|
-
const
|
|
431
|
-
const s = j(new
|
|
432
|
-
s.current.publish(b, ...
|
|
433
|
-
}, []), l = f((b,
|
|
430
|
+
const Oe = () => {
|
|
431
|
+
const s = j(new we()), n = f((b, ...h) => {
|
|
432
|
+
s.current.publish(b, ...h);
|
|
433
|
+
}, []), l = f((b, h) => s.current.subscribe(b, h), []), g = f(() => {
|
|
434
434
|
s.current.reset();
|
|
435
435
|
}, []);
|
|
436
|
-
return { publish: n, subscribe: l, reset:
|
|
437
|
-
}, Oe = () => {
|
|
438
|
-
const [s, n] = ue(), l = f(() => n((/* @__PURE__ */ new Date()).toString()), []);
|
|
439
|
-
return [s, l];
|
|
436
|
+
return { publish: n, subscribe: l, reset: g };
|
|
440
437
|
}, Ce = () => {
|
|
441
|
-
const [,
|
|
438
|
+
const [s, n] = ce(), l = f(() => n((/* @__PURE__ */ new Date()).toString()), []);
|
|
439
|
+
return [s, l];
|
|
440
|
+
}, je = () => {
|
|
441
|
+
const [, s] = ce({});
|
|
442
442
|
return f(() => s({}), []);
|
|
443
|
-
},
|
|
444
|
-
const
|
|
443
|
+
}, Pe = ({ channels: s, getValues: n, getErrors: l, getFieldStates: g, getFormState: b }) => {
|
|
444
|
+
const h = je(), E = f(({ name: c, compute: m }) => {
|
|
445
445
|
if (typeof m == "function") return m(n());
|
|
446
446
|
if (Array.isArray(c)) {
|
|
447
447
|
const a = {};
|
|
@@ -455,18 +455,18 @@ const we = () => {
|
|
|
455
455
|
...n(),
|
|
456
456
|
errors: { ...l() },
|
|
457
457
|
formState: { ...b() },
|
|
458
|
-
fieldStates: { ...
|
|
458
|
+
fieldStates: { ...g() }
|
|
459
459
|
}
|
|
460
460
|
);
|
|
461
|
-
}, []),
|
|
461
|
+
}, []), v = f((c) => {
|
|
462
462
|
if (!c)
|
|
463
463
|
return s.subscribe("values", () => {
|
|
464
|
-
|
|
464
|
+
h();
|
|
465
465
|
}), n();
|
|
466
466
|
if (typeof c == "string") {
|
|
467
467
|
const m = q(c);
|
|
468
468
|
return s.subscribe(m, () => {
|
|
469
|
-
|
|
469
|
+
h();
|
|
470
470
|
}), E({ name: c });
|
|
471
471
|
}
|
|
472
472
|
if (Array.isArray(c)) {
|
|
@@ -474,12 +474,12 @@ const we = () => {
|
|
|
474
474
|
return c.forEach((a) => {
|
|
475
475
|
const o = q(a);
|
|
476
476
|
s.subscribe(o, () => {
|
|
477
|
-
|
|
477
|
+
h();
|
|
478
478
|
}), m[a] = E({ name: a });
|
|
479
479
|
}), m;
|
|
480
480
|
}
|
|
481
481
|
throw new Error("Parameters of watch must be string or array of string");
|
|
482
|
-
}, []),
|
|
482
|
+
}, []), F = f(({ name: c, compute: m, value: a, setValue: o }) => {
|
|
483
483
|
if (typeof m == "function")
|
|
484
484
|
return [s.subscribe("values", () => {
|
|
485
485
|
const d = E({ compute: m });
|
|
@@ -495,11 +495,11 @@ const we = () => {
|
|
|
495
495
|
} else if (Array.isArray(c)) {
|
|
496
496
|
const i = E({ name: c }), d = [];
|
|
497
497
|
return c.forEach((A) => {
|
|
498
|
-
const
|
|
499
|
-
const
|
|
500
|
-
i[A] !==
|
|
498
|
+
const Y = q(A), W = s.subscribe(Y, () => {
|
|
499
|
+
const I = E({ name: A });
|
|
500
|
+
i[A] !== I && (i[A] = I, o({ ...i }));
|
|
501
501
|
});
|
|
502
|
-
d.push(
|
|
502
|
+
d.push(W);
|
|
503
503
|
}), d;
|
|
504
504
|
} else
|
|
505
505
|
throw new Error("Parameters of name must be string or array of string or compute must be a function");
|
|
@@ -526,34 +526,34 @@ const we = () => {
|
|
|
526
526
|
},
|
|
527
527
|
[s]
|
|
528
528
|
);
|
|
529
|
-
return { watch:
|
|
530
|
-
},
|
|
531
|
-
numberFields: s =
|
|
532
|
-
defaultValues: n =
|
|
529
|
+
return { watch: v, registerHookWatcher: F, getWatchValue: E, subscribe: k };
|
|
530
|
+
}, xe = [], Ne = {}, Me = ({
|
|
531
|
+
numberFields: s = xe,
|
|
532
|
+
defaultValues: n = Ne,
|
|
533
533
|
shouldUnRegister: l = !1,
|
|
534
|
-
shouldConvertNumber:
|
|
534
|
+
shouldConvertNumber: g = !1
|
|
535
535
|
} = {}) => {
|
|
536
|
-
const [b,
|
|
536
|
+
const [b, h] = Ce(), E = j(), v = j(!1), F = j(!1), k = j(s), c = j(/* @__PURE__ */ new Map()), m = j({}), a = j({}), o = j(n), i = j(n), d = Oe(), A = f(() => {
|
|
537
537
|
a.current = Object.keys(i.current).reduce(
|
|
538
538
|
(r, t) => ({ ...r, [t]: { isError: !1, isDirty: !1, isTouched: !1, customState: null } }),
|
|
539
539
|
{}
|
|
540
540
|
);
|
|
541
|
-
}, []),
|
|
542
|
-
i.current = { ...i.current, ...r }, o.current = { ...i.current }, c.current.forEach((t,
|
|
543
|
-
t(i.current[
|
|
544
|
-
}),
|
|
545
|
-
}, []),
|
|
541
|
+
}, []), Y = f((r = {}) => {
|
|
542
|
+
i.current = { ...i.current, ...r }, o.current = { ...i.current }, c.current.forEach((t, T) => {
|
|
543
|
+
t(i.current[T]);
|
|
544
|
+
}), v.current = !1, m.current = {}, k.current = s, c.current = /* @__PURE__ */ new Map(), d.reset(), A(), s.length > 0 && (g = !0), h();
|
|
545
|
+
}, []), W = f(() => {
|
|
546
546
|
const r = Object.fromEntries(new FormData(E.current));
|
|
547
|
-
return c.current.forEach((
|
|
548
|
-
r[
|
|
549
|
-
}),
|
|
550
|
-
(
|
|
547
|
+
return c.current.forEach((T) => {
|
|
548
|
+
r[T] = o.current[T];
|
|
549
|
+
}), g && k.current.forEach(
|
|
550
|
+
(T) => r.hasOwnProperty(T) && (r[T] = Number(r[T]) || 0)
|
|
551
551
|
), r;
|
|
552
|
-
}, []),
|
|
552
|
+
}, []), I = f(() => !!Object.values($()).find((r) => r.isDirty), []), J = f(() => !!Object.values(N()).find((r) => !!r), []), se = f((r) => Ee(r.target), []), ne = f(() => i.current, []), oe = f(() => k.current, []), z = f(() => c.current, []), P = f((r, t) => t ? Array.isArray(t) ? t.map((T) => r[T]) : r[t] : { ...r }, []), G = f((r) => P(o.current, r), [P]), N = f((r) => P(m.current, r), [P]), $ = f((r) => P(a.current, r), [P]), V = f(
|
|
553
553
|
(r) => P(
|
|
554
554
|
{
|
|
555
|
-
isDirty:
|
|
556
|
-
isError:
|
|
555
|
+
isDirty: v.current,
|
|
556
|
+
isError: F.current,
|
|
557
557
|
errorFields: Object.keys(m.current).filter((t) => !!m.current[t]),
|
|
558
558
|
dirtyFields: Object.keys(a.current).filter((t) => a.current[t].isDirty),
|
|
559
559
|
touchedFields: Object.keys(a.current).filter((t) => a.current[t].isTouched)
|
|
@@ -561,150 +561,154 @@ const we = () => {
|
|
|
561
561
|
r
|
|
562
562
|
),
|
|
563
563
|
[P]
|
|
564
|
-
), { watch: D, registerHookWatcher: H, getWatchValue: X, subscribe: Z } =
|
|
564
|
+
), { watch: D, registerHookWatcher: H, getWatchValue: X, subscribe: Z } = Pe({
|
|
565
565
|
channels: d,
|
|
566
566
|
getValues: G,
|
|
567
|
-
getErrors:
|
|
568
|
-
getFieldStates:
|
|
569
|
-
getFormState:
|
|
570
|
-
}),
|
|
567
|
+
getErrors: N,
|
|
568
|
+
getFieldStates: $,
|
|
569
|
+
getFormState: V
|
|
570
|
+
}), y = f((r, t, T) => {
|
|
571
571
|
const C = a.current[r];
|
|
572
|
-
C[t] !==
|
|
572
|
+
C[t] !== T && (a.current[r] = { ...C, [t]: T }, d.publish(`fieldStates.${r}.${t}`, T), t === "isError" && d.publish("formState.errorFields", V("errorFields")), t === "isDirty" && d.publish("formState.dirtyFields", V("dirtyFields")), t === "isTouched" && d.publish("formState.touchedFields", V("touchedFields")));
|
|
573
573
|
}, []), Q = f(
|
|
574
574
|
(r) => {
|
|
575
|
-
|
|
575
|
+
y(r, "isError", !1), y(r, "isDirty", !1), y(r, "isTouched", !1), y(r, "customState", null);
|
|
576
576
|
},
|
|
577
|
-
[
|
|
577
|
+
[y]
|
|
578
578
|
), e = f(
|
|
579
579
|
(r, t) => {
|
|
580
580
|
if (m.current[r] === t) return;
|
|
581
|
-
m.current[r] = t,
|
|
581
|
+
m.current[r] = t, y(r, "isError", !!t), d.publish(`errors.${r}`, t);
|
|
582
582
|
const C = J();
|
|
583
|
-
|
|
583
|
+
F.current !== C && (F.current = C, d.publish("formState.isError", C));
|
|
584
584
|
},
|
|
585
|
-
[
|
|
585
|
+
[y]
|
|
586
586
|
), u = f(
|
|
587
587
|
(r) => {
|
|
588
588
|
if (!m.current[r]) return;
|
|
589
|
-
m.current[r] = null,
|
|
589
|
+
m.current[r] = null, y(r, "isError", !1), d.publish(`errors.${r}`, null);
|
|
590
590
|
const t = J();
|
|
591
|
-
|
|
591
|
+
F.current !== t && (F.current = t, d.publish("formState.isError", t));
|
|
592
592
|
},
|
|
593
|
-
[
|
|
593
|
+
[y]
|
|
594
594
|
), R = f(() => {
|
|
595
595
|
if (Object.keys(m.current) === 0) return;
|
|
596
596
|
m.current = {}, d.publish("errors", m.current);
|
|
597
597
|
const r = J();
|
|
598
|
-
|
|
599
|
-
}, []),
|
|
598
|
+
F.current !== r && (F.current = r, d.publish("formState.isError", r));
|
|
599
|
+
}, []), _ = f(
|
|
600
600
|
(r) => {
|
|
601
|
-
const t =
|
|
601
|
+
const t = Ee(r.target);
|
|
602
602
|
t ? e(r.target.name, t) : u(r.target.name);
|
|
603
603
|
},
|
|
604
604
|
[e, u]
|
|
605
605
|
), O = f(
|
|
606
|
-
(r, t, { shouldDirty:
|
|
606
|
+
(r, t, { shouldDirty: T = !0, shouldOnChange: C = !0 } = {}) => {
|
|
607
607
|
if (t === o.current[r]) return;
|
|
608
|
-
|
|
609
|
-
const
|
|
610
|
-
|
|
611
|
-
const
|
|
612
|
-
|
|
608
|
+
g && k.current.includes(r) && (t = Number(t) || void 0), y(r, "isTouched", !0);
|
|
609
|
+
const ee = t !== i.current[r];
|
|
610
|
+
T && a.current[r].isDirty !== ee && y(r, "isDirty", ee);
|
|
611
|
+
const M = I();
|
|
612
|
+
v.current !== M && (v.current = M, d.publish("formState.isDirty", M)), o.current[r] = t;
|
|
613
613
|
const U = c.current.get(r);
|
|
614
|
-
U && U(t), d.publish(`values.${r}`, t, { shouldDirty:
|
|
614
|
+
U && U(t), d.publish(`values.${r}`, t, { shouldDirty: T, shouldOnChange: C }), C && d.publish("onChange", r, t, o.current);
|
|
615
615
|
},
|
|
616
|
-
[
|
|
616
|
+
[y]
|
|
617
617
|
), w = f((r, t) => (c.current.set(r, t), () => {
|
|
618
618
|
l && c.current.delete(r);
|
|
619
|
-
}), []),
|
|
620
|
-
(r, { keepError: t, keepDirty:
|
|
619
|
+
}), []), B = f(
|
|
620
|
+
(r, { keepError: t, keepDirty: T, keepTouched: C, keepCustomState: ee, defaultValue: M }) => {
|
|
621
621
|
const U = c.current.get(r);
|
|
622
622
|
if (!U)
|
|
623
623
|
throw new Error(`Cannot reset "${r}" because it's uncontrolled field`);
|
|
624
|
-
i.current[r] =
|
|
624
|
+
i.current[r] = M, o.current[r] = M, U && U(M), t || u(r), T || y(r, "isDirty", !1), C || y(r, "isTouched", !1), ee || y(r, "customState", null);
|
|
625
625
|
},
|
|
626
|
-
[u,
|
|
627
|
-
),
|
|
626
|
+
[u, y]
|
|
627
|
+
), L = f((r, t = S.getValues(r)) => {
|
|
628
|
+
d.publish("onBlur", r, t, S.getValues());
|
|
629
|
+
}, []), S = ae(
|
|
628
630
|
() => ({
|
|
629
631
|
subscribe: Z,
|
|
630
|
-
reset:
|
|
631
|
-
resetField:
|
|
632
|
+
reset: Y,
|
|
633
|
+
resetField: B,
|
|
632
634
|
setValue: O,
|
|
633
635
|
getValues: G,
|
|
634
|
-
getErrors:
|
|
635
|
-
getFieldStates:
|
|
636
|
-
getFormState:
|
|
636
|
+
getErrors: N,
|
|
637
|
+
getFieldStates: $,
|
|
638
|
+
getFormState: V,
|
|
637
639
|
setError: e,
|
|
638
640
|
clearError: u,
|
|
639
641
|
clearErrors: R,
|
|
640
|
-
checkValidity:
|
|
641
|
-
getNumberFields:
|
|
642
|
-
getFieldValidity:
|
|
643
|
-
getDefaultValues:
|
|
644
|
-
setFieldState:
|
|
642
|
+
checkValidity: _,
|
|
643
|
+
getNumberFields: oe,
|
|
644
|
+
getFieldValidity: se,
|
|
645
|
+
getDefaultValues: ne,
|
|
646
|
+
setFieldState: y,
|
|
647
|
+
triggerFieldBlur: L,
|
|
645
648
|
resetFieldState: Q,
|
|
646
649
|
getControlledFields: z
|
|
647
650
|
}),
|
|
648
651
|
[
|
|
649
652
|
Z,
|
|
650
|
-
|
|
651
|
-
|
|
653
|
+
Y,
|
|
654
|
+
B,
|
|
652
655
|
O,
|
|
653
656
|
G,
|
|
654
|
-
x,
|
|
655
|
-
M,
|
|
656
657
|
N,
|
|
658
|
+
$,
|
|
659
|
+
V,
|
|
657
660
|
e,
|
|
658
661
|
u,
|
|
659
662
|
R,
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
te,
|
|
663
|
+
_,
|
|
664
|
+
oe,
|
|
663
665
|
se,
|
|
664
|
-
|
|
666
|
+
ne,
|
|
667
|
+
y,
|
|
665
668
|
Q,
|
|
669
|
+
L,
|
|
666
670
|
z
|
|
667
671
|
]
|
|
668
|
-
),
|
|
672
|
+
), x = ae(
|
|
669
673
|
() => ({
|
|
670
674
|
ref: E,
|
|
671
675
|
watch: D,
|
|
672
|
-
actions:
|
|
676
|
+
actions: S,
|
|
673
677
|
registerController: w,
|
|
674
678
|
registerHookWatcher: H,
|
|
675
679
|
lastReloadedAt: b,
|
|
676
|
-
loadFormValues:
|
|
680
|
+
loadFormValues: W,
|
|
677
681
|
getWatchValue: X,
|
|
678
682
|
channels: d
|
|
679
683
|
}),
|
|
680
684
|
[
|
|
681
685
|
E,
|
|
682
686
|
D,
|
|
683
|
-
|
|
687
|
+
S,
|
|
684
688
|
w,
|
|
685
689
|
H,
|
|
686
690
|
b,
|
|
687
|
-
|
|
691
|
+
W,
|
|
688
692
|
X,
|
|
689
693
|
d
|
|
690
694
|
]
|
|
691
|
-
),
|
|
692
|
-
return
|
|
695
|
+
), K = ae(() => ({ control: x, actions: S, watch: D }), [b, x, S, D]);
|
|
696
|
+
return le(() => {
|
|
693
697
|
if ([...E.current.querySelectorAll("[name]")].forEach((t) => {
|
|
694
698
|
!t.defaultValue && i.current[t.name] && (t.defaultValue = i.current[t.name]), t.type === "number" && !k.current.includes(t.name) && k.current.push(t.name);
|
|
695
699
|
}), E.current) {
|
|
696
|
-
const t =
|
|
700
|
+
const t = W();
|
|
697
701
|
o.current = { ...t }, i.current = { ...t };
|
|
698
702
|
}
|
|
699
|
-
}, [b]),
|
|
703
|
+
}, [b]), le(() => {
|
|
700
704
|
A();
|
|
701
|
-
}, []),
|
|
705
|
+
}, []), K;
|
|
702
706
|
};
|
|
703
707
|
export {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
+
$e as Controller,
|
|
709
|
+
We as Form,
|
|
710
|
+
_e as useController,
|
|
711
|
+
Me as useForm,
|
|
708
712
|
he as useFormContext,
|
|
709
|
-
|
|
713
|
+
Fe as useWatch
|
|
710
714
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(w,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(w=typeof globalThis<"u"?globalThis:w||self,r(w.Name={},w.React))})(this,function(w,r){"use strict";var
|
|
1
|
+
(function(w,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(w=typeof globalThis<"u"?globalThis:w||self,r(w.Name={},w.React))})(this,function(w,r){"use strict";var se={exports:{}},G={};/**
|
|
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 ue;function he(){if(ue)return G;ue=1;var n=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function f(h,b,g){var E=null;if(g!==void 0&&(E=""+g),b.key!==void 0&&(E=""+b.key),"key"in b){g={};for(var y in b)y!=="key"&&(g[y]=b[y])}else g=b;return b=g.ref,{$$typeof:n,type:h,key:E,ref:b!==void 0?b:null,props:g}}return G.Fragment=o,G.jsx=f,G.jsxs=f,G}var H={};/**
|
|
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 le;function ge(){return le||(le=1,process.env.NODE_ENV!=="production"&&function(){function n(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Q?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case d:return"Fragment";case B:return"Profiler";case _:return"StrictMode";case ne:return"Suspense";case oe:return"SuspenseList";case P:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case i:return"Portal";case L:return(e.displayName||"Context")+".Provider";case W:return(e._context.displayName||"Context")+".Consumer";case X:var c=e.render;return e=e.displayName,e||(e=c.displayName||c.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ae:return c=e.displayName||null,c!==null?c:n(e.type)||"Memo";case Z:c=e._payload,e=e._init;try{return n(e(c))}catch{}}return null}function o(e){return""+e}function f(e){try{o(e);var c=!1}catch{c=!0}if(c){c=console;var R=c.error,T=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return R.call(c,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",T),o(e)}}function h(e){if(e===d)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===Z)return"<...>";try{var c=n(e);return c?"<"+c+">":"<...>"}catch{return"<...>"}}function b(){var e=x.A;return e===null?null:e.getOwner()}function g(){return Error("react-stack-top-frame")}function E(e){if(M.call(e,"key")){var c=Object.getOwnPropertyDescriptor(e,"key").get;if(c&&c.isReactWarning)return!1}return e.key!==void 0}function y(e,c){function R(){K||(K=!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)",c))}R.isReactWarning=!0,Object.defineProperty(e,"key",{get:R,configurable:!0})}function v(){var e=n(this.type);return q[e]||(q[e]=!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.")),e=this.props.ref,e!==void 0?e:null}function F(e,c,R,T,O,A,U,J){return R=A.ref,e={$$typeof:a,type:e,key:c,props:A,_owner:O},(R!==void 0?R:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:v}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:U}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:J}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function u(e,c,R,T,O,A,U,J){var S=c.children;if(S!==void 0)if(T)if(V(S)){for(T=0;T<S.length;T++)m(S[T]);Object.freeze&&Object.freeze(S)}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 m(S);if(M.call(c,"key")){S=n(e);var N=Object.keys(c).filter(function(t){return t!=="key"});T=0<N.length?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}",ee[S+T]||(N=0<N.length?"{"+N.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} />`,v,T,W,T),ee[T+v]=!0)}if(T=null,R!==void 0&&(f(R),T=""+R),E(c)&&(f(c.key),T=""+c.key),"key"in c){R={};for(var t in c)t!=="key"&&(R[t]=c[t])}else R=c;return T&&y(R,typeof e=="function"?e.displayName||e.name||"Unknown":e),F(e,T,A,O,b(),R,J,V)}function m(e){typeof e=="object"&&e!==null&&e.$$typeof===a&&e._store&&(e._store.validated=1)}var l=r,a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),U=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),oe=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),N=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=Object.prototype.hasOwnProperty,x=Array.isArray,D=console.createTask?console.createTask:function(){return null};l={"react-stack-bottom-frame":function(e){return e()}};var K,q={},$=l["react-stack-bottom-frame"].bind(l,g)(),S=D(h(g)),ee={};H.Fragment=d,H.jsx=function(e,c,R,v,O){var A=1e4>N.recentlyCreatedOwnerStacks++;return u(e,c,R,!1,v,O,A?Error("react-stack-top-frame"):$,A?D(h(e)):S)},H.jsxs=function(e,c,R,v,O){var A=1e4>N.recentlyCreatedOwnerStacks++;return u(e,c,R,!0,v,O,A?Error("react-stack-top-frame"):$,A?D(h(e)):S)}}()),H}var le;function ge(){return le||(le=1,process.env.NODE_ENV==="production"?re.exports=Ee():re.exports=he()),re.exports}var ie=ge();const k=()=>{},fe=r.createContext({ref:null,watch:k,actions:{reset:k,resetField:k,setValue:k,getValues:k,getErrors:k,getFieldStates:k,getFormStates:k,setError:k,clearError:k,clearErrors:k,checkValidity:k,getNumberFields:k,getFieldValidity:k,getDefaultValues:k,setFieldState:k,resetFieldState:k,getControlledFields:k},registerController:k,registerHookWatcher:k,lastReloadedAt:k,loadFormValues:k,getWatchValue:k,channels:{}}),ae=()=>r.useContext(fe),Re=({id:n,control:o,method:f,action:h,children:b,onSubmit:g=()=>{},onInput:E=()=>{},onChange:y=()=>{},onBlur:p=()=>{},onReset:F=()=>{},numberFields:u=[],className:m,...l})=>(r.useEffect(()=>{const a=o.channels.subscribe("onChange",y),i=o.channels.subscribe("onBlur",p);return()=>{a(),i()}},[]),ie.jsx(fe.Provider,{value:o,children:ie.jsx("form",{id:n,ref:o.ref,action:h,method:f,className:m,onInput:E,onSubmit:a=>{f||a.preventDefault();const i=o.loadFormValues();g(i)},onChange:a=>{const i=a.target.name;o.actions.getControlledFields().has(i)||o.actions.setValue(i,a.target.value)},onBlur:a=>{const i=a.target.name;if(o.actions.getControlledFields().has(i))return;const d=a.target.value;o.channels.publish("onBlur",i,d,o.actions.getValues())},onReset:a=>{o.actions.reset(),F(a)},...l,children:b},o.lastReloadedAt)})),de=({control:n,name:o,compute:f})=>{const{getWatchValue:h,registerHookWatcher:b}=n||ae(),g=h({name:o,compute:f}),[E,y]=r.useState(g);return r.useEffect(()=>{const p=b({name:o,compute:f,value:E,setValue:y});return()=>p.forEach(F=>F())},[]),E},be=({name:n,defaultValue:o})=>{const{actions:f,registerController:h,channels:b}=ae(),g=r.useRef(),E=f.getDefaultValues()[n]||o,[y,p]=r.useState(E),F=de({name:`fieldStates.${n}.customState`}),u=r.useCallback(a=>{f.setFieldState(n,"customState",a)},[]),m=r.useCallback((a,{shouldDirty:i=!0,shouldOnChange:d=!0}={})=>{p(a),f.setValue(n,a,{shouldDirty:i,shouldOnChange:d})},[f.setValue]),l=r.useCallback(()=>{b.publish("onBlur",n,y,f.getValues())},[]);return r.useEffect(()=>h(n,p),[]),{ref:g,name:n,defaultValue:E,value:y,onChange:m,onBlur:l,customState:F,setCustomState:u}},ke=({name:n,defaultValue:o,render:f=({ref:h,name:b,defaultValue:g,value:E,onChange:y,onBlur:p,customState:F,setCustomState:u})=>null})=>{const h=be({name:n,defaultValue:o});return f(h)},Se=["errors","fieldStates","formState"],L=n=>Se.some(o=>n.startsWith(o))?n:"values."+n,ye=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],me=n=>{typeof n.setCustomValidity=="function"&&n.setCustomValidity("");let o=n.validity,f=ye.find(h=>o[h]);if(f)return{type:f,message:n.validationMessage}};class Ce{constructor(){this.events=new Map}getEvents(){return this.events}subscribe(o,f){return this.events.has(o)||this.events.set(o,new Set),this.events.get(o).add(f),()=>{var h;return(h=this.events.get(o))==null?void 0:h.delete(f)}}publish(o,...f){const h=this.events.get(o);h&&h.forEach(b=>b(...f)),this.events.forEach((b,g)=>{o.includes(g)&&b.forEach(E=>E(...f))})}reset(){this.events.clear()}}const pe=()=>{const n=r.useRef(new Ce),o=r.useCallback((b,...g)=>{n.current.publish(b,...g)},[]),f=r.useCallback((b,g)=>n.current.subscribe(b,g),[]),h=r.useCallback(()=>{n.current.reset()},[]);return{publish:o,subscribe:f,reset:h}},ve=()=>{const[n,o]=r.useState(),f=r.useCallback(()=>o(new Date().toString()),[]);return[n,f]},Te=()=>{const[,n]=r.useState({});return r.useCallback(()=>n({}),[])},Fe=({channels:n,getValues:o,getErrors:f,getFieldStates:h,getFormState:b})=>{const g=Te(),E=r.useCallback(({name:u,compute:m})=>{if(typeof m=="function")return m(o());if(Array.isArray(u)){const l={};return u.forEach(a=>{l[a]=E({name:a})}),l}return u.replaceAll(/\[(\d+)\]/g,".$1").split(".").reduce((l,a)=>l&&l[a]!==void 0?l[a]:void 0,{...o(),errors:{...f()},formState:{...b()},fieldStates:{...h()}})},[]),y=r.useCallback(u=>{if(!u)return n.subscribe("values",()=>{g()}),o();if(typeof u=="string"){const m=L(u);return n.subscribe(m,()=>{g()}),E({name:u})}if(Array.isArray(u)){const m={};return u.forEach(l=>{const a=L(l);n.subscribe(a,()=>{g()}),m[l]=E({name:l})}),m}throw new Error("Parameters of watch must be string or array of string")},[]),p=r.useCallback(({name:u,compute:m,value:l,setValue:a})=>{if(typeof m=="function")return[n.subscribe("values",()=>{const d=E({compute:m});d!==l&&a(d)})];if(u)if(typeof u=="string"){const i=L(u);return[n.subscribe(i,()=>{const _=E({name:u});_!==l&&a(_)})]}else if(Array.isArray(u)){const i=E({name:u}),d=[];return u.forEach(_=>{const B=L(_),M=n.subscribe(B,()=>{const U=E({name:_});i[_]!==U&&(i[_]=U,a({...i}))});d.push(M)}),d}else throw new Error("Parameters of name must be string or array of string or compute must be a function");else return[n.subscribe("values",()=>{a(o())})]},[]),F=r.useCallback((u,m)=>{if(typeof u===void 0)return n.subscribe("values",m);if(typeof u=="string"){const l=L(u);return n.subscribe(l,m)}if(Array.isArray(u)){const l={},a=[];return u.forEach(i=>{const d=L(i),_=n.subscribe(d,()=>{l[i]=E({name:i}),m(l)});a.push(_)}),a}},[n]);return{watch:y,registerHookWatcher:p,getWatchValue:E,subscribe:F}},_e=[],Ae={},we=({numberFields:n=_e,defaultValues:o=Ae,shouldUnRegister:f=!1,shouldConvertNumber:h=!1}={})=>{const[b,g]=ve(),E=r.useRef(),y=r.useRef(!1),p=r.useRef(!1),F=r.useRef(n),u=r.useRef(new Map),m=r.useRef({}),l=r.useRef({}),a=r.useRef(o),i=r.useRef(o),d=pe(),_=r.useCallback(()=>{l.current=Object.keys(i.current).reduce((t,s)=>({...t,[s]:{isError:!1,isDirty:!1,isTouched:!1,customState:null}}),{})},[]),B=r.useCallback((t={})=>{i.current={...i.current,...t},a.current={...i.current},u.current.forEach((s,C)=>{s(i.current[C])}),y.current=!1,m.current={},F.current=n,u.current=new Map,d.reset(),_(),n.length>0&&(h=!0),g()},[]),M=r.useCallback(()=>{const t=Object.fromEntries(new FormData(E.current));return u.current.forEach(C=>{t[C]=a.current[C]}),h&&F.current.forEach(C=>t.hasOwnProperty(C)&&(t[C]=Number(t[C])||0)),t},[]),U=r.useCallback(()=>!!Object.values(Y()).find(t=>t.isDirty),[]),X=r.useCallback(()=>!!Object.values(N()).find(t=>!!t),[]),se=r.useCallback(t=>me(t.target),[]),ne=r.useCallback(()=>i.current,[]),oe=r.useCallback(()=>F.current,[]),Z=r.useCallback(()=>u.current,[]),P=r.useCallback((t,s)=>s?Array.isArray(s)?s.map(C=>t[C]):t[s]:{...t},[]),Q=r.useCallback(t=>P(a.current,t),[P]),N=r.useCallback(t=>P(m.current,t),[P]),Y=r.useCallback(t=>P(l.current,t),[P]),x=r.useCallback(t=>P({isDirty:y.current,isError:p.current,errorFields:Object.keys(m.current).filter(s=>!!m.current[s]),dirtyFields:Object.keys(l.current).filter(s=>l.current[s].isDirty),touchedFields:Object.keys(l.current).filter(s=>l.current[s].isTouched)},t),[P]),{watch:D,registerHookWatcher:K,getWatchValue:q,subscribe:$}=Fe({channels:d,getValues:Q,getErrors:N,getFieldStates:Y,getFormState:x}),S=r.useCallback((t,s,C)=>{const j=l.current[t];j[s]!==C&&(l.current[t]={...j,[s]:C},d.publish(`fieldStates.${t}.${s}`,C),s==="isError"&&d.publish("formState.errorFields",x("errorFields")),s==="isDirty"&&d.publish("formState.dirtyFields",x("dirtyFields")),s==="isTouched"&&d.publish("formState.touchedFields",x("touchedFields")))},[]),ee=r.useCallback(t=>{S(t,"isError",!1),S(t,"isDirty",!1),S(t,"isTouched",!1),S(t,"customState",null)},[S]),e=r.useCallback((t,s)=>{if(m.current[t]===s)return;m.current[t]=s,S(t,"isError",!!s),d.publish(`errors.${t}`,s);const j=X();p.current!==j&&(p.current=j,d.publish("formState.isError",j))},[S]),c=r.useCallback(t=>{if(!m.current[t])return;m.current[t]=null,S(t,"isError",!1),d.publish(`errors.${t}`,null);const s=X();p.current!==s&&(p.current=s,d.publish("formState.isError",s))},[S]),R=r.useCallback(()=>{if(Object.keys(m.current)===0)return;m.current={},d.publish("errors",m.current);const t=X();p.current!==t&&(p.current=t,d.publish("formState.isError",t))},[]),v=r.useCallback(t=>{const s=me(t.target);s?e(t.target.name,s):c(t.target.name)},[e,c]),O=r.useCallback((t,s,{shouldDirty:C=!0,shouldOnChange:j=!0}={})=>{if(s===a.current[t])return;h&&F.current.includes(t)&&(s=Number(s)||void 0),S(t,"isTouched",!0);const te=s!==i.current[t];C&&l.current[t].isDirty!==te&&S(t,"isDirty",te);const I=U();y.current!==I&&(y.current=I,d.publish("formState.isDirty",I)),a.current[t]=s;const z=u.current.get(t);z&&z(s),d.publish(`values.${t}`,s,{shouldDirty:C,shouldOnChange:j}),j&&d.publish("onChange",t,s,a.current)},[S]),A=r.useCallback((t,s)=>(u.current.set(t,s),()=>{f&&u.current.delete(t)}),[]),J=r.useCallback((t,{keepError:s,keepDirty:C,keepTouched:j,keepCustomState:te,defaultValue:I})=>{const z=u.current.get(t);if(!z)throw new Error(`Cannot reset "${t}" because it's uncontrolled field`);i.current[t]=I,a.current[t]=I,z&&z(I),s||c(t),C||S(t,"isDirty",!1),j||S(t,"isTouched",!1),te||S(t,"customState",null)},[c,S]),V=r.useMemo(()=>({subscribe:$,reset:B,resetField:J,setValue:O,getValues:Q,getErrors:N,getFieldStates:Y,getFormState:x,setError:e,clearError:c,clearErrors:R,checkValidity:v,getNumberFields:oe,getFieldValidity:se,getDefaultValues:ne,setFieldState:S,resetFieldState:ee,getControlledFields:Z}),[$,B,J,O,Q,N,Y,x,e,c,R,v,oe,se,ne,S,ee,Z]),T=r.useMemo(()=>({ref:E,watch:D,actions:V,registerController:A,registerHookWatcher:K,lastReloadedAt:b,loadFormValues:M,getWatchValue:q,channels:d}),[E,D,V,A,K,b,M,q,d]),W=r.useMemo(()=>({control:T,actions:V,watch:D}),[b,T,V,D]);return r.useLayoutEffect(()=>{if([...E.current.querySelectorAll("[name]")].forEach(s=>{!s.defaultValue&&i.current[s.name]&&(s.defaultValue=i.current[s.name]),s.type==="number"&&!F.current.includes(s.name)&&F.current.push(s.name)}),E.current){const s=M();a.current={...s},i.current={...s}}},[b]),r.useLayoutEffect(()=>{_()},[]),W};w.Controller=ke,w.Form=Re,w.useController=be,w.useForm=we,w.useFormContext=ae,w.useWatch=de,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
|
22
|
+
<%s key={someKey} {...props} />`,T,S,N,S),ee[S+T]=!0)}if(S=null,R!==void 0&&(f(R),S=""+R),E(c)&&(f(c.key),S=""+c.key),"key"in c){R={};for(var te in c)te!=="key"&&(R[te]=c[te])}else R=c;return S&&y(R,typeof e=="function"?e.displayName||e.name||"Unknown":e),F(e,S,A,O,b(),R,U,J)}function m(e){typeof e=="object"&&e!==null&&e.$$typeof===a&&e._store&&(e._store.validated=1)}var l=r,a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),L=Symbol.for("react.context"),X=Symbol.for("react.forward_ref"),ne=Symbol.for("react.suspense"),oe=Symbol.for("react.suspense_list"),ae=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),Q=Symbol.for("react.client.reference"),x=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,V=Array.isArray,D=console.createTask?console.createTask:function(){return null};l={"react-stack-bottom-frame":function(e){return e()}};var K,q={},$=l["react-stack-bottom-frame"].bind(l,g)(),C=D(h(g)),ee={};H.Fragment=d,H.jsx=function(e,c,R,T,O){var A=1e4>x.recentlyCreatedOwnerStacks++;return u(e,c,R,!1,T,O,A?Error("react-stack-top-frame"):$,A?D(h(e)):C)},H.jsxs=function(e,c,R,T,O){var A=1e4>x.recentlyCreatedOwnerStacks++;return u(e,c,R,!0,T,O,A?Error("react-stack-top-frame"):$,A?D(h(e)):C)}}()),H}var ie;function Re(){return ie||(ie=1,process.env.NODE_ENV==="production"?se.exports=he():se.exports=ge()),se.exports}var fe=Re();const k=()=>{},de=r.createContext({ref:null,watch:k,actions:{reset:k,resetField:k,setValue:k,getValues:k,getErrors:k,getFieldStates:k,getFormStates:k,setError:k,clearError:k,clearErrors:k,checkValidity:k,getNumberFields:k,getFieldValidity:k,getDefaultValues:k,setFieldState:k,resetFieldState:k,getControlledFields:k},registerController:k,registerHookWatcher:k,lastReloadedAt:k,loadFormValues:k,getWatchValue:k,channels:{}}),ce=()=>r.useContext(de),ke=({id:n,control:o,method:f,action:h,children:b,onSubmit:g=()=>{},onInput:E=()=>{},onChange:y=()=>{},onBlur:v=()=>{},onReset:F=()=>{},numberFields:u=[],className:m,...l})=>(r.useEffect(()=>{const a=o.channels.subscribe("onChange",y),i=o.channels.subscribe("onBlur",v);return()=>{a(),i()}},[]),fe.jsx(de.Provider,{value:o,children:fe.jsx("form",{id:n,ref:o.ref,action:h,method:f,className:m,onInput:E,onSubmit:a=>{f||a.preventDefault();const i=o.loadFormValues();g(i)},onChange:a=>{const i=a.target.name;o.actions.getControlledFields().has(i)||o.actions.setValue(i,a.target.value)},onBlur:a=>{const i=a.target.name;if(o.actions.getControlledFields().has(i))return;const d=a.target.value;o.channels.publish("onBlur",i,d,o.actions.getValues())},onReset:a=>{o.actions.reset(),F(a)},...l,children:b},o.lastReloadedAt)})),be=({control:n,name:o,compute:f})=>{const{getWatchValue:h,registerHookWatcher:b}=n||ce(),g=h({name:o,compute:f}),[E,y]=r.useState(g);return r.useEffect(()=>{const v=b({name:o,compute:f,value:E,setValue:y});return()=>v.forEach(F=>F())},[]),E},me=({name:n,defaultValue:o})=>{const{actions:f,registerController:h,channels:b}=ce(),g=r.useRef(),E=f.getDefaultValues()[n]||o,[y,v]=r.useState(E),F=be({name:`fieldStates.${n}.customState`}),u=r.useCallback(a=>{f.setFieldState(n,"customState",a)},[]),m=r.useCallback((a,{shouldDirty:i=!0,shouldOnChange:d=!0}={})=>{v(a),f.setValue(n,a,{shouldDirty:i,shouldOnChange:d})},[f.setValue]),l=r.useCallback(()=>{b.publish("onBlur",n,y,f.getValues())},[]);return r.useEffect(()=>h(n,v),[]),{ref:g,name:n,defaultValue:E,value:y,onChange:m,onBlur:l,customState:F,setCustomState:u}},Se=({name:n,defaultValue:o,render:f=({ref:h,name:b,defaultValue:g,value:E,onChange:y,onBlur:v,customState:F,setCustomState:u})=>null})=>{const h=me({name:n,defaultValue:o});return f(h)},Ce=["errors","fieldStates","formState"],I=n=>Ce.some(o=>n.startsWith(o))?n:"values."+n,ye=["badInput","customError","patternMismatch","rangeOverflow","rangeUnderflow","stepMismatch","tooLong","tooShort","typeMismatch","valueMissing"],Ee=n=>{typeof n.setCustomValidity=="function"&&n.setCustomValidity("");let o=n.validity,f=ye.find(h=>o[h]);if(f)return{type:f,message:n.validationMessage}};class pe{constructor(){this.events=new Map}getEvents(){return this.events}subscribe(o,f){return this.events.has(o)||this.events.set(o,new Set),this.events.get(o).add(f),()=>{var h;return(h=this.events.get(o))==null?void 0:h.delete(f)}}publish(o,...f){const h=this.events.get(o);h&&h.forEach(b=>b(...f)),this.events.forEach((b,g)=>{o.includes(g)&&b.forEach(E=>E(...f))})}reset(){this.events.clear()}}const ve=()=>{const n=r.useRef(new pe),o=r.useCallback((b,...g)=>{n.current.publish(b,...g)},[]),f=r.useCallback((b,g)=>n.current.subscribe(b,g),[]),h=r.useCallback(()=>{n.current.reset()},[]);return{publish:o,subscribe:f,reset:h}},Te=()=>{const[n,o]=r.useState(),f=r.useCallback(()=>o(new Date().toString()),[]);return[n,f]},Fe=()=>{const[,n]=r.useState({});return r.useCallback(()=>n({}),[])},_e=({channels:n,getValues:o,getErrors:f,getFieldStates:h,getFormState:b})=>{const g=Fe(),E=r.useCallback(({name:u,compute:m})=>{if(typeof m=="function")return m(o());if(Array.isArray(u)){const l={};return u.forEach(a=>{l[a]=E({name:a})}),l}return u.replaceAll(/\[(\d+)\]/g,".$1").split(".").reduce((l,a)=>l&&l[a]!==void 0?l[a]:void 0,{...o(),errors:{...f()},formState:{...b()},fieldStates:{...h()}})},[]),y=r.useCallback(u=>{if(!u)return n.subscribe("values",()=>{g()}),o();if(typeof u=="string"){const m=I(u);return n.subscribe(m,()=>{g()}),E({name:u})}if(Array.isArray(u)){const m={};return u.forEach(l=>{const a=I(l);n.subscribe(a,()=>{g()}),m[l]=E({name:l})}),m}throw new Error("Parameters of watch must be string or array of string")},[]),v=r.useCallback(({name:u,compute:m,value:l,setValue:a})=>{if(typeof m=="function")return[n.subscribe("values",()=>{const d=E({compute:m});d!==l&&a(d)})];if(u)if(typeof u=="string"){const i=I(u);return[n.subscribe(i,()=>{const _=E({name:u});_!==l&&a(_)})]}else if(Array.isArray(u)){const i=E({name:u}),d=[];return u.forEach(_=>{const B=I(_),W=n.subscribe(B,()=>{const L=E({name:_});i[_]!==L&&(i[_]=L,a({...i}))});d.push(W)}),d}else throw new Error("Parameters of name must be string or array of string or compute must be a function");else return[n.subscribe("values",()=>{a(o())})]},[]),F=r.useCallback((u,m)=>{if(typeof u===void 0)return n.subscribe("values",m);if(typeof u=="string"){const l=I(u);return n.subscribe(l,m)}if(Array.isArray(u)){const l={},a=[];return u.forEach(i=>{const d=I(i),_=n.subscribe(d,()=>{l[i]=E({name:i}),m(l)});a.push(_)}),a}},[n]);return{watch:y,registerHookWatcher:v,getWatchValue:E,subscribe:F}},Ae=[],we={},Oe=({numberFields:n=Ae,defaultValues:o=we,shouldUnRegister:f=!1,shouldConvertNumber:h=!1}={})=>{const[b,g]=Te(),E=r.useRef(),y=r.useRef(!1),v=r.useRef(!1),F=r.useRef(n),u=r.useRef(new Map),m=r.useRef({}),l=r.useRef({}),a=r.useRef(o),i=r.useRef(o),d=ve(),_=r.useCallback(()=>{l.current=Object.keys(i.current).reduce((t,s)=>({...t,[s]:{isError:!1,isDirty:!1,isTouched:!1,customState:null}}),{})},[]),B=r.useCallback((t={})=>{i.current={...i.current,...t},a.current={...i.current},u.current.forEach((s,p)=>{s(i.current[p])}),y.current=!1,m.current={},F.current=n,u.current=new Map,d.reset(),_(),n.length>0&&(h=!0),g()},[]),W=r.useCallback(()=>{const t=Object.fromEntries(new FormData(E.current));return u.current.forEach(p=>{t[p]=a.current[p]}),h&&F.current.forEach(p=>t.hasOwnProperty(p)&&(t[p]=Number(t[p])||0)),t},[]),L=r.useCallback(()=>!!Object.values(M()).find(t=>t.isDirty),[]),X=r.useCallback(()=>!!Object.values(x()).find(t=>!!t),[]),ne=r.useCallback(t=>Ee(t.target),[]),oe=r.useCallback(()=>i.current,[]),ae=r.useCallback(()=>F.current,[]),Z=r.useCallback(()=>u.current,[]),P=r.useCallback((t,s)=>s?Array.isArray(s)?s.map(p=>t[p]):t[s]:{...t},[]),Q=r.useCallback(t=>P(a.current,t),[P]),x=r.useCallback(t=>P(m.current,t),[P]),M=r.useCallback(t=>P(l.current,t),[P]),V=r.useCallback(t=>P({isDirty:y.current,isError:v.current,errorFields:Object.keys(m.current).filter(s=>!!m.current[s]),dirtyFields:Object.keys(l.current).filter(s=>l.current[s].isDirty),touchedFields:Object.keys(l.current).filter(s=>l.current[s].isTouched)},t),[P]),{watch:D,registerHookWatcher:K,getWatchValue:q,subscribe:$}=_e({channels:d,getValues:Q,getErrors:x,getFieldStates:M,getFormState:V}),C=r.useCallback((t,s,p)=>{const j=l.current[t];j[s]!==p&&(l.current[t]={...j,[s]:p},d.publish(`fieldStates.${t}.${s}`,p),s==="isError"&&d.publish("formState.errorFields",V("errorFields")),s==="isDirty"&&d.publish("formState.dirtyFields",V("dirtyFields")),s==="isTouched"&&d.publish("formState.touchedFields",V("touchedFields")))},[]),ee=r.useCallback(t=>{C(t,"isError",!1),C(t,"isDirty",!1),C(t,"isTouched",!1),C(t,"customState",null)},[C]),e=r.useCallback((t,s)=>{if(m.current[t]===s)return;m.current[t]=s,C(t,"isError",!!s),d.publish(`errors.${t}`,s);const j=X();v.current!==j&&(v.current=j,d.publish("formState.isError",j))},[C]),c=r.useCallback(t=>{if(!m.current[t])return;m.current[t]=null,C(t,"isError",!1),d.publish(`errors.${t}`,null);const s=X();v.current!==s&&(v.current=s,d.publish("formState.isError",s))},[C]),R=r.useCallback(()=>{if(Object.keys(m.current)===0)return;m.current={},d.publish("errors",m.current);const t=X();v.current!==t&&(v.current=t,d.publish("formState.isError",t))},[]),T=r.useCallback(t=>{const s=Ee(t.target);s?e(t.target.name,s):c(t.target.name)},[e,c]),O=r.useCallback((t,s,{shouldDirty:p=!0,shouldOnChange:j=!0}={})=>{if(s===a.current[t])return;h&&F.current.includes(t)&&(s=Number(s)||void 0),C(t,"isTouched",!0);const re=s!==i.current[t];p&&l.current[t].isDirty!==re&&C(t,"isDirty",re);const Y=L();y.current!==Y&&(y.current=Y,d.publish("formState.isDirty",Y)),a.current[t]=s;const z=u.current.get(t);z&&z(s),d.publish(`values.${t}`,s,{shouldDirty:p,shouldOnChange:j}),j&&d.publish("onChange",t,s,a.current)},[C]),A=r.useCallback((t,s)=>(u.current.set(t,s),()=>{f&&u.current.delete(t)}),[]),U=r.useCallback((t,{keepError:s,keepDirty:p,keepTouched:j,keepCustomState:re,defaultValue:Y})=>{const z=u.current.get(t);if(!z)throw new Error(`Cannot reset "${t}" because it's uncontrolled field`);i.current[t]=Y,a.current[t]=Y,z&&z(Y),s||c(t),p||C(t,"isDirty",!1),j||C(t,"isTouched",!1),re||C(t,"customState",null)},[c,C]),J=r.useCallback((t,s=S.getValues(t))=>{d.publish("onBlur",t,s,S.getValues())},[]),S=r.useMemo(()=>({subscribe:$,reset:B,resetField:U,setValue:O,getValues:Q,getErrors:x,getFieldStates:M,getFormState:V,setError:e,clearError:c,clearErrors:R,checkValidity:T,getNumberFields:ae,getFieldValidity:ne,getDefaultValues:oe,setFieldState:C,triggerFieldBlur:J,resetFieldState:ee,getControlledFields:Z}),[$,B,U,O,Q,x,M,V,e,c,R,T,ae,ne,oe,C,ee,J,Z]),N=r.useMemo(()=>({ref:E,watch:D,actions:S,registerController:A,registerHookWatcher:K,lastReloadedAt:b,loadFormValues:W,getWatchValue:q,channels:d}),[E,D,S,A,K,b,W,q,d]),te=r.useMemo(()=>({control:N,actions:S,watch:D}),[b,N,S,D]);return r.useLayoutEffect(()=>{if([...E.current.querySelectorAll("[name]")].forEach(s=>{!s.defaultValue&&i.current[s.name]&&(s.defaultValue=i.current[s.name]),s.type==="number"&&!F.current.includes(s.name)&&F.current.push(s.name)}),E.current){const s=W();a.current={...s},i.current={...s}}},[b]),r.useLayoutEffect(()=>{_()},[]),te};w.Controller=Se,w.Form=ke,w.useController=me,w.useForm=Oe,w.useFormContext=ce,w.useWatch=be,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simple-formkit",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react formkit",
|
|
6
6
|
"react ez formkit",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dayjs": "^1.11.13",
|
|
37
37
|
"react": "^19.1.0",
|
|
38
38
|
"react-dom": "^19.1.0",
|
|
39
|
-
"react-simple-formkit": "^2.
|
|
39
|
+
"react-simple-formkit": "^2.1.4",
|
|
40
40
|
"vite": "^6.0.7"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|