@angular/forms 22.0.0-next.0 → 22.0.0-next.1
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 +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 +30 -9
- 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 +1 -1
- package/types/forms.d.ts +1 -1
- package/types/signals-compat.d.ts +1 -1
- package/types/signals.d.ts +4 -4
package/fesm2022/signals.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v22.0.0-next.
|
|
2
|
+
* @license Angular v22.0.0-next.1
|
|
3
3
|
* (c) 2010-2026 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -451,12 +451,24 @@ function validateHttp(path, opts) {
|
|
|
451
451
|
});
|
|
452
452
|
}
|
|
453
453
|
|
|
454
|
-
function debounce(path,
|
|
454
|
+
function debounce(path, config) {
|
|
455
455
|
assertPathIsCurrent(path);
|
|
456
456
|
const pathNode = FieldPathNode.unwrapFieldPath(path);
|
|
457
|
-
const debouncer =
|
|
457
|
+
const debouncer = normalizeDebouncer(config);
|
|
458
458
|
pathNode.builder.addMetadataRule(DEBOUNCER, () => debouncer);
|
|
459
459
|
}
|
|
460
|
+
function normalizeDebouncer(debouncer) {
|
|
461
|
+
if (typeof debouncer === 'function') {
|
|
462
|
+
return debouncer;
|
|
463
|
+
}
|
|
464
|
+
if (debouncer === 'blur') {
|
|
465
|
+
return debounceUntilBlur();
|
|
466
|
+
}
|
|
467
|
+
if (debouncer > 0) {
|
|
468
|
+
return debounceForDuration(debouncer);
|
|
469
|
+
}
|
|
470
|
+
return immediate;
|
|
471
|
+
}
|
|
460
472
|
function debounceForDuration(durationInMilliseconds) {
|
|
461
473
|
return (_context, abortSignal) => {
|
|
462
474
|
return new Promise(resolve => {
|
|
@@ -475,6 +487,15 @@ function debounceForDuration(durationInMilliseconds) {
|
|
|
475
487
|
});
|
|
476
488
|
};
|
|
477
489
|
}
|
|
490
|
+
function debounceUntilBlur() {
|
|
491
|
+
return (_context, abortSignal) => {
|
|
492
|
+
return new Promise(resolve => {
|
|
493
|
+
abortSignal.addEventListener('abort', () => resolve(), {
|
|
494
|
+
once: true
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
};
|
|
498
|
+
}
|
|
478
499
|
function immediate() {}
|
|
479
500
|
|
|
480
501
|
const FORM_FIELD_PARSE_ERRORS = new InjectionToken(typeof ngDevMode !== 'undefined' && ngDevMode ? 'FORM_FIELD_PARSE_ERRORS' : '');
|
|
@@ -1030,7 +1051,7 @@ class FormField {
|
|
|
1030
1051
|
}
|
|
1031
1052
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1032
1053
|
minVersion: "12.0.0",
|
|
1033
|
-
version: "22.0.0-next.
|
|
1054
|
+
version: "22.0.0-next.1",
|
|
1034
1055
|
ngImport: i0,
|
|
1035
1056
|
type: FormField,
|
|
1036
1057
|
deps: [],
|
|
@@ -1038,7 +1059,7 @@ class FormField {
|
|
|
1038
1059
|
});
|
|
1039
1060
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1040
1061
|
minVersion: "17.1.0",
|
|
1041
|
-
version: "22.0.0-next.
|
|
1062
|
+
version: "22.0.0-next.1",
|
|
1042
1063
|
type: FormField,
|
|
1043
1064
|
isStandalone: true,
|
|
1044
1065
|
selector: "[formField]",
|
|
@@ -1070,7 +1091,7 @@ class FormField {
|
|
|
1070
1091
|
}
|
|
1071
1092
|
i0.ɵɵngDeclareClassMetadata({
|
|
1072
1093
|
minVersion: "12.0.0",
|
|
1073
|
-
version: "22.0.0-next.
|
|
1094
|
+
version: "22.0.0-next.1",
|
|
1074
1095
|
ngImport: i0,
|
|
1075
1096
|
type: FormField,
|
|
1076
1097
|
decorators: [{
|
|
@@ -1115,7 +1136,7 @@ class FormRoot {
|
|
|
1115
1136
|
}
|
|
1116
1137
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1117
1138
|
minVersion: "12.0.0",
|
|
1118
|
-
version: "22.0.0-next.
|
|
1139
|
+
version: "22.0.0-next.1",
|
|
1119
1140
|
ngImport: i0,
|
|
1120
1141
|
type: FormRoot,
|
|
1121
1142
|
deps: [],
|
|
@@ -1123,7 +1144,7 @@ class FormRoot {
|
|
|
1123
1144
|
});
|
|
1124
1145
|
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
1125
1146
|
minVersion: "17.1.0",
|
|
1126
|
-
version: "22.0.0-next.
|
|
1147
|
+
version: "22.0.0-next.1",
|
|
1127
1148
|
type: FormRoot,
|
|
1128
1149
|
isStandalone: true,
|
|
1129
1150
|
selector: "form[formRoot]",
|
|
@@ -1149,7 +1170,7 @@ class FormRoot {
|
|
|
1149
1170
|
}
|
|
1150
1171
|
i0.ɵɵngDeclareClassMetadata({
|
|
1151
1172
|
minVersion: "12.0.0",
|
|
1152
|
-
version: "22.0.0-next.
|
|
1173
|
+
version: "22.0.0-next.1",
|
|
1153
1174
|
ngImport: i0,
|
|
1154
1175
|
type: FormRoot,
|
|
1155
1176
|
decorators: [{
|