@angular/forms 21.0.0-next.1 → 21.0.0-next.10
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/fesm2022/forms.mjs +4835 -7285
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals.mjs +2056 -0
- package/fesm2022/signals.mjs.map +1 -0
- package/package.json +11 -6
- package/{index.d.ts → types/forms.d.ts} +37 -4
- package/types/signals.d.ts +2725 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
3
|
-
* (c) 2010-2025 Google LLC. https://angular.
|
|
2
|
+
* @license Angular v21.0.0-next.10
|
|
3
|
+
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -1100,6 +1100,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1100
1100
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1101
1101
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1102
1102
|
* inserted. When false, no events are emitted.
|
|
1103
|
+
*
|
|
1104
|
+
* NOTE: Pushing to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1103
1105
|
*/
|
|
1104
1106
|
push(control: TControl | Array<TControl>, options?: {
|
|
1105
1107
|
emitEvent?: boolean;
|
|
@@ -1116,6 +1118,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1116
1118
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1117
1119
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1118
1120
|
* inserted. When false, no events are emitted.
|
|
1121
|
+
*
|
|
1122
|
+
* NOTE: Inserting to the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1119
1123
|
*/
|
|
1120
1124
|
insert(index: number, control: TControl, options?: {
|
|
1121
1125
|
emitEvent?: boolean;
|
|
@@ -1131,6 +1135,8 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1131
1135
|
* * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and
|
|
1132
1136
|
* `valueChanges` observables emit events with the latest status and value when the control is
|
|
1133
1137
|
* removed. When false, no events are emitted.
|
|
1138
|
+
*
|
|
1139
|
+
* NOTE: Removing the FormArray will not mark it dirty. If you want to mark if dirty, call `markAsDirty()`.
|
|
1134
1140
|
*/
|
|
1135
1141
|
removeAt(index: number, options?: {
|
|
1136
1142
|
emitEvent?: boolean;
|
|
@@ -1279,6 +1285,7 @@ declare class FormArray<TControl extends AbstractControl<any> = any> extends Abs
|
|
|
1279
1285
|
reset(value?: ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any>, options?: {
|
|
1280
1286
|
onlySelf?: boolean;
|
|
1281
1287
|
emitEvent?: boolean;
|
|
1288
|
+
overwriteDefaultValue?: boolean;
|
|
1282
1289
|
}): void;
|
|
1283
1290
|
/**
|
|
1284
1291
|
* The aggregate value of the array, including any disabled controls.
|
|
@@ -1345,6 +1352,8 @@ declare const UntypedFormArray: UntypedFormArrayCtor;
|
|
|
1345
1352
|
* @description
|
|
1346
1353
|
* Asserts that the given control is an instance of `FormArray`
|
|
1347
1354
|
*
|
|
1355
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
1356
|
+
*
|
|
1348
1357
|
* @publicApi
|
|
1349
1358
|
*/
|
|
1350
1359
|
declare const isFormArray: (control: unknown) => control is FormArray;
|
|
@@ -1577,7 +1586,7 @@ interface FormControl<TValue = any> extends AbstractControl<TValue> {
|
|
|
1577
1586
|
* value. See {@link FormControlOptions#nonNullable} for more information on configuring
|
|
1578
1587
|
* a default value.
|
|
1579
1588
|
*/
|
|
1580
|
-
|
|
1589
|
+
defaultValue: TValue;
|
|
1581
1590
|
/**
|
|
1582
1591
|
* Sets a new value for the form control.
|
|
1583
1592
|
*
|
|
@@ -1653,11 +1662,13 @@ interface FormControl<TValue = any> extends AbstractControl<TValue> {
|
|
|
1653
1662
|
* `valueChanges`
|
|
1654
1663
|
* observables emit events with the latest status and value when the control is reset.
|
|
1655
1664
|
* When false, no events are emitted.
|
|
1665
|
+
* * `overwriteDefaultValue`: When true, the value used to reset the control becomes the new default value of the control.
|
|
1656
1666
|
*
|
|
1657
1667
|
*/
|
|
1658
1668
|
reset(formState?: TValue | FormControlState<TValue>, options?: {
|
|
1659
1669
|
onlySelf?: boolean;
|
|
1660
1670
|
emitEvent?: boolean;
|
|
1671
|
+
overwriteDefaultValue?: boolean;
|
|
1661
1672
|
}): void;
|
|
1662
1673
|
/**
|
|
1663
1674
|
* For a simple FormControl, the raw value is equivalent to the value.
|
|
@@ -1695,6 +1706,8 @@ declare const UntypedFormControl: UntypedFormControlCtor;
|
|
|
1695
1706
|
* @description
|
|
1696
1707
|
* Asserts that the given control is an instance of `FormControl`
|
|
1697
1708
|
*
|
|
1709
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
1710
|
+
*
|
|
1698
1711
|
* @publicApi
|
|
1699
1712
|
*/
|
|
1700
1713
|
declare const isFormControl: (control: unknown) => control is FormControl;
|
|
@@ -2093,6 +2106,7 @@ declare class FormGroup<TControl extends {
|
|
|
2093
2106
|
reset(value?: ɵTypedOrUntyped<TControl, ɵFormGroupArgumentValue<TControl>, any>, options?: {
|
|
2094
2107
|
onlySelf?: boolean;
|
|
2095
2108
|
emitEvent?: boolean;
|
|
2109
|
+
overwriteDefaultValue?: boolean;
|
|
2096
2110
|
}): void;
|
|
2097
2111
|
/**
|
|
2098
2112
|
* The aggregate value of the `FormGroup`, including any disabled controls.
|
|
@@ -2120,6 +2134,8 @@ declare const UntypedFormGroup: UntypedFormGroupCtor;
|
|
|
2120
2134
|
* @description
|
|
2121
2135
|
* Asserts that the given control is an instance of `FormGroup`
|
|
2122
2136
|
*
|
|
2137
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
2138
|
+
*
|
|
2123
2139
|
* @publicApi
|
|
2124
2140
|
*/
|
|
2125
2141
|
declare const isFormGroup: (control: unknown) => control is FormGroup;
|
|
@@ -2233,6 +2249,8 @@ interface FormRecord<TControl> {
|
|
|
2233
2249
|
* @description
|
|
2234
2250
|
* Asserts that the given control is an instance of `FormRecord`
|
|
2235
2251
|
*
|
|
2252
|
+
* @see [Utility functions for narrowing form control types](guide/forms/reactive-forms#utility-functions-for-narrowing-form-control-types)
|
|
2253
|
+
*
|
|
2236
2254
|
* @publicApi
|
|
2237
2255
|
*/
|
|
2238
2256
|
declare const isFormRecord: (control: unknown) => control is FormRecord;
|
|
@@ -2269,6 +2287,8 @@ declare abstract class ControlEvent<T = any> {
|
|
|
2269
2287
|
/**
|
|
2270
2288
|
* Event fired when the value of a control changes.
|
|
2271
2289
|
*
|
|
2290
|
+
* @see {@link AbstractControl.events}
|
|
2291
|
+
*
|
|
2272
2292
|
* @publicApi
|
|
2273
2293
|
*/
|
|
2274
2294
|
declare class ValueChangeEvent<T> extends ControlEvent<T> {
|
|
@@ -2279,6 +2299,8 @@ declare class ValueChangeEvent<T> extends ControlEvent<T> {
|
|
|
2279
2299
|
/**
|
|
2280
2300
|
* Event fired when the control's pristine state changes (pristine <=> dirty).
|
|
2281
2301
|
*
|
|
2302
|
+
* @see {@link AbstractControl.events}
|
|
2303
|
+
*
|
|
2282
2304
|
* @publicApi */
|
|
2283
2305
|
declare class PristineChangeEvent extends ControlEvent {
|
|
2284
2306
|
readonly pristine: boolean;
|
|
@@ -2288,6 +2310,8 @@ declare class PristineChangeEvent extends ControlEvent {
|
|
|
2288
2310
|
/**
|
|
2289
2311
|
* Event fired when the control's touched status changes (touched <=> untouched).
|
|
2290
2312
|
*
|
|
2313
|
+
* @see {@link AbstractControl.events}
|
|
2314
|
+
*
|
|
2291
2315
|
* @publicApi
|
|
2292
2316
|
*/
|
|
2293
2317
|
declare class TouchedChangeEvent extends ControlEvent {
|
|
@@ -2298,6 +2322,8 @@ declare class TouchedChangeEvent extends ControlEvent {
|
|
|
2298
2322
|
/**
|
|
2299
2323
|
* Event fired when the control's status changes.
|
|
2300
2324
|
*
|
|
2325
|
+
* @see {@link AbstractControl.events}
|
|
2326
|
+
*
|
|
2301
2327
|
* @publicApi
|
|
2302
2328
|
*/
|
|
2303
2329
|
declare class StatusChangeEvent extends ControlEvent {
|
|
@@ -2308,6 +2334,8 @@ declare class StatusChangeEvent extends ControlEvent {
|
|
|
2308
2334
|
/**
|
|
2309
2335
|
* Event fired when a form is submitted
|
|
2310
2336
|
*
|
|
2337
|
+
* @see {@link AbstractControl.events}
|
|
2338
|
+
*
|
|
2311
2339
|
* @publicApi
|
|
2312
2340
|
*/
|
|
2313
2341
|
declare class FormSubmittedEvent extends ControlEvent {
|
|
@@ -2317,6 +2345,8 @@ declare class FormSubmittedEvent extends ControlEvent {
|
|
|
2317
2345
|
/**
|
|
2318
2346
|
* Event fired when a form is reset.
|
|
2319
2347
|
*
|
|
2348
|
+
* @see {@link AbstractControl.events}
|
|
2349
|
+
*
|
|
2320
2350
|
* @publicApi
|
|
2321
2351
|
*/
|
|
2322
2352
|
declare class FormResetEvent extends ControlEvent {
|
|
@@ -2635,6 +2665,7 @@ declare abstract class AbstractControl<TValue = any, TRawValue extends TValue =
|
|
|
2635
2665
|
* `events` of the parent control instead.
|
|
2636
2666
|
* For other event types, the events are emitted after the parent control has been updated.
|
|
2637
2667
|
*
|
|
2668
|
+
* @see [Unified control state change events](guide/forms/reactive-forms#unified-control-state-change-events)
|
|
2638
2669
|
*/
|
|
2639
2670
|
readonly events: Observable<ControlEvent<TValue>>;
|
|
2640
2671
|
/**
|
|
@@ -3028,6 +3059,8 @@ declare abstract class AbstractControl<TValue = any, TRawValue extends TValue =
|
|
|
3028
3059
|
*
|
|
3029
3060
|
* Calling `setErrors` also updates the validity of the parent control.
|
|
3030
3061
|
*
|
|
3062
|
+
* Note: Manually set errors are always overwritten by the results of the next validation run.
|
|
3063
|
+
*
|
|
3031
3064
|
* @param opts Configuration options that determine how the control propagates
|
|
3032
3065
|
* changes and emits events after the control errors are set.
|
|
3033
3066
|
* * `emitEvent`: When true or not supplied (the default), the `statusChanges`
|
|
@@ -4061,7 +4094,7 @@ type SetDisabledStateOption = 'whenDisabledForLegacyCode' | 'always';
|
|
|
4061
4094
|
*
|
|
4062
4095
|
* To inspect the properties of the associated `FormControl` (like the validity state),
|
|
4063
4096
|
* export the directive into a local template variable using `ngModel` as the key (ex:
|
|
4064
|
-
* `#myVar="ngModel"`). You can then access the control using the directive's `
|
|
4097
|
+
* `#myVar="ngModel"`). You can then access the control using the directive's `field` property.
|
|
4065
4098
|
* However, the most commonly used properties (like `valid` and `dirty`) also exist on the control
|
|
4066
4099
|
* for direct access. See a full list of properties directly available in
|
|
4067
4100
|
* `AbstractControlDirective`.
|