@juantroconisf/lib 4.0.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +11 -7
- package/dist/index.mjs +11 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -206,13 +206,17 @@ function useForm(initialState, { validations, errorMessages } = {}) {
|
|
|
206
206
|
},
|
|
207
207
|
[errors2, touched]
|
|
208
208
|
);
|
|
209
|
-
const onBlur = (id) =>
|
|
210
|
-
(
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
209
|
+
const onBlur = (id) => {
|
|
210
|
+
validateInput(id, state[id]);
|
|
211
|
+
if (touched[id]) return;
|
|
212
|
+
setTouched(
|
|
213
|
+
(prev) => handleNestedChange({
|
|
214
|
+
state: prev,
|
|
215
|
+
id,
|
|
216
|
+
value: true
|
|
217
|
+
})
|
|
218
|
+
);
|
|
219
|
+
}, onValueChange = (id, value) => {
|
|
216
220
|
setState((prev) => handleNestedChange({ state: prev, id, value }));
|
|
217
221
|
validateInput(id, value);
|
|
218
222
|
}, onSelectionChange = (id, value) => {
|
package/dist/index.mjs
CHANGED
|
@@ -187,13 +187,17 @@ function useForm(initialState, { validations, errorMessages } = {}) {
|
|
|
187
187
|
},
|
|
188
188
|
[errors2, touched]
|
|
189
189
|
);
|
|
190
|
-
const onBlur = (id) =>
|
|
191
|
-
(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
190
|
+
const onBlur = (id) => {
|
|
191
|
+
validateInput(id, state[id]);
|
|
192
|
+
if (touched[id]) return;
|
|
193
|
+
setTouched(
|
|
194
|
+
(prev) => handleNestedChange({
|
|
195
|
+
state: prev,
|
|
196
|
+
id,
|
|
197
|
+
value: true
|
|
198
|
+
})
|
|
199
|
+
);
|
|
200
|
+
}, onValueChange = (id, value) => {
|
|
197
201
|
setState((prev) => handleNestedChange({ state: prev, id, value }));
|
|
198
202
|
validateInput(id, value);
|
|
199
203
|
}, onSelectionChange = (id, value) => {
|