@angular/forms 21.1.3 → 21.2.0-next.1
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/_structure-chunk.mjs +31 -5
- package/fesm2022/_structure-chunk.mjs.map +1 -1
- package/fesm2022/forms.mjs +128 -128
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals-compat.mjs +4 -1
- package/fesm2022/signals-compat.mjs.map +1 -1
- package/fesm2022/signals.mjs +29 -15
- package/fesm2022/signals.mjs.map +1 -1
- package/package.json +4 -4
- package/resources/code-examples.db +0 -0
- package/types/_structure-chunk.d.ts +171 -165
- package/types/forms.d.ts +1 -1
- package/types/signals-compat.d.ts +1 -1
- package/types/signals.d.ts +16 -10
package/types/signals.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.1
|
|
2
|
+
* @license Angular v21.2.0-next.1
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import { Signal, ResourceRef, InputSignal, InputSignalWithTransform, ModelSignal, OutputRef } from '@angular/core';
|
|
8
|
-
import { PathKind, SchemaPath, SchemaPathRules, LogicFn, OneOrMany, ValidationError, SchemaPathTree, FieldValidator, FieldContext, TreeValidationResult, TreeValidator,
|
|
9
|
-
export { AsyncValidationResult, ChildFieldContext, CompatFieldState, CompatSchemaPath, EmailValidationError, FORM_FIELD, FieldState, FieldTree, FormField, FormFieldBindingOptions, FormOptions, ItemFieldContext, ItemType, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MaybeFieldTree, MaybeSchemaPathTree, MetadataKey, MetadataReducer, MetadataSetterType, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, ReadonlyArrayLike, RequiredValidationError, RootFieldContext, Schema, SchemaFn, SchemaOrSchemaFn, SignalFormsConfig, StandardSchemaValidationError, Subfields, ValidationResult, ValidationSuccess, Validator, WithField, WithoutField, apply, applyEach, applyWhen, applyWhenValue, createManagedMetadataKey, createMetadataKey, emailError, form, maxError, maxLengthError, metadata, minError, minLengthError, patternError, provideSignalFormsConfig, requiredError, schema, standardSchemaError, submit } from './_structure-chunk.js';
|
|
8
|
+
import { PathKind, SchemaPath, SchemaPathRules, LogicFn, OneOrMany, ValidationError, SchemaPathTree, FieldValidator, FieldContext, TreeValidationResult, TreeValidator, WithOptionalFieldTree, DisabledReason, Debouncer } from './_structure-chunk.js';
|
|
9
|
+
export { AsyncValidationResult, ChildFieldContext, CompatFieldState, CompatSchemaPath, EmailValidationError, FORM_FIELD, FieldState, FieldTree, FormField, FormFieldBindingOptions, FormOptions, ItemFieldContext, ItemType, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MaybeFieldTree, MaybeSchemaPathTree, MetadataKey, MetadataReducer, MetadataSetterType, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, ReadonlyArrayLike, RequiredValidationError, RootFieldContext, Schema, SchemaFn, SchemaOrSchemaFn, SignalFormsConfig, StandardSchemaValidationError, Subfields, ValidationResult, ValidationSuccess, Validator, WithField, WithFieldTree, WithOptionalField, WithoutField, WithoutFieldTree, apply, applyEach, applyWhen, applyWhenValue, createManagedMetadataKey, createMetadataKey, emailError, form, maxError, maxLengthError, metadata, minError, minLengthError, patternError, provideSignalFormsConfig, requiredError, schema, standardSchemaError, submit } from './_structure-chunk.js';
|
|
10
10
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
11
11
|
import { HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';
|
|
12
12
|
import '@angular/forms';
|
|
@@ -423,12 +423,12 @@ declare function validateTree<TValue, TPathKind extends PathKind = PathKind.Root
|
|
|
423
423
|
* @category control
|
|
424
424
|
* @experimental 21.0.0
|
|
425
425
|
*/
|
|
426
|
-
interface FormUiControl {
|
|
426
|
+
interface FormUiControl<TValue> {
|
|
427
427
|
/**
|
|
428
428
|
* An input to receive the errors for the field. If implemented, the `Field` directive will
|
|
429
429
|
* automatically bind errors from the bound field to this input.
|
|
430
430
|
*/
|
|
431
|
-
readonly errors?: InputSignal<readonly
|
|
431
|
+
readonly errors?: InputSignal<readonly ValidationError.WithOptionalFieldTree[]> | InputSignalWithTransform<readonly ValidationError.WithOptionalFieldTree[], unknown>;
|
|
432
432
|
/**
|
|
433
433
|
* An input to receive the disabled status for the field. If implemented, the `Field` directive
|
|
434
434
|
* will automatically bind the disabled status from the bound field to this input.
|
|
@@ -438,7 +438,7 @@ interface FormUiControl {
|
|
|
438
438
|
* An input to receive the reasons for the disablement of the field. If implemented, the `Field`
|
|
439
439
|
* directive will automatically bind the disabled reason from the bound field to this input.
|
|
440
440
|
*/
|
|
441
|
-
readonly disabledReasons?: InputSignal<readonly
|
|
441
|
+
readonly disabledReasons?: InputSignal<readonly WithOptionalFieldTree<DisabledReason>[]> | InputSignalWithTransform<readonly WithOptionalFieldTree<DisabledReason>[], unknown>;
|
|
442
442
|
/**
|
|
443
443
|
* An input to receive the readonly status for the field. If implemented, the `Field` directive
|
|
444
444
|
* will automatically bind the readonly status from the bound field to this input.
|
|
@@ -504,13 +504,19 @@ interface FormUiControl {
|
|
|
504
504
|
* will automatically bind the value patterns from the bound field to this input.
|
|
505
505
|
*/
|
|
506
506
|
readonly pattern?: InputSignal<readonly RegExp[]> | InputSignalWithTransform<readonly RegExp[], unknown>;
|
|
507
|
+
/**
|
|
508
|
+
* A signal containing the current parse errors for the control.
|
|
509
|
+
* This allows the control to communicate to the form that there are additional validation errors
|
|
510
|
+
* beyond those produced by the schema, due to being unable to parse the user's input.
|
|
511
|
+
*/
|
|
512
|
+
readonly parseErrors?: Signal<ValidationError.WithoutFieldTree[]>;
|
|
507
513
|
/**
|
|
508
514
|
* Focuses the UI control.
|
|
509
515
|
*
|
|
510
516
|
* If the focus method is not implemented, Signal Forms will attempt to focus the host element
|
|
511
517
|
* when asked to focus this control.
|
|
512
518
|
*/
|
|
513
|
-
focus?(): void;
|
|
519
|
+
focus?(options?: FocusOptions): void;
|
|
514
520
|
}
|
|
515
521
|
/**
|
|
516
522
|
* A contract for a form control that edits a `FieldTree` of type `TValue`. Any component that
|
|
@@ -525,7 +531,7 @@ interface FormUiControl {
|
|
|
525
531
|
* @category control
|
|
526
532
|
* @experimental 21.0.0
|
|
527
533
|
*/
|
|
528
|
-
interface FormValueControl<TValue> extends FormUiControl {
|
|
534
|
+
interface FormValueControl<TValue> extends FormUiControl<TValue> {
|
|
529
535
|
/**
|
|
530
536
|
* The value is the only required property in this contract. A component that wants to integrate
|
|
531
537
|
* with the `Field` directive via this contract, *must* provide a `model()` that will be kept in
|
|
@@ -549,7 +555,7 @@ interface FormValueControl<TValue> extends FormUiControl {
|
|
|
549
555
|
* @category control
|
|
550
556
|
* @experimental 21.0.0
|
|
551
557
|
*/
|
|
552
|
-
interface FormCheckboxControl extends FormUiControl {
|
|
558
|
+
interface FormCheckboxControl extends FormUiControl<boolean> {
|
|
553
559
|
/**
|
|
554
560
|
* The checked is the only required property in this contract. A component that wants to integrate
|
|
555
561
|
* with the `Field` directive, *must* provide a `model()` that will be kept in sync with the
|
|
@@ -577,5 +583,5 @@ interface FormCheckboxControl extends FormUiControl {
|
|
|
577
583
|
*/
|
|
578
584
|
declare function debounce<TValue, TPathKind extends PathKind = PathKind.Root>(path: SchemaPath<TValue, SchemaPathRules.Supported, TPathKind>, durationOrDebouncer: number | Debouncer<TValue, TPathKind>): void;
|
|
579
585
|
|
|
580
|
-
export { Debouncer, DisabledReason, FieldContext, FieldValidator, LogicFn, OneOrMany, PathKind, SchemaPath, SchemaPathRules, SchemaPathTree, TreeValidationResult, TreeValidator, ValidationError,
|
|
586
|
+
export { Debouncer, DisabledReason, FieldContext, FieldValidator, LogicFn, OneOrMany, PathKind, SchemaPath, SchemaPathRules, SchemaPathTree, TreeValidationResult, TreeValidator, ValidationError, WithOptionalFieldTree, debounce, disabled, email, hidden, max, maxLength, min, minLength, pattern, readonly, required, validate, validateAsync, validateHttp, validateStandardSchema, validateTree };
|
|
581
587
|
export type { AsyncValidatorOptions, FormCheckboxControl, FormUiControl, FormValueControl, HttpValidatorOptions, IgnoreUnknownProperties, MapToErrorsFn, RemoveStringIndexUnknownKey };
|