@angular/forms 21.0.0-rc.1 → 21.0.0-rc.2
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/README.md +1 -2
- package/fesm2022/forms.mjs +132 -133
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals.mjs +140 -65
- package/fesm2022/signals.mjs.map +1 -1
- package/package.json +4 -4
- package/types/forms.d.ts +26 -1
- package/types/signals.d.ts +236 -141
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/forms",
|
|
3
|
-
"version": "21.0.0-rc.
|
|
3
|
+
"version": "21.0.0-rc.2",
|
|
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": "21.0.0-rc.
|
|
15
|
-
"@angular/common": "21.0.0-rc.
|
|
16
|
-
"@angular/platform-browser": "21.0.0-rc.
|
|
14
|
+
"@angular/core": "21.0.0-rc.2",
|
|
15
|
+
"@angular/common": "21.0.0-rc.2",
|
|
16
|
+
"@angular/platform-browser": "21.0.0-rc.2",
|
|
17
17
|
"@standard-schema/spec": "^1.0.0",
|
|
18
18
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
19
19
|
},
|
package/types/forms.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-rc.
|
|
2
|
+
* @license Angular v21.0.0-rc.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -604,6 +604,8 @@ declare class CheckboxControlValueAccessor extends BuiltInControlValueAccessor i
|
|
|
604
604
|
* @description
|
|
605
605
|
* Defines the map of errors returned from failed validation checks.
|
|
606
606
|
*
|
|
607
|
+
* @see [Defining custom validators](guide/forms/form-validation#defining-custom-validators)
|
|
608
|
+
*
|
|
607
609
|
* @publicApi
|
|
608
610
|
*/
|
|
609
611
|
type ValidationErrors = {
|
|
@@ -765,6 +767,8 @@ declare class MinValidator extends AbstractValidatorDirective {
|
|
|
765
767
|
* }
|
|
766
768
|
* ```
|
|
767
769
|
*
|
|
770
|
+
* @see [Creating asynchronous validators](guide/forms/form-validation#creating-asynchronous-validators)
|
|
771
|
+
*
|
|
768
772
|
* @publicApi
|
|
769
773
|
*/
|
|
770
774
|
interface AsyncValidator extends Validator {
|
|
@@ -877,6 +881,8 @@ declare class EmailValidator extends AbstractValidatorDirective {
|
|
|
877
881
|
* A function that receives a control and synchronously returns a map of
|
|
878
882
|
* validation errors if present, otherwise null.
|
|
879
883
|
*
|
|
884
|
+
* @see [Defining custom validators](guide/forms/form-validation#defining-custom-validators)
|
|
885
|
+
*
|
|
880
886
|
* @publicApi
|
|
881
887
|
*/
|
|
882
888
|
interface ValidatorFn {
|
|
@@ -887,6 +893,8 @@ interface ValidatorFn {
|
|
|
887
893
|
* A function that receives a control and returns a Promise or observable
|
|
888
894
|
* that emits validation errors if present, otherwise null.
|
|
889
895
|
*
|
|
896
|
+
* @see [Creating asynchronous validators](guide/forms/form-validation#creating-asynchronous-validators)
|
|
897
|
+
*
|
|
890
898
|
* @publicApi
|
|
891
899
|
*/
|
|
892
900
|
interface AsyncValidatorFn {
|
|
@@ -1065,6 +1073,9 @@ type ɵFormArrayRawValue<T extends AbstractControl<any>> = ɵTypedOrUntyped<T, A
|
|
|
1065
1073
|
* the `FormArray` directly, as that result in strange and unexpected behavior such
|
|
1066
1074
|
* as broken change detection.
|
|
1067
1075
|
*
|
|
1076
|
+
* @see [FormArray: Dynamic, Homogenous Collections](guide/forms/typed-forms#formcontrol-getting-started)
|
|
1077
|
+
* @see [Creating dynamic forms](guide/forms/reactive-forms#creating-dynamic-forms)
|
|
1078
|
+
*
|
|
1068
1079
|
* @publicApi
|
|
1069
1080
|
*/
|
|
1070
1081
|
declare class FormArray<TControl extends AbstractControl<any> = any> extends AbstractControl<ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any>, ɵTypedOrUntyped<TControl, ɵFormArrayRawValue<TControl>, any>> {
|
|
@@ -1579,6 +1590,9 @@ interface ɵFormControlCtor {
|
|
|
1579
1590
|
* console.log(control.value); // 'Drew'
|
|
1580
1591
|
* console.log(control.status); // 'DISABLED'
|
|
1581
1592
|
* ```
|
|
1593
|
+
*
|
|
1594
|
+
* @see [FormControl: Getting Started](guide/forms/typed-forms#formcontrol-getting-started)
|
|
1595
|
+
*
|
|
1582
1596
|
*/
|
|
1583
1597
|
interface FormControl<TValue = any> extends AbstractControl<TValue> {
|
|
1584
1598
|
/**
|
|
@@ -1868,6 +1882,9 @@ type ɵOptionalKeys<T> = {
|
|
|
1868
1882
|
* Notice that `c.value.one` has type `string|null|undefined`. This is because calling `c.reset({})`
|
|
1869
1883
|
* without providing the optional key `one` will cause it to become `null`.
|
|
1870
1884
|
*
|
|
1885
|
+
* @see [Grouping form controls](guide/forms/reactive-forms#grouping-form-controls)
|
|
1886
|
+
* @see [FormGroup and FormRecord](guide/forms/typed-forms#formgroup-and-formrecord)
|
|
1887
|
+
*
|
|
1871
1888
|
* @publicApi
|
|
1872
1889
|
*/
|
|
1873
1890
|
declare class FormGroup<TControl extends {
|
|
@@ -2156,6 +2173,8 @@ declare const isFormGroup: (control: unknown) => control is FormGroup;
|
|
|
2156
2173
|
* numbers.removeControl('bill');
|
|
2157
2174
|
* ```
|
|
2158
2175
|
*
|
|
2176
|
+
* @see [FormGroup and FormRecord](guide/forms/typed-forms#formgroup-and-formrecord)
|
|
2177
|
+
*
|
|
2159
2178
|
* @publicApi
|
|
2160
2179
|
*/
|
|
2161
2180
|
declare class FormRecord<TControl extends AbstractControl = AbstractControl> extends FormGroup<{
|
|
@@ -4881,6 +4900,8 @@ declare class FormBuilder {
|
|
|
4881
4900
|
* `NonNullableFormBuilder` is similar to {@link FormBuilder}, but automatically constructed
|
|
4882
4901
|
* {@link FormControl} elements have `{nonNullable: true}` and are non-nullable.
|
|
4883
4902
|
*
|
|
4903
|
+
* @see [FormBuilder and NonNullableFormBuilder](guide/forms/typed-forms#formbuilder-and-nonnullableformbuilder)
|
|
4904
|
+
*
|
|
4884
4905
|
* @publicApi
|
|
4885
4906
|
*/
|
|
4886
4907
|
declare abstract class NonNullableFormBuilder {
|
|
@@ -4969,6 +4990,8 @@ declare class UntypedFormBuilder extends FormBuilder {
|
|
|
4969
4990
|
* }
|
|
4970
4991
|
* ```
|
|
4971
4992
|
*
|
|
4993
|
+
* @see [Defining custom validators](guide/forms/form-validation#defining-custom-validators)
|
|
4994
|
+
*
|
|
4972
4995
|
* @publicApi
|
|
4973
4996
|
*/
|
|
4974
4997
|
declare const NG_VALIDATORS: InjectionToken<readonly (Function | Validator)[]>;
|
|
@@ -4999,6 +5022,8 @@ declare const NG_VALIDATORS: InjectionToken<readonly (Function | Validator)[]>;
|
|
|
4999
5022
|
* }
|
|
5000
5023
|
* ```
|
|
5001
5024
|
*
|
|
5025
|
+
* @see [Implementing a custom async validator](guide/forms/form-validation#implementing-a-custom-async-validator)
|
|
5026
|
+
*
|
|
5002
5027
|
* @publicApi
|
|
5003
5028
|
*/
|
|
5004
5029
|
declare const NG_ASYNC_VALIDATORS: InjectionToken<readonly (Function | Validator)[]>;
|