@angular/forms 22.0.0-next.3 → 22.0.0-next.5
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/_validation_errors-chunk.mjs +191 -89
- package/fesm2022/_validation_errors-chunk.mjs.map +1 -1
- package/fesm2022/forms.mjs +3633 -3301
- package/fesm2022/forms.mjs.map +1 -1
- package/fesm2022/signals-compat.mjs +83 -9
- package/fesm2022/signals-compat.mjs.map +1 -1
- package/fesm2022/signals.mjs +186 -67
- 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 +63 -27
- package/types/forms.d.ts +123 -17
- package/types/signals-compat.d.ts +60 -2
- package/types/signals.d.ts +14 -4
package/types/signals.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-next.
|
|
2
|
+
* @license Angular v22.0.0-next.5
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
|
-
import { Signal, ResourceRef, InputSignal, InputSignalWithTransform, OutputRef, ModelSignal, WritableSignal } from '@angular/core';
|
|
8
|
+
import { DebounceTimer, Signal, ResourceRef, InputSignal, InputSignalWithTransform, OutputRef, ModelSignal, WritableSignal } from '@angular/core';
|
|
9
9
|
import { PathKind, SchemaPath, SchemaPathRules, LogicFn, OneOrMany, ValidationError, FieldValidator, FieldContext, TreeValidationResult, TreeValidator, WithOptionalFieldTree, DisabledReason, Debouncer, FieldTree } from './_structure-chunk.js';
|
|
10
|
-
export { AsyncValidationResult, BaseNgValidationError, ChildFieldContext, CompatFieldState, CompatSchemaPath, EmailValidationError, FORM_FIELD, Field, FieldState, FieldStateByMode, FormField, FormFieldBinding, FormFieldBindingOptions, FormOptions, FormSubmitOptions, IgnoreUnknownProperties, ItemFieldContext, ItemType, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MaybeFieldTree, MaybeSchemaPathTree, MetadataKey, MetadataReducer, MetadataSetterType, MinLengthValidationError, MinValidationError, NativeInputParseError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, ReadonlyArrayLike, ReadonlyCompatFieldState, ReadonlyFieldState, ReadonlyFieldTree, RemoveStringIndexUnknownKey, RequiredValidationError, RootFieldContext, Schema, SchemaFn, SchemaOrSchemaFn, SchemaPathTree, SignalFormsConfig, StandardSchemaValidationError, Subfields, ValidationErrorOptions, ValidationResult, ValidationSuccess, Validator,
|
|
10
|
+
export { AsyncValidationResult, BaseNgValidationError, ChildFieldContext, CompatFieldState, CompatSchemaPath, EmailValidationError, FORM_FIELD, Field, FieldState, FieldStateByMode, FormField, FormFieldBinding, FormFieldBindingOptions, FormOptions, FormSubmitOptions, IS_ASYNC_VALIDATION_RESOURCE, IgnoreUnknownProperties, ItemFieldContext, ItemType, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MarkAsTouchedOptions, MaxLengthValidationError, MaxValidationError, MaybeFieldTree, MaybeSchemaPathTree, MetadataKey, MetadataReducer, MetadataSetterType, MinLengthValidationError, MinValidationError, NativeInputParseError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, ReadonlyArrayLike, ReadonlyCompatFieldState, ReadonlyFieldState, ReadonlyFieldTree, RemoveStringIndexUnknownKey, RequiredValidationError, RootFieldContext, Schema, SchemaFn, SchemaOrSchemaFn, SchemaPathTree, SignalFormsConfig, StandardSchemaValidationError, Subfields, ValidationErrorOptions, ValidationResult, ValidationSuccess, Validator, WithFieldTree, WithoutFieldTree, apply, applyEach, applyWhen, applyWhenValue, createManagedMetadataKey, createMetadataKey, emailError, form, maxError, maxLengthError, metadata, minError, minLengthError, patternError, provideSignalFormsConfig, requiredError, schema, standardSchemaError, submit, validateStandardSchema, ɵNgFieldDirective } from './_structure-chunk.js';
|
|
11
11
|
import { HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';
|
|
12
12
|
import '@angular/forms';
|
|
13
13
|
import '@standard-schema/spec';
|
|
@@ -267,6 +267,11 @@ interface AsyncValidatorOptions<TValue, TParams, TResult, TPathKind extends Path
|
|
|
267
267
|
* @returns The params for the resource.
|
|
268
268
|
*/
|
|
269
269
|
readonly params: (ctx: FieldContext<TValue, TPathKind>) => TParams;
|
|
270
|
+
/**
|
|
271
|
+
* Duration in milliseconds to wait before triggering the async operation, or a function that
|
|
272
|
+
* returns a promise that resolves when the update should proceed.
|
|
273
|
+
*/
|
|
274
|
+
readonly debounce?: DebounceTimer<TParams | undefined>;
|
|
270
275
|
/**
|
|
271
276
|
* A function that receives the resource params and returns a resource of the given params.
|
|
272
277
|
* The given params should be used as is to create the resource.
|
|
@@ -352,6 +357,11 @@ interface HttpValidatorOptions<TValue, TResult, TPathKind extends PathKind = Pat
|
|
|
352
357
|
* The options to use when creating the httpResource.
|
|
353
358
|
*/
|
|
354
359
|
readonly options?: HttpResourceOptions<TResult, unknown>;
|
|
360
|
+
/**
|
|
361
|
+
* Duration in milliseconds to wait before triggering the async operation, or a function that
|
|
362
|
+
* returns a promise that resolves when the update should proceed.
|
|
363
|
+
*/
|
|
364
|
+
readonly debounce?: DebounceTimer<string | HttpResourceRequest | undefined>;
|
|
355
365
|
}
|
|
356
366
|
/**
|
|
357
367
|
* Adds async validation to the field corresponding to the given path based on an httpResource.
|
|
@@ -644,7 +654,7 @@ declare function transformedValue<TValue, TRaw>(value: ModelSignal<TValue>, opti
|
|
|
644
654
|
* It automatically:
|
|
645
655
|
* 1. Sets `novalidate` on the form element to disable browser validation.
|
|
646
656
|
* 2. Listens for the `submit` event, prevents the default behavior, and calls `submit()` on the
|
|
647
|
-
* `FieldTree
|
|
657
|
+
* `FieldTree` if it defines its own submission options.
|
|
648
658
|
*
|
|
649
659
|
* @usageNotes
|
|
650
660
|
*
|