@angular/forms 21.1.0 → 21.1.2
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 +25 -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 +25 -11
- 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.1.
|
|
2
|
+
* @license Angular v21.1.2
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -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();
|
|
@@ -1547,8 +1557,11 @@ function applyWhenValue(path, predicate, schema) {
|
|
|
1547
1557
|
}
|
|
1548
1558
|
async function submit(form, action) {
|
|
1549
1559
|
const node = form();
|
|
1550
|
-
|
|
1551
|
-
|
|
1560
|
+
const invalid = untracked(() => {
|
|
1561
|
+
markAllAsTouched(node);
|
|
1562
|
+
return node.invalid();
|
|
1563
|
+
});
|
|
1564
|
+
if (invalid) {
|
|
1552
1565
|
return;
|
|
1553
1566
|
}
|
|
1554
1567
|
node.submitState.selfSubmitting.set(true);
|
|
@@ -1582,6 +1595,9 @@ function schema(fn) {
|
|
|
1582
1595
|
return SchemaImpl.create(fn);
|
|
1583
1596
|
}
|
|
1584
1597
|
function markAllAsTouched(node) {
|
|
1598
|
+
if (node.validationState.shouldSkipValidation()) {
|
|
1599
|
+
return;
|
|
1600
|
+
}
|
|
1585
1601
|
node.markAsTouched();
|
|
1586
1602
|
for (const child of node.structure.children()) {
|
|
1587
1603
|
markAllAsTouched(child);
|