@angular/forms
Advanced tools
| /** | ||
| * @license Angular v21.1.0 | ||
| * @license Angular v21.1.1 | ||
| * (c) 2010-2026 Google LLC. https://angular.dev/ | ||
@@ -1281,5 +1281,6 @@ * License: MIT | ||
| markAsTouched() { | ||
| this.nodeState.markAsTouched(); | ||
| this.pendingSync()?.abort(); | ||
| this.sync(); | ||
| untracked(() => { | ||
| this.nodeState.markAsTouched(); | ||
| this.flushSync(); | ||
| }); | ||
| } | ||
@@ -1303,5 +1304,7 @@ markAsDirty() { | ||
| setControlValue(newValue) { | ||
| this._controlValue.set(newValue); | ||
| this.markAsDirty(); | ||
| this.debounceSync(); | ||
| untracked(() => { | ||
| this._controlValue.set(newValue); | ||
| this.markAsDirty(); | ||
| this.debounceSync(); | ||
| }); | ||
| } | ||
@@ -1311,2 +1314,9 @@ sync() { | ||
| } | ||
| flushSync() { | ||
| const pending = this.pendingSync(); | ||
| if (pending && !pending.signal.aborted) { | ||
| pending.abort(); | ||
| this.sync(); | ||
| } | ||
| } | ||
| async debounceSync() { | ||
@@ -1313,0 +1323,0 @@ this.pendingSync()?.abort(); |
| /** | ||
| * @license Angular v21.1.0 | ||
| * @license Angular v21.1.1 | ||
| * (c) 2010-2026 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
+21
-6
| /** | ||
| * @license Angular v21.1.0 | ||
| * @license Angular v21.1.1 | ||
| * (c) 2010-2026 Google LLC. https://angular.dev/ | ||
@@ -8,3 +8,3 @@ * License: MIT | ||
| import * as i0 from '@angular/core'; | ||
| import { InjectionToken, ɵRuntimeError as _RuntimeError, inject, ElementRef, Injector, input, computed, ɵCONTROL as _CONTROL, effect, Directive, ɵɵcontrolCreate as __controlCreate, ɵcontrolUpdate as _controlUpdate, ɵisPromise as _isPromise, resource } from '@angular/core'; | ||
| import { InjectionToken, ɵRuntimeError as _RuntimeError, inject, ElementRef, Injector, input, computed, signal, ɵCONTROL as _CONTROL, untracked, effect, Directive, ɵɵcontrolCreate as __controlCreate, ɵcontrolUpdate as _controlUpdate, ɵisPromise as _isPromise, resource } from '@angular/core'; | ||
| import { Validators, NG_VALUE_ACCESSOR, NgControl } from '@angular/forms'; | ||
@@ -111,2 +111,5 @@ import { assertPathIsCurrent, FieldPathNode, addDefaultField, metadata, createMetadataKey, MAX, MAX_LENGTH, MIN, MIN_LENGTH, PATTERN, REQUIRED, createManagedMetadataKey, DEBOUNCER } from './_structure-chunk.mjs'; | ||
| }] : [])); | ||
| bindingOptions = signal(undefined, ...(ngDevMode ? [{ | ||
| debugName: "bindingOptions" | ||
| }] : [])); | ||
| [_CONTROL] = controlInstructions; | ||
@@ -128,3 +131,7 @@ config = inject(SIGNAL_FORMS_CONFIG, { | ||
| } | ||
| ɵregister() { | ||
| registerAsBinding(bindingOptions) { | ||
| if (untracked(this.bindingOptions)) { | ||
| throw new _RuntimeError(1913, ngDevMode && 'FormField already registered as a binding'); | ||
| } | ||
| this.bindingOptions.set(bindingOptions); | ||
| effect(onCleanup => { | ||
@@ -140,5 +147,13 @@ const fieldNode = this.state(); | ||
| } | ||
| focus() { | ||
| const bindingOptions = untracked(this.bindingOptions); | ||
| if (bindingOptions?.focus) { | ||
| bindingOptions.focus(); | ||
| } else { | ||
| this.element.focus(); | ||
| } | ||
| } | ||
| static ɵfac = i0.ɵɵngDeclareFactory({ | ||
| minVersion: "12.0.0", | ||
| version: "21.1.0", | ||
| version: "21.1.1", | ||
| ngImport: i0, | ||
@@ -151,3 +166,3 @@ type: FormField, | ||
| minVersion: "17.1.0", | ||
| version: "21.1.0", | ||
| version: "21.1.1", | ||
| type: FormField, | ||
@@ -177,3 +192,3 @@ isStandalone: true, | ||
| minVersion: "12.0.0", | ||
| version: "21.1.0", | ||
| version: "21.1.1", | ||
| ngImport: i0, | ||
@@ -180,0 +195,0 @@ type: FormField, |
+4
-4
| { | ||
| "name": "@angular/forms", | ||
| "version": "21.1.0", | ||
| "version": "21.1.1", | ||
| "description": "Angular - directives and services for creating forms", | ||
@@ -15,5 +15,5 @@ "author": "angular", | ||
| "peerDependencies": { | ||
| "@angular/core": "21.1.0", | ||
| "@angular/common": "21.1.0", | ||
| "@angular/platform-browser": "21.1.0", | ||
| "@angular/core": "21.1.1", | ||
| "@angular/common": "21.1.1", | ||
| "@angular/platform-browser": "21.1.1", | ||
| "rxjs": "^6.5.3 || ^7.4.0" | ||
@@ -20,0 +20,0 @@ }, |
| /** | ||
| * @license Angular v21.1.0 | ||
| * @license Angular v21.1.1 | ||
| * (c) 2010-2026 Google LLC. https://angular.dev/ | ||
@@ -4,0 +4,0 @@ * License: MIT |
| /** | ||
| * @license Angular v21.1.0 | ||
| * @license Angular v21.1.1 | ||
| * (c) 2010-2026 Google LLC. https://angular.dev/ | ||
@@ -9,3 +9,3 @@ * License: MIT | ||
| import { PathKind, SchemaPath, SchemaPathRules, LogicFn, OneOrMany, ValidationError, SchemaPathTree, FieldValidator, FieldContext, TreeValidationResult, TreeValidator, WithOptionalField, DisabledReason, Debouncer } from './_structure-chunk.js'; | ||
| export { AsyncValidationResult, ChildFieldContext, CompatFieldState, CompatSchemaPath, EmailValidationError, FORM_FIELD, FieldState, FieldTree, FormField, 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, SubmittedStatus, 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'; | ||
| 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'; | ||
| import { StandardSchemaV1 } from '@standard-schema/spec'; | ||
@@ -508,2 +508,9 @@ import { HttpResourceRequest, HttpResourceOptions } from '@angular/common/http'; | ||
| readonly pattern?: InputSignal<readonly RegExp[]> | InputSignalWithTransform<readonly RegExp[], unknown>; | ||
| /** | ||
| * Focuses the UI control. | ||
| * | ||
| * If the focus method is not implemented, Signal Forms will attempt to focus the host element | ||
| * when asked to focus this control. | ||
| */ | ||
| focus?(): void; | ||
| } | ||
@@ -510,0 +517,0 @@ /** |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
1473776
0.26%16297
0.3%