mobx-react-hook-form 2.1.1 → 2.1.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/index.d.ts +0 -1
- package/index.d.ts.map +1 -1
- package/index.js +0 -1
- package/mobx-form/mobx-form.d.ts +15 -30
- package/mobx-form/mobx-form.d.ts.map +1 -1
- package/mobx-form/mobx-form.js +36 -86
- package/mobx-form/mobx-form.types.d.ts +7 -32
- package/mobx-form/mobx-form.types.d.ts.map +1 -1
- package/package.json +15 -14
- package/hooks/index.d.ts +0 -2
- package/hooks/index.d.ts.map +0 -1
- package/hooks/index.js +0 -1
- package/hooks/use-mobx-form.d.ts +0 -3
- package/hooks/use-mobx-form.d.ts.map +0 -1
- package/hooks/use-mobx-form.js +0 -4
package/index.d.ts
CHANGED
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/index.js
CHANGED
package/mobx-form/mobx-form.d.ts
CHANGED
|
@@ -1,49 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
export declare class MobxForm<TFieldValues extends
|
|
1
|
+
import { createFormControl, FieldValues, FormState, SubmitErrorHandler, SubmitHandler, UseFormProps } from 'react-hook-form';
|
|
2
|
+
import { Maybe } from 'yummies/utils/types';
|
|
3
|
+
import { MobxFormParams } from './mobx-form.types.js';
|
|
4
|
+
export declare class MobxForm<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues> {
|
|
5
5
|
private config;
|
|
6
6
|
protected abortController: AbortController;
|
|
7
7
|
/**
|
|
8
8
|
* Real react-hook-form params
|
|
9
9
|
* Needed to connect real react-hook-form to this mobx wrapper
|
|
10
10
|
*/
|
|
11
|
-
params: UseFormProps<TFieldValues, TContext>;
|
|
12
|
-
protected handleSubmit(...args: Parameters<SubmitHandler<
|
|
11
|
+
params: UseFormProps<TFieldValues, TContext, TTransformedValues>;
|
|
12
|
+
protected handleSubmit(...args: Parameters<SubmitHandler<TTransformedValues>>): void | Promise<void>;
|
|
13
13
|
protected handleSubmitFailed(...args: Parameters<SubmitErrorHandler<TFieldValues>>): void | Promise<void>;
|
|
14
14
|
protected handleReset(): void;
|
|
15
15
|
/**
|
|
16
16
|
* Original react-hook-form form
|
|
17
17
|
*/
|
|
18
|
-
form:
|
|
18
|
+
form: ReturnType<typeof createFormControl<TFieldValues, TContext, TTransformedValues>>;
|
|
19
19
|
/**
|
|
20
20
|
* form state received from form.formState
|
|
21
21
|
*/
|
|
22
|
-
state: FormState<TFieldValues
|
|
22
|
+
state: Maybe<Partial<FormState<TFieldValues>> & {
|
|
23
|
+
values: TFieldValues;
|
|
24
|
+
}>;
|
|
23
25
|
/**
|
|
24
26
|
* Raw data received from form.getValues()
|
|
25
27
|
*/
|
|
26
|
-
data:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
32
|
-
setParams(params: UseFormProps<TFieldValues, TContext>): void;
|
|
33
|
-
/**
|
|
34
|
-
* Allows to modify real react-hook-form useForm() payload
|
|
35
|
-
*/
|
|
36
|
-
updateParams(params: Partial<UseFormProps<TFieldValues, TContext>>): 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>;
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated use destroy();
|
|
46
|
-
*/
|
|
47
|
-
dispose(): void;
|
|
28
|
+
data: TFieldValues;
|
|
29
|
+
constructor(config: MobxFormParams<TFieldValues, TContext, TTransformedValues>);
|
|
30
|
+
destroy(): void;
|
|
31
|
+
submit: (event?: any) => Promise<void>;
|
|
32
|
+
reset: () => void;
|
|
48
33
|
}
|
|
49
34
|
//# sourceMappingURL=mobx-form.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobx-form.d.ts","sourceRoot":"","sources":["../../src/mobx-form/mobx-form.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mobx-form.d.ts","sourceRoot":"","sources":["../../src/mobx-form/mobx-form.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,iBAAiB,EACjB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,aAAa,EACb,YAAY,EACb,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,qBAAa,QAAQ,CACnB,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY;IAqD/B,OAAO,CAAC,MAAM;IAnDhB,SAAS,CAAC,eAAe,EAAE,eAAe,CAAC;IAE3C;;;OAGG;IACH,MAAM,EAAE,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CAAC;IAEjE,SAAS,CAAC,YAAY,CAEpB,GAAG,IAAI,EAAE,UAAU,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC,GACrD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvB,SAAS,CAAC,kBAAkB,CAE1B,GAAG,IAAI,EAAE,UAAU,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,GACpD,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAKvB,SAAS,CAAC,WAAW;IAKrB;;OAEG;IACH,IAAI,EAAE,UAAU,CACd,OAAO,iBAAiB,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC,CACrE,CAAC;IAEF;;OAEG;IACH,KAAK,EAAE,KAAK,CACV,OAAO,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,GAAG;QACjC,MAAM,EAAE,YAAY,CAAC;KACtB,CACF,CAAC;IAEF;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC;gBAGT,MAAM,EAAE,cAAc,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC;IAgD5E,OAAO,IAAI,IAAI;IAIf,MAAM,GAAU,QAAQ,GAAG,mBAOzB;IAEF,KAAK,aAEH;CACH"}
|
package/mobx-form/mobx-form.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
1
2
|
import { LinkedAbortController } from 'linked-abort-controller';
|
|
2
|
-
import { action, makeObservable, observable,
|
|
3
|
+
import { action, makeObservable, observable, runInAction } from 'mobx';
|
|
4
|
+
import { createFormControl, } from 'react-hook-form';
|
|
3
5
|
export class MobxForm {
|
|
4
6
|
config;
|
|
5
7
|
abortController;
|
|
@@ -36,106 +38,54 @@ export class MobxForm {
|
|
|
36
38
|
* Raw data received from form.getValues()
|
|
37
39
|
*/
|
|
38
40
|
data;
|
|
39
|
-
isConnected = false;
|
|
40
41
|
constructor(config) {
|
|
41
42
|
this.config = config;
|
|
43
|
+
this.params = config;
|
|
42
44
|
this.abortController = new LinkedAbortController(config.abortSignal);
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
this.form = createFormControl(config);
|
|
46
|
+
this.data = this.form.getValues();
|
|
47
|
+
this.state = null;
|
|
48
|
+
this.params = config;
|
|
49
|
+
const subscription = this.form.subscribe({
|
|
50
|
+
callback: (rawFormState) => {
|
|
51
|
+
runInAction(() => {
|
|
52
|
+
if (this.state) {
|
|
53
|
+
Object.assign(this.state, rawFormState);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
this.state = rawFormState;
|
|
57
|
+
}
|
|
58
|
+
Object.assign(this.data, rawFormState.values);
|
|
59
|
+
});
|
|
60
|
+
},
|
|
61
|
+
});
|
|
48
62
|
this.abortController.signal.addEventListener('abort', () => {
|
|
63
|
+
subscription();
|
|
64
|
+
// @ts-ignore
|
|
49
65
|
this.form = null;
|
|
66
|
+
// @ts-ignore
|
|
50
67
|
this.data = null;
|
|
68
|
+
// @ts-ignore
|
|
69
|
+
this.state = null;
|
|
51
70
|
});
|
|
52
|
-
this.state = {
|
|
53
|
-
disabled: false,
|
|
54
|
-
errors: {},
|
|
55
|
-
isDirty: false,
|
|
56
|
-
isLoading: false,
|
|
57
|
-
isSubmitSuccessful: false,
|
|
58
|
-
isSubmitted: false,
|
|
59
|
-
isValid: false,
|
|
60
|
-
isValidating: false,
|
|
61
|
-
isSubmitting: false,
|
|
62
|
-
submitCount: 0,
|
|
63
|
-
touchedFields: {},
|
|
64
|
-
defaultValues: undefined,
|
|
65
|
-
dirtyFields: {},
|
|
66
|
-
validatingFields: {},
|
|
67
|
-
};
|
|
68
|
-
this.params = config;
|
|
69
71
|
observable.deep(this, 'state');
|
|
70
72
|
observable.deep(this, 'data');
|
|
71
73
|
observable.ref(this, 'params');
|
|
74
|
+
observable.ref(this, 'form');
|
|
72
75
|
action.bound(this, 'setParams');
|
|
73
76
|
action.bound(this, 'updateParams');
|
|
74
77
|
action.bound(this, 'syncForm');
|
|
75
78
|
makeObservable(this);
|
|
76
|
-
if (config.getParams) {
|
|
77
|
-
reaction(config.getParams, (params) => {
|
|
78
|
-
this.updateParams(params);
|
|
79
|
-
}, {
|
|
80
|
-
signal: this.abortController.signal,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Allows to modify real react-hook-form useForm() payload
|
|
86
|
-
*/
|
|
87
|
-
setParams(params) {
|
|
88
|
-
this.params = params;
|
|
89
79
|
}
|
|
90
|
-
|
|
91
|
-
* Allows to modify real react-hook-form useForm() payload
|
|
92
|
-
*/
|
|
93
|
-
updateParams(params) {
|
|
94
|
-
this.setParams({ ...this.params, ...params });
|
|
95
|
-
}
|
|
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
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* @deprecated use destroy();
|
|
137
|
-
*/
|
|
138
|
-
dispose() {
|
|
80
|
+
destroy() {
|
|
139
81
|
this.abortController.abort();
|
|
140
82
|
}
|
|
83
|
+
submit = async (event) => {
|
|
84
|
+
if (this.config.onSubmit) {
|
|
85
|
+
await this.form.handleSubmit(this.config.onSubmit, this.config.onSubmitFailed)(event);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
reset = () => {
|
|
89
|
+
this.form.reset();
|
|
90
|
+
};
|
|
141
91
|
}
|
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { SubmitErrorHandler, SubmitHandler, UseFormProps, UseFormReturn } from 'react-hook-form';
|
|
3
|
-
import { AnyObject } from 'yummies/utils/types';
|
|
1
|
+
import { FieldValues, SubmitErrorHandler, SubmitHandler, UseFormProps } from 'react-hook-form';
|
|
4
2
|
import type { MobxForm } from './mobx-form.js';
|
|
3
|
+
export type AnyMobxForm = MobxForm<any, any, any>;
|
|
5
4
|
/**
|
|
6
5
|
* Additional options for {@link MobxForm} constructor
|
|
7
6
|
*/
|
|
8
|
-
export interface MobxFormParams<TFieldValues extends
|
|
9
|
-
/**
|
|
10
|
-
* Disposer for mobx form
|
|
11
|
-
* @deprecated use {abortSignal} instead
|
|
12
|
-
*/
|
|
13
|
-
disposer?: IDisposer;
|
|
7
|
+
export interface MobxFormParams<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues = TFieldValues> extends UseFormProps<TFieldValues, TContext, TTransformedValues> {
|
|
14
8
|
/**
|
|
15
9
|
* Abort signal for mobx form
|
|
16
10
|
*/
|
|
@@ -18,7 +12,7 @@ export interface MobxFormParams<TFieldValues extends AnyObject, TContext = any,
|
|
|
18
12
|
/**
|
|
19
13
|
* Form submit handler
|
|
20
14
|
*/
|
|
21
|
-
onSubmit?: SubmitHandler<
|
|
15
|
+
onSubmit?: SubmitHandler<TTransformedValues>;
|
|
22
16
|
/**
|
|
23
17
|
* Form submit failed handler
|
|
24
18
|
*/
|
|
@@ -27,27 +21,8 @@ export interface MobxFormParams<TFieldValues extends AnyObject, TContext = any,
|
|
|
27
21
|
* Form reset handler
|
|
28
22
|
*/
|
|
29
23
|
onReset?: VoidFunction;
|
|
30
|
-
/**
|
|
31
|
-
* Dynamic change react-hook-form params, works as reaction
|
|
32
|
-
*/
|
|
33
|
-
getParams?: () => Partial<UseFormProps<TFieldValues, TContext>>;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Interface for a connected Mobx form.
|
|
37
|
-
* Extends the properties of react-hook-form's UseFormReturn,
|
|
38
|
-
* Adds custom form handlers.
|
|
39
|
-
*/
|
|
40
|
-
export interface ConnectedMobxForm<TFieldValues extends AnyObject, TContext = any, TFieldOutputValues extends AnyObject = TFieldValues> extends UseFormReturn<TFieldValues, TContext, TFieldOutputValues> {
|
|
41
|
-
/**
|
|
42
|
-
* Handler to reset the form.
|
|
43
|
-
*/
|
|
44
|
-
onReset: VoidFunction;
|
|
45
|
-
/**
|
|
46
|
-
* Handler to submit the form.
|
|
47
|
-
*/
|
|
48
|
-
onSubmit: VoidFunction;
|
|
49
24
|
}
|
|
50
|
-
export type ExtractFormFieldValues<T extends
|
|
51
|
-
export type ExtractFormContext<T extends
|
|
52
|
-
export type ExtractFormFieldOutputValues<T extends
|
|
25
|
+
export type ExtractFormFieldValues<T extends AnyMobxForm> = Exclude<T['params']['values'], undefined | null>;
|
|
26
|
+
export type ExtractFormContext<T extends AnyMobxForm> = Exclude<T['params']['context'], undefined | null>;
|
|
27
|
+
export type ExtractFormFieldOutputValues<T extends AnyMobxForm> = T extends MobxForm<any, any, infer TFieldOutputValues> ? TFieldOutputValues : never;
|
|
53
28
|
//# sourceMappingURL=mobx-form.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mobx-form.types.d.ts","sourceRoot":"","sources":["../../src/mobx-form/mobx-form.types.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"mobx-form.types.d.ts","sourceRoot":"","sources":["../../src/mobx-form/mobx-form.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,aAAa,EACb,YAAY,EACb,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,cAAc,CAC7B,YAAY,SAAS,WAAW,GAAG,WAAW,EAC9C,QAAQ,GAAG,GAAG,EACd,kBAAkB,GAAG,YAAY,CACjC,SAAQ,YAAY,CAAC,YAAY,EAAE,QAAQ,EAAE,kBAAkB,CAAC;IAChE;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B;;OAEG;IACH,QAAQ,CAAC,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;IAC7C;;OAEG;IACH,cAAc,CAAC,EAAE,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAClD;;OAEG;IACH,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAED,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,WAAW,IAAI,OAAO,CACjE,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EACrB,SAAS,GAAG,IAAI,CACjB,CAAC;AAEF,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,WAAW,IAAI,OAAO,CAC7D,CAAC,CAAC,QAAQ,CAAC,CAAC,SAAS,CAAC,EACtB,SAAS,GAAG,IAAI,CACjB,CAAC;AAEF,MAAM,MAAM,4BAA4B,CAAC,CAAC,SAAS,WAAW,IAC5D,CAAC,SAAS,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC,GAClD,kBAAkB,GAClB,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobx-react-hook-form",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
7
7
|
"author": "js2me",
|
|
8
8
|
"license": "MIT",
|
|
9
|
+
"bugs": {
|
|
10
|
+
"url": "https://github.com/js2me/mobx-react-hook-form/issues"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://github.com/js2me/mobx-react-hook-form",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git://github.com/js2me/mobx-react-hook-form"
|
|
16
|
+
},
|
|
9
17
|
"peerDependencies": {
|
|
10
18
|
"mobx": "^6.12.4",
|
|
11
19
|
"mobx-react-lite": "^4.0.7",
|
|
12
20
|
"react": "^18.3.1",
|
|
13
|
-
"react-hook-form": "^7.
|
|
21
|
+
"react-hook-form": "^7.56.1"
|
|
14
22
|
},
|
|
15
23
|
"dependencies": {
|
|
16
24
|
"disposer-util": "^2.0.0",
|
|
@@ -22,21 +30,11 @@
|
|
|
22
30
|
"@types/lodash-es": "^4.17.12",
|
|
23
31
|
"eslint": "^8.57.1",
|
|
24
32
|
"js2me-eslint-config": "^1.0.7",
|
|
25
|
-
"js2me-exports-post-build-script": "^
|
|
33
|
+
"js2me-exports-post-build-script": "^3.0.1",
|
|
26
34
|
"rimraf": "^6.0.1",
|
|
27
35
|
"typescript": "^5.8.3"
|
|
28
36
|
},
|
|
29
37
|
"exports": {
|
|
30
|
-
"./hooks": {
|
|
31
|
-
"import": "./hooks/index.js",
|
|
32
|
-
"default": "./hooks/index.js",
|
|
33
|
-
"types": "./hooks/index.d.ts"
|
|
34
|
-
},
|
|
35
|
-
"./hooks/use-mobx-form": {
|
|
36
|
-
"import": "./hooks/use-mobx-form.js",
|
|
37
|
-
"default": "./hooks/use-mobx-form.js",
|
|
38
|
-
"types": "./hooks/use-mobx-form.d.ts"
|
|
39
|
-
},
|
|
40
38
|
".": {
|
|
41
39
|
"import": "./index.js",
|
|
42
40
|
"default": "./index.js",
|
|
@@ -64,8 +62,11 @@
|
|
|
64
62
|
"check": "eslint . --fix",
|
|
65
63
|
"prebuild": "npm run clean && npm run check",
|
|
66
64
|
"build": "tsc && node ./post-build.mjs",
|
|
65
|
+
"pub": "PUBLISH=true pnpm run build",
|
|
66
|
+
"pub:next": "PUBLISH=true PUBLISH_TAG=next PUBLISH_FORCE=true pnpm run build",
|
|
67
67
|
"pub:patch": "PUBLISH=true PUBLISH_VERSION=patch pnpm run build",
|
|
68
68
|
"pub:minor": "PUBLISH=true PUBLISH_VERSION=minor pnpm run build",
|
|
69
|
-
"pub:major": "PUBLISH=true PUBLISH_VERSION=major pnpm run build"
|
|
69
|
+
"pub:major": "PUBLISH=true PUBLISH_VERSION=major pnpm run build",
|
|
70
|
+
"pub:patch:next": "PUBLISH=true PUBLISH_VERSION=patch PUBLISH_TAG=next PUBLISH_FORCE=true pnpm run build"
|
|
70
71
|
}
|
|
71
72
|
}
|
package/hooks/index.d.ts
DELETED
package/hooks/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC"}
|
package/hooks/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-mobx-form.js';
|
package/hooks/use-mobx-form.d.ts
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { ConnectedMobxForm, ExtractFormContext, ExtractFormFieldValues, MobxForm } from '../mobx-form/index.js';
|
|
2
|
-
export declare const useMobxForm: <T extends MobxForm<any, any, any>>(mobxForm: T) => ConnectedMobxForm<ExtractFormFieldValues<T>, ExtractFormContext<T>>;
|
|
3
|
-
//# sourceMappingURL=use-mobx-form.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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/hooks/use-mobx-form.js
DELETED