@reactables/forms 1.3.0-beta.3 → 2.0.0-beta.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.
Files changed (83) hide show
  1. package/dist/Helpers/addAsyncValidationEffects.d.ts +9 -6
  2. package/dist/Helpers/buildFormState.d.ts +6 -6
  3. package/dist/Helpers/buildHub2Source.d.ts +4 -4
  4. package/dist/Helpers/controlRefCheck.d.ts +5 -5
  5. package/dist/Helpers/controlRefCheck.test.d.ts +1 -1
  6. package/dist/Helpers/generateKey.d.ts +1 -1
  7. package/dist/Helpers/getAncestorControls.d.ts +3 -3
  8. package/dist/Helpers/getAncestorControls.test.d.ts +1 -1
  9. package/dist/Helpers/getArrayItems.d.ts +3 -3
  10. package/dist/Helpers/getArrayItems.test.d.ts +1 -1
  11. package/dist/Helpers/getControl.d.ts +3 -3
  12. package/dist/Helpers/getControlBranch.d.ts +3 -3
  13. package/dist/Helpers/getControlBranch.test.d.ts +1 -1
  14. package/dist/Helpers/getDescendantControls.d.ts +3 -3
  15. package/dist/Helpers/getDescendantControls.test.d.ts +1 -1
  16. package/dist/Helpers/getFormKey.d.ts +2 -2
  17. package/dist/Helpers/getValueFromControlConfig.d.ts +2 -2
  18. package/dist/Helpers/getValueFromControlConfig.test.d.ts +1 -1
  19. package/dist/Helpers/index.d.ts +4 -4
  20. package/dist/Helpers/isChildRef.d.ts +2 -2
  21. package/dist/Helpers/reverseObjectKeys.d.ts +2 -2
  22. package/dist/Models/Configs.d.ts +22 -22
  23. package/dist/Models/ControlRef.d.ts +1 -1
  24. package/dist/Models/Controls.d.ts +48 -48
  25. package/dist/Models/FormErrors.d.ts +3 -3
  26. package/dist/Models/Payloads.d.ts +24 -24
  27. package/dist/Models/Validators.d.ts +5 -5
  28. package/dist/Models/index.d.ts +6 -6
  29. package/dist/Reducers/Hub1/addControl.d.ts +5 -5
  30. package/dist/Reducers/Hub1/getErrors.d.ts +4 -4
  31. package/dist/Reducers/Hub1/index.d.ts +6 -7
  32. package/dist/Reducers/Hub1/markControlAsPristine.d.ts +4 -4
  33. package/dist/Reducers/Hub1/markControlAsTouched.d.ts +4 -4
  34. package/dist/Reducers/Hub1/markControlAsUntouched.d.ts +4 -4
  35. package/dist/Reducers/Hub1/pushControl.d.ts +5 -5
  36. package/dist/Reducers/Hub1/removeControl.d.ts +5 -5
  37. package/dist/Reducers/Hub1/resetControl.d.ts +5 -5
  38. package/dist/Reducers/Hub1/updateAncestorPristineValues.d.ts +5 -5
  39. package/dist/Reducers/Hub1/updateAncestorValues.d.ts +6 -6
  40. package/dist/Reducers/Hub1/updateAncestorValuesAddControl.d.ts +6 -6
  41. package/dist/Reducers/Hub1/updateAncestorValuesRemoveControl.d.ts +6 -6
  42. package/dist/Reducers/Hub1/updateValues.d.ts +5 -5
  43. package/dist/Reducers/Hub2/asyncValidation.d.ts +4 -4
  44. package/dist/Reducers/Hub2/asyncValidationResponse.d.ts +4 -0
  45. package/dist/Reducers/Hub2/formChange.d.ts +3 -3
  46. package/dist/Reducers/Hub2/index.d.ts +3 -3
  47. package/dist/Reducers/Hub2/mergeBranchErrors.d.ts +3 -3
  48. package/dist/Reducers/Hub2/mergeControls.d.ts +5 -5
  49. package/dist/Reducers/Hub2/mergeErrors.d.ts +2 -2
  50. package/dist/Reducers/Hub2/mergeRemoveControl.d.ts +6 -6
  51. package/dist/Reducers/index.d.ts +2 -2
  52. package/dist/RxForm/RxForm.d.ts +103 -99
  53. package/dist/RxForm/Tests/addControl.test.d.ts +1 -1
  54. package/dist/RxForm/Tests/combinedTest.test.d.ts +1 -1
  55. package/dist/RxForm/Tests/customReducers.test.d.ts +1 -1
  56. package/dist/RxForm/Tests/initialization.test.d.ts +1 -1
  57. package/dist/RxForm/Tests/load.test.d.ts +1 -1
  58. package/dist/RxForm/Tests/markControlAsPristine.test.d.ts +1 -1
  59. package/dist/RxForm/Tests/markControlTouchStatus.test.d.ts +1 -1
  60. package/dist/RxForm/Tests/pushControl.test.d.ts +1 -1
  61. package/dist/RxForm/Tests/removeControl.test.d.ts +1 -1
  62. package/dist/RxForm/Tests/resetControl.test.d.ts +1 -1
  63. package/dist/RxForm/Tests/updateValues.test.d.ts +1 -1
  64. package/dist/RxForm/index.d.ts +1 -1
  65. package/dist/Testing/AsyncValidators.d.ts +9 -8
  66. package/dist/Testing/Models/Contact.d.ts +11 -11
  67. package/dist/Testing/Models/DoctorInfo.d.ts +6 -6
  68. package/dist/Testing/Models/EmergencyContact.d.ts +6 -6
  69. package/dist/Testing/Models/initialState.d.ts +667 -667
  70. package/dist/Testing/Validators.d.ts +10 -10
  71. package/dist/Testing/asyncConfig.d.ts +3 -3
  72. package/dist/Testing/config.d.ts +3 -3
  73. package/dist/Validators/Validators.d.ts +4 -4
  74. package/dist/Validators/index.d.ts +1 -1
  75. package/dist/index.cjs +1213 -0
  76. package/dist/index.cjs.map +1 -0
  77. package/dist/index.d.ts +4 -4
  78. package/dist/index.js +1064 -1075
  79. package/dist/index.js.map +1 -0
  80. package/package.json +10 -3
  81. package/dist/Reducers/Hub2/asyncValidationResponseSuccess.d.ts +0 -4
  82. package/dist/Reducers/Hub2/hub2Reducer.d.ts +0 -3
  83. package/dist/Testing/Effects.d.ts +0 -10
@@ -1,6 +1,9 @@
1
- import { Action, Effect } from '@reactables/core';
2
- import { BaseControl } from '../Models/Controls';
3
- import { ControlAsyncValidationResponse } from '../Models/Payloads';
4
- import { RxFormProviders } from '../RxForm/RxForm';
5
- export declare const getScopedEffectsForControl: <T>(formControl: BaseControl<T>, providers: RxFormProviders) => Effect<BaseControl<T>, ControlAsyncValidationResponse>[];
6
- export declare const getAsyncValidationActions: (formControls: BaseControl<unknown>[]) => Action<BaseControl<unknown>>[];
1
+ import { Action, Effect } from '@reactables/core';
2
+ import { BaseControl } from '../Models/Controls';
3
+ import { ControlAsyncValidationResponse } from '../Models/Payloads';
4
+ import { RxFormProviders } from '../RxForm/RxForm';
5
+ import { ControlRef } from '../Models';
6
+ type ControlScopedEffect<T> = Effect<BaseControl<T>, ControlAsyncValidationResponse | ControlRef>;
7
+ export declare const getScopedEffectsForControl: <T>(formControl: BaseControl<T>, providers: RxFormProviders) => ControlScopedEffect<T>[];
8
+ export declare const getAsyncValidationEffects: (formControls: BaseControl<unknown>[]) => Action<BaseControl<unknown>>[];
9
+ export {};
@@ -1,6 +1,6 @@
1
- import { AbstractControlConfig } from '../Models/Configs';
2
- import { BaseForm, BaseFormState } from '../Models/Controls';
3
- import { ControlRef } from '../Models/ControlRef';
4
- import { RxFormProviders } from '../RxForm/RxForm';
5
- export declare const buildState: <T>(config: AbstractControlConfig, form: BaseForm<T>, controlRef: ControlRef, providers: RxFormProviders) => BaseForm<T>;
6
- export declare const buildFormState: <T>(config: AbstractControlConfig, form: BaseForm<T>, controlRef: ControlRef, providers: RxFormProviders) => BaseFormState<T>;
1
+ import { AbstractControlConfig } from '../Models/Configs';
2
+ import { BaseForm, BaseFormState } from '../Models/Controls';
3
+ import { ControlRef } from '../Models/ControlRef';
4
+ import { RxFormProviders } from '../RxForm/RxForm';
5
+ export declare const buildState: <T>(config: AbstractControlConfig, form: BaseForm<T>, controlRef: ControlRef, providers: RxFormProviders) => BaseForm<T>;
6
+ export declare const buildFormState: <T>(config: AbstractControlConfig, form: BaseForm<T>, controlRef: ControlRef, providers: RxFormProviders) => BaseFormState<T>;
@@ -1,4 +1,4 @@
1
- import { Observable } from 'rxjs';
2
- import { Action } from '@reactables/core';
3
- import { BaseFormState } from '../Models/Controls';
4
- export declare const buildHub2Source: <T>(hub1State$: Observable<BaseFormState<T>>, initialBaseState: BaseFormState<T>) => Observable<Action<T>>;
1
+ import { Observable } from 'rxjs';
2
+ import { Action } from '@reactables/core';
3
+ import { BaseFormState } from '../Models/Controls';
4
+ export declare const buildHub2Source: <T>(hub1State$: Observable<BaseFormState<T>>, initialBaseState: BaseFormState<T>) => Observable<Action<T>>;
@@ -1,5 +1,5 @@
1
- import { ControlRef } from '../Models';
2
- /**
3
- * @description see if any keys in a ControlRef has a "." probably a mistake by developer
4
- */
5
- export declare const controlRefCheck: (ref: ControlRef) => void;
1
+ import { ControlRef } from '../Models';
2
+ /**
3
+ * @description see if any keys in a ControlRef has a "." probably a mistake by developer
4
+ */
5
+ export declare const controlRefCheck: (ref: ControlRef) => void;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1 +1 @@
1
- export declare const generateKey: (length: number) => string;
1
+ export declare const generateKey: (length: number) => string;
@@ -1,3 +1,3 @@
1
- import { BaseControl, BaseForm, Form, FormControl } from '../Models/Controls';
2
- import { ControlRef } from '../Models/ControlRef';
3
- export declare const getAncestorControls: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T, excludeSelf?: boolean) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
1
+ import { BaseControl, BaseForm, Form, FormControl } from '../Models/Controls';
2
+ import { ControlRef } from '../Models/ControlRef';
3
+ export declare const getAncestorControls: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T, excludeSelf?: boolean) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { FormControl, Form, BaseForm, BaseControl } from '../Models/Controls';
2
- import { ControlRef } from '../Models/ControlRef';
3
- export declare const getArrayItems: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => T extends BaseForm<unknown> ? BaseControl<unknown>[] : FormControl<unknown>[];
1
+ import { FormControl, Form, BaseForm, BaseControl } from '../Models/Controls';
2
+ import { ControlRef } from '../Models/ControlRef';
3
+ export declare const getArrayItems: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => T extends BaseForm<unknown> ? BaseControl<unknown>[] : FormControl<unknown>[];
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { BaseForm, Form, BaseControl, FormControl } from '../Models/Controls';
2
- import { ControlRef } from '../Models/ControlRef';
3
- export declare const getControl: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => T extends BaseForm<unknown> ? BaseControl<unknown> : FormControl<unknown>;
1
+ import { BaseForm, Form, BaseControl, FormControl } from '../Models/Controls';
2
+ import { ControlRef } from '../Models/ControlRef';
3
+ export declare const getControl: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => T extends BaseForm<unknown> ? BaseControl<unknown> : FormControl<unknown>;
@@ -1,3 +1,3 @@
1
- import { ControlRef } from '../Models/ControlRef';
2
- import { BaseControl, FormControl, BaseForm, Form } from '../Models/Controls';
3
- export declare const getControlBranch: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
1
+ import { ControlRef } from '../Models/ControlRef';
2
+ import { BaseControl, FormControl, BaseForm, Form } from '../Models/Controls';
3
+ export declare const getControlBranch: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,3 +1,3 @@
1
- import { BaseControl, FormControl, BaseForm, Form } from '../Models/Controls';
2
- import { ControlRef } from '../Models/ControlRef';
3
- export declare const getDescendantControls: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T, excludeSelf?: boolean) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
1
+ import { BaseControl, FormControl, BaseForm, Form } from '../Models/Controls';
2
+ import { ControlRef } from '../Models/ControlRef';
3
+ export declare const getDescendantControls: <T extends BaseForm<unknown> | Form<unknown>>(controlRef: ControlRef, form: T, excludeSelf?: boolean) => (T extends Form<unknown> ? FormControl<unknown> : BaseControl<unknown>)[];
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,2 +1,2 @@
1
- import { ControlRef } from '../Models';
2
- export declare const getFormKey: (controlRef: ControlRef) => string;
1
+ import { ControlRef } from '../Models';
2
+ export declare const getFormKey: (controlRef: ControlRef) => string;
@@ -1,2 +1,2 @@
1
- import { AbstractControlConfig } from '../Models/Configs';
2
- export declare const getValueFromControlConfig: <T>(controlConfig: AbstractControlConfig) => T;
1
+ import { AbstractControlConfig } from '../Models/Configs';
2
+ export declare const getValueFromControlConfig: <T>(controlConfig: AbstractControlConfig) => T;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,4 +1,4 @@
1
- export { getArrayItems } from './getArrayItems';
2
- export { getAncestorControls } from './getAncestorControls';
3
- export { getDescendantControls } from './getDescendantControls';
4
- export { getValueFromControlConfig } from './getValueFromControlConfig';
1
+ export { getArrayItems } from './getArrayItems';
2
+ export { getAncestorControls } from './getAncestorControls';
3
+ export { getDescendantControls } from './getDescendantControls';
4
+ export { getValueFromControlConfig } from './getValueFromControlConfig';
@@ -1,2 +1,2 @@
1
- import { ControlRef } from '../Models/ControlRef';
2
- export declare const isChildRef: (controlRef: ControlRef, parentRef: ControlRef) => boolean;
1
+ import { ControlRef } from '../Models/ControlRef';
2
+ export declare const isChildRef: (controlRef: ControlRef, parentRef: ControlRef) => boolean;
@@ -1,2 +1,2 @@
1
- import { Form } from '../Models/Controls';
2
- export declare const reverseObjectKeys: <T>(form: Form<T>) => Form<T>;
1
+ import { Form } from '../Models/Controls';
2
+ export declare const reverseObjectKeys: <T>(form: Form<T>) => Form<T>;
@@ -1,22 +1,22 @@
1
- interface ValidatorConfigs {
2
- validators?: string[];
3
- asyncValidators?: string[];
4
- }
5
- export interface FormGroupConfig extends ValidatorConfigs {
6
- controls: {
7
- [key: string]: AbstractControlConfig;
8
- };
9
- }
10
- export interface FormArrayConfig extends ValidatorConfigs {
11
- controls: AbstractControlConfig[];
12
- }
13
- export interface FormControlConfig<T> extends ValidatorConfigs {
14
- initialValue: T;
15
- normalizers?: string[];
16
- }
17
- export type AbstractControlConfig = (FormControlConfig<unknown> | FormArrayConfig | FormGroupConfig) & {
18
- controls?: AbstractControlConfig[] | {
19
- [key: string]: AbstractControlConfig;
20
- };
21
- };
22
- export {};
1
+ interface ValidatorConfigs {
2
+ validators?: string[];
3
+ asyncValidators?: string[];
4
+ }
5
+ export interface FormGroupConfig extends ValidatorConfigs {
6
+ controls: {
7
+ [key: string]: AbstractControlConfig;
8
+ };
9
+ }
10
+ export interface FormArrayConfig extends ValidatorConfigs {
11
+ controls: AbstractControlConfig[];
12
+ }
13
+ export interface FormControlConfig<T> extends ValidatorConfigs {
14
+ initialValue: T;
15
+ normalizers?: string[];
16
+ }
17
+ export type AbstractControlConfig = (FormControlConfig<unknown> | FormArrayConfig | FormGroupConfig) & {
18
+ controls?: AbstractControlConfig[] | {
19
+ [key: string]: AbstractControlConfig;
20
+ };
21
+ };
22
+ export {};
@@ -1 +1 @@
1
- export type ControlRef = (string | number)[];
1
+ export type ControlRef = (string | number)[];
@@ -1,48 +1,48 @@
1
- import { AbstractControlConfig } from './Configs';
2
- import { FormErrors } from './FormErrors';
3
- import { ControlRef } from './ControlRef';
4
- export interface BaseControl<T> {
5
- pristineValue: T;
6
- controlRef: ControlRef;
7
- value: T;
8
- dirty: boolean;
9
- touched: boolean;
10
- validatorErrors: FormErrors;
11
- config: AbstractControlConfig;
12
- key: string;
13
- }
14
- interface AsyncFields {
15
- asyncValidatorErrors: FormErrors;
16
- asyncValidateInProgress: {
17
- [key: string | number]: boolean;
18
- };
19
- pending?: boolean;
20
- }
21
- interface ValidatedFields {
22
- valid: boolean;
23
- errors: FormErrors;
24
- childrenValid: boolean;
25
- }
26
- export interface Hub2Fields extends AsyncFields, ValidatedFields {
27
- }
28
- export interface FormControl<T> extends BaseControl<T>, Hub2Fields {
29
- }
30
- export interface BaseFormState<T> {
31
- form: BaseForm<T>;
32
- _changedControls?: {
33
- [key: string]: BaseControl<unknown>;
34
- };
35
- _removedControls?: {
36
- [key: string]: BaseControl<unknown>;
37
- };
38
- }
39
- export interface BaseForm<T> {
40
- root?: BaseControl<T>;
41
- [key: string]: BaseControl<unknown>;
42
- }
43
- export interface Form<T> {
44
- root?: FormControl<T>;
45
- [key: string]: FormControl<unknown>;
46
- }
47
- export declare const DEFAULT_HUB2_FIELDS: Hub2Fields;
48
- export {};
1
+ import { AbstractControlConfig } from './Configs';
2
+ import { FormErrors } from './FormErrors';
3
+ import { ControlRef } from './ControlRef';
4
+ export interface BaseControl<T> {
5
+ pristineValue: T;
6
+ controlRef: ControlRef;
7
+ value: T;
8
+ dirty: boolean;
9
+ touched: boolean;
10
+ validatorErrors: FormErrors;
11
+ config: AbstractControlConfig;
12
+ key: string;
13
+ }
14
+ interface AsyncFields {
15
+ asyncValidatorErrors: FormErrors;
16
+ asyncValidateInProgress: {
17
+ [key: string | number]: boolean;
18
+ };
19
+ pending?: boolean;
20
+ }
21
+ interface ValidatedFields {
22
+ valid: boolean;
23
+ errors: FormErrors;
24
+ childrenValid: boolean;
25
+ }
26
+ export interface Hub2Fields extends AsyncFields, ValidatedFields {
27
+ }
28
+ export interface FormControl<T> extends BaseControl<T>, Hub2Fields {
29
+ }
30
+ export interface BaseFormState<T> {
31
+ form: BaseForm<T>;
32
+ _changedControls?: {
33
+ [key: string]: BaseControl<unknown>;
34
+ };
35
+ _removedControls?: {
36
+ [key: string]: BaseControl<unknown>;
37
+ };
38
+ }
39
+ export interface BaseForm<T> {
40
+ root?: BaseControl<T>;
41
+ [key: string]: BaseControl<unknown>;
42
+ }
43
+ export interface Form<T> {
44
+ root?: FormControl<T>;
45
+ [key: string]: FormControl<unknown>;
46
+ }
47
+ export declare const DEFAULT_HUB2_FIELDS: Hub2Fields;
48
+ export {};
@@ -1,3 +1,3 @@
1
- export interface FormErrors {
2
- [key: string]: boolean;
3
- }
1
+ export interface FormErrors {
2
+ [key: string]: boolean;
3
+ }
@@ -1,24 +1,24 @@
1
- import { ControlRef } from './ControlRef';
2
- import { AbstractControlConfig } from './Configs';
3
- import { FormErrors } from './FormErrors';
4
- export interface UpdateValuesPayload<T> {
5
- value: T;
6
- controlRef: ControlRef;
7
- }
8
- export interface AddControlPayload {
9
- config: AbstractControlConfig;
10
- controlRef: ControlRef;
11
- }
12
- export interface PushControlPayload {
13
- config: AbstractControlConfig;
14
- controlRef: ControlRef;
15
- }
16
- export interface ControlAsyncValidationResponse {
17
- key: string;
18
- validatorIndex: number;
19
- errors: FormErrors;
20
- }
21
- export interface MarkTouchedPayload {
22
- controlRef: ControlRef;
23
- markAll?: boolean;
24
- }
1
+ import { ControlRef } from './ControlRef';
2
+ import { AbstractControlConfig } from './Configs';
3
+ import { FormErrors } from './FormErrors';
4
+ export interface UpdateValuesPayload<T> {
5
+ value: T;
6
+ controlRef: ControlRef;
7
+ }
8
+ export interface AddControlPayload {
9
+ config: AbstractControlConfig;
10
+ controlRef: ControlRef;
11
+ }
12
+ export interface PushControlPayload {
13
+ config: AbstractControlConfig;
14
+ controlRef: ControlRef;
15
+ }
16
+ export interface ControlAsyncValidationResponse {
17
+ key: string;
18
+ validatorIndex: number;
19
+ errors: FormErrors;
20
+ }
21
+ export interface MarkTouchedPayload {
22
+ controlRef: ControlRef;
23
+ markAll?: boolean;
24
+ }
@@ -1,5 +1,5 @@
1
- import { Observable } from 'rxjs';
2
- import { BaseControl } from './Controls';
3
- import { FormErrors } from './FormErrors';
4
- export type ValidatorFn = (value: unknown) => FormErrors;
5
- export type ValidatorAsyncFn = <T>(control$: Observable<BaseControl<T>>) => Observable<FormErrors>;
1
+ import { Observable } from 'rxjs';
2
+ import { BaseControl } from './Controls';
3
+ import { FormErrors } from './FormErrors';
4
+ export type ValidatorFn = (value: unknown) => FormErrors;
5
+ export type ValidatorAsyncFn = <T>(control$: Observable<BaseControl<T>>) => Observable<Observable<FormErrors>>;
@@ -1,6 +1,6 @@
1
- export { AbstractControlConfig, FormArrayConfig, FormGroupConfig, FormControlConfig, } from './Configs';
2
- export { ControlRef } from './ControlRef';
3
- export * as ControlModels from './Controls';
4
- export { FormErrors } from './FormErrors';
5
- export { UpdateValuesPayload, AddControlPayload, ControlAsyncValidationResponse, MarkTouchedPayload, } from './Payloads';
6
- export { ValidatorAsyncFn, ValidatorFn } from './Validators';
1
+ export { AbstractControlConfig, FormArrayConfig, FormGroupConfig, FormControlConfig, } from './Configs';
2
+ export { ControlRef } from './ControlRef';
3
+ export * as ControlModels from './Controls';
4
+ export { FormErrors } from './FormErrors';
5
+ export { UpdateValuesPayload, AddControlPayload, ControlAsyncValidationResponse, MarkTouchedPayload, } from './Payloads';
6
+ export { ValidatorAsyncFn, ValidatorFn } from './Validators';
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { AddControlPayload } from '../../Models/Payloads';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const addControl: <T>(state: BaseFormState<T>, action: Action<AddControlPayload>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { AddControlPayload } from '../../Models/Payloads';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const addControl: <T>(state: BaseFormState<T>, action: Action<AddControlPayload>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,4 +1,4 @@
1
- import { BaseControl } from '../../Models/Controls';
2
- import { FormErrors } from '../../Models';
3
- import { RxFormProviders } from '../../RxForm/RxForm';
4
- export declare const getErrors: <T>(control: BaseControl<T>, value: T, { validators }: RxFormProviders) => FormErrors;
1
+ import { BaseControl } from '../../Models/Controls';
2
+ import { FormErrors } from '../../Models';
3
+ import { RxFormProviders } from '../../RxForm/RxForm';
4
+ export declare const getErrors: <T>(control: BaseControl<T>, value: T, { validators }: RxFormProviders) => FormErrors;
@@ -1,7 +1,6 @@
1
- export { markControlAsPristine } from './markControlAsPristine';
2
- export { markControlAsTouched } from './markControlAsTouched';
3
- export { markControlAsUntouched } from './markControlAsUntouched';
4
- export { removeControl } from './removeControl';
5
- export { resetControl } from './resetControl';
6
- export { syncValidate } from './syncValidate';
7
- export { updateValues } from './updateValues';
1
+ export { markControlAsPristine } from './markControlAsPristine';
2
+ export { markControlAsTouched } from './markControlAsTouched';
3
+ export { markControlAsUntouched } from './markControlAsUntouched';
4
+ export { removeControl } from './removeControl';
5
+ export { resetControl } from './resetControl';
6
+ export { updateValues } from './updateValues';
@@ -1,4 +1,4 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- export declare const markControlAsPristine: <T>(state: BaseFormState<T>, action: Action<ControlRef>, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ export declare const markControlAsPristine: <T>(state: BaseFormState<T>, action: Action<ControlRef>, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,4 +1,4 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { MarkTouchedPayload } from '../../Models/Payloads';
4
- export declare const markControlAsTouched: <T>(state: BaseFormState<T>, action: Action<MarkTouchedPayload>, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { MarkTouchedPayload } from '../../Models/Payloads';
4
+ export declare const markControlAsTouched: <T>(state: BaseFormState<T>, action: Action<MarkTouchedPayload>, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,4 +1,4 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- export declare const markControlAsUntouched: <T>(state: BaseFormState<T>, action: Action<ControlRef>, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ export declare const markControlAsUntouched: <T>(state: BaseFormState<T>, action: Action<ControlRef>, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { AddControlPayload } from '../../Models/Payloads';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const pushControl: <T>(state: BaseFormState<T>, action: Action<AddControlPayload>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { AddControlPayload } from '../../Models/Payloads';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const pushControl: <T>(state: BaseFormState<T>, action: Action<AddControlPayload>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const removeControl: <T>(state: BaseFormState<T>, action: Action<ControlRef>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const removeControl: <T>(state: BaseFormState<T>, action: Action<ControlRef>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const resetControl: <T>(state: BaseFormState<T>, action: Action<ControlRef>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const resetControl: <T>(state: BaseFormState<T>, action: Action<ControlRef>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseForm } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- export declare const UPDATE_ANCESTOR_PRISTINE_VALUES = "UPDATE_ANCESTOR_PRISTINE_VALUES";
5
- export declare const updateAncestorPristineValues: <T>(form: BaseForm<T>, { payload: controlRef }: Action<ControlRef>) => BaseForm<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseForm } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ export declare const UPDATE_ANCESTOR_PRISTINE_VALUES = "UPDATE_ANCESTOR_PRISTINE_VALUES";
5
+ export declare const updateAncestorPristineValues: <T>(form: BaseForm<T>, { payload: controlRef }: Action<ControlRef>) => BaseForm<T>;
@@ -1,6 +1,6 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseForm } from '../../Models/Controls';
3
- import { UpdateValuesPayload } from '../../Models/Payloads';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const UPDATE_ANCESTOR_VALUES = "UPDATE_ANCESTOR_VALUES";
6
- export declare const updateAncestorValues: <T>(form: BaseForm<T>, { payload: { controlRef, value } }: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders) => BaseForm<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseForm } from '../../Models/Controls';
3
+ import { UpdateValuesPayload } from '../../Models/Payloads';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const UPDATE_ANCESTOR_VALUES = "UPDATE_ANCESTOR_VALUES";
6
+ export declare const updateAncestorValues: <T>(form: BaseForm<T>, { payload: { controlRef, value } }: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders) => BaseForm<T>;
@@ -1,6 +1,6 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseForm } from '../../Models/Controls';
3
- import { UpdateValuesPayload } from '../../Models/Payloads';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const UPDATE_ANCESTOR_VALUES_ADD_CONTROL = "UPDATE_ANCESTOR_VALUES_ADD_CONTROL";
6
- export declare const updateAncestorValuesAddControl: <T>(form: BaseForm<T>, { payload: { controlRef, value } }: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders) => BaseForm<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseForm } from '../../Models/Controls';
3
+ import { UpdateValuesPayload } from '../../Models/Payloads';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const UPDATE_ANCESTOR_VALUES_ADD_CONTROL = "UPDATE_ANCESTOR_VALUES_ADD_CONTROL";
6
+ export declare const updateAncestorValuesAddControl: <T>(form: BaseForm<T>, { payload: { controlRef, value } }: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders) => BaseForm<T>;
@@ -1,6 +1,6 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseForm } from '../../Models/Controls';
3
- import { ControlRef } from '../../Models/ControlRef';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const UPDATE_ANCESTOR_VALUES_REMOVE_CONTROL = "UPDATE_ANCESTOR_VALUES_REMOVE_CONTROL";
6
- export declare const updateAncestorValuesRemoveControl: <T>(form: BaseForm<T>, { payload: controlRef }: Action<ControlRef>, providers: RxFormProviders) => BaseForm<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseForm } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models/ControlRef';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const UPDATE_ANCESTOR_VALUES_REMOVE_CONTROL = "UPDATE_ANCESTOR_VALUES_REMOVE_CONTROL";
6
+ export declare const updateAncestorValuesRemoveControl: <T>(form: BaseForm<T>, { payload: controlRef }: Action<ControlRef>, providers: RxFormProviders) => BaseForm<T>;
@@ -1,5 +1,5 @@
1
- import { Action } from '@reactables/core';
2
- import { BaseFormState } from '../../Models/Controls';
3
- import { UpdateValuesPayload } from '../../Models/Payloads';
4
- import { RxFormProviders } from '../../RxForm/RxForm';
5
- export declare const updateValues: <T>({ form, _changedControls, _removedControls }: BaseFormState<T>, action: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { BaseFormState } from '../../Models/Controls';
3
+ import { UpdateValuesPayload } from '../../Models/Payloads';
4
+ import { RxFormProviders } from '../../RxForm/RxForm';
5
+ export declare const updateValues: <T>({ form, _changedControls, _removedControls }: BaseFormState<T>, action: Action<UpdateValuesPayload<unknown>>, providers: RxFormProviders, mergeChanges?: boolean) => BaseFormState<T>;
@@ -1,4 +1,4 @@
1
- import { Action } from '@reactables/core';
2
- import { Form } from '../../Models/Controls';
3
- import { BaseControl } from '../../Models/Controls';
4
- export declare const asyncValidation: <T>(form: Form<T>, { payload: { controlRef } }: Action<BaseControl<unknown>>) => Form<T>;
1
+ import { Action } from '@reactables/core';
2
+ import { Form } from '../../Models/Controls';
3
+ import { ControlRef } from '../../Models';
4
+ export declare const asyncValidation: <T>(form: Form<T>, { payload: controlRef }: Action<ControlRef>) => Form<T>;
@@ -0,0 +1,4 @@
1
+ import { Action } from '@reactables/core';
2
+ import { Form } from '../../Models/Controls';
3
+ import { ControlAsyncValidationResponse } from '../../Models/Payloads';
4
+ export declare const asyncValidationResponse: <T>(form: Form<T>, { payload: { key, validatorIndex, errors } }: Action<ControlAsyncValidationResponse>) => Form<T>;
@@ -1,3 +1,3 @@
1
- import { Reducer } from '@reactables/core';
2
- import { Form } from '../../Models/Controls';
3
- export declare const formChange: Reducer<Form<unknown>>;
1
+ import { Reducer } from '@reactables/core';
2
+ import { Form } from '../../Models/Controls';
3
+ export declare const formChange: Reducer<Form<unknown>>;
@@ -1,3 +1,3 @@
1
- export { formChange } from './formChange';
2
- export { asyncValidation } from './asyncValidation';
3
- export { asyncValidationResponseSuccess } from './asyncValidationResponseSuccess';
1
+ export { formChange } from './formChange';
2
+ export { asyncValidation } from './asyncValidation';
3
+ export { asyncValidationResponse } from './asyncValidationResponse';