@angular/forms 21.2.0-rc.0 → 21.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/forms",
3
- "version": "21.2.0-rc.0",
3
+ "version": "21.2.0",
4
4
  "description": "Angular - directives and services for creating forms",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -12,9 +12,9 @@
12
12
  "@standard-schema/spec": "^1.0.0"
13
13
  },
14
14
  "peerDependencies": {
15
- "@angular/core": "21.2.0-rc.0",
16
- "@angular/common": "21.2.0-rc.0",
17
- "@angular/platform-browser": "21.2.0-rc.0",
15
+ "@angular/core": "21.2.0",
16
+ "@angular/common": "21.2.0",
17
+ "@angular/platform-browser": "21.2.0",
18
18
  "rxjs": "^6.5.3 || ^7.4.0"
19
19
  },
20
20
  "repository": {
Binary file
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-rc.0
2
+ * @license Angular v21.2.0
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
package/types/forms.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.2.0-rc.0
2
+ * @license Angular v21.2.0
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.2.0-rc.0
2
+ * @license Angular v21.2.0
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.2.0-rc.0
2
+ * @license Angular v21.2.0
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -548,13 +548,13 @@ declare function debounce<TValue, TPathKind extends PathKind = PathKind.Root>(pa
548
548
  */
549
549
  interface ParseResult<TValue> {
550
550
  /**
551
- * The parsed value, if parsing was successful.
551
+ * The parsed value. If omitted, the model is not updated.
552
552
  */
553
553
  readonly value?: TValue;
554
554
  /**
555
555
  * Errors encountered during parsing, if any.
556
556
  */
557
- readonly errors?: readonly ValidationError.WithoutFieldTree[];
557
+ readonly error?: OneOrMany<ValidationError.WithoutFieldTree>;
558
558
  }
559
559
  /**
560
560
  * Options for `transformedValue`.
@@ -567,7 +567,7 @@ interface TransformedValueOptions<TValue, TRaw> {
567
567
  *
568
568
  * Should return an object containing the parsed result, which may contain:
569
569
  * - `value`: The parsed model value. If `undefined`, the model will not be updated.
570
- * - `errors`: Any parse errors encountered. If `undefined`, no errors are reported.
570
+ * - `error`: Any parse errors encountered. If `undefined`, no errors are reported.
571
571
  */
572
572
  parse: (rawValue: TRaw) => ParseResult<TValue>;
573
573
  /**
@@ -596,6 +596,14 @@ interface TransformedValueSignal<TRaw> extends WritableSignal<TRaw> {
596
596
  * representation into an underlying model value. For example, a numeric input that displays and
597
597
  * accepts string values but stores a number.
598
598
  *
599
+ * Parse errors are exposed via the returned signal’s `parseErrors()` property.
600
+ * When `transformedValue` is used within a Signal Forms field context, parse errors are also
601
+ * reported to the nearest field automatically. When no field context is present, no automatic
602
+ * reporting occurs and `parseErrors` can be consumed directly.
603
+ *
604
+ * Note: `parse` may return both a `value` and an `error`. Returning `value` updates the model;
605
+ * omitting it leaves the model unchanged.
606
+ *
599
607
  * @param value The model signal to synchronize with.
600
608
  * @param options Configuration including `parse` and `format` functions.
601
609
  * @returns A `TransformedValueSignal` representing the raw value with parse error tracking.
@@ -615,7 +623,7 @@ interface TransformedValueSignal<TRaw> extends WritableSignal<TRaw> {
615
623
  * if (val === '') return {value: null};
616
624
  * const num = Number(val);
617
625
  * if (Number.isNaN(num)) {
618
- * return {errors: [{kind: 'parse', message: `${val} is not numeric`}]};
626
+ * return {error: {kind: 'parse', message: `${val} is not numeric`}};
619
627
  * }
620
628
  * return {value: num};
621
629
  * },