@angular/forms 21.0.0-next.4 → 21.0.0-next.6

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v21.0.0-next.4
2
+ * @license Angular v21.0.0-next.6
3
3
  * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1072,6 +1072,7 @@ function assertPathIsCurrent(path) {
1072
1072
  * Represents a property that may be defined on a field when it is created using a `property` rule
1073
1073
  * in the schema. A particular `Property` can only be defined on a particular field **once**.
1074
1074
  *
1075
+ * @category logic
1075
1076
  * @experimental 21.0.0
1076
1077
  */
1077
1078
  class Property {
@@ -1175,36 +1176,42 @@ function andProperty() {
1175
1176
  /**
1176
1177
  * An aggregate property representing whether the field is required.
1177
1178
  *
1179
+ * @category validation
1178
1180
  * @experimental 21.0.0
1179
1181
  */
1180
1182
  const REQUIRED = orProperty();
1181
1183
  /**
1182
1184
  * An aggregate property representing the min value of the field.
1183
1185
  *
1186
+ * @category validation
1184
1187
  * @experimental 21.0.0
1185
1188
  */
1186
1189
  const MIN = maxProperty();
1187
1190
  /**
1188
1191
  * An aggregate property representing the max value of the field.
1189
1192
  *
1193
+ * @category validation
1190
1194
  * @experimental 21.0.0
1191
1195
  */
1192
1196
  const MAX = minProperty();
1193
1197
  /**
1194
1198
  * An aggregate property representing the min length of the field.
1195
1199
  *
1200
+ * @category validation
1196
1201
  * @experimental 21.0.0
1197
1202
  */
1198
1203
  const MIN_LENGTH = maxProperty();
1199
1204
  /**
1200
1205
  * An aggregate property representing the max length of the field.
1201
1206
  *
1207
+ * @category validation
1202
1208
  * @experimental 21.0.0
1203
1209
  */
1204
1210
  const MAX_LENGTH = minProperty();
1205
1211
  /**
1206
1212
  * An aggregate property representing the patterns the field must match.
1207
1213
  *
1214
+ * @category validation
1208
1215
  * @experimental 21.0.0
1209
1216
  */
1210
1217
  const PATTERN = listProperty();
@@ -1219,6 +1226,7 @@ const PATTERN = listProperty();
1219
1226
  * @template TValue The type of value stored in the field the logic is bound to.
1220
1227
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1221
1228
  *
1229
+ * @category logic
1222
1230
  * @experimental 21.0.0
1223
1231
  */
1224
1232
  function disabled(path, logic) {
@@ -1247,6 +1255,7 @@ function disabled(path, logic) {
1247
1255
  * @template TValue The type of value stored in the field the logic is bound to.
1248
1256
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1249
1257
  *
1258
+ * @category logic
1250
1259
  * @experimental 21.0.0
1251
1260
  */
1252
1261
  function readonly(path, logic = () => true) {
@@ -1271,6 +1280,7 @@ function readonly(path, logic = () => true) {
1271
1280
  * @template TValue The type of value stored in the field the logic is bound to.
1272
1281
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1273
1282
  *
1283
+ * @category logic
1274
1284
  * @experimental 21.0.0
1275
1285
  */
1276
1286
  function hidden(path, logic) {
@@ -1286,6 +1296,7 @@ function hidden(path, logic) {
1286
1296
  * @template TValue The type of value stored in the field the logic is bound to.
1287
1297
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1288
1298
  *
1299
+ * @category logic
1289
1300
  * @experimental 21.0.0
1290
1301
  */
1291
1302
  function validate(path, logic) {
@@ -1302,6 +1313,7 @@ function validate(path, logic) {
1302
1313
  * @template TValue The type of value stored in the field the logic is bound to.
1303
1314
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1304
1315
  *
1316
+ * @category logic
1305
1317
  * @experimental 21.0.0
1306
1318
  */
1307
1319
  function validateTree(path, logic) {
@@ -1319,6 +1331,7 @@ function validateTree(path, logic) {
1319
1331
  * @template TPropItem The type of value the property aggregates over.
1320
1332
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
1321
1333
  *
1334
+ * @category logic
1322
1335
  * @experimental 21.0.0
1323
1336
  */
1324
1337
  function aggregateProperty(path, prop, logic) {
@@ -1353,6 +1366,7 @@ function property(path, ...rest) {
1353
1366
  * @template TResult The type of result returned by the resource
1354
1367
  * @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
1355
1368
  *
1369
+ * @category validation
1356
1370
  * @experimental 21.0.0
1357
1371
  */
1358
1372
  function validateAsync(path, opts) {
@@ -1400,6 +1414,7 @@ function validateAsync(path, opts) {
1400
1414
  * @template TResult The type of result returned by the httpResource
1401
1415
  * @template TPathKind The kind of path being validated (a root path, child path, or item of an array)
1402
1416
  *
1417
+ * @category validation
1403
1418
  * @experimental 21.0.0
1404
1419
  */
1405
1420
  function validateHttp(path, opts) {
@@ -1542,6 +1557,7 @@ function isInputSignal(value) {
1542
1557
  * forms `NgControl`. This is provided to improve interoperability with controls designed to work
1543
1558
  * with reactive forms. It should not be used by controls written for signal forms.
1544
1559
  *
1560
+ * @category control
1545
1561
  * @experimental 21.0.0
1546
1562
  */
1547
1563
  class Control {
@@ -1857,15 +1873,15 @@ class Control {
1857
1873
  }
1858
1874
  };
1859
1875
  }
1860
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.4", ngImport: i0, type: Control, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1861
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.0-next.4", type: Control, isStandalone: true, selector: "[control]", inputs: { _field: ["control", "_field"] }, providers: [
1876
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0-next.6", ngImport: i0, type: Control, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1877
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.0-next.6", type: Control, isStandalone: true, selector: "[control]", inputs: { _field: ["control", "_field"] }, providers: [
1862
1878
  {
1863
1879
  provide: NgControl,
1864
1880
  useFactory: () => inject(Control).ngControl,
1865
1881
  },
1866
1882
  ], ngImport: i0 });
1867
1883
  }
1868
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.4", ngImport: i0, type: Control, decorators: [{
1884
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0-next.6", ngImport: i0, type: Control, decorators: [{
1869
1885
  type: Directive,
1870
1886
  args: [{
1871
1887
  selector: '[control]',
@@ -2445,10 +2461,11 @@ class FieldSubmitState {
2445
2461
  serverErrors;
2446
2462
  constructor(node) {
2447
2463
  this.node = node;
2448
- this.serverErrors = linkedSignal({
2449
- source: this.node.structure.value,
2450
- computation: () => [],
2451
- });
2464
+ this.serverErrors = linkedSignal(...(ngDevMode ? [{ debugName: "serverErrors", source: this.node.structure.value,
2465
+ computation: () => [] }] : [{
2466
+ source: this.node.structure.value,
2467
+ computation: () => [],
2468
+ }]));
2452
2469
  }
2453
2470
  /**
2454
2471
  * Whether this form is currently in the process of being submitted.
@@ -2900,6 +2917,7 @@ function form(...args) {
2900
2917
  * element of the array.
2901
2918
  * @template TValue The data type of the item field to apply the schema to.
2902
2919
  *
2920
+ * @category structure
2903
2921
  * @experimental 21.0.0
2904
2922
  */
2905
2923
  function applyEach(path, schema) {
@@ -2925,6 +2943,7 @@ function applyEach(path, schema) {
2925
2943
  * @param schema The schema to apply to the property
2926
2944
  * @template TValue The data type of the field to apply the schema to.
2927
2945
  *
2946
+ * @category structure
2928
2947
  * @experimental 21.0.0
2929
2948
  */
2930
2949
  function apply(path, schema) {
@@ -2940,6 +2959,7 @@ function apply(path, schema) {
2940
2959
  * @param schema The schema to apply to the field when the `logic` function returns `true`.
2941
2960
  * @template TValue The data type of the field to apply the schema to.
2942
2961
  *
2962
+ * @category structure
2943
2963
  * @experimental 21.0.0
2944
2964
  */
2945
2965
  function applyWhen(path, logic, schema) {
@@ -2981,6 +3001,7 @@ function applyWhenValue(path, predicate, schema) {
2981
3001
  * errors.
2982
3002
  * @template TValue The data type of the field being submitted.
2983
3003
  *
3004
+ * @category submission
2984
3005
  * @experimental 21.0.0
2985
3006
  */
2986
3007
  async function submit(form, action) {
@@ -3030,6 +3051,7 @@ function setServerErrors(submittedField, errors) {
3030
3051
  * @returns A schema object that implements the given logic.
3031
3052
  * @template TValue The value type of a `Field` that this schema binds to.
3032
3053
  *
3054
+ * @category structure
3033
3055
  * @experimental 21.0.0
3034
3056
  */
3035
3057
  function schema(fn) {
@@ -3073,6 +3095,7 @@ function customError(obj) {
3073
3095
  /**
3074
3096
  * A custom error that may contain additional properties
3075
3097
  *
3098
+ * @category validation
3076
3099
  * @experimental 21.0.0
3077
3100
  */
3078
3101
  class CustomValidationError {
@@ -3114,6 +3137,7 @@ class _NgValidationError {
3114
3137
  /**
3115
3138
  * An error used to indicate that a required field is empty.
3116
3139
  *
3140
+ * @category validation
3117
3141
  * @experimental 21.0.0
3118
3142
  */
3119
3143
  class RequiredValidationError extends _NgValidationError {
@@ -3122,6 +3146,7 @@ class RequiredValidationError extends _NgValidationError {
3122
3146
  /**
3123
3147
  * An error used to indicate that a value is lower than the minimum allowed.
3124
3148
  *
3149
+ * @category validation
3125
3150
  * @experimental 21.0.0
3126
3151
  */
3127
3152
  class MinValidationError extends _NgValidationError {
@@ -3135,6 +3160,7 @@ class MinValidationError extends _NgValidationError {
3135
3160
  /**
3136
3161
  * An error used to indicate that a value is higher than the maximum allowed.
3137
3162
  *
3163
+ * @category validation
3138
3164
  * @experimental 21.0.0
3139
3165
  */
3140
3166
  class MaxValidationError extends _NgValidationError {
@@ -3148,6 +3174,7 @@ class MaxValidationError extends _NgValidationError {
3148
3174
  /**
3149
3175
  * An error used to indicate that a value is shorter than the minimum allowed length.
3150
3176
  *
3177
+ * @category validation
3151
3178
  * @experimental 21.0.0
3152
3179
  */
3153
3180
  class MinLengthValidationError extends _NgValidationError {
@@ -3161,6 +3188,7 @@ class MinLengthValidationError extends _NgValidationError {
3161
3188
  /**
3162
3189
  * An error used to indicate that a value is longer than the maximum allowed length.
3163
3190
  *
3191
+ * @category validation
3164
3192
  * @experimental 21.0.0
3165
3193
  */
3166
3194
  class MaxLengthValidationError extends _NgValidationError {
@@ -3174,6 +3202,7 @@ class MaxLengthValidationError extends _NgValidationError {
3174
3202
  /**
3175
3203
  * An error used to indicate that a value does not match the required pattern.
3176
3204
  *
3205
+ * @category validation
3177
3206
  * @experimental 21.0.0
3178
3207
  */
3179
3208
  class PatternValidationError extends _NgValidationError {
@@ -3187,6 +3216,7 @@ class PatternValidationError extends _NgValidationError {
3187
3216
  /**
3188
3217
  * An error used to indicate that a value is not a valid email.
3189
3218
  *
3219
+ * @category validation
3190
3220
  * @experimental 21.0.0
3191
3221
  */
3192
3222
  class EmailValidationError extends _NgValidationError {
@@ -3195,6 +3225,7 @@ class EmailValidationError extends _NgValidationError {
3195
3225
  /**
3196
3226
  * An error used to indicate an issue validating against a standard schema.
3197
3227
  *
3228
+ * @category validation
3198
3229
  * @experimental 21.0.0
3199
3230
  */
3200
3231
  class StandardSchemaValidationError extends _NgValidationError {
@@ -3227,6 +3258,7 @@ class StandardSchemaValidationError extends _NgValidationError {
3227
3258
  * }
3228
3259
  * ```
3229
3260
  *
3261
+ * @category validation
3230
3262
  * @experimental 21.0.0
3231
3263
  */
3232
3264
  const NgValidationError = _NgValidationError;
@@ -3298,6 +3330,7 @@ const EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(
3298
3330
  * or a function that receives the `FieldContext` and returns custom validation error(s).
3299
3331
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3300
3332
  *
3333
+ * @category validation
3301
3334
  * @experimental 21.0.0
3302
3335
  */
3303
3336
  function email(path, config) {
@@ -3330,6 +3363,7 @@ function email(path, config) {
3330
3363
  * or a function that receives the `FieldContext` and returns custom validation error(s).
3331
3364
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3332
3365
  *
3366
+ * @category validation
3333
3367
  * @experimental 21.0.0
3334
3368
  */
3335
3369
  function max(path, maxValue, config) {
@@ -3369,6 +3403,7 @@ function max(path, maxValue, config) {
3369
3403
  * @template TValue The type of value stored in the field the logic is bound to.
3370
3404
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3371
3405
  *
3406
+ * @category validation
3372
3407
  * @experimental 21.0.0
3373
3408
  */
3374
3409
  function maxLength(path, maxLength, config) {
@@ -3407,6 +3442,7 @@ function maxLength(path, maxLength, config) {
3407
3442
  * or a function that receives the `FieldContext` and returns custom validation error(s).
3408
3443
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3409
3444
  *
3445
+ * @category validation
3410
3446
  * @experimental 21.0.0
3411
3447
  */
3412
3448
  function min(path, minValue, config) {
@@ -3446,6 +3482,7 @@ function min(path, minValue, config) {
3446
3482
  * @template TValue The type of value stored in the field the logic is bound to.
3447
3483
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3448
3484
  *
3485
+ * @category validation
3449
3486
  * @experimental 21.0.0
3450
3487
  */
3451
3488
  function minLength(path, minLength, config) {
@@ -3483,6 +3520,7 @@ function minLength(path, minLength, config) {
3483
3520
  * or a function that receives the `FieldContext` and returns custom validation error(s).
3484
3521
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3485
3522
  *
3523
+ * @category validation
3486
3524
  * @experimental 21.0.0
3487
3525
  */
3488
3526
  function pattern(path, pattern, config) {
@@ -3522,6 +3560,7 @@ function pattern(path, pattern, config) {
3522
3560
  * @template TValue The type of value stored in the field the logic is bound to.
3523
3561
  * @template TPathKind The kind of path the logic is bound to (a root path, child path, or item of an array)
3524
3562
  *
3563
+ * @category validation
3525
3564
  * @experimental 21.0.0
3526
3565
  */
3527
3566
  function required(path, config) {
@@ -3551,6 +3590,7 @@ function required(path, config) {
3551
3590
  * or a partial of it.
3552
3591
  * @template TValue The type of value stored in the field being validated.
3553
3592
  *
3593
+ * @category validation
3554
3594
  * @experimental 21.0.0
3555
3595
  */
3556
3596
  function validateStandardSchema(path, schema) {