@angular/forms 21.1.0 → 21.2.0-next.0
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 +19 -9
- 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 +1 -1
- package/fesm2022/signals.mjs +21 -6
- 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 +28 -13
- package/types/forms.d.ts +2 -2
- package/types/signals-compat.d.ts +1 -1
- package/types/signals.d.ts +9 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.
|
|
2
|
+
* @license Angular v21.2.0-next.0
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -1178,8 +1178,8 @@ class FieldNode {
|
|
|
1178
1178
|
this.metadataState = new FieldMetadataState(this);
|
|
1179
1179
|
this.submitState = new FieldSubmitState(this);
|
|
1180
1180
|
}
|
|
1181
|
-
focusBoundControl() {
|
|
1182
|
-
this.getBindingForFocus()?.focus();
|
|
1181
|
+
focusBoundControl(options) {
|
|
1182
|
+
this.getBindingForFocus()?.focus(options);
|
|
1183
1183
|
}
|
|
1184
1184
|
getBindingForFocus() {
|
|
1185
1185
|
const own = this.formFieldBindings().filter(b => b.focus !== undefined).reduce(firstInDom, undefined);
|
|
@@ -1278,9 +1278,10 @@ class FieldNode {
|
|
|
1278
1278
|
return this.metadataState.has(key);
|
|
1279
1279
|
}
|
|
1280
1280
|
markAsTouched() {
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1281
|
+
untracked(() => {
|
|
1282
|
+
this.nodeState.markAsTouched();
|
|
1283
|
+
this.flushSync();
|
|
1284
|
+
});
|
|
1284
1285
|
}
|
|
1285
1286
|
markAsDirty() {
|
|
1286
1287
|
this.nodeState.markAsDirty();
|
|
@@ -1299,13 +1300,22 @@ class FieldNode {
|
|
|
1299
1300
|
}
|
|
1300
1301
|
}
|
|
1301
1302
|
setControlValue(newValue) {
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1303
|
+
untracked(() => {
|
|
1304
|
+
this._controlValue.set(newValue);
|
|
1305
|
+
this.markAsDirty();
|
|
1306
|
+
this.debounceSync();
|
|
1307
|
+
});
|
|
1305
1308
|
}
|
|
1306
1309
|
sync() {
|
|
1307
1310
|
this.value.set(this.controlValue());
|
|
1308
1311
|
}
|
|
1312
|
+
flushSync() {
|
|
1313
|
+
const pending = this.pendingSync();
|
|
1314
|
+
if (pending && !pending.signal.aborted) {
|
|
1315
|
+
pending.abort();
|
|
1316
|
+
this.sync();
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1309
1319
|
async debounceSync() {
|
|
1310
1320
|
this.pendingSync()?.abort();
|
|
1311
1321
|
const debouncer = this.nodeState.debouncer();
|