@strictly/react-form 0.0.22 → 0.0.23
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/.out/core/mobx/hooks.d.ts +2 -3
- package/.out/core/mobx/specs/form_model.tests.js +7 -7
- package/.out/index.d.ts +0 -1
- package/.out/index.js +0 -1
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +6 -6
- package/.turbo/turbo-check-types.log +1 -1
- package/.turbo/turbo-release$colon$exports.log +1 -1
- package/core/mobx/hooks.tsx +7 -11
- package/core/mobx/specs/form_model.tests.ts +7 -7
- package/dist/index.d.cts +3 -21
- package/dist/index.d.ts +3 -21
- package/index.ts +0 -1
- package/package.json +1 -1
- package/.out/core/mobx/types.d.ts +0 -19
- package/.out/core/mobx/types.js +0 -1
- package/core/mobx/types.ts +0 -57
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { type ReadonlyTypeOfType, type ValueOfType } from '@strictly/define';
|
|
2
2
|
import { type FormModel } from './form_model';
|
|
3
|
-
import { type FormFieldsOfModel, type ValuePathsOfModel } from './types';
|
|
4
3
|
type ValueOfModel<M extends FormModel<any, any, any, any, any>> = M extends FormModel<infer T, any, any, any, any> ? ValueOfType<ReadonlyTypeOfType<T>> : never;
|
|
5
|
-
export declare function useDefaultMobxFormHooks<M extends FormModel<any, any, any, any, any>, F extends
|
|
6
|
-
onValidFieldSubmit?: <Path extends
|
|
4
|
+
export declare function useDefaultMobxFormHooks<M extends FormModel<any, any, any, any, any>, F extends M['fields'] = M['fields']>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
|
|
5
|
+
onValidFieldSubmit?: <Path extends keyof F>(valuePath: Path) => void;
|
|
7
6
|
onValidFormSubmit?: (value: ValueOfModel<M>) => void;
|
|
8
7
|
}): {
|
|
9
8
|
onFormSubmit: () => void;
|
|
@@ -30,7 +30,7 @@ describe('all', function () {
|
|
|
30
30
|
resetMockAdapter(originalIntegerToStringAdapter, integerToStringAdapter);
|
|
31
31
|
resetMockAdapter(originalBooleanToBooleanAdapter, booleanToBooleanAdapter);
|
|
32
32
|
});
|
|
33
|
-
describe('
|
|
33
|
+
describe('FlattenedTypePathsToAdaptersOf', function () {
|
|
34
34
|
describe('record', function () {
|
|
35
35
|
const typeDef = record(numberType);
|
|
36
36
|
it('equals expected type', function () {
|
|
@@ -743,8 +743,8 @@ describe('all', function () {
|
|
|
743
743
|
b: false,
|
|
744
744
|
},
|
|
745
745
|
}, 'x', true)).narrow,
|
|
746
|
-
'
|
|
747
|
-
'
|
|
746
|
+
'$:x.a': identityAdapter(0).narrow,
|
|
747
|
+
'$:y.b': identityAdapter(false).narrow,
|
|
748
748
|
};
|
|
749
749
|
describe('isValuePathActive', function () {
|
|
750
750
|
describe('discriminator x', function () {
|
|
@@ -758,11 +758,11 @@ describe('all', function () {
|
|
|
758
758
|
true,
|
|
759
759
|
],
|
|
760
760
|
[
|
|
761
|
-
'
|
|
761
|
+
'$:x.a',
|
|
762
762
|
true,
|
|
763
763
|
],
|
|
764
764
|
[
|
|
765
|
-
'
|
|
765
|
+
'$:y.b',
|
|
766
766
|
false,
|
|
767
767
|
],
|
|
768
768
|
])('value path %s is active %s', function (path, expected) {
|
|
@@ -781,11 +781,11 @@ describe('all', function () {
|
|
|
781
781
|
true,
|
|
782
782
|
],
|
|
783
783
|
[
|
|
784
|
-
'
|
|
784
|
+
'$:x.a',
|
|
785
785
|
false,
|
|
786
786
|
],
|
|
787
787
|
[
|
|
788
|
-
'
|
|
788
|
+
'$:y.b',
|
|
789
789
|
true,
|
|
790
790
|
],
|
|
791
791
|
])('value path %s is active %s', function (path, expected) {
|
package/.out/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from './core/mobx/hooks';
|
|
|
8
8
|
export * from './core/mobx/merge_field_adapters_with_two_way_converter';
|
|
9
9
|
export * from './core/mobx/merge_field_adapters_with_validators';
|
|
10
10
|
export * from './core/mobx/sub_form_field_adapters';
|
|
11
|
-
export * from './core/mobx/types';
|
|
12
11
|
export * from './core/props';
|
|
13
12
|
export * from './field_converters/integer_to_string_converter';
|
|
14
13
|
export * from './field_converters/nullable_to_boolean_converter';
|
package/.out/index.js
CHANGED
|
@@ -8,7 +8,6 @@ export * from './core/mobx/hooks';
|
|
|
8
8
|
export * from './core/mobx/merge_field_adapters_with_two_way_converter';
|
|
9
9
|
export * from './core/mobx/merge_field_adapters_with_validators';
|
|
10
10
|
export * from './core/mobx/sub_form_field_adapters';
|
|
11
|
-
export * from './core/mobx/types';
|
|
12
11
|
export * from './core/props';
|
|
13
12
|
export * from './field_converters/integer_to_string_converter';
|
|
14
13
|
export * from './field_converters/nullable_to_boolean_converter';
|