@juantroconisf/lib 3.2.0 → 3.2.1
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -12
- package/dist/index.mjs +22 -12
- package/package.json +1 -2
- package/dist/chunk-JRLTQWP6.mjs +0 -10463
- package/dist/dist-PNR4MRVJ.mjs +0 -10
- package/dist/es-JFG5WQC6.mjs +0 -259
- package/dist/src-UW24ZMRV-GCDZGEWH.mjs +0 -10
package/dist/index.d.mts
CHANGED
|
@@ -107,4 +107,4 @@ interface UseFormChangeResponse<O extends StateType> {
|
|
|
107
107
|
|
|
108
108
|
declare function useFormChange<O extends StateType>({ state: newState, validations, errorMessages, }: FormChangeState<O>): UseFormChangeResponse<O>;
|
|
109
109
|
|
|
110
|
-
export { type BlurFunc, type ComponentInputProps, type FormChangeState, type GetNestedValueByKey, type GetValidationFunc, type MapValidator, type NXErrorFunc, type NestedChangeProps, NextUIError, type RegisterFunc, type RegisterHandleFunc, type RequiredValidationFunc, type StateType, type TouchedType, type UseFormChangeResponse, type UseValidationFunc, type Validator, type ValidatorErrorMessage$1 as ValidatorErrorMessage, type ValidatorFunction, type ValidatorParams$1 as ValidatorParams, type ValidatorTypes, type ValueChangeFunc, useFormChange };
|
|
110
|
+
export { type BlurFunc, type ComponentInputProps, type FormChangeState, type GetNestedValueByKey, type GetValidationFunc, type GetValidationResponse, type MapValidator, type NXErrorFunc, type NestedChangeProps, NextUIError, type RegisterFunc, type RegisterHandleFunc, type RequiredValidationFunc, type StateType, type TouchedType, type UseFormChangeResponse, type UseValidationFunc, type Validator, type ValidatorErrorMessage$1 as ValidatorErrorMessage, type ValidatorFunction, type ValidatorParams$1 as ValidatorParams, type ValidatorTypes, type ValueChangeFunc, useFormChange };
|
package/dist/index.d.ts
CHANGED
|
@@ -107,4 +107,4 @@ interface UseFormChangeResponse<O extends StateType> {
|
|
|
107
107
|
|
|
108
108
|
declare function useFormChange<O extends StateType>({ state: newState, validations, errorMessages, }: FormChangeState<O>): UseFormChangeResponse<O>;
|
|
109
109
|
|
|
110
|
-
export { type BlurFunc, type ComponentInputProps, type FormChangeState, type GetNestedValueByKey, type GetValidationFunc, type MapValidator, type NXErrorFunc, type NestedChangeProps, NextUIError, type RegisterFunc, type RegisterHandleFunc, type RequiredValidationFunc, type StateType, type TouchedType, type UseFormChangeResponse, type UseValidationFunc, type Validator, type ValidatorErrorMessage$1 as ValidatorErrorMessage, type ValidatorFunction, type ValidatorParams$1 as ValidatorParams, type ValidatorTypes, type ValueChangeFunc, useFormChange };
|
|
110
|
+
export { type BlurFunc, type ComponentInputProps, type FormChangeState, type GetNestedValueByKey, type GetValidationFunc, type GetValidationResponse, type MapValidator, type NXErrorFunc, type NestedChangeProps, NextUIError, type RegisterFunc, type RegisterHandleFunc, type RequiredValidationFunc, type StateType, type TouchedType, type UseFormChangeResponse, type UseValidationFunc, type Validator, type ValidatorErrorMessage$1 as ValidatorErrorMessage, type ValidatorFunction, type ValidatorParams$1 as ValidatorParams, type ValidatorTypes, type ValueChangeFunc, useFormChange };
|
package/dist/index.js
CHANGED
|
@@ -200,18 +200,28 @@ function useFormChange({
|
|
|
200
200
|
errorMessage: ""
|
|
201
201
|
};
|
|
202
202
|
if (requirements === void 0) return props;
|
|
203
|
-
const [ui
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
203
|
+
const [ui] = [
|
|
204
|
+
{
|
|
205
|
+
ref: errors2,
|
|
206
|
+
touched: isTouched
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
ref: untouchedErrors,
|
|
210
|
+
touched: true
|
|
211
|
+
}
|
|
212
|
+
].map((item) => {
|
|
213
|
+
const req = getValidation(
|
|
214
|
+
value,
|
|
215
|
+
item.touched,
|
|
216
|
+
requirements,
|
|
217
|
+
errorMessages?.[id]
|
|
218
|
+
);
|
|
219
|
+
item.ref.current = handleNestedChange({
|
|
220
|
+
state: item.ref.current,
|
|
221
|
+
id,
|
|
222
|
+
value: req.isValid
|
|
223
|
+
});
|
|
224
|
+
return req;
|
|
215
225
|
});
|
|
216
226
|
return {
|
|
217
227
|
...props,
|
package/dist/index.mjs
CHANGED
|
@@ -181,18 +181,28 @@ function useFormChange({
|
|
|
181
181
|
errorMessage: ""
|
|
182
182
|
};
|
|
183
183
|
if (requirements === void 0) return props;
|
|
184
|
-
const [ui
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
184
|
+
const [ui] = [
|
|
185
|
+
{
|
|
186
|
+
ref: errors2,
|
|
187
|
+
touched: isTouched
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
ref: untouchedErrors,
|
|
191
|
+
touched: true
|
|
192
|
+
}
|
|
193
|
+
].map((item) => {
|
|
194
|
+
const req = getValidation(
|
|
195
|
+
value,
|
|
196
|
+
item.touched,
|
|
197
|
+
requirements,
|
|
198
|
+
errorMessages?.[id]
|
|
199
|
+
);
|
|
200
|
+
item.ref.current = handleNestedChange({
|
|
201
|
+
state: item.ref.current,
|
|
202
|
+
id,
|
|
203
|
+
value: req.isValid
|
|
204
|
+
});
|
|
205
|
+
return req;
|
|
196
206
|
});
|
|
197
207
|
return {
|
|
198
208
|
...props,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juantroconisf/lib",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"homepage": "https://github.com/juandiegotroconis/lib#readme",
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@heroui/react": "^2.7.5",
|
|
21
|
-
"@types/node": "^22.13.10",
|
|
22
21
|
"@types/react": "^19.0.12",
|
|
23
22
|
"tsup": "^8.4.0",
|
|
24
23
|
"typescript": "^5.8.2"
|