react-simple-formkit 1.0.1 → 1.0.3
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 +268 -5
- package/dist/react-simple-formkit.js +4 -4
- package/dist/react-simple-formkit.mjs +253 -233
- package/dist/react-simple-formkit.umd.js +4 -4
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -1,24 +1,287 @@
|
|
|
1
|
-
# React
|
|
1
|
+
# React Simple FormKit
|
|
2
2
|
|
|
3
3
|
Support form handling simply. Simple, fast and productive.
|
|
4
4
|
|
|
5
|
+
# Peer dependencies
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"react": "^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
10
|
+
"react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0"
|
|
11
|
+
},
|
|
12
|
+
```
|
|
13
|
+
|
|
5
14
|
# Quick start
|
|
6
15
|
|
|
7
16
|
```
|
|
8
|
-
import { Form, useForm } form 'react-
|
|
17
|
+
import { Form, useForm } form 'react-simple-formkit'
|
|
9
18
|
|
|
10
19
|
const form = useForm();
|
|
11
|
-
const { isDirty } = form;
|
|
20
|
+
const { isDirty, actions } = form;
|
|
12
21
|
|
|
13
22
|
const handleSubmit = (data) => {
|
|
14
|
-
|
|
23
|
+
alert(JSON.stringify(data));
|
|
15
24
|
};
|
|
16
25
|
|
|
17
26
|
return (
|
|
18
27
|
<Form form={form} onSubmit={handleSubmit}>
|
|
19
28
|
<input required name="email" />
|
|
20
29
|
<input required name="password" type="password" />
|
|
21
|
-
<button type="
|
|
30
|
+
<button type="button" disabled={!isDirty} onClick={() => actions.reset()}>
|
|
31
|
+
Reset
|
|
32
|
+
</button>
|
|
33
|
+
<button type="submit" disabled={!isDirty}>
|
|
34
|
+
Submit
|
|
35
|
+
</button>
|
|
36
|
+
</Form>
|
|
37
|
+
);
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
# More kits
|
|
41
|
+
|
|
42
|
+
## number fields
|
|
43
|
+
|
|
44
|
+
- By default form, values are string at all. So, adding numberFields will catch the number value in on submit
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
const form = useForm( {numberFields: ['number'] } );
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<Form form={form}>
|
|
51
|
+
<input name="number" placeholder=This is number field" />
|
|
52
|
+
<button type="submit" disabled={!isDirty || isError}>
|
|
53
|
+
Submit
|
|
54
|
+
</button>
|
|
55
|
+
</Form>
|
|
56
|
+
);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## JS Built-in validate on blur
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
const form = useForm();
|
|
63
|
+
const { isDirty, isError, errors, actions } = form;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<Form form={form}>
|
|
67
|
+
<input required name="email" placeholder="email" type="email" onBlur={actions.checkValidity} />
|
|
68
|
+
{errors.email && <span>{errors.email}</span>}
|
|
69
|
+
|
|
70
|
+
<button type="submit" disabled={!isDirty || isError}>
|
|
71
|
+
Submit
|
|
72
|
+
</button>
|
|
73
|
+
</Form>
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Double validate on blur
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
const form = useForm();
|
|
81
|
+
const { isDirty, isError, errors, actions } = form;
|
|
82
|
+
|
|
83
|
+
return (
|
|
84
|
+
<Form form={form}>
|
|
85
|
+
<input
|
|
86
|
+
required
|
|
87
|
+
name="number"
|
|
88
|
+
onBlur={(e) => {
|
|
89
|
+
let error = null;
|
|
90
|
+
error = actions.getFieldValidity(e);
|
|
91
|
+
|
|
92
|
+
if (error) {
|
|
93
|
+
actions.changeError("number", error);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const value = Number(e.target.value || 0);
|
|
98
|
+
if (value >= 10) error = "Number must be less than 10";
|
|
99
|
+
actions.changeError("number", error);
|
|
100
|
+
}}
|
|
101
|
+
/>
|
|
102
|
+
{errors.number && <span className="error-message">{errors.number}</span>}
|
|
103
|
+
|
|
104
|
+
<button type="submit" disabled={!isDirty || isError}>
|
|
105
|
+
Submit
|
|
106
|
+
</button>
|
|
22
107
|
</Form>
|
|
23
108
|
);
|
|
24
109
|
```
|
|
110
|
+
|
|
111
|
+
## Validate by other field
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
const form = useForm();
|
|
115
|
+
const { isDirty, isError, errors, actions } = form;
|
|
116
|
+
|
|
117
|
+
return (
|
|
118
|
+
<Form form={form}>
|
|
119
|
+
<input required name="number" onBlur={actions.checkValidity} />
|
|
120
|
+
{errors.number && <span className="error-message">{errors.number}</span>}
|
|
121
|
+
|
|
122
|
+
<input
|
|
123
|
+
required
|
|
124
|
+
name="number2"
|
|
125
|
+
onBlur={(e) => {
|
|
126
|
+
let error = null;
|
|
127
|
+
error = actions.getFieldValidity(e);
|
|
128
|
+
|
|
129
|
+
if (error) {
|
|
130
|
+
actions.changeError("number2", error);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const value = Number(e.target.value || 0);
|
|
135
|
+
const formState = actions.getFormState();
|
|
136
|
+
const number = Number(formState.number || 0);
|
|
137
|
+
|
|
138
|
+
if (value >= number) error = "Number 2 must be less than number 1";
|
|
139
|
+
actions.changeError("number2", error);
|
|
140
|
+
}}
|
|
141
|
+
/>
|
|
142
|
+
{errors.number2 && <span className="error-message">{errors.number2}</span>}
|
|
143
|
+
<button type="submit" disabled={!isDirty || isError}>
|
|
144
|
+
Submit
|
|
145
|
+
</button>
|
|
146
|
+
</Form>
|
|
147
|
+
)
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Centralized processing with onChange
|
|
151
|
+
|
|
152
|
+
```
|
|
153
|
+
const handleChange = ({ formState, isDirty }) => {
|
|
154
|
+
console.log({ formState, isDirty });
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<Form form={form} onChange={handleChange}>
|
|
159
|
+
<input required name="email" />
|
|
160
|
+
<input required name="password" type="password" />
|
|
161
|
+
<button type="submit" disabled={!isDirty}>
|
|
162
|
+
Submit
|
|
163
|
+
</button>
|
|
164
|
+
</Form>
|
|
165
|
+
);
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
# Support for third party library
|
|
169
|
+
|
|
170
|
+
## Catch value instantly
|
|
171
|
+
|
|
172
|
+
- Some input types like DatePicker, Select just change by click and don't dispatch input actions
|
|
173
|
+
- You also catch this on submit, but cannot use for actions.getFormState() for validate and isDirty update
|
|
174
|
+
- Just put the actions.instantChange where these components onchange
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
const form = useForm();
|
|
178
|
+
const { isDirty, actions } = form;
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<Form form={form}>
|
|
182
|
+
<Select name="select" onChange={actions.instantChange}>
|
|
183
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
184
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
185
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
186
|
+
</Select>
|
|
187
|
+
<LocalizationProvider dateAdapter={AdapterDayjs}>
|
|
188
|
+
<DatePicker name="date" onChange={actions.instantChange} />
|
|
189
|
+
</LocalizationProvider>
|
|
190
|
+
<button type="button" onClick={() => alert(JSON.stringify(actions.getFormState()))}>
|
|
191
|
+
Get value
|
|
192
|
+
</button>
|
|
193
|
+
<button type="submit" disabled={!isDirty}>
|
|
194
|
+
Submit
|
|
195
|
+
</button>
|
|
196
|
+
</Form>
|
|
197
|
+
)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## More control with Controller
|
|
201
|
+
|
|
202
|
+
- Control custom values like object and array
|
|
203
|
+
- Make field assignable by actions.setValue
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
import { Controller, Form, useForm } from "react-simple-formkit";
|
|
207
|
+
|
|
208
|
+
const form = useForm({ numberFields: ["number1", "number2"] });
|
|
209
|
+
const { isDirty, actions } = form;
|
|
210
|
+
|
|
211
|
+
return (
|
|
212
|
+
<Form form={form}>
|
|
213
|
+
{/* Custom value as array */}
|
|
214
|
+
<Controller
|
|
215
|
+
name="multipleSelect"
|
|
216
|
+
defaultValue={[]}
|
|
217
|
+
render={({ ref, value, setValue, name }) => (
|
|
218
|
+
<Select
|
|
219
|
+
multiple
|
|
220
|
+
ref={ref}
|
|
221
|
+
name={name}
|
|
222
|
+
labelId="demo-multiple-name-label"
|
|
223
|
+
id="demo-multiple-name"
|
|
224
|
+
value={value}
|
|
225
|
+
onChange={(e) => {
|
|
226
|
+
const value = e.target.value;
|
|
227
|
+
// On autofill we get a stringified value.
|
|
228
|
+
setValue(typeof value === "string" ? value.split(",") : value);
|
|
229
|
+
// instantChange by select
|
|
230
|
+
actions.instantChange();
|
|
231
|
+
}}
|
|
232
|
+
input={<OutlinedInput label="Name" />}
|
|
233
|
+
>
|
|
234
|
+
<MenuItem value={10}>Ten</MenuItem>
|
|
235
|
+
<MenuItem value={20}>Twenty</MenuItem>
|
|
236
|
+
<MenuItem value={30}>Thirty</MenuItem>
|
|
237
|
+
</Select>
|
|
238
|
+
)}
|
|
239
|
+
/>
|
|
240
|
+
{/* actions.setValue (target field of actions.setValue must use controller)*/}
|
|
241
|
+
<input
|
|
242
|
+
name="number1"
|
|
243
|
+
placeholder="number 1"
|
|
244
|
+
onBlur={(e) => {
|
|
245
|
+
const number1 = Number(e.target.value || 0);
|
|
246
|
+
const number2 = actions.getFormState().number2 || 0;
|
|
247
|
+
actions.setValue("sum", number1 + number2);
|
|
248
|
+
}}
|
|
249
|
+
/>
|
|
250
|
+
<input
|
|
251
|
+
name="number2"
|
|
252
|
+
placeholder="number 2"
|
|
253
|
+
onBlur={(e) => {
|
|
254
|
+
const number2 = Number(e.target.value || 0);
|
|
255
|
+
const number1 = actions.getFormState().number1 || 0;
|
|
256
|
+
actions.setValue("sum", number1 + number2);
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
<Controller
|
|
260
|
+
name="sum"
|
|
261
|
+
render={({ ref, value, setValue, name }) => (
|
|
262
|
+
<input
|
|
263
|
+
ref={ref}
|
|
264
|
+
value={value}
|
|
265
|
+
onChange={(e) => setValue(e.target.value)}
|
|
266
|
+
name={name}
|
|
267
|
+
placeholder="sum(number1, number2)"
|
|
268
|
+
/>
|
|
269
|
+
)}
|
|
270
|
+
/>
|
|
271
|
+
<button type="button" onClick={() => alert(JSON.stringify(actions.getFormState()))}>
|
|
272
|
+
Get value
|
|
273
|
+
</button>
|
|
274
|
+
<button type="submit" disabled={!isDirty}>
|
|
275
|
+
Submit
|
|
276
|
+
</button>
|
|
277
|
+
</Form>
|
|
278
|
+
)
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
# Examples
|
|
282
|
+
|
|
283
|
+
- https://codesandbox.io/p/sandbox/react-simple-formkit-examples-rhmhjj
|
|
284
|
+
|
|
285
|
+
# Contact
|
|
286
|
+
|
|
287
|
+
For any ideas or issues, please get in touch with me at anhhuy2000@gmail.com
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react"),se=(o,a)=>{let b=!1;return Object.keys(a).forEach(i=>{if(!(i in o)||b)return;const c=a[i],s=o[i];(typeof c=="object"||c!==s)&&(b=!0)}),b},Q=o=>!o||typeof o.checkValidity!="function"||o.checkValidity()?null:o.validationMessage,ne=()=>{const[o,a]=n.useState({}),b=n.useMemo(()=>Object.values(o).filter(Boolean).length>0,[o]),i=n.useCallback((u,R)=>{a(m=>m[u]===R?m:{...m,[u]:R})},[]),c=n.useCallback(u=>{a(R=>({...R,...u}))},[]),s=n.useCallback(u=>{a(R=>R[u]?{...R,[u]:""}:R)},[]),E=n.useCallback(()=>{a({})},[]);return{isError:b,errors:o,changeError:i,changeErrors:c,clearError:s,clearErrors:E}},H={defaultValues:{},numberFields:[]},ce=(o=H)=>{const{defaultValues:a=H.defaultValues,numberFields:b=H.numberFields}=o,{changeError:i,errors:c,changeErrors:s,clearError:E,clearErrors:u,isError:R}=ne(),[m,T]=n.useState(!1),f=n.useRef({}),v=n.useRef(a),y=n.useRef({}),w=n.useRef(()=>{}),S=n.useRef(),Y=n.useCallback((t,{shouldDirty:_=!0}={})=>{let d=t;typeof t=="function"&&(d=t(f.current)),f.current=d;let g=m;_&&(g=se(f.current,v.current),g!==m&&T(g)),w.current({formState:f.current,isDirty:g})},[m]),I=n.useCallback(()=>{T(!1),u();const t=y.current;Object.values(t).forEach(d=>d("")),S.current.reset(),f.current=v.current},[u]),z=n.useCallback((t,_)=>{const d=y.current;return d[t]=_,()=>d[t]=null},[]),$=n.useCallback(t=>(w.current=t,()=>w.current=()=>{})),M=n.useCallback(t=>Q(t.target),[]),L=n.useCallback(t=>t?f.current[t]:f.current,[]),W=n.useCallback(()=>v.current,[]),j=n.useCallback(()=>{setTimeout(()=>S.current.dispatchEvent(new Event("input",{bubbles:!0})))},[]),P=n.useCallback(t=>{const _=Q(t.target);_?i(t.target.name,_):i(t.target.name,null)},[i]),U=n.useCallback((t,_,{shouldDirty:d=!0}={})=>{const g=y.current;if(typeof t=="string"){const O=g[t];if(!O)throw new Error(`${t} is uncontrolled, please use Controller for it!`);O(_,{shouldDirty:d}),j()}typeof t=="object"&&(Object.entries(t).forEach(([O,q])=>{const N=g[O];if(!N)throw new Error(`${O} is uncontrolled, please use Controller for it!`);N(q,{shouldDirty:d})}),j())},[j]),x=n.useCallback(()=>{const t=Object.fromEntries(new FormData(S.current)),_=y.current;return Object.keys(_).map(d=>{t[d]=f.current[d]}),b.forEach(d=>t.hasOwnProperty(d)&&(t[d]=+t[d])),t},[]),A=n.useMemo(()=>({setValue:U,instantChange:j,getDefaultValues:W,getFormState:L,setFormState:Y,changeError:i,changeErrors:s,clearError:E,clearErrors:u,loadFormValues:x,checkValidity:P,getFieldValidity:M,registerOnchange:$,reset:I}),[U,j,W,L,Y,i,s,E,x,M,P,$,I]);return n.useEffect(()=>{if(S.current){const t=x();v.current={...t,...a},f.current={...t,...a}}},[]),{ref:S,isDirty:m,isError:R,errors:c,numberFields:b,subscribe:z,actions:A}};var J={exports:{}},V={};/**
|
|
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 K;function ue(){if(K)return V;K=1;var o=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function b(i,c,s){var E=null;if(s!==void 0&&(E=""+s),c.key!==void 0&&(E=""+c.key),"key"in c){s={};for(var u in c)u!=="key"&&(s[u]=c[u])}else s=c;return c=s.ref,{$$typeof:o,type:i,key:E,ref:c!==void 0?c:null,props:s}}return V.Fragment=a,V.jsx=b,V.jsxs=b,V}var D={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
17
|
+
*/var ee;function le(){return ee||(ee=1,process.env.NODE_ENV!=="production"&&function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===x?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case I:return"Profiler";case Y:return"StrictMode";case L:return"Suspense";case W:return"SuspenseList";case U: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 w:return"Portal";case $:return(e.displayName||"Context")+".Provider";case z:return(e._context.displayName||"Context")+".Consumer";case M:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case j:return r=e.displayName||null,r!==null?r:o(e.type)||"Memo";case P:r=e._payload,e=e._init;try{return o(e(r))}catch{}}return null}function a(e){return""+e}function b(e){try{a(e);var r=!1}catch{r=!0}if(r){r=console;var l=r.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(r,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),a(e)}}function i(e){if(e===S)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===P)return"<...>";try{var r=o(e);return r?"<"+r+">":"<...>"}catch{return"<...>"}}function c(){var e=A.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function E(e){if(t.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function u(e,r){function l(){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)",r))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}function R(){var e=o(this.type);return O[e]||(O[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 m(e,r,l,k,C,h,G,X){return l=h.ref,e={$$typeof:y,type:e,key:r,props:h,_owner:C},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):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:G}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:X}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function T(e,r,l,k,C,h,G,X){var p=r.children;if(p!==void 0)if(k)if(_(p)){for(k=0;k<p.length;k++)f(p[k]);Object.freeze&&Object.freeze(p)}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 f(p);if(t.call(r,"key")){p=o(e);var F=Object.keys(r).filter(function(oe){return oe!=="key"});k=0<F.length?"{key: someKey, "+F.join(": ..., ")+": ...}":"{key: someKey}",Z[p+k]||(F=0<F.length?"{"+F.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} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,k,p,F,p),Z[p+k]=!0)}if(p=null,l!==void 0&&(b(l),p=""+l),E(r)&&(b(r.key),p=""+r.key),"key"in r){l={};for(var B in r)B!=="key"&&(l[B]=r[B])}else l=r;return p&&u(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,p,h,C,c(),l,G,X)}function f(e){typeof e=="object"&&e!==null&&e.$$typeof===y&&e._store&&(e._store.validated=1)}var v=n,y=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),Y=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),W=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),x=Symbol.for("react.client.reference"),A=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,t=Object.prototype.hasOwnProperty,_=Array.isArray,d=console.createTask?console.createTask:function(){return null};v={"react-stack-bottom-frame":function(e){return e()}};var g,O={},q=v["react-stack-bottom-frame"].bind(v,s)(),N=d(i(s)),Z={};D.Fragment=S,D.jsx=function(e,r,l,k,C){var h=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,l,!1,k,C,h?Error("react-stack-top-frame"):q,h?d(i(e)):N)},D.jsxs=function(e,r,l,k,C){var h=1e4>A.recentlyCreatedOwnerStacks++;return T(e,r,l,!0,k,C,h?Error("react-stack-top-frame"):q,h?d(i(e)):N)}}()),D}var re;function ie(){return re||(re=1,process.env.NODE_ENV==="production"?J.exports=ue():J.exports=le()),J.exports}var te=ie();const ae=n.createContext({}),fe=()=>n.useContext(ae),de=({id:o,form:a,method:b,action:i,children:c,onSubmit:s=()=>{},onInput:E=()=>{},onChange:u=()=>{},numberFields:R=[],className:m,...T})=>(n.useEffect(()=>a.actions.registerOnchange(u),[u]),te.jsx(ae.Provider,{value:a,children:te.jsx("form",{ref:a==null?void 0:a.ref,action:i,className:m,onSubmit:f=>{b||f.preventDefault();const v=a.actions.loadFormValues();s(v)},onInput:f=>{if(f.target.tagName==="FORM"){const v=a.actions.loadFormValues();a.actions.setFormState(v)}else E(f)},onChange:()=>{const f=a.actions.loadFormValues();a.actions.setFormState(f)},...T,children:c})})),be=({name:o,defaultValue:a,render:b=({ref:i,name:c,defaultValue:s,value:E,setValue:u})=>null})=>{const[i,c]=n.useState(a),s=fe(),E=n.useRef(),u=n.useCallback((R,{shouldDirty:m=!1}={})=>{s.actions.setFormState(T=>({...T,[o]:R}),{shouldDirty:m}),c(R)},[c,s.actions.setFormState]);return n.useEffect(()=>(s.actions.setFormState(m=>({...m,[o]:a}),{shouldDirty:!1}),s.subscribe(o,(m,{shouldDirty:T=!0})=>{c(m),s.actions.setFormState(f=>({...f,[o]:m}),{shouldDirty:T}),E.current&&typeof E.current.dispatchEvent=="function"&&E.current.dispatchEvent(new Event("change"))})),[]),b({ref:E,name:o,defaultValue:a,value:i,setValue:u})};exports.Controller=be;exports.Form=de;exports.useForm=ce;exports.useValidateForm=ne;
|
|
@@ -1,101 +1,114 @@
|
|
|
1
|
-
import le, { useState as
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
return Object.keys(n).forEach((
|
|
5
|
-
if (!(
|
|
6
|
-
const s = n[
|
|
7
|
-
typeof s == "object"
|
|
8
|
-
}),
|
|
9
|
-
},
|
|
10
|
-
const [
|
|
11
|
-
n((
|
|
12
|
-
}, []), s =
|
|
13
|
-
n((
|
|
14
|
-
}, []),
|
|
15
|
-
n((
|
|
16
|
-
}, []),
|
|
1
|
+
import le, { useState as Q, useMemo as se, useCallback as _, useRef as A, useEffect as K, createContext as ie, useContext as fe } from "react";
|
|
2
|
+
const de = (o, n) => {
|
|
3
|
+
let d = !1;
|
|
4
|
+
return Object.keys(n).forEach((l) => {
|
|
5
|
+
if (!(l in o) || d) return;
|
|
6
|
+
const s = n[l], a = o[l];
|
|
7
|
+
(typeof s == "object" || s !== a) && (d = !0);
|
|
8
|
+
}), d;
|
|
9
|
+
}, re = (o) => !o || typeof o.checkValidity != "function" || o.checkValidity() ? null : o.validationMessage, Ee = () => {
|
|
10
|
+
const [o, n] = Q({}), d = se(() => Object.values(o).filter(Boolean).length > 0, [o]), l = _((c, b) => {
|
|
11
|
+
n((E) => E[c] === b ? E : { ...E, [c]: b });
|
|
12
|
+
}, []), s = _((c) => {
|
|
13
|
+
n((b) => ({ ...b, ...c }));
|
|
14
|
+
}, []), a = _((c) => {
|
|
15
|
+
n((b) => b[c] ? { ...b, [c]: "" } : b);
|
|
16
|
+
}, []), m = _(() => {
|
|
17
17
|
n({});
|
|
18
18
|
}, []);
|
|
19
|
-
return { isError:
|
|
20
|
-
},
|
|
19
|
+
return { isError: d, errors: o, changeError: l, changeErrors: s, clearError: a, clearErrors: m };
|
|
20
|
+
}, Z = {
|
|
21
21
|
defaultValues: {},
|
|
22
22
|
numberFields: []
|
|
23
|
-
},
|
|
24
|
-
const { defaultValues: n =
|
|
23
|
+
}, ve = (o = Z) => {
|
|
24
|
+
const { defaultValues: n = Z.defaultValues, numberFields: d = Z.numberFields } = o, { changeError: l, errors: s, changeErrors: a, clearError: m, clearErrors: c, isError: b } = Ee(), [E, g] = Q(!1), i = A({}), v = A(n), j = A({}), F = A(() => {
|
|
25
|
+
}), O = A(), I = _(
|
|
25
26
|
(t, { shouldDirty: T = !0 } = {}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
27
|
+
let f = t;
|
|
28
|
+
typeof t == "function" && (f = t(i.current)), i.current = f;
|
|
29
|
+
let h = E;
|
|
30
|
+
T && (h = de(i.current, v.current), h !== E && g(h)), F.current({ formState: i.current, isDirty: h });
|
|
30
31
|
},
|
|
31
|
-
[
|
|
32
|
-
),
|
|
33
|
-
|
|
32
|
+
[E]
|
|
33
|
+
), $ = _(() => {
|
|
34
|
+
g(!1), c();
|
|
34
35
|
const t = j.current;
|
|
35
|
-
Object.values(t).forEach((
|
|
36
|
-
}, [
|
|
37
|
-
|
|
38
|
-
[]
|
|
39
|
-
), M =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}, []),
|
|
43
|
-
(t
|
|
44
|
-
const
|
|
36
|
+
Object.values(t).forEach((f) => f("")), O.current.reset(), i.current = v.current;
|
|
37
|
+
}, [c]), G = _((t, T) => {
|
|
38
|
+
const f = j.current;
|
|
39
|
+
return f[t] = T, () => f[t] = null;
|
|
40
|
+
}, []), M = _((t) => (F.current = t, () => F.current = () => {
|
|
41
|
+
})), L = _((t) => re(t.target), []), W = _((t) => t ? i.current[t] : i.current, []), U = _(() => v.current, []), w = _(() => {
|
|
42
|
+
setTimeout(() => O.current.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
43
|
+
}, []), P = _(
|
|
44
|
+
(t) => {
|
|
45
|
+
const T = re(t.target);
|
|
46
|
+
T ? l(t.target.name, T) : l(t.target.name, null);
|
|
47
|
+
},
|
|
48
|
+
[l]
|
|
49
|
+
), q = _(
|
|
50
|
+
(t, T, { shouldDirty: f = !0 } = {}) => {
|
|
51
|
+
const h = j.current;
|
|
45
52
|
if (typeof t == "string") {
|
|
46
|
-
const
|
|
47
|
-
if (!
|
|
53
|
+
const S = h[t];
|
|
54
|
+
if (!S)
|
|
48
55
|
throw new Error(`${t} is uncontrolled, please use Controller for it!`);
|
|
49
|
-
|
|
56
|
+
S(T, { shouldDirty: f }), w();
|
|
50
57
|
}
|
|
51
|
-
typeof t == "object" && (Object.entries(t).forEach(([
|
|
52
|
-
const
|
|
53
|
-
if (
|
|
54
|
-
throw new Error(`${
|
|
55
|
-
|
|
58
|
+
typeof t == "object" && (Object.entries(t).forEach(([S, J]) => {
|
|
59
|
+
const V = h[S];
|
|
60
|
+
if (!V)
|
|
61
|
+
throw new Error(`${S} is uncontrolled, please use Controller for it!`);
|
|
62
|
+
V(J, { shouldDirty: f });
|
|
56
63
|
}), w());
|
|
57
64
|
},
|
|
58
65
|
[w]
|
|
59
|
-
),
|
|
60
|
-
const t = Object.fromEntries(new FormData(
|
|
61
|
-
return Object.keys(T).map((
|
|
62
|
-
t[
|
|
63
|
-
}),
|
|
64
|
-
}, []),
|
|
66
|
+
), C = _(() => {
|
|
67
|
+
const t = Object.fromEntries(new FormData(O.current)), T = j.current;
|
|
68
|
+
return Object.keys(T).map((f) => {
|
|
69
|
+
t[f] = i.current[f];
|
|
70
|
+
}), d.forEach((f) => t.hasOwnProperty(f) && (t[f] = +t[f])), t;
|
|
71
|
+
}, []), N = se(
|
|
65
72
|
() => ({
|
|
66
|
-
setValue:
|
|
73
|
+
setValue: q,
|
|
67
74
|
instantChange: w,
|
|
68
|
-
getDefaultValues:
|
|
69
|
-
getFormState:
|
|
70
|
-
setFormState:
|
|
71
|
-
changeError:
|
|
72
|
-
changeErrors:
|
|
73
|
-
clearError:
|
|
74
|
-
clearErrors:
|
|
75
|
-
loadFormValues:
|
|
76
|
-
|
|
75
|
+
getDefaultValues: U,
|
|
76
|
+
getFormState: W,
|
|
77
|
+
setFormState: I,
|
|
78
|
+
changeError: l,
|
|
79
|
+
changeErrors: a,
|
|
80
|
+
clearError: m,
|
|
81
|
+
clearErrors: c,
|
|
82
|
+
loadFormValues: C,
|
|
83
|
+
checkValidity: P,
|
|
84
|
+
getFieldValidity: L,
|
|
85
|
+
registerOnchange: M,
|
|
86
|
+
reset: $
|
|
77
87
|
}),
|
|
78
88
|
[
|
|
79
|
-
|
|
89
|
+
q,
|
|
80
90
|
w,
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
U,
|
|
92
|
+
W,
|
|
93
|
+
I,
|
|
94
|
+
l,
|
|
95
|
+
a,
|
|
96
|
+
m,
|
|
97
|
+
C,
|
|
98
|
+
L,
|
|
99
|
+
P,
|
|
100
|
+
M,
|
|
101
|
+
$
|
|
89
102
|
]
|
|
90
103
|
);
|
|
91
|
-
return
|
|
92
|
-
if (
|
|
93
|
-
const t =
|
|
94
|
-
|
|
104
|
+
return K(() => {
|
|
105
|
+
if (O.current) {
|
|
106
|
+
const t = C();
|
|
107
|
+
v.current = { ...t, ...n }, i.current = { ...t, ...n };
|
|
95
108
|
}
|
|
96
|
-
}, []), { ref:
|
|
109
|
+
}, []), { ref: O, isDirty: E, isError: b, errors: s, numberFields: d, subscribe: G, actions: N };
|
|
97
110
|
};
|
|
98
|
-
var
|
|
111
|
+
var z = { exports: {} }, D = {};
|
|
99
112
|
/**
|
|
100
113
|
* @license React
|
|
101
114
|
* react-jsx-runtime.production.js
|
|
@@ -105,29 +118,29 @@ var L = { exports: {} }, P = {};
|
|
|
105
118
|
* This source code is licensed under the MIT license found in the
|
|
106
119
|
* LICENSE file in the root directory of this source tree.
|
|
107
120
|
*/
|
|
108
|
-
var
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
111
|
-
|
|
112
|
-
var
|
|
113
|
-
function
|
|
114
|
-
var
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
for (var
|
|
118
|
-
|
|
119
|
-
} else
|
|
120
|
-
return s =
|
|
121
|
-
$$typeof:
|
|
122
|
-
type:
|
|
123
|
-
key:
|
|
121
|
+
var te;
|
|
122
|
+
function me() {
|
|
123
|
+
if (te) return D;
|
|
124
|
+
te = 1;
|
|
125
|
+
var o = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
|
|
126
|
+
function d(l, s, a) {
|
|
127
|
+
var m = null;
|
|
128
|
+
if (a !== void 0 && (m = "" + a), s.key !== void 0 && (m = "" + s.key), "key" in s) {
|
|
129
|
+
a = {};
|
|
130
|
+
for (var c in s)
|
|
131
|
+
c !== "key" && (a[c] = s[c]);
|
|
132
|
+
} else a = s;
|
|
133
|
+
return s = a.ref, {
|
|
134
|
+
$$typeof: o,
|
|
135
|
+
type: l,
|
|
136
|
+
key: m,
|
|
124
137
|
ref: s !== void 0 ? s : null,
|
|
125
|
-
props:
|
|
138
|
+
props: a
|
|
126
139
|
};
|
|
127
140
|
}
|
|
128
|
-
return
|
|
141
|
+
return D.Fragment = n, D.jsx = d, D.jsxs = d, D;
|
|
129
142
|
}
|
|
130
|
-
var
|
|
143
|
+
var Y = {};
|
|
131
144
|
/**
|
|
132
145
|
* @license React
|
|
133
146
|
* react-jsx-runtime.development.js
|
|
@@ -137,47 +150,47 @@ var F = {};
|
|
|
137
150
|
* This source code is licensed under the MIT license found in the
|
|
138
151
|
* LICENSE file in the root directory of this source tree.
|
|
139
152
|
*/
|
|
140
|
-
var
|
|
141
|
-
function
|
|
142
|
-
return
|
|
143
|
-
function
|
|
153
|
+
var ne;
|
|
154
|
+
function be() {
|
|
155
|
+
return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
156
|
+
function o(e) {
|
|
144
157
|
if (e == null) return null;
|
|
145
158
|
if (typeof e == "function")
|
|
146
|
-
return e.$$typeof ===
|
|
159
|
+
return e.$$typeof === C ? null : e.displayName || e.name || null;
|
|
147
160
|
if (typeof e == "string") return e;
|
|
148
161
|
switch (e) {
|
|
149
|
-
case
|
|
162
|
+
case O:
|
|
150
163
|
return "Fragment";
|
|
151
|
-
case
|
|
164
|
+
case $:
|
|
152
165
|
return "Profiler";
|
|
153
|
-
case
|
|
166
|
+
case I:
|
|
154
167
|
return "StrictMode";
|
|
155
|
-
case
|
|
168
|
+
case W:
|
|
156
169
|
return "Suspense";
|
|
157
|
-
case
|
|
170
|
+
case U:
|
|
158
171
|
return "SuspenseList";
|
|
159
|
-
case
|
|
172
|
+
case q:
|
|
160
173
|
return "Activity";
|
|
161
174
|
}
|
|
162
175
|
if (typeof e == "object")
|
|
163
176
|
switch (typeof e.tag == "number" && console.error(
|
|
164
177
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
165
178
|
), e.$$typeof) {
|
|
166
|
-
case
|
|
179
|
+
case F:
|
|
167
180
|
return "Portal";
|
|
168
|
-
case
|
|
181
|
+
case M:
|
|
169
182
|
return (e.displayName || "Context") + ".Provider";
|
|
170
|
-
case
|
|
183
|
+
case G:
|
|
171
184
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
172
|
-
case
|
|
185
|
+
case L:
|
|
173
186
|
var r = e.render;
|
|
174
187
|
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
175
|
-
case
|
|
176
|
-
return r = e.displayName || null, r !== null ? r :
|
|
177
|
-
case
|
|
188
|
+
case w:
|
|
189
|
+
return r = e.displayName || null, r !== null ? r : o(e.type) || "Memo";
|
|
190
|
+
case P:
|
|
178
191
|
r = e._payload, e = e._init;
|
|
179
192
|
try {
|
|
180
|
-
return
|
|
193
|
+
return o(e(r));
|
|
181
194
|
} catch {
|
|
182
195
|
}
|
|
183
196
|
}
|
|
@@ -186,7 +199,7 @@ function me() {
|
|
|
186
199
|
function n(e) {
|
|
187
200
|
return "" + e;
|
|
188
201
|
}
|
|
189
|
-
function
|
|
202
|
+
function d(e) {
|
|
190
203
|
try {
|
|
191
204
|
n(e);
|
|
192
205
|
var r = !1;
|
|
@@ -195,67 +208,67 @@ function me() {
|
|
|
195
208
|
}
|
|
196
209
|
if (r) {
|
|
197
210
|
r = console;
|
|
198
|
-
var
|
|
199
|
-
return
|
|
211
|
+
var u = r.error, R = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
212
|
+
return u.call(
|
|
200
213
|
r,
|
|
201
214
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
202
|
-
|
|
215
|
+
R
|
|
203
216
|
), n(e);
|
|
204
217
|
}
|
|
205
218
|
}
|
|
206
|
-
function
|
|
207
|
-
if (e ===
|
|
208
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
219
|
+
function l(e) {
|
|
220
|
+
if (e === O) return "<>";
|
|
221
|
+
if (typeof e == "object" && e !== null && e.$$typeof === P)
|
|
209
222
|
return "<...>";
|
|
210
223
|
try {
|
|
211
|
-
var r =
|
|
224
|
+
var r = o(e);
|
|
212
225
|
return r ? "<" + r + ">" : "<...>";
|
|
213
226
|
} catch {
|
|
214
227
|
return "<...>";
|
|
215
228
|
}
|
|
216
229
|
}
|
|
217
230
|
function s() {
|
|
218
|
-
var e =
|
|
231
|
+
var e = N.A;
|
|
219
232
|
return e === null ? null : e.getOwner();
|
|
220
233
|
}
|
|
221
|
-
function
|
|
234
|
+
function a() {
|
|
222
235
|
return Error("react-stack-top-frame");
|
|
223
236
|
}
|
|
224
|
-
function
|
|
225
|
-
if (
|
|
237
|
+
function m(e) {
|
|
238
|
+
if (t.call(e, "key")) {
|
|
226
239
|
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
227
240
|
if (r && r.isReactWarning) return !1;
|
|
228
241
|
}
|
|
229
242
|
return e.key !== void 0;
|
|
230
243
|
}
|
|
231
|
-
function
|
|
232
|
-
function
|
|
233
|
-
|
|
244
|
+
function c(e, r) {
|
|
245
|
+
function u() {
|
|
246
|
+
h || (h = !0, console.error(
|
|
234
247
|
"%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)",
|
|
235
248
|
r
|
|
236
249
|
));
|
|
237
250
|
}
|
|
238
|
-
|
|
239
|
-
get:
|
|
251
|
+
u.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
252
|
+
get: u,
|
|
240
253
|
configurable: !0
|
|
241
254
|
});
|
|
242
255
|
}
|
|
243
|
-
function
|
|
244
|
-
var e =
|
|
245
|
-
return
|
|
256
|
+
function b() {
|
|
257
|
+
var e = o(this.type);
|
|
258
|
+
return S[e] || (S[e] = !0, console.error(
|
|
246
259
|
"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."
|
|
247
260
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
248
261
|
}
|
|
249
|
-
function
|
|
250
|
-
return
|
|
262
|
+
function E(e, r, u, R, y, k, X, B) {
|
|
263
|
+
return u = k.ref, e = {
|
|
251
264
|
$$typeof: j,
|
|
252
265
|
type: e,
|
|
253
266
|
key: r,
|
|
254
|
-
props:
|
|
255
|
-
_owner:
|
|
256
|
-
}, (
|
|
267
|
+
props: k,
|
|
268
|
+
_owner: y
|
|
269
|
+
}, (u !== void 0 ? u : null) !== null ? Object.defineProperty(e, "ref", {
|
|
257
270
|
enumerable: !1,
|
|
258
|
-
get:
|
|
271
|
+
get: b
|
|
259
272
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
260
273
|
configurable: !1,
|
|
261
274
|
enumerable: !1,
|
|
@@ -270,158 +283,165 @@ function me() {
|
|
|
270
283
|
configurable: !1,
|
|
271
284
|
enumerable: !1,
|
|
272
285
|
writable: !0,
|
|
273
|
-
value:
|
|
286
|
+
value: X
|
|
274
287
|
}), Object.defineProperty(e, "_debugTask", {
|
|
275
288
|
configurable: !1,
|
|
276
289
|
enumerable: !1,
|
|
277
290
|
writable: !0,
|
|
278
|
-
value:
|
|
291
|
+
value: B
|
|
279
292
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
280
293
|
}
|
|
281
|
-
function
|
|
282
|
-
var
|
|
283
|
-
if (
|
|
284
|
-
if (
|
|
285
|
-
if (
|
|
286
|
-
for (
|
|
287
|
-
|
|
288
|
-
Object.freeze && Object.freeze(
|
|
294
|
+
function g(e, r, u, R, y, k, X, B) {
|
|
295
|
+
var p = r.children;
|
|
296
|
+
if (p !== void 0)
|
|
297
|
+
if (R)
|
|
298
|
+
if (T(p)) {
|
|
299
|
+
for (R = 0; R < p.length; R++)
|
|
300
|
+
i(p[R]);
|
|
301
|
+
Object.freeze && Object.freeze(p);
|
|
289
302
|
} else
|
|
290
303
|
console.error(
|
|
291
304
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
292
305
|
);
|
|
293
|
-
else
|
|
294
|
-
if (
|
|
295
|
-
|
|
306
|
+
else i(p);
|
|
307
|
+
if (t.call(r, "key")) {
|
|
308
|
+
p = o(e);
|
|
296
309
|
var x = Object.keys(r).filter(function(ue) {
|
|
297
310
|
return ue !== "key";
|
|
298
311
|
});
|
|
299
|
-
|
|
312
|
+
R = 0 < x.length ? "{key: someKey, " + x.join(": ..., ") + ": ...}" : "{key: someKey}", ee[p + R] || (x = 0 < x.length ? "{" + x.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
300
313
|
`A props object containing a "key" prop is being spread into JSX:
|
|
301
314
|
let props = %s;
|
|
302
315
|
<%s {...props} />
|
|
303
316
|
React keys must be passed directly to JSX without using spread:
|
|
304
317
|
let props = %s;
|
|
305
318
|
<%s key={someKey} {...props} />`,
|
|
306
|
-
|
|
307
|
-
|
|
319
|
+
R,
|
|
320
|
+
p,
|
|
308
321
|
x,
|
|
309
|
-
|
|
310
|
-
),
|
|
322
|
+
p
|
|
323
|
+
), ee[p + R] = !0);
|
|
311
324
|
}
|
|
312
|
-
if (
|
|
313
|
-
|
|
314
|
-
for (var
|
|
315
|
-
|
|
316
|
-
} else
|
|
317
|
-
return
|
|
318
|
-
|
|
325
|
+
if (p = null, u !== void 0 && (d(u), p = "" + u), m(r) && (d(r.key), p = "" + r.key), "key" in r) {
|
|
326
|
+
u = {};
|
|
327
|
+
for (var H in r)
|
|
328
|
+
H !== "key" && (u[H] = r[H]);
|
|
329
|
+
} else u = r;
|
|
330
|
+
return p && c(
|
|
331
|
+
u,
|
|
319
332
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
320
|
-
),
|
|
333
|
+
), E(
|
|
321
334
|
e,
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
335
|
+
p,
|
|
336
|
+
k,
|
|
337
|
+
y,
|
|
325
338
|
s(),
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
339
|
+
u,
|
|
340
|
+
X,
|
|
341
|
+
B
|
|
329
342
|
);
|
|
330
343
|
}
|
|
331
|
-
function
|
|
344
|
+
function i(e) {
|
|
332
345
|
typeof e == "object" && e !== null && e.$$typeof === j && e._store && (e._store.validated = 1);
|
|
333
346
|
}
|
|
334
|
-
var
|
|
347
|
+
var v = le, j = Symbol.for("react.transitional.element"), F = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), I = Symbol.for("react.strict_mode"), $ = Symbol.for("react.profiler"), G = Symbol.for("react.consumer"), M = Symbol.for("react.context"), L = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), q = Symbol.for("react.activity"), C = Symbol.for("react.client.reference"), N = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, t = Object.prototype.hasOwnProperty, T = Array.isArray, f = console.createTask ? console.createTask : function() {
|
|
335
348
|
return null;
|
|
336
349
|
};
|
|
337
|
-
|
|
350
|
+
v = {
|
|
338
351
|
"react-stack-bottom-frame": function(e) {
|
|
339
352
|
return e();
|
|
340
353
|
}
|
|
341
354
|
};
|
|
342
|
-
var
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
)(),
|
|
346
|
-
|
|
347
|
-
var
|
|
348
|
-
return
|
|
355
|
+
var h, S = {}, J = v["react-stack-bottom-frame"].bind(
|
|
356
|
+
v,
|
|
357
|
+
a
|
|
358
|
+
)(), V = f(l(a)), ee = {};
|
|
359
|
+
Y.Fragment = O, Y.jsx = function(e, r, u, R, y) {
|
|
360
|
+
var k = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
361
|
+
return g(
|
|
349
362
|
e,
|
|
350
363
|
r,
|
|
351
|
-
|
|
364
|
+
u,
|
|
352
365
|
!1,
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
366
|
+
R,
|
|
367
|
+
y,
|
|
368
|
+
k ? Error("react-stack-top-frame") : J,
|
|
369
|
+
k ? f(l(e)) : V
|
|
357
370
|
);
|
|
358
|
-
},
|
|
359
|
-
var
|
|
360
|
-
return
|
|
371
|
+
}, Y.jsxs = function(e, r, u, R, y) {
|
|
372
|
+
var k = 1e4 > N.recentlyCreatedOwnerStacks++;
|
|
373
|
+
return g(
|
|
361
374
|
e,
|
|
362
375
|
r,
|
|
363
|
-
|
|
376
|
+
u,
|
|
364
377
|
!0,
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
378
|
+
R,
|
|
379
|
+
y,
|
|
380
|
+
k ? Error("react-stack-top-frame") : J,
|
|
381
|
+
k ? f(l(e)) : V
|
|
369
382
|
);
|
|
370
383
|
};
|
|
371
|
-
}()),
|
|
384
|
+
}()), Y;
|
|
372
385
|
}
|
|
373
|
-
var
|
|
374
|
-
function
|
|
375
|
-
return
|
|
386
|
+
var oe;
|
|
387
|
+
function Re() {
|
|
388
|
+
return oe || (oe = 1, process.env.NODE_ENV === "production" ? z.exports = me() : z.exports = be()), z.exports;
|
|
376
389
|
}
|
|
377
|
-
var
|
|
378
|
-
const ce = ie({}),
|
|
379
|
-
id:
|
|
390
|
+
var ae = Re();
|
|
391
|
+
const ce = ie({}), pe = () => fe(ce), Te = ({
|
|
392
|
+
id: o,
|
|
380
393
|
form: n,
|
|
381
|
-
method:
|
|
382
|
-
action:
|
|
394
|
+
method: d,
|
|
395
|
+
action: l,
|
|
383
396
|
children: s,
|
|
384
|
-
onSubmit:
|
|
397
|
+
onSubmit: a = () => {
|
|
385
398
|
},
|
|
386
|
-
onInput:
|
|
399
|
+
onInput: m = () => {
|
|
387
400
|
},
|
|
388
|
-
onChange:
|
|
401
|
+
onChange: c = () => {
|
|
389
402
|
},
|
|
390
|
-
numberFields:
|
|
391
|
-
className:
|
|
392
|
-
...
|
|
393
|
-
}) => /* @__PURE__ */
|
|
403
|
+
numberFields: b = [],
|
|
404
|
+
className: E,
|
|
405
|
+
...g
|
|
406
|
+
}) => (K(() => n.actions.registerOnchange(c), [c]), /* @__PURE__ */ ae.jsx(ce.Provider, { value: n, children: /* @__PURE__ */ ae.jsx(
|
|
394
407
|
"form",
|
|
395
408
|
{
|
|
396
409
|
ref: n == null ? void 0 : n.ref,
|
|
397
|
-
action:
|
|
398
|
-
className:
|
|
399
|
-
onSubmit: (
|
|
400
|
-
|
|
401
|
-
const
|
|
402
|
-
|
|
410
|
+
action: l,
|
|
411
|
+
className: E,
|
|
412
|
+
onSubmit: (i) => {
|
|
413
|
+
d || i.preventDefault();
|
|
414
|
+
const v = n.actions.loadFormValues();
|
|
415
|
+
a(v);
|
|
416
|
+
},
|
|
417
|
+
onInput: (i) => {
|
|
418
|
+
if (i.target.tagName === "FORM") {
|
|
419
|
+
const v = n.actions.loadFormValues();
|
|
420
|
+
n.actions.setFormState(v);
|
|
421
|
+
} else
|
|
422
|
+
m(i);
|
|
403
423
|
},
|
|
404
|
-
onChange: (
|
|
405
|
-
const
|
|
406
|
-
n.actions.setFormState(
|
|
424
|
+
onChange: () => {
|
|
425
|
+
const i = n.actions.loadFormValues();
|
|
426
|
+
n.actions.setFormState(i);
|
|
407
427
|
},
|
|
408
|
-
...
|
|
428
|
+
...g,
|
|
409
429
|
children: s
|
|
410
430
|
}
|
|
411
|
-
) }),
|
|
412
|
-
const [
|
|
413
|
-
(E) => {
|
|
414
|
-
|
|
431
|
+
) })), ge = ({ name: o, defaultValue: n, render: d = ({ ref: l, name: s, defaultValue: a, value: m, setValue: c }) => null }) => {
|
|
432
|
+
const [l, s] = Q(n), a = pe(), m = A(), c = _(
|
|
433
|
+
(b, { shouldDirty: E = !1 } = {}) => {
|
|
434
|
+
a.actions.setFormState((g) => ({ ...g, [o]: b }), { shouldDirty: E }), s(b);
|
|
415
435
|
},
|
|
416
|
-
[s,
|
|
436
|
+
[s, a.actions.setFormState]
|
|
417
437
|
);
|
|
418
|
-
return
|
|
419
|
-
s(
|
|
420
|
-
})), []),
|
|
438
|
+
return K(() => (a.actions.setFormState((E) => ({ ...E, [o]: n }), { shouldDirty: !1 }), a.subscribe(o, (E, { shouldDirty: g = !0 }) => {
|
|
439
|
+
s(E), a.actions.setFormState((i) => ({ ...i, [o]: E }), { shouldDirty: g }), m.current && typeof m.current.dispatchEvent == "function" && m.current.dispatchEvent(new Event("change"));
|
|
440
|
+
})), []), d({ ref: m, name: o, defaultValue: n, value: l, setValue: c });
|
|
421
441
|
};
|
|
422
442
|
export {
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
443
|
+
ge as Controller,
|
|
444
|
+
Te as Form,
|
|
445
|
+
ve as useForm,
|
|
446
|
+
Ee as useValidateForm
|
|
427
447
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(h,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],r):(h=typeof globalThis<"u"?globalThis:h||self,r(h.Name={},h.React))})(this,function(h,r){"use strict";const se=(o,a)=>{let b=!1;return Object.keys(a).forEach(i=>{if(!(i in o)||b)return;const c=a[i],s=o[i];(typeof c=="object"||c!==s)&&(b=!0)}),b},q=o=>!o||typeof o.checkValidity!="function"||o.checkValidity()?null:o.validationMessage,$=()=>{const[o,a]=r.useState({}),b=r.useMemo(()=>Object.values(o).filter(Boolean).length>0,[o]),i=r.useCallback((u,R)=>{a(m=>m[u]===R?m:{...m,[u]:R})},[]),c=r.useCallback(u=>{a(R=>({...R,...u}))},[]),s=r.useCallback(u=>{a(R=>R[u]?{...R,[u]:""}:R)},[]),E=r.useCallback(()=>{a({})},[]);return{isError:b,errors:o,changeError:i,changeErrors:c,clearError:s,clearErrors:E}},B={defaultValues:{},numberFields:[]},ce=(o=B)=>{const{defaultValues:a=B.defaultValues,numberFields:b=B.numberFields}=o,{changeError:i,errors:c,changeErrors:s,clearError:E,clearErrors:u,isError:R}=$(),[m,_]=r.useState(!1),f=r.useRef({}),v=r.useRef(a),j=r.useRef({}),x=r.useRef(()=>{}),O=r.useRef(),M=r.useCallback((n,{shouldDirty:T=!0}={})=>{let d=n;typeof n=="function"&&(d=n(f.current)),f.current=d;let g=m;T&&(g=se(f.current,v.current),g!==m&&_(g)),x.current({formState:f.current,isDirty:g})},[m]),L=r.useCallback(()=>{_(!1),u();const n=j.current;Object.values(n).forEach(d=>d("")),O.current.reset(),f.current=v.current},[u]),H=r.useCallback((n,T)=>{const d=j.current;return d[n]=T,()=>d[n]=null},[]),W=r.useCallback(n=>(x.current=n,()=>x.current=()=>{})),U=r.useCallback(n=>q(n.target),[]),J=r.useCallback(n=>n?f.current[n]:f.current,[]),z=r.useCallback(()=>v.current,[]),F=r.useCallback(()=>{setTimeout(()=>O.current.dispatchEvent(new Event("input",{bubbles:!0})))},[]),N=r.useCallback(n=>{const T=q(n.target);T?i(n.target.name,T):i(n.target.name,null)},[i]),G=r.useCallback((n,T,{shouldDirty:d=!0}={})=>{const g=j.current;if(typeof n=="string"){const y=g[n];if(!y)throw new Error(`${n} is uncontrolled, please use Controller for it!`);y(T,{shouldDirty:d}),F()}typeof n=="object"&&(Object.entries(n).forEach(([y,X])=>{const Y=g[y];if(!Y)throw new Error(`${y} is uncontrolled, please use Controller for it!`);Y(X,{shouldDirty:d})}),F())},[F]),V=r.useCallback(()=>{const n=Object.fromEntries(new FormData(O.current)),T=j.current;return Object.keys(T).map(d=>{n[d]=f.current[d]}),b.forEach(d=>n.hasOwnProperty(d)&&(n[d]=+n[d])),n},[]),D=r.useMemo(()=>({setValue:G,instantChange:F,getDefaultValues:z,getFormState:J,setFormState:M,changeError:i,changeErrors:s,clearError:E,clearErrors:u,loadFormValues:V,checkValidity:N,getFieldValidity:U,registerOnchange:W,reset:L}),[G,F,z,J,M,i,s,E,V,U,N,W,L]);return r.useEffect(()=>{if(O.current){const n=V();v.current={...n,...a},f.current={...n,...a}}},[]),{ref:O,isDirty:m,isError:R,errors:c,numberFields:b,subscribe:H,actions:D}};var I={exports:{}},P={};/**
|
|
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 ee;function ue(){if(ee)return P;ee=1;var o=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function b(i,c,s){var E=null;if(s!==void 0&&(E=""+s),c.key!==void 0&&(E=""+c.key),"key"in c){s={};for(var u in c)u!=="key"&&(s[u]=c[u])}else s=c;return c=s.ref,{$$typeof:o,type:i,key:E,ref:c!==void 0?c:null,props:s}}return P.Fragment=a,P.jsx=b,P.jsxs=b,P}var A={};/**
|
|
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 te;function le(){return te||(te=1,process.env.NODE_ENV!=="production"&&function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===V?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case L:return"Profiler";case M:return"StrictMode";case J:return"Suspense";case z:return"SuspenseList";case G: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 x:return"Portal";case W:return(e.displayName||"Context")+".Provider";case H:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case F:return t=e.displayName||null,t!==null?t:o(e.type)||"Memo";case N:t=e._payload,e=e._init;try{return o(e(t))}catch{}}return null}function a(e){return""+e}function b(e){try{a(e);var t=!1}catch{t=!0}if(t){t=console;var l=t.error,k=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return l.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",k),a(e)}}function i(e){if(e===O)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===N)return"<...>";try{var t=o(e);return t?"<"+t+">":"<...>"}catch{return"<...>"}}function c(){var e=D.A;return e===null?null:e.getOwner()}function s(){return Error("react-stack-top-frame")}function E(e){if(n.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function u(e,t){function l(){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)",t))}l.isReactWarning=!0,Object.defineProperty(e,"key",{get:l,configurable:!0})}function R(){var e=o(this.type);return y[e]||(y[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 m(e,t,l,k,C,S,Z,Q){return l=S.ref,e={$$typeof:j,type:e,key:t,props:S,_owner:C},(l!==void 0?l:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:R}):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:Z}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Q}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function _(e,t,l,k,C,S,Z,Q){var p=t.children;if(p!==void 0)if(k)if(T(p)){for(k=0;k<p.length;k++)f(p[k]);Object.freeze&&Object.freeze(p)}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 f(p);if(n.call(t,"key")){p=o(e);var w=Object.keys(t).filter(function(me){return me!=="key"});k=0<w.length?"{key: someKey, "+w.join(": ..., ")+": ...}":"{key: someKey}",oe[p+k]||(w=0<w.length?"{"+w.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} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,k,p,w,p),oe[p+k]=!0)}if(p=null,l!==void 0&&(b(l),p=""+l),E(t)&&(b(t.key),p=""+t.key),"key"in t){l={};for(var K in t)K!=="key"&&(l[K]=t[K])}else l=t;return p&&u(l,typeof e=="function"?e.displayName||e.name||"Unknown":e),m(e,p,S,C,c(),l,Z,Q)}function f(e){typeof e=="object"&&e!==null&&e.$$typeof===j&&e._store&&(e._store.validated=1)}var v=r,j=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),W=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),G=Symbol.for("react.activity"),V=Symbol.for("react.client.reference"),D=v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,n=Object.prototype.hasOwnProperty,T=Array.isArray,d=console.createTask?console.createTask:function(){return null};v={"react-stack-bottom-frame":function(e){return e()}};var g,y={},X=v["react-stack-bottom-frame"].bind(v,s)(),Y=d(i(s)),oe={};A.Fragment=O,A.jsx=function(e,t,l,k,C){var S=1e4>D.recentlyCreatedOwnerStacks++;return _(e,t,l,!1,k,C,S?Error("react-stack-top-frame"):X,S?d(i(e)):Y)},A.jsxs=function(e,t,l,k,C){var S=1e4>D.recentlyCreatedOwnerStacks++;return _(e,t,l,!0,k,C,S?Error("react-stack-top-frame"):X,S?d(i(e)):Y)}}()),A}var re;function ie(){return re||(re=1,process.env.NODE_ENV==="production"?I.exports=ue():I.exports=le()),I.exports}var ne=ie();const ae=r.createContext({}),fe=()=>r.useContext(ae),de=({id:o,form:a,method:b,action:i,children:c,onSubmit:s=()=>{},onInput:E=()=>{},onChange:u=()=>{},numberFields:R=[],className:m,..._})=>(r.useEffect(()=>a.actions.registerOnchange(u),[u]),ne.jsx(ae.Provider,{value:a,children:ne.jsx("form",{ref:a==null?void 0:a.ref,action:i,className:m,onSubmit:f=>{b||f.preventDefault();const v=a.actions.loadFormValues();s(v)},onInput:f=>{if(f.target.tagName==="FORM"){const v=a.actions.loadFormValues();a.actions.setFormState(v)}else E(f)},onChange:()=>{const f=a.actions.loadFormValues();a.actions.setFormState(f)},..._,children:c})})),be=({name:o,defaultValue:a,render:b=({ref:i,name:c,defaultValue:s,value:E,setValue:u})=>null})=>{const[i,c]=r.useState(a),s=fe(),E=r.useRef(),u=r.useCallback((R,{shouldDirty:m=!1}={})=>{s.actions.setFormState(_=>({..._,[o]:R}),{shouldDirty:m}),c(R)},[c,s.actions.setFormState]);return r.useEffect(()=>(s.actions.setFormState(m=>({...m,[o]:a}),{shouldDirty:!1}),s.subscribe(o,(m,{shouldDirty:_=!0})=>{c(m),s.actions.setFormState(f=>({...f,[o]:m}),{shouldDirty:_}),E.current&&typeof E.current.dispatchEvent=="function"&&E.current.dispatchEvent(new Event("change"))})),[]),b({ref:E,name:o,defaultValue:a,value:i,setValue:u})};h.Controller=be,h.Form=de,h.useForm=ce,h.useValidateForm=$,Object.defineProperty(h,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-simple-formkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react formkit",
|
|
6
6
|
"react ez formkit",
|
|
@@ -17,10 +17,6 @@
|
|
|
17
17
|
],
|
|
18
18
|
"main": "dist/react-simple-formkit.js",
|
|
19
19
|
"module": "dist/react-simple-formkit.mjs",
|
|
20
|
-
"repository": {
|
|
21
|
-
"type": "git",
|
|
22
|
-
"url": "https://github.com/huynguyen294/react-simple-formkit.git"
|
|
23
|
-
},
|
|
24
20
|
"author": "huynguyen294",
|
|
25
21
|
"license": "MIT",
|
|
26
22
|
"scripts": {
|
|
@@ -31,9 +27,15 @@
|
|
|
31
27
|
},
|
|
32
28
|
"dependencies": {},
|
|
33
29
|
"devDependencies": {
|
|
30
|
+
"@emotion/react": "^11.14.0",
|
|
31
|
+
"@emotion/styled": "^11.14.0",
|
|
32
|
+
"@mui/material": "^7.1.0",
|
|
33
|
+
"@mui/x-date-pickers": "^8.3.0",
|
|
34
34
|
"@vitejs/plugin-react": "^4.4.1",
|
|
35
|
+
"dayjs": "^1.11.13",
|
|
35
36
|
"react": "^19.1.0",
|
|
36
37
|
"react-dom": "^19.1.0",
|
|
38
|
+
"react-simple-formkit": "^1.0.1",
|
|
37
39
|
"vite": "^6.0.7"
|
|
38
40
|
},
|
|
39
41
|
"peerDependencies": {
|