@angular/forms 21.1.2 → 21.1.4

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,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.2
2
+ * @license Angular v21.1.4
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -7,13 +7,33 @@
7
7
  import * as i0 from '@angular/core';
8
8
  import { ɵFormFieldBindingOptions as _FormFieldBindingOptions, InjectionToken, Injector, ɵCONTROL as _CONTROL, ɵɵcontrolCreate as __controlCreate, ɵcontrolUpdate as _controlUpdate, Signal, ɵFieldState as _FieldState, Provider, WritableSignal, DestroyableInjector } from '@angular/core';
9
9
  import * as _angular_forms from '@angular/forms';
10
- import { NgControl, AbstractControl, ValidationErrors, FormControlStatus, ControlValueAccessor, ValidatorFn } from '@angular/forms';
10
+ import { AbstractControl, ValidationErrors, FormControlStatus, ControlValueAccessor, ValidatorFn } from '@angular/forms';
11
11
  import { StandardSchemaV1 } from '@standard-schema/spec';
12
12
 
13
13
  /**
14
- * Properties of both NgControl & AbstractControl that are supported by the InteropNgControl.
15
- */
16
- type InteropSharedKeys = 'value' | 'valid' | 'invalid' | 'touched' | 'untouched' | 'disabled' | 'enabled' | 'errors' | 'pristine' | 'dirty' | 'status';
14
+ * Represents a combination of `NgControl` and `AbstractControl`.
15
+ *
16
+ * Note: We have this separate interface, rather than implementing the relevant parts of the two
17
+ * controls with something like `InteropNgControl implements Pick<NgControl, ...>, Pick<AbstractControl, ...>`
18
+ * because it confuses the internal JS minifier which can cause collisions in field names.
19
+ */
20
+ interface CombinedControl {
21
+ value: any;
22
+ valid: boolean;
23
+ invalid: boolean;
24
+ touched: boolean;
25
+ untouched: boolean;
26
+ disabled: boolean;
27
+ enabled: boolean;
28
+ errors: ValidationErrors | null;
29
+ pristine: boolean;
30
+ dirty: boolean;
31
+ status: FormControlStatus;
32
+ control: AbstractControl<any, any>;
33
+ valueAccessor: ControlValueAccessor | null;
34
+ hasValidator(validator: ValidatorFn): boolean;
35
+ updateValueAndValidity(): void;
36
+ }
17
37
  /**
18
38
  * A fake version of `NgControl` provided by the `Field` directive. This allows interoperability
19
39
  * with a wider range of components designed to work with reactive forms, in particular ones that
@@ -21,7 +41,7 @@ type InteropSharedKeys = 'value' | 'valid' | 'invalid' | 'touched' | 'untouched'
21
41
  * the real `NgControl`, but does implement some of the most commonly used ones that have a clear
22
42
  * equivalent in signal forms.
23
43
  */
24
- declare class InteropNgControl implements Pick<NgControl, InteropSharedKeys | 'control' | 'valueAccessor'>, Pick<AbstractControl<unknown>, InteropSharedKeys | 'hasValidator'> {
44
+ declare class InteropNgControl implements CombinedControl {
25
45
  protected field: () => FieldState<unknown>;
26
46
  constructor(field: () => FieldState<unknown>);
27
47
  readonly control: AbstractControl<any, any>;
package/types/forms.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.2
2
+ * @license Angular v21.1.4
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.2
2
+ * @license Angular v21.1.4
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.1.2
2
+ * @license Angular v21.1.4
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -240,7 +240,7 @@ type IgnoreUnknownProperties<T> = T extends Record<PropertyKey, unknown> ? {
240
240
  * See https://github.com/standard-schema/standard-schema for more about standard schema.
241
241
  *
242
242
  * @param path The `FieldPath` to the field to validate.
243
- * @param schema The standard schema compatible validator to use for validation.
243
+ * @param schema The standard schema compatible validator to use for validation, or a LogicFn that returns the schema.
244
244
  * @template TSchema The type validated by the schema. This may be either the full `TValue` type,
245
245
  * or a partial of it.
246
246
  * @template TValue The type of value stored in the field being validated.
@@ -249,7 +249,7 @@ type IgnoreUnknownProperties<T> = T extends Record<PropertyKey, unknown> ? {
249
249
  * @category validation
250
250
  * @experimental 21.0.0
251
251
  */
252
- declare function validateStandardSchema<TSchema, TModel extends IgnoreUnknownProperties<TSchema>>(path: SchemaPath<TModel> & SchemaPathTree<TModel>, schema: StandardSchemaV1<TSchema>): void;
252
+ declare function validateStandardSchema<TSchema, TModel extends IgnoreUnknownProperties<TSchema>>(path: SchemaPath<TModel> & SchemaPathTree<TModel>, schema: StandardSchemaV1<TSchema> | LogicFn<TModel, StandardSchemaV1<unknown> | undefined>): void;
253
253
 
254
254
  /**
255
255
  * Adds logic to a field to determine if the field has validation errors.