mobx-react-hook-form 5.2.2 → 5.3.0
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/mobx-form/mobx-form.d.ts +6 -2
- package/mobx-form/mobx-form.d.ts.map +1 -1
- package/mobx-form/mobx-form.js +12 -9
- package/package.json +6 -15
- package/mobx-form/deep-observable-struct.d.ts +0 -7
- package/mobx-form/deep-observable-struct.d.ts.map +0 -1
- package/mobx-form/deep-observable-struct.js +0 -57
package/mobx-form/mobx-form.d.ts
CHANGED
|
@@ -259,7 +259,7 @@ export declare class Form<TFieldValues extends FieldValues = FieldValues, TConte
|
|
|
259
259
|
private _observableStruct;
|
|
260
260
|
constructor(config: FormParams<TFieldValues, TContext, TTransformedValues>);
|
|
261
261
|
/**
|
|
262
|
-
* The same as setValue, but will trigger validation if form was submitted
|
|
262
|
+
* The same as setValue, but will trigger validation if form was submitted, also marks this field as dirty
|
|
263
263
|
* It should work the same as field.onChange from react-hook-form's Controller
|
|
264
264
|
*
|
|
265
265
|
* @param name - the path name to the form field value.
|
|
@@ -270,10 +270,14 @@ export declare class Form<TFieldValues extends FieldValues = FieldValues, TConte
|
|
|
270
270
|
* ```tsx
|
|
271
271
|
* // Update a single field
|
|
272
272
|
* changeField('name', 'value');
|
|
273
|
+
* ->
|
|
274
|
+
* setValue('name', 'value', { shouldDirty: true });
|
|
273
275
|
*
|
|
274
276
|
* ** form submitted **
|
|
275
277
|
*
|
|
276
|
-
* changeField('name', 'value');
|
|
278
|
+
* changeField('name', 'value');
|
|
279
|
+
* ->
|
|
280
|
+
* setValue('name', 'value', { shouldDirty: true, shouldValidate: true });
|
|
277
281
|
* ```
|
|
278
282
|
*/
|
|
279
283
|
changeField: <TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(name: TFieldName, value: FieldPathValue<TFieldValues, TFieldName> | undefined, options?: SetValueConfig) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"m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BAA4B,CAKlC;IAEF,OAAO,CAAC,uBAAuB,CAQ7B;IAEF,OAAO,IAAI,IAAI;CAIhB;AAED;;GAEG;AACH,qBAAa,QAAQ,CACnB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,CACjC,SAAQ,IAAI,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC;CAAG"}
|
package/mobx-form/mobx-form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LinkedAbortController } from 'linked-abort-controller';
|
|
2
2
|
import { action, isObservableObject, makeObservable, observable, toJS, } from 'mobx';
|
|
3
3
|
import { createFormControl, get, set, } from 'react-hook-form';
|
|
4
|
-
import { DeepObservableStruct } from '
|
|
4
|
+
import { DeepObservableStruct } from 'yummies/mobx';
|
|
5
5
|
export class Form {
|
|
6
6
|
config;
|
|
7
7
|
values;
|
|
@@ -290,7 +290,7 @@ export class Form {
|
|
|
290
290
|
else {
|
|
291
291
|
defaultValues = structuredClone(defaultValues);
|
|
292
292
|
}
|
|
293
|
-
// @ts-
|
|
293
|
+
// @ts-expect-error
|
|
294
294
|
this.values = defaultValues;
|
|
295
295
|
return this.originalForm.reset(...args);
|
|
296
296
|
});
|
|
@@ -347,14 +347,12 @@ export class Form {
|
|
|
347
347
|
makeObservable(this);
|
|
348
348
|
this.abortController.signal.addEventListener('abort', () => {
|
|
349
349
|
subscription();
|
|
350
|
-
// @ts-
|
|
350
|
+
// @ts-expect-error
|
|
351
351
|
this.originalForm = null;
|
|
352
|
-
// @ts-ignore
|
|
353
|
-
this.data = null;
|
|
354
352
|
});
|
|
355
353
|
}
|
|
356
354
|
/**
|
|
357
|
-
* The same as setValue, but will trigger validation if form was submitted
|
|
355
|
+
* The same as setValue, but will trigger validation if form was submitted, also marks this field as dirty
|
|
358
356
|
* It should work the same as field.onChange from react-hook-form's Controller
|
|
359
357
|
*
|
|
360
358
|
* @param name - the path name to the form field value.
|
|
@@ -365,16 +363,21 @@ export class Form {
|
|
|
365
363
|
* ```tsx
|
|
366
364
|
* // Update a single field
|
|
367
365
|
* changeField('name', 'value');
|
|
366
|
+
* ->
|
|
367
|
+
* setValue('name', 'value', { shouldDirty: true });
|
|
368
368
|
*
|
|
369
369
|
* ** form submitted **
|
|
370
370
|
*
|
|
371
|
-
* changeField('name', 'value');
|
|
371
|
+
* changeField('name', 'value');
|
|
372
|
+
* ->
|
|
373
|
+
* setValue('name', 'value', { shouldDirty: true, shouldValidate: true });
|
|
372
374
|
* ```
|
|
373
375
|
*/
|
|
374
376
|
changeField = (name, value, options) => {
|
|
375
377
|
this.setValue(name, value, {
|
|
378
|
+
shouldDirty: true,
|
|
379
|
+
shouldValidate: this.isSubmitted,
|
|
376
380
|
...options,
|
|
377
|
-
shouldValidate: options?.shouldValidate ?? this.isSubmitted,
|
|
378
381
|
});
|
|
379
382
|
};
|
|
380
383
|
/**
|
|
@@ -423,7 +426,7 @@ export class Form {
|
|
|
423
426
|
updateFormState({ values, errors, dirtyFields, validatingFields, touchedFields, ...simpleProperties }) {
|
|
424
427
|
Object.entries(simpleProperties).forEach(([key, value]) => {
|
|
425
428
|
if (value != null) {
|
|
426
|
-
// @ts-
|
|
429
|
+
// @ts-expect-error
|
|
427
430
|
this[key] = value;
|
|
428
431
|
}
|
|
429
432
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-react-hook-form",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -24,15 +24,16 @@
|
|
|
24
24
|
"@types/react": "^18.0.0 || ^19.0.0",
|
|
25
25
|
"disposer-util": "^2.0.0",
|
|
26
26
|
"linked-abort-controller": "^1.1.0",
|
|
27
|
-
"yummies": "^
|
|
27
|
+
"yummies": "^5.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@biomejs/biome": "2.
|
|
30
|
+
"@biomejs/biome": "2.2.2",
|
|
31
|
+
"@vitejs/plugin-react-swc": "^3.9.0",
|
|
32
|
+
"@vitest/coverage-istanbul": "^3.1.2",
|
|
31
33
|
"commitfmt": "^1.0.4",
|
|
34
|
+
"js2me-biome-config": "^1.0.4",
|
|
32
35
|
"js2me-exports-post-build-script": "^3.0.2",
|
|
33
36
|
"jsdom": "^26.1.0",
|
|
34
|
-
"@vitejs/plugin-react-swc": "^3.9.0",
|
|
35
|
-
"@vitest/coverage-istanbul": "^3.1.2",
|
|
36
37
|
"lefthook": "^1.11.13",
|
|
37
38
|
"nodemon": "^3.1.10",
|
|
38
39
|
"rimraf": "^6.0.1",
|
|
@@ -55,16 +56,6 @@
|
|
|
55
56
|
"default": "./index.js",
|
|
56
57
|
"types": "./index.d.ts"
|
|
57
58
|
},
|
|
58
|
-
"./mobx-form/deep-observable-struct.test": {
|
|
59
|
-
"import": "./mobx-form/deep-observable-struct.test.js",
|
|
60
|
-
"default": "./mobx-form/deep-observable-struct.test.js",
|
|
61
|
-
"types": "./mobx-form/deep-observable-struct.test.d.ts"
|
|
62
|
-
},
|
|
63
|
-
"./mobx-form/deep-observable-struct": {
|
|
64
|
-
"import": "./mobx-form/deep-observable-struct.js",
|
|
65
|
-
"default": "./mobx-form/deep-observable-struct.js",
|
|
66
|
-
"types": "./mobx-form/deep-observable-struct.d.ts"
|
|
67
|
-
},
|
|
68
59
|
"./mobx-form": {
|
|
69
60
|
"import": "./mobx-form/index.js",
|
|
70
61
|
"default": "./mobx-form/index.js",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-observable-struct.d.ts","sourceRoot":"","sources":["../../src/mobx-form/deep-observable-struct.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,qBAAa,oBAAoB,CAAC,KAAK,SAAS,SAAS;IACvD,IAAI,EAAE,KAAK,CAAC;gBAEA,IAAI,EAAE,KAAK;IASvB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;CAoD5B"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import { action, makeObservable, observable } from 'mobx';
|
|
2
|
-
import { typeGuard } from 'yummies/type-guard';
|
|
3
|
-
export class DeepObservableStruct {
|
|
4
|
-
data;
|
|
5
|
-
constructor(data) {
|
|
6
|
-
this.data = data;
|
|
7
|
-
makeObservable(this, {
|
|
8
|
-
data: observable.deep,
|
|
9
|
-
set: action,
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
set(newData) {
|
|
13
|
-
const stack = Object.keys(this.data).map((key) => [
|
|
14
|
-
key,
|
|
15
|
-
this.data,
|
|
16
|
-
newData,
|
|
17
|
-
]);
|
|
18
|
-
let currentIndex = 0;
|
|
19
|
-
let stackLength = stack.length;
|
|
20
|
-
while (currentIndex < stackLength) {
|
|
21
|
-
const [key, currObservableData, newData] = stack[currentIndex];
|
|
22
|
-
const newValue = newData[key];
|
|
23
|
-
const currValue = currObservableData[key];
|
|
24
|
-
currentIndex++;
|
|
25
|
-
if (key in newData) {
|
|
26
|
-
if (typeGuard.isObject(newValue) && typeGuard.isObject(currValue)) {
|
|
27
|
-
const newValueKeys = Object.keys(newValue);
|
|
28
|
-
Object.keys(currValue).forEach((childKey) => {
|
|
29
|
-
if (!(childKey in newValue)) {
|
|
30
|
-
delete currObservableData[key][childKey];
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
newValueKeys.forEach((childKey) => {
|
|
34
|
-
const length = stack.push([
|
|
35
|
-
childKey,
|
|
36
|
-
currObservableData[key],
|
|
37
|
-
newValue,
|
|
38
|
-
]);
|
|
39
|
-
stackLength = length;
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
else if (newValue !== currValue) {
|
|
43
|
-
currObservableData[key] = newValue;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
delete currObservableData[key];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
Object.keys(newData).forEach((newDataKey) => {
|
|
51
|
-
if (!this.data[newDataKey]) {
|
|
52
|
-
// @ts-ignore
|
|
53
|
-
this.data[newDataKey] = newData[newDataKey];
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
}
|