mobx-react-hook-form 2.0.16 → 2.1.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/hooks/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from './use-mobx-form';
1
+ export * from './use-mobx-form.js';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
package/hooks/index.js CHANGED
@@ -1 +1 @@
1
- export * from './use-mobx-form';
1
+ export * from './use-mobx-form.js';
@@ -1,3 +1,3 @@
1
- import { ConnectedMobxForm, ExtractFormContext, ExtractFormFieldValues, MobxForm } from '../mobx-form';
1
+ import { ConnectedMobxForm, ExtractFormContext, ExtractFormFieldValues, MobxForm } from '../mobx-form/index.js';
2
2
  export declare const useMobxForm: <T extends MobxForm<any, any, any>>(mobxForm: T) => ConnectedMobxForm<ExtractFormFieldValues<T>, ExtractFormContext<T>>;
3
3
  //# sourceMappingURL=use-mobx-form.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-mobx-form.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobx-form.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACT,MAAM,cAAc,CAAC;AAEtB,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,YACjD,CAAC,KACV,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAEzB,CAAC"}
1
+ {"version":3,"file":"use-mobx-form.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobx-form.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,QAAQ,EACT,MAAM,uBAAuB,CAAC;AAE/B,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAC3D,UAAU,CAAC,KACV,iBAAiB,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC,CAAC,CAEzB,CAAC"}
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export * from './mobx-form';
2
- export * from './hooks';
1
+ export * from './mobx-form/index.js';
2
+ export * from './hooks/index.js';
3
3
  //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export * from './mobx-form';
2
- export * from './hooks';
1
+ export * from './mobx-form/index.js';
2
+ export * from './hooks/index.js';
@@ -1,3 +1,3 @@
1
- export * from './mobx-form';
2
- export * from './mobx-form.types';
1
+ export * from './mobx-form.js';
2
+ export * from './mobx-form.types.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mobx-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mobx-form/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC"}
@@ -1,2 +1,2 @@
1
- export * from './mobx-form';
2
- export * from './mobx-form.types';
1
+ export * from './mobx-form.js';
2
+ export * from './mobx-form.types.js';
@@ -1,6 +1,6 @@
1
- import { DeepPartial, FormState, SubmitErrorHandler, SubmitHandler, UseFormProps, createFormControl } from 'react-hook-form';
1
+ import { DeepPartial, FormState, SubmitErrorHandler, SubmitHandler, UseFormProps, UseFormReturn } from 'react-hook-form';
2
2
  import type { AnyObject, Maybe } from 'yummies/utils/types';
3
- import { MobxFormParams } from './mobx-form.types';
3
+ import { ConnectedMobxForm, MobxFormParams } from './mobx-form.types.js';
4
4
  export declare class MobxForm<TFieldValues extends AnyObject, TContext = any, TFieldOutputValues extends AnyObject = TFieldValues> {
5
5
  private config;
6
6
  protected abortController: AbortController;
@@ -9,11 +9,13 @@ export declare class MobxForm<TFieldValues extends AnyObject, TContext = any, TF
9
9
  * Needed to connect real react-hook-form to this mobx wrapper
10
10
  */
11
11
  params: UseFormProps<TFieldValues, TContext>;
12
+ protected handleSubmit(...args: Parameters<SubmitHandler<TFieldOutputValues>>): void | Promise<void>;
13
+ protected handleSubmitFailed(...args: Parameters<SubmitErrorHandler<TFieldValues>>): void | Promise<void>;
12
14
  protected handleReset(): void;
13
15
  /**
14
16
  * Original react-hook-form form
15
17
  */
16
- instance: Maybe<ReturnType<typeof createFormControl<TFieldValues, TContext>>>;
18
+ form: Maybe<UseFormReturn<TFieldValues, TContext, TFieldOutputValues>>;
17
19
  /**
18
20
  * form state received from form.formState
19
21
  */
@@ -22,13 +24,8 @@ export declare class MobxForm<TFieldValues extends AnyObject, TContext = any, TF
22
24
  * Raw data received from form.getValues()
23
25
  */
24
26
  data: Maybe<DeepPartial<TFieldValues>>;
25
- onSubmit: (event?: any) => Promise<void>;
26
27
  protected isConnected: boolean;
27
28
  constructor(config: MobxFormParams<TFieldValues, TContext, TFieldOutputValues>);
28
- protected handleSubmit(...args: Parameters<SubmitHandler<TFieldOutputValues>>): void | Promise<void>;
29
- protected handleSubmitFailed(...args: Parameters<SubmitErrorHandler<TFieldValues>>): void | Promise<void>;
30
- protected syncForm(formState: Partial<FormState<TFieldValues>>, data?: DeepPartial<TFieldValues> | TFieldValues): void;
31
- onReset: () => void;
32
29
  /**
33
30
  * Allows to modify real react-hook-form useForm() payload
34
31
  */
@@ -37,7 +34,13 @@ export declare class MobxForm<TFieldValues extends AnyObject, TContext = any, TF
37
34
  * Allows to modify real react-hook-form useForm() payload
38
35
  */
39
36
  updateParams(params: Partial<UseFormProps<TFieldValues, TContext>>): void;
40
- destroy(): void;
37
+ protected syncForm(formResult: UseFormReturn<TFieldValues, TContext, TFieldOutputValues>, data?: DeepPartial<TFieldValues>): void;
38
+ /**
39
+ * Needed to connect real react-hook-form to this mobx wrapper
40
+ *
41
+ * This is used in useMobxForm
42
+ */
43
+ protected connect(formResult: UseFormReturn<TFieldValues, TContext, TFieldOutputValues>): ConnectedMobxForm<TFieldValues, TContext, TFieldOutputValues>;
41
44
  /**
42
45
  * @deprecated use destroy();
43
46
  */
@@ -1 +1 @@
1
- {"version":3,"file":"mobx-form.d.ts","sourceRoot":"","sources":["../../src/mobx-form/mobx-form.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,YAAY,EACZ,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAcnD,qBAAa,QAAQ,CACnB,YAAY,SAAS,SAAS,EAC9B,QAAQ,GAAG,GAAG,EACd,kBAAkB,SAAS,SAAS,GAAG,YAAY;IAmCjD,OAAO,CAAC,MAAM;IAjChB,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,CA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EAAE,QAAQ,CAAC;IAItD;;OAEG;IACH,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IAIlE,SAAS,CAAC,QAAQ,CAChB,UAAU,EAAE,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,EACrE,IAAI,GAAE,WAAW,CAAC,YAAY,CAAiC;IAOjE;;;;OAIG;IACH,SAAS,CAAC,OAAO,CACf,UAAU,EAAE,aAAa,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,GACpE,iBAAiB,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC;IA0ChE;;OAEG;IACH,OAAO,IAAI,IAAI;CAGhB"}
@@ -1,16 +1,5 @@
1
1
  import { LinkedAbortController } from 'linked-abort-controller';
2
- import { action, makeObservable, observable, reaction, runInAction, } from 'mobx';
3
- import { createFormControl, } from 'react-hook-form';
4
- const dependsOn = {
5
- isDirty: true,
6
- isLoading: true,
7
- isValidating: true,
8
- isValid: true,
9
- dirtyFields: true,
10
- touchedFields: true,
11
- validatingFields: true,
12
- errors: true,
13
- };
2
+ import { action, makeObservable, observable, reaction } from 'mobx';
14
3
  export class MobxForm {
15
4
  config;
16
5
  abortController;
@@ -19,6 +8,18 @@ export class MobxForm {
19
8
  * Needed to connect real react-hook-form to this mobx wrapper
20
9
  */
21
10
  params;
11
+ handleSubmit(
12
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
13
+ ...args) {
14
+ this.config.onSubmit?.(...args);
15
+ // used to override
16
+ }
17
+ handleSubmitFailed(
18
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
19
+ ...args) {
20
+ this.config.onSubmitFailed?.(...args);
21
+ // used to override
22
+ }
22
23
  handleReset() {
23
24
  this.config.onReset?.();
24
25
  // used to override
@@ -26,7 +27,7 @@ export class MobxForm {
26
27
  /**
27
28
  * Original react-hook-form form
28
29
  */
29
- instance;
30
+ form;
30
31
  /**
31
32
  * form state received from form.formState
32
33
  */
@@ -35,7 +36,6 @@ export class MobxForm {
35
36
  * Raw data received from form.getValues()
36
37
  */
37
38
  data;
38
- onSubmit;
39
39
  isConnected = false;
40
40
  constructor(config) {
41
41
  this.config = config;
@@ -46,7 +46,7 @@ export class MobxForm {
46
46
  config.disposer.add(() => this.dispose());
47
47
  }
48
48
  this.abortController.signal.addEventListener('abort', () => {
49
- this.instance = null;
49
+ this.form = null;
50
50
  this.data = null;
51
51
  });
52
52
  this.state = {
@@ -69,22 +69,9 @@ export class MobxForm {
69
69
  observable.deep(this, 'state');
70
70
  observable.deep(this, 'data');
71
71
  observable.ref(this, 'params');
72
- observable.ref(this, 'instance');
73
72
  action.bound(this, 'setParams');
73
+ action.bound(this, 'updateParams');
74
74
  action.bound(this, 'syncForm');
75
- this.instance = createFormControl(config);
76
- this.onSubmit = this.instance?.handleSubmit(this.handleSubmit.bind(this), this.handleSubmitFailed.bind(this));
77
- /**
78
- *
79
- *
80
- * Subscribes
81
- *
82
- *
83
- */
84
- this.instance.subscribe({
85
- formState: dependsOn,
86
- callback: (formState) => this.syncForm(formState, formState.values),
87
- });
88
75
  makeObservable(this);
89
76
  if (config.getParams) {
90
77
  reaction(config.getParams, (params) => {
@@ -94,29 +81,6 @@ export class MobxForm {
94
81
  });
95
82
  }
96
83
  }
97
- handleSubmit(
98
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
99
- ...args) {
100
- this.config.onSubmit?.(...args);
101
- // used to override
102
- }
103
- handleSubmitFailed(
104
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
105
- ...args) {
106
- this.config.onSubmitFailed?.(...args);
107
- // used to override
108
- }
109
- syncForm(formState, data) {
110
- runInAction(() => {
111
- Object.assign(this.state, formState);
112
- if (this.data) {
113
- this.data = data;
114
- }
115
- });
116
- }
117
- onReset = () => {
118
- this.config.onReset?.();
119
- };
120
84
  /**
121
85
  * Allows to modify real react-hook-form useForm() payload
122
86
  */
@@ -129,13 +93,49 @@ export class MobxForm {
129
93
  updateParams(params) {
130
94
  this.setParams({ ...this.params, ...params });
131
95
  }
132
- destroy() {
133
- this.abortController.abort();
96
+ syncForm(formResult, data = formResult.getValues()) {
97
+ this.form = formResult;
98
+ this.state = formResult.formState;
99
+ this.data = data;
100
+ }
101
+ /**
102
+ * Needed to connect real react-hook-form to this mobx wrapper
103
+ *
104
+ * This is used in useMobxForm
105
+ */
106
+ connect(formResult) {
107
+ if (!this.isConnected) {
108
+ this.isConnected = true;
109
+ this.syncForm(formResult);
110
+ const formWatchSubscription = formResult.watch((values) => {
111
+ this.syncForm(formResult, values);
112
+ });
113
+ this.abortController.signal.addEventListener('abort', formWatchSubscription.unsubscribe);
114
+ }
115
+ return {
116
+ ...formResult,
117
+ onReset: () => this.handleReset(),
118
+ onSubmit: formResult.handleSubmit(
119
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
120
+ // @ts-expect-error
121
+ (...args) => this.handleSubmit(...args), (...args) => this.handleSubmitFailed(...args)),
122
+ handleSubmit: (onValid, onInvalid) => {
123
+ return formResult.handleSubmit(async (...args) => {
124
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
125
+ // @ts-expect-error
126
+ await this.handleSubmit(...args);
127
+ await onValid(...args);
128
+ }, async (...args) => {
129
+ await this.handleSubmitFailed(...args);
130
+ await onInvalid?.(...args);
131
+ });
132
+ },
133
+ };
134
134
  }
135
135
  /**
136
136
  * @deprecated use destroy();
137
137
  */
138
138
  dispose() {
139
- this.destroy();
139
+ this.abortController.abort();
140
140
  }
141
141
  }
@@ -1,7 +1,7 @@
1
1
  import type { IDisposer } from 'disposer-util';
2
2
  import { SubmitErrorHandler, SubmitHandler, UseFormProps, UseFormReturn } from 'react-hook-form';
3
- import type { AnyObject } from 'yummies/utils/types';
4
- import type { MobxForm } from './mobx-form';
3
+ import { AnyObject } from 'yummies/utils/types';
4
+ import type { MobxForm } from './mobx-form.js';
5
5
  /**
6
6
  * Additional options for {@link MobxForm} constructor
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4
4
  "description": "",
5
+ "type": "module",
5
6
  "keywords": [],
6
7
  "author": "js2me",
7
8
  "license": "MIT",
8
9
  "peerDependencies": {
9
10
  "mobx": "^6.12.4",
10
11
  "mobx-react-lite": "^4.0.7",
11
- "react": "^18.3.1"
12
+ "react": "^18.3.1",
13
+ "react-hook-form": "^7.55.0"
12
14
  },
13
15
  "dependencies": {
14
- "react-hook-form": "^7.55.0-next.3",
15
- "disposer-util": "^1.0.11",
16
- "linked-abort-controller": "^1.0.1",
16
+ "disposer-util": "^2.0.0",
17
+ "linked-abort-controller": "^1.0.4",
17
18
  "lodash-es": "^4.17.21",
18
- "yummies": "^3.0.0"
19
+ "yummies": "^3.0.39"
19
20
  },
20
21
  "devDependencies": {
21
- "@types/lodash-es": "4.17.12",
22
- "eslint": "8.57.0",
23
- "js2me-eslint-config": "1.0.7",
24
- "js2me-exports-post-build-script": "2.0.10",
25
- "rimraf": "6.0.1",
26
- "prettier": "3.3.3",
27
- "typescript": "5.6.2"
22
+ "@types/lodash-es": "^4.17.12",
23
+ "eslint": "^8.57.1",
24
+ "js2me-eslint-config": "^1.0.7",
25
+ "js2me-exports-post-build-script": "^2.0.18",
26
+ "rimraf": "^6.0.1",
27
+ "typescript": "^5.8.3"
28
28
  },
29
29
  "exports": {
30
30
  "./hooks": {