@angular/forms 14.1.1 → 14.2.0-next.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 (30) hide show
  1. package/esm2020/src/directives/abstract_form_group_directive.mjs +3 -3
  2. package/esm2020/src/directives/checkbox_value_accessor.mjs +3 -3
  3. package/esm2020/src/directives/control_value_accessor.mjs +6 -6
  4. package/esm2020/src/directives/default_value_accessor.mjs +3 -3
  5. package/esm2020/src/directives/ng_control_status.mjs +6 -6
  6. package/esm2020/src/directives/ng_form.mjs +3 -3
  7. package/esm2020/src/directives/ng_model.mjs +3 -3
  8. package/esm2020/src/directives/ng_model_group.mjs +3 -3
  9. package/esm2020/src/directives/ng_no_validate_directive.mjs +3 -3
  10. package/esm2020/src/directives/number_value_accessor.mjs +3 -3
  11. package/esm2020/src/directives/radio_control_value_accessor.mjs +10 -10
  12. package/esm2020/src/directives/range_value_accessor.mjs +3 -3
  13. package/esm2020/src/directives/reactive_directives/form_control_directive.mjs +3 -3
  14. package/esm2020/src/directives/reactive_directives/form_control_name.mjs +3 -3
  15. package/esm2020/src/directives/reactive_directives/form_group_directive.mjs +3 -3
  16. package/esm2020/src/directives/reactive_directives/form_group_name.mjs +6 -6
  17. package/esm2020/src/directives/select_control_value_accessor.mjs +6 -6
  18. package/esm2020/src/directives/select_multiple_control_value_accessor.mjs +6 -6
  19. package/esm2020/src/directives/validators.mjs +27 -27
  20. package/esm2020/src/directives.mjs +4 -4
  21. package/esm2020/src/form_builder.mjs +31 -11
  22. package/esm2020/src/form_providers.mjs +8 -8
  23. package/esm2020/src/model/form_group.mjs +1 -1
  24. package/esm2020/src/version.mjs +1 -1
  25. package/fesm2015/forms.mjs +146 -126
  26. package/fesm2015/forms.mjs.map +1 -1
  27. package/fesm2020/forms.mjs +146 -126
  28. package/fesm2020/forms.mjs.map +1 -1
  29. package/index.d.ts +32 -2
  30. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.1
2
+ * @license Angular v14.2.0-next.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1915,6 +1915,24 @@ export declare class FormBuilder {
1915
1915
  }, options: {
1916
1916
  [key: string]: any;
1917
1917
  }): FormGroup;
1918
+ /**
1919
+ * @description
1920
+ * Construct a new `FormRecord` instance. Accepts a single generic argument, which is an object
1921
+ * containing all the keys and corresponding inner control types.
1922
+ *
1923
+ * @param controls A collection of child controls. The key for each child is the name
1924
+ * under which it is registered.
1925
+ *
1926
+ * @param options Configuration options object for the `FormRecord`. The object should have the
1927
+ * `AbstractControlOptions` type and might contain the following fields:
1928
+ * * `validators`: A synchronous validator function, or an array of validator functions.
1929
+ * * `asyncValidators`: A single async validator or array of async validator functions.
1930
+ * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur'
1931
+ * | submit').
1932
+ */
1933
+ record<T>(controls: {
1934
+ [key: string]: T;
1935
+ }, options?: AbstractControlOptions | null): FormRecord<ɵElement<T, null>>;
1918
1936
  /** @deprecated Use `nonNullable` instead. */
1919
1937
  control<T>(formState: T | FormControlState<T>, opts: FormControlOptions & {
1920
1938
  initialValueIsDefault: true;
@@ -3030,7 +3048,7 @@ declare type FormHooks = 'change' | 'blur' | 'submit';
3030
3048
  *
3031
3049
  * @publicApi
3032
3050
  */
3033
- export declare class FormRecord<TControl extends AbstractControl<ɵValue<TControl>, ɵRawValue<TControl>> = AbstractControl> extends FormGroup<{
3051
+ export declare class FormRecord<TControl extends AbstractControl = AbstractControl> extends FormGroup<{
3034
3052
  [key: string]: TControl;
3035
3053
  }> {
3036
3054
  }
@@ -4110,6 +4128,14 @@ export declare abstract class NonNullableFormBuilder {
4110
4128
  abstract group<T extends {}>(controls: T, options?: AbstractControlOptions | null): FormGroup<{
4111
4129
  [K in keyof T]: ɵElement<T[K], never>;
4112
4130
  }>;
4131
+ /**
4132
+ * Similar to `FormBuilder#record`, except any implicitly constructed `FormControl`
4133
+ * will be non-nullable (i.e. it will have `nonNullable` set to true). Note
4134
+ * that already-constructed controls will not be altered.
4135
+ */
4136
+ abstract record<T>(controls: {
4137
+ [key: string]: T;
4138
+ }, options?: AbstractControlOptions | null): FormRecord<ɵElement<T, never>>;
4113
4139
  /**
4114
4140
  * Similar to `FormBuilder#array`, except any implicitly constructed `FormControl`
4115
4141
  * will be non-nullable (i.e. it will have `nonNullable` set to true). Note
@@ -5038,6 +5064,10 @@ T
5038
5064
  T
5039
5065
  ] extends [FormGroup<infer U> | undefined] ? FormGroup<U> : [
5040
5066
  T
5067
+ ] extends [FormRecord<infer U>] ? FormRecord<U> : [
5068
+ T
5069
+ ] extends [FormRecord<infer U> | undefined] ? FormRecord<U> : [
5070
+ T
5041
5071
  ] extends [FormArray<infer U>] ? FormArray<U> : [
5042
5072
  T
5043
5073
  ] extends [FormArray<infer U> | undefined] ? FormArray<U> : [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/forms",
3
- "version": "14.1.1",
3
+ "version": "14.2.0-next.0",
4
4
  "description": "Angular - directives and services for creating forms",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -11,9 +11,9 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "14.1.1",
15
- "@angular/common": "14.1.1",
16
- "@angular/platform-browser": "14.1.1",
14
+ "@angular/core": "14.2.0-next.0",
15
+ "@angular/common": "14.2.0-next.0",
16
+ "@angular/platform-browser": "14.2.0-next.0",
17
17
  "rxjs": "^6.5.3 || ^7.4.0"
18
18
  },
19
19
  "repository": {