@angular/forms 21.0.0-next.7 → 21.0.0-next.9
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 +161 -134
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals.mjs +158 -29
- package/fesm2022/signals.mjs.map +1 -1
- package/package.json +4 -4
- package/types/forms.d.ts +34 -3
- package/types/signals.d.ts +94 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/forms",
|
|
3
|
-
"version": "21.0.0-next.
|
|
3
|
+
"version": "21.0.0-next.9",
|
|
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-next.
|
|
15
|
-
"@angular/common": "21.0.0-next.
|
|
16
|
-
"@angular/platform-browser": "21.0.0-next.
|
|
14
|
+
"@angular/core": "21.0.0-next.9",
|
|
15
|
+
"@angular/common": "21.0.0-next.9",
|
|
16
|
+
"@angular/platform-browser": "21.0.0-next.9",
|
|
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-next.
|
|
2
|
+
* @license Angular v21.0.0-next.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -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
|
/**
|
|
@@ -4063,7 +4094,7 @@ type SetDisabledStateOption = 'whenDisabledForLegacyCode' | 'always';
|
|
|
4063
4094
|
*
|
|
4064
4095
|
* To inspect the properties of the associated `FormControl` (like the validity state),
|
|
4065
4096
|
* export the directive into a local template variable using `ngModel` as the key (ex:
|
|
4066
|
-
* `#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.
|
|
4067
4098
|
* However, the most commonly used properties (like `valid` and `dirty`) also exist on the control
|
|
4068
4099
|
* for direct access. See a full list of properties directly available in
|
|
4069
4100
|
* `AbstractControlDirective`.
|
package/types/signals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-next.
|
|
2
|
+
* @license Angular v21.0.0-next.9
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,26 +7,57 @@
|
|
|
7
7
|
import { HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';
|
|
8
8
|
import * as i0 from '@angular/core';
|
|
9
9
|
import { InjectionToken, ɵControl as _Control, ɵCONTROL as _CONTROL, ɵFieldState as _FieldState, Signal, ResourceRef, InputSignal, ModelSignal, OutputRef, WritableSignal, DestroyableInjector, Injector } from '@angular/core';
|
|
10
|
+
import { NgControl, AbstractControl, ValidationErrors, FormControlStatus, ControlValueAccessor, ValidatorFn } from '@angular/forms';
|
|
10
11
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
11
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';
|
|
17
|
+
/**
|
|
18
|
+
* A fake version of `NgControl` provided by the `Field` directive. This allows interoperability
|
|
19
|
+
* with a wider range of components designed to work with reactive forms, in particular ones that
|
|
20
|
+
* inject the `NgControl`. The interop control does not implement *all* properties and methods of
|
|
21
|
+
* the real `NgControl`, but does implement some of the most commonly used ones that have a clear
|
|
22
|
+
* equivalent in signal forms.
|
|
23
|
+
*/
|
|
24
|
+
declare class InteropNgControl implements Pick<NgControl, InteropSharedKeys | 'control' | 'valueAccessor'>, Pick<AbstractControl<unknown>, InteropSharedKeys | 'hasValidator'> {
|
|
25
|
+
protected field: () => FieldState<unknown>;
|
|
26
|
+
constructor(field: () => FieldState<unknown>);
|
|
27
|
+
readonly control: AbstractControl<any, any>;
|
|
28
|
+
get value(): any;
|
|
29
|
+
get valid(): boolean;
|
|
30
|
+
get invalid(): boolean;
|
|
31
|
+
get pending(): boolean | null;
|
|
32
|
+
get disabled(): boolean;
|
|
33
|
+
get enabled(): boolean;
|
|
34
|
+
get errors(): ValidationErrors | null;
|
|
35
|
+
get pristine(): boolean;
|
|
36
|
+
get dirty(): boolean;
|
|
37
|
+
get touched(): boolean;
|
|
38
|
+
get untouched(): boolean;
|
|
39
|
+
get status(): FormControlStatus;
|
|
40
|
+
valueAccessor: ControlValueAccessor | null;
|
|
41
|
+
hasValidator(validator: ValidatorFn): boolean;
|
|
42
|
+
updateValueAndValidity(): void;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Lightweight DI token provided by the {@link Field} directive.
|
|
14
47
|
*/
|
|
15
|
-
declare const
|
|
48
|
+
declare const FIELD: InjectionToken<Field<unknown>>;
|
|
16
49
|
/**
|
|
17
50
|
* Binds a form `FieldTree` to a UI control that edits it. A UI control can be one of several things:
|
|
18
51
|
* 1. A native HTML input or textarea
|
|
19
52
|
* 2. A signal forms custom control that implements `FormValueControl` or `FormCheckboxControl`
|
|
20
|
-
* 3.
|
|
21
|
-
* component that provides a ControlValueAccessor. This should only be used to backwards
|
|
53
|
+
* 3. A component that provides a `ControlValueAccessor`. This should only be used for backwards
|
|
22
54
|
* compatibility with reactive forms. Prefer options (1) and (2).
|
|
23
55
|
*
|
|
24
56
|
* This directive has several responsibilities:
|
|
25
57
|
* 1. Two-way binds the field's value with the UI control's value
|
|
26
58
|
* 2. Binds additional forms related state on the field to the UI control (disabled, required, etc.)
|
|
27
59
|
* 3. Relays relevant events on the control to the field (e.g. marks field touched on blur)
|
|
28
|
-
* 4.
|
|
29
|
-
* Provides a fake `NgControl` that implements a subset of the features available on the
|
|
60
|
+
* 4. Provides a fake `NgControl` that implements a subset of the features available on the
|
|
30
61
|
* reactive forms `NgControl`. This is provided to improve interoperability with controls
|
|
31
62
|
* designed to work with reactive forms. It should not be used by controls written for signal
|
|
32
63
|
* forms.
|
|
@@ -34,14 +65,25 @@ declare const CONTROL: InjectionToken<Control<unknown>>;
|
|
|
34
65
|
* @category control
|
|
35
66
|
* @experimental 21.0.0
|
|
36
67
|
*/
|
|
37
|
-
declare class
|
|
68
|
+
declare class Field<T> implements _Control<T> {
|
|
38
69
|
private readonly injector;
|
|
39
70
|
readonly field: i0.InputSignal<FieldTree<T>>;
|
|
40
71
|
readonly state: i0.Signal<FieldState<T, string | number>>;
|
|
41
72
|
readonly [_CONTROL]: undefined;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
73
|
+
/** Any `ControlValueAccessor` instances provided on the host element. */
|
|
74
|
+
private readonly controlValueAccessors;
|
|
75
|
+
/** A lazily instantiated fake `NgControl`. */
|
|
76
|
+
private interopNgControl;
|
|
77
|
+
/** A `ControlValueAccessor`, if configured, for the host component. */
|
|
78
|
+
private get controlValueAccessor();
|
|
79
|
+
get ɵhasInteropControl(): boolean;
|
|
80
|
+
/** Lazily instantiates a fake `NgControl` for this field. */
|
|
81
|
+
ɵgetOrCreateNgControl(): InteropNgControl;
|
|
82
|
+
ɵinteropControlCreate(): void;
|
|
83
|
+
ɵinteropControlUpdate(): void;
|
|
84
|
+
ɵregister(): void;
|
|
85
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<Field<any>, never>;
|
|
86
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<Field<any>, "[field]", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
45
87
|
}
|
|
46
88
|
|
|
47
89
|
/**
|
|
@@ -518,15 +560,6 @@ type NgValidationError = RequiredValidationError | MinValidationError | MaxValid
|
|
|
518
560
|
* Symbol used to retain generic type information when it would otherwise be lost.
|
|
519
561
|
*/
|
|
520
562
|
declare const ɵɵTYPE: unique symbol;
|
|
521
|
-
/**
|
|
522
|
-
* Creates a type based on the given type T, but with all readonly properties made writable.
|
|
523
|
-
* @template T The type to create a mutable version of.
|
|
524
|
-
*
|
|
525
|
-
* @experimental 21.0.0
|
|
526
|
-
*/
|
|
527
|
-
type Mutable<T> = {
|
|
528
|
-
-readonly [P in keyof T]: T[P];
|
|
529
|
-
};
|
|
530
563
|
/**
|
|
531
564
|
* A type that represents either a single value of type `T` or a readonly array of `T`.
|
|
532
565
|
* @template T The type of the value(s).
|
|
@@ -762,9 +795,9 @@ interface FieldState<TValue, TKey extends string | number = string | number> ext
|
|
|
762
795
|
*/
|
|
763
796
|
readonly keyInParent: Signal<TKey>;
|
|
764
797
|
/**
|
|
765
|
-
*
|
|
798
|
+
* The {@link Field} directives that bind this field to a UI control.
|
|
766
799
|
*/
|
|
767
|
-
readonly
|
|
800
|
+
readonly fieldBindings: Signal<readonly Field<unknown>[]>;
|
|
768
801
|
/**
|
|
769
802
|
* Reads an aggregate property value from the field.
|
|
770
803
|
* @param prop The property to read.
|
|
@@ -1073,93 +1106,93 @@ declare function validateHttp<TValue, TResult = unknown, TPathKind extends PathK
|
|
|
1073
1106
|
*/
|
|
1074
1107
|
interface FormUiControl {
|
|
1075
1108
|
/**
|
|
1076
|
-
* An input to receive the errors for the field. If implemented, the `
|
|
1109
|
+
* An input to receive the errors for the field. If implemented, the `Field` directive will
|
|
1077
1110
|
* automatically bind errors from the bound field to this input.
|
|
1078
1111
|
*/
|
|
1079
1112
|
readonly errors?: InputSignal<readonly WithOptionalField<ValidationError>[]>;
|
|
1080
1113
|
/**
|
|
1081
|
-
* An input to receive the disabled status for the field. If implemented, the `
|
|
1114
|
+
* An input to receive the disabled status for the field. If implemented, the `Field` directive
|
|
1082
1115
|
* will automatically bind the disabled status from the bound field to this input.
|
|
1083
1116
|
*/
|
|
1084
1117
|
readonly disabled?: InputSignal<boolean>;
|
|
1085
1118
|
/**
|
|
1086
|
-
* An input to receive the reasons for the disablement of the field. If implemented, the `
|
|
1119
|
+
* An input to receive the reasons for the disablement of the field. If implemented, the `Field`
|
|
1087
1120
|
* directive will automatically bind the disabled reason from the bound field to this input.
|
|
1088
1121
|
*/
|
|
1089
1122
|
readonly disabledReasons?: InputSignal<readonly WithOptionalField<DisabledReason>[]>;
|
|
1090
1123
|
/**
|
|
1091
|
-
* An input to receive the readonly status for the field. If implemented, the `
|
|
1124
|
+
* An input to receive the readonly status for the field. If implemented, the `Field` directive
|
|
1092
1125
|
* will automatically bind the readonly status from the bound field to this input.
|
|
1093
1126
|
*/
|
|
1094
1127
|
readonly readonly?: InputSignal<boolean>;
|
|
1095
1128
|
/**
|
|
1096
|
-
* An input to receive the hidden status for the field. If implemented, the `
|
|
1129
|
+
* An input to receive the hidden status for the field. If implemented, the `Field` directive
|
|
1097
1130
|
* will automatically bind the hidden status from the bound field to this input.
|
|
1098
1131
|
*/
|
|
1099
1132
|
readonly hidden?: InputSignal<boolean>;
|
|
1100
1133
|
/**
|
|
1101
|
-
* An input to receive the invalid status for the field. If implemented, the `
|
|
1134
|
+
* An input to receive the invalid status for the field. If implemented, the `Field` directive
|
|
1102
1135
|
* will automatically bind the invalid status from the bound field to this input.
|
|
1103
1136
|
*/
|
|
1104
1137
|
readonly invalid?: InputSignal<boolean>;
|
|
1105
1138
|
/**
|
|
1106
|
-
* An input to receive the pending status for the field. If implemented, the `
|
|
1139
|
+
* An input to receive the pending status for the field. If implemented, the `Field` directive
|
|
1107
1140
|
* will automatically bind the pending status from the bound field to this input.
|
|
1108
1141
|
*/
|
|
1109
1142
|
readonly pending?: InputSignal<boolean>;
|
|
1110
1143
|
/**
|
|
1111
|
-
* An input to receive the touched status for the field. If implemented, the `
|
|
1144
|
+
* An input to receive the touched status for the field. If implemented, the `Field` directive
|
|
1112
1145
|
* will automatically bind the touched status from the bound field to this input.
|
|
1113
1146
|
*/
|
|
1114
1147
|
readonly touched?: ModelSignal<boolean> | InputSignal<boolean> | OutputRef<boolean>;
|
|
1115
1148
|
/**
|
|
1116
|
-
* An input to receive the dirty status for the field. If implemented, the `
|
|
1149
|
+
* An input to receive the dirty status for the field. If implemented, the `Field` directive
|
|
1117
1150
|
* will automatically bind the dirty status from the bound field to this input.
|
|
1118
1151
|
*/
|
|
1119
1152
|
readonly dirty?: InputSignal<boolean>;
|
|
1120
1153
|
/**
|
|
1121
|
-
* An input to receive the name for the field. If implemented, the `
|
|
1154
|
+
* An input to receive the name for the field. If implemented, the `Field` directive will
|
|
1122
1155
|
* automatically bind the name from the bound field to this input.
|
|
1123
1156
|
*/
|
|
1124
1157
|
readonly name?: InputSignal<string>;
|
|
1125
1158
|
/**
|
|
1126
|
-
* An input to receive the required status for the field. If implemented, the `
|
|
1159
|
+
* An input to receive the required status for the field. If implemented, the `Field` directive
|
|
1127
1160
|
* will automatically bind the required status from the bound field to this input.
|
|
1128
1161
|
*/
|
|
1129
1162
|
readonly required?: InputSignal<boolean>;
|
|
1130
1163
|
/**
|
|
1131
|
-
* An input to receive the min value for the field. If implemented, the `
|
|
1164
|
+
* An input to receive the min value for the field. If implemented, the `Field` directive will
|
|
1132
1165
|
* automatically bind the min value from the bound field to this input.
|
|
1133
1166
|
*/
|
|
1134
1167
|
readonly min?: InputSignal<number | undefined>;
|
|
1135
1168
|
/**
|
|
1136
|
-
* An input to receive the min length for the field. If implemented, the `
|
|
1169
|
+
* An input to receive the min length for the field. If implemented, the `Field` directive will
|
|
1137
1170
|
* automatically bind the min length from the bound field to this input.
|
|
1138
1171
|
*/
|
|
1139
1172
|
readonly minLength?: InputSignal<number | undefined>;
|
|
1140
1173
|
/**
|
|
1141
|
-
* An input to receive the max value for the field. If implemented, the `
|
|
1174
|
+
* An input to receive the max value for the field. If implemented, the `Field` directive will
|
|
1142
1175
|
* automatically bind the max value from the bound field to this input.
|
|
1143
1176
|
*/
|
|
1144
1177
|
readonly max?: InputSignal<number | undefined>;
|
|
1145
1178
|
/**
|
|
1146
|
-
* An input to receive the max length for the field. If implemented, the `
|
|
1179
|
+
* An input to receive the max length for the field. If implemented, the `Field` directive will
|
|
1147
1180
|
* automatically bind the max length from the bound field to this input.
|
|
1148
1181
|
*/
|
|
1149
1182
|
readonly maxLength?: InputSignal<number | undefined>;
|
|
1150
1183
|
/**
|
|
1151
|
-
* An input to receive the value patterns for the field. If implemented, the `
|
|
1184
|
+
* An input to receive the value patterns for the field. If implemented, the `Field` directive
|
|
1152
1185
|
* will automatically bind the value patterns from the bound field to this input.
|
|
1153
1186
|
*/
|
|
1154
1187
|
readonly pattern?: InputSignal<readonly RegExp[]>;
|
|
1155
1188
|
}
|
|
1156
1189
|
/**
|
|
1157
1190
|
* A contract for a form control that edits a `FieldTree` of type `TValue`. Any component that
|
|
1158
|
-
* implements this contract can be used with the `
|
|
1191
|
+
* implements this contract can be used with the `Field` directive.
|
|
1159
1192
|
*
|
|
1160
1193
|
* Many of the properties declared on this contract are optional. They do not need to be
|
|
1161
1194
|
* implemented, but if they are will be kept in sync with the field state of the field bound to the
|
|
1162
|
-
* `
|
|
1195
|
+
* `Field` directive.
|
|
1163
1196
|
*
|
|
1164
1197
|
* @template TValue The type of `FieldTree` that the implementing component can edit.
|
|
1165
1198
|
*
|
|
@@ -1169,23 +1202,23 @@ interface FormUiControl {
|
|
|
1169
1202
|
interface FormValueControl<TValue> extends FormUiControl {
|
|
1170
1203
|
/**
|
|
1171
1204
|
* The value is the only required property in this contract. A component that wants to integrate
|
|
1172
|
-
* with the `
|
|
1205
|
+
* with the `Field` directive via this contract, *must* provide a `model()` that will be kept in
|
|
1173
1206
|
* sync with the value of the bound `FieldTree`.
|
|
1174
1207
|
*/
|
|
1175
1208
|
readonly value: ModelSignal<TValue>;
|
|
1176
1209
|
/**
|
|
1177
1210
|
* The implementing component *must not* define a `checked` property. This is reserved for
|
|
1178
|
-
* components that want to integrate with the `
|
|
1211
|
+
* components that want to integrate with the `Field` directive as a checkbox.
|
|
1179
1212
|
*/
|
|
1180
1213
|
readonly checked?: undefined;
|
|
1181
1214
|
}
|
|
1182
1215
|
/**
|
|
1183
1216
|
* A contract for a form control that edits a boolean checkbox `FieldTree`. Any component that
|
|
1184
|
-
* implements this contract can be used with the `
|
|
1217
|
+
* implements this contract can be used with the `Field` directive.
|
|
1185
1218
|
*
|
|
1186
1219
|
* Many of the properties declared on this contract are optional. They do not need to be
|
|
1187
1220
|
* implemented, but if they are will be kept in sync with the field state of the field bound to the
|
|
1188
|
-
* `
|
|
1221
|
+
* `Field` directive.
|
|
1189
1222
|
*
|
|
1190
1223
|
* @category control
|
|
1191
1224
|
* @experimental 21.0.0
|
|
@@ -1193,13 +1226,13 @@ interface FormValueControl<TValue> extends FormUiControl {
|
|
|
1193
1226
|
interface FormCheckboxControl extends FormUiControl {
|
|
1194
1227
|
/**
|
|
1195
1228
|
* The checked is the only required property in this contract. A component that wants to integrate
|
|
1196
|
-
* with the `
|
|
1229
|
+
* with the `Field` directive, *must* provide a `model()` that will be kept in sync with the
|
|
1197
1230
|
* value of the bound `FieldTree`.
|
|
1198
1231
|
*/
|
|
1199
1232
|
readonly checked: ModelSignal<boolean>;
|
|
1200
1233
|
/**
|
|
1201
1234
|
* The implementing component *must not* define a `value` property. This is reserved for
|
|
1202
|
-
* components that want to integrate with the `
|
|
1235
|
+
* components that want to integrate with the `Field` directive as a standard input.
|
|
1203
1236
|
*/
|
|
1204
1237
|
readonly value?: undefined;
|
|
1205
1238
|
}
|
|
@@ -1445,7 +1478,7 @@ declare class LogicContainer {
|
|
|
1445
1478
|
*/
|
|
1446
1479
|
constructor(predicates: ReadonlyArray<BoundPredicate>);
|
|
1447
1480
|
/** Checks whether there is logic for the given aggregate property. */
|
|
1448
|
-
hasAggregateProperty(prop: AggregateProperty<
|
|
1481
|
+
hasAggregateProperty(prop: AggregateProperty<any, any>): boolean;
|
|
1449
1482
|
/**
|
|
1450
1483
|
* Gets an iterable of [aggregate property, logic function] pairs.
|
|
1451
1484
|
* @returns An iterable of aggregate property entries.
|
|
@@ -1682,7 +1715,7 @@ declare class FieldPropertyState {
|
|
|
1682
1715
|
* @param prop
|
|
1683
1716
|
* @returns
|
|
1684
1717
|
*/
|
|
1685
|
-
has(prop: Property<
|
|
1718
|
+
has(prop: Property<any> | AggregateProperty<any, any>): boolean;
|
|
1686
1719
|
}
|
|
1687
1720
|
|
|
1688
1721
|
/**
|
|
@@ -1721,8 +1754,8 @@ declare class FieldNodeState {
|
|
|
1721
1754
|
* Marks this specific field as not touched.
|
|
1722
1755
|
*/
|
|
1723
1756
|
markAsUntouched(): void;
|
|
1724
|
-
/** The
|
|
1725
|
-
readonly
|
|
1757
|
+
/** The {@link Field} directives that bind this field to a UI control. */
|
|
1758
|
+
readonly fieldBindings: i0.WritableSignal<readonly Field<unknown>[]>;
|
|
1726
1759
|
constructor(node: FieldNode);
|
|
1727
1760
|
/**
|
|
1728
1761
|
* Whether this field is considered dirty.
|
|
@@ -1932,18 +1965,19 @@ declare class FieldNode implements FieldState<unknown> {
|
|
|
1932
1965
|
get disabledReasons(): Signal<readonly DisabledReason[]>;
|
|
1933
1966
|
get hidden(): Signal<boolean>;
|
|
1934
1967
|
get readonly(): Signal<boolean>;
|
|
1935
|
-
get
|
|
1968
|
+
get fieldBindings(): Signal<readonly Field<unknown>[]>;
|
|
1936
1969
|
get submitting(): Signal<boolean>;
|
|
1937
1970
|
get name(): Signal<string>;
|
|
1938
|
-
|
|
1939
|
-
get
|
|
1940
|
-
get
|
|
1941
|
-
get
|
|
1942
|
-
get
|
|
1943
|
-
get
|
|
1971
|
+
private propertyOrUndefined;
|
|
1972
|
+
get max(): Signal<number | undefined> | undefined;
|
|
1973
|
+
get maxLength(): Signal<number | undefined> | undefined;
|
|
1974
|
+
get min(): Signal<number | undefined> | undefined;
|
|
1975
|
+
get minLength(): Signal<number | undefined> | undefined;
|
|
1976
|
+
get pattern(): Signal<readonly RegExp[]> | undefined;
|
|
1977
|
+
get required(): Signal<boolean> | undefined;
|
|
1944
1978
|
property<M>(prop: AggregateProperty<M, any>): Signal<M>;
|
|
1945
1979
|
property<M>(prop: Property<M>): M | undefined;
|
|
1946
|
-
hasProperty(prop: Property<
|
|
1980
|
+
hasProperty(prop: Property<any> | AggregateProperty<any, any>): boolean;
|
|
1947
1981
|
/**
|
|
1948
1982
|
* Marks this specific field as touched.
|
|
1949
1983
|
*/
|
|
@@ -2650,5 +2684,5 @@ type IgnoreUnknownProperties<T> = T extends Record<PropertyKey, unknown> ? {
|
|
|
2650
2684
|
*/
|
|
2651
2685
|
declare function validateStandardSchema<TSchema, TValue extends IgnoreUnknownProperties<TSchema>>(path: FieldPath<TValue>, schema: StandardSchemaV1<TSchema>): void;
|
|
2652
2686
|
|
|
2653
|
-
export { AggregateProperty,
|
|
2654
|
-
export type { AsyncValidationResult, AsyncValidatorOptions, ChildFieldContext, DisabledReason, FieldContext, FieldPath, FieldState, FieldTree, FieldValidationResult, FieldValidator, FormCheckboxControl, FormOptions, FormUiControl, FormValueControl, HttpValidatorOptions, IgnoreUnknownProperties, ItemFieldContext, LogicFn, MapToErrorsFn, MaybeFieldPath, MaybeFieldTree,
|
|
2687
|
+
export { AggregateProperty, CustomValidationError, EmailValidationError, FIELD, Field, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PathKind, PatternValidationError, Property, REQUIRED, RequiredValidationError, StandardSchemaValidationError, aggregateProperty, andProperty, apply, applyEach, applyWhen, applyWhenValue, createProperty, customError, disabled, email, emailError, form, hidden, listProperty, max, maxError, maxLength, maxLengthError, maxProperty, min, minError, minLength, minLengthError, minProperty, orProperty, pattern, patternError, property, readonly, reducedProperty, required, requiredError, schema, standardSchemaError, submit, validate, validateAsync, validateHttp, validateStandardSchema, validateTree };
|
|
2688
|
+
export type { AsyncValidationResult, AsyncValidatorOptions, ChildFieldContext, DisabledReason, FieldContext, FieldPath, FieldState, FieldTree, FieldValidationResult, FieldValidator, FormCheckboxControl, FormOptions, FormUiControl, FormValueControl, HttpValidatorOptions, IgnoreUnknownProperties, ItemFieldContext, LogicFn, MapToErrorsFn, MaybeFieldPath, MaybeFieldTree, OneOrMany, ReadonlyArrayLike, RemoveStringIndexUnknownKey, RootFieldContext, Schema, SchemaFn, SchemaOrSchemaFn, Subfields, SubmittedStatus, TreeValidationResult, TreeValidator, ValidationError, ValidationResult, ValidationSuccess, Validator, WithField, WithOptionalField, WithoutField };
|