@strictly/react-form 0.0.21 → 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.
@@ -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 FormFieldsOfModel<M> = FormFieldsOfModel<M>>(model: M, { onValidFieldSubmit, onValidFormSubmit, }?: {
6
- onValidFieldSubmit?: <Path extends ValuePathsOfModel<M>>(valuePath: Path) => void;
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('FlattenedTypePathsToConvertersOf', function () {
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
- '$.x:a': identityAdapter(0).narrow,
747
- '$.y:b': identityAdapter(false).narrow,
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
- '$.x:a',
761
+ '$:x.a',
762
762
  true,
763
763
  ],
764
764
  [
765
- '$.y:b',
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
- '$.x:a',
784
+ '$:x.a',
785
785
  false,
786
786
  ],
787
787
  [
788
- '$.y:b',
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';