You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@angular/forms

Package Overview
Dependencies
Maintainers
2
Versions
1011
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@angular/forms - npm Package Compare versions

Comparing version
21.1.0-rc.0
to
21.1.0
+15
-1
fesm2022/_structure-chunk.mjs
/**
* @license Angular v21.1.0-rc.0
* @license Angular v21.1.0
* (c) 2010-2026 Google LLC. https://angular.dev/

@@ -1181,2 +1181,10 @@ * License: MIT

}
focusBoundControl() {
this.getBindingForFocus()?.focus();
}
getBindingForFocus() {
const own = this.formFieldBindings().filter(b => b.focus !== undefined).reduce(firstInDom, undefined);
if (own) return own;
return this.structure.children().map(child => child.getBindingForFocus()).reduce(firstInDom, undefined);
}
pendingSync = linkedSignal({

@@ -1351,2 +1359,8 @@ ...(ngDevMode ? {

}] : []));
function firstInDom(a, b) {
if (!a) return b;
if (!b) return a;
const position = a.element.compareDocumentPosition(b.element);
return position & Node.DOCUMENT_POSITION_PRECEDING ? b : a;
}

@@ -1353,0 +1367,0 @@ class FieldNodeState {

+1
-1
/**
* @license Angular v21.1.0-rc.0
* @license Angular v21.1.0
* (c) 2010-2026 Google LLC. https://angular.dev/

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license Angular v21.1.0-rc.0
* @license Angular v21.1.0
* (c) 2010-2026 Google LLC. https://angular.dev/

@@ -96,106 +96,2 @@ * License: MIT

const FIELD = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'FIELD' : '');
const controlInstructions$1 = {
create: __controlCreate,
update: _controlUpdate
};
class Field {
element = inject(ElementRef).nativeElement;
injector = inject(Injector);
field = input.required(...(ngDevMode ? [{
debugName: "field"
}] : []));
state = computed(() => this.field()(), ...(ngDevMode ? [{
debugName: "state"
}] : []));
[_CONTROL] = controlInstructions$1;
config = inject(SIGNAL_FORMS_CONFIG, {
optional: true
});
classes = Object.entries(this.config?.classes ?? {}).map(([className, computation]) => [className, computed(() => computation(this))]);
controlValueAccessors = inject(NG_VALUE_ACCESSOR, {
optional: true,
self: true
});
interopNgControl;
get ɵinteropControl() {
return this.controlValueAccessors?.[0] ?? this.interopNgControl?.valueAccessor ?? undefined;
}
getOrCreateNgControl() {
return this.interopNgControl ??= new InteropNgControl(this.state);
}
ɵregister() {
effect(onCleanup => {
const fieldNode = this.state();
fieldNode.nodeState.formFieldBindings.update(controls => [...controls, this]);
onCleanup(() => {
fieldNode.nodeState.formFieldBindings.update(controls => controls.filter(c => c !== this));
});
}, {
injector: this.injector
});
}
static ɵfac = i0.ɵɵngDeclareFactory({
minVersion: "12.0.0",
version: "21.1.0-rc.0",
ngImport: i0,
type: Field,
deps: [],
target: i0.ɵɵFactoryTarget.Directive
});
static ɵdir = i0.ɵɵngDeclareDirective({
minVersion: "17.1.0",
version: "21.1.0-rc.0",
type: Field,
isStandalone: true,
selector: "[field]",
inputs: {
field: {
classPropertyName: "field",
publicName: "field",
isSignal: true,
isRequired: true,
transformFunction: null
}
},
providers: [{
provide: FIELD,
useExisting: Field
}, {
provide: NgControl,
useFactory: () => inject(Field).getOrCreateNgControl()
}],
ngImport: i0
});
}
i0.ɵɵngDeclareClassMetadata({
minVersion: "12.0.0",
version: "21.1.0-rc.0",
ngImport: i0,
type: Field,
decorators: [{
type: Directive,
args: [{
selector: '[field]',
providers: [{
provide: FIELD,
useExisting: Field
}, {
provide: NgControl,
useFactory: () => inject(Field).getOrCreateNgControl()
}]
}]
}],
propDecorators: {
field: [{
type: i0.Input,
args: [{
isSignal: true,
alias: "field",
required: true
}]
}]
}
});
const FORM_FIELD = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'FORM_FIELD' : '');

@@ -244,3 +140,3 @@ const controlInstructions = {

minVersion: "12.0.0",
version: "21.1.0-rc.0",
version: "21.1.0",
ngImport: i0,

@@ -253,3 +149,3 @@ type: FormField,

minVersion: "17.1.0",
version: "21.1.0-rc.0",
version: "21.1.0",
type: FormField,

@@ -279,3 +175,3 @@ isStandalone: true,

minVersion: "12.0.0",
version: "21.1.0-rc.0",
version: "21.1.0",
ngImport: i0,

@@ -752,3 +648,3 @@ type: FormField,

export { EmailValidationError, FIELD, FORM_FIELD, Field, FormField, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, RequiredValidationError, StandardSchemaValidationError, createManagedMetadataKey, createMetadataKey, debounce, disabled, email, emailError, hidden, max, maxError, maxLength, maxLengthError, metadata, min, minError, minLength, minLengthError, pattern, patternError, provideSignalFormsConfig, readonly, required, requiredError, standardSchemaError, validate, validateAsync, validateHttp, validateStandardSchema, validateTree };
export { EmailValidationError, FORM_FIELD, FormField, MAX, MAX_LENGTH, MIN, MIN_LENGTH, MaxLengthValidationError, MaxValidationError, MinLengthValidationError, MinValidationError, NgValidationError, PATTERN, PatternValidationError, REQUIRED, RequiredValidationError, StandardSchemaValidationError, createManagedMetadataKey, createMetadataKey, debounce, disabled, email, emailError, hidden, max, maxError, maxLength, maxLengthError, metadata, min, minError, minLength, minLengthError, pattern, patternError, provideSignalFormsConfig, readonly, required, requiredError, standardSchemaError, validate, validateAsync, validateHttp, validateStandardSchema, validateTree };
//# sourceMappingURL=signals.mjs.map
{
"name": "@angular/forms",
"version": "21.1.0-rc.0",
"version": "21.1.0",
"description": "Angular - directives and services for creating forms",

@@ -15,5 +15,5 @@ "author": "angular",

"peerDependencies": {
"@angular/core": "21.1.0-rc.0",
"@angular/common": "21.1.0-rc.0",
"@angular/platform-browser": "21.1.0-rc.0",
"@angular/core": "21.1.0",
"@angular/common": "21.1.0",
"@angular/platform-browser": "21.1.0",
"rxjs": "^6.5.3 || ^7.4.0"

@@ -20,0 +20,0 @@ },

/**
* @license Angular v21.1.0-rc.0
* @license Angular v21.1.0
* (c) 2010-2026 Google LLC. https://angular.dev/

@@ -4,0 +4,0 @@ * License: MIT

/**
* @license Angular v21.1.0-rc.0
* @license Angular v21.1.0
* (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, FIELD, FORM_FIELD, 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, 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';
import { StandardSchemaV1 } from '@standard-schema/spec';

@@ -12,0 +12,0 @@ import { HttpResourceRequest, HttpResourceOptions } from '@angular/common/http';

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