@angular/forms 14.1.0-next.2 → 14.1.0-rc.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.
Files changed (36) hide show
  1. package/esm2020/src/directives/abstract_form_group_directive.mjs +3 -3
  2. package/esm2020/src/directives/checkbox_value_accessor.mjs +3 -3
  3. package/esm2020/src/directives/control_value_accessor.mjs +6 -6
  4. package/esm2020/src/directives/default_value_accessor.mjs +3 -3
  5. package/esm2020/src/directives/ng_control_status.mjs +6 -6
  6. package/esm2020/src/directives/ng_form.mjs +3 -3
  7. package/esm2020/src/directives/ng_model.mjs +3 -3
  8. package/esm2020/src/directives/ng_model_group.mjs +3 -3
  9. package/esm2020/src/directives/ng_no_validate_directive.mjs +3 -3
  10. package/esm2020/src/directives/number_value_accessor.mjs +3 -3
  11. package/esm2020/src/directives/radio_control_value_accessor.mjs +13 -13
  12. package/esm2020/src/directives/range_value_accessor.mjs +3 -3
  13. package/esm2020/src/directives/reactive_directives/form_control_directive.mjs +3 -3
  14. package/esm2020/src/directives/reactive_directives/form_control_name.mjs +3 -3
  15. package/esm2020/src/directives/reactive_directives/form_group_directive.mjs +3 -3
  16. package/esm2020/src/directives/reactive_directives/form_group_name.mjs +6 -6
  17. package/esm2020/src/directives/reactive_errors.mjs +7 -6
  18. package/esm2020/src/directives/select_control_value_accessor.mjs +9 -9
  19. package/esm2020/src/directives/select_multiple_control_value_accessor.mjs +9 -9
  20. package/esm2020/src/directives/shared.mjs +3 -2
  21. package/esm2020/src/directives/template_driven_errors.mjs +6 -5
  22. package/esm2020/src/directives/validators.mjs +27 -27
  23. package/esm2020/src/directives.mjs +4 -4
  24. package/esm2020/src/errors.mjs +1 -1
  25. package/esm2020/src/form_builder.mjs +10 -16
  26. package/esm2020/src/form_providers.mjs +8 -8
  27. package/esm2020/src/forms.mjs +1 -1
  28. package/esm2020/src/model/abstract_model.mjs +35 -1
  29. package/esm2020/src/validators.mjs +16 -9
  30. package/esm2020/src/version.mjs +1 -1
  31. package/fesm2015/forms.mjs +188 -153
  32. package/fesm2015/forms.mjs.map +1 -1
  33. package/fesm2020/forms.mjs +188 -153
  34. package/fesm2020/forms.mjs.map +1 -1
  35. package/index.d.ts +38 -4
  36. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.2
2
+ * @license Angular v14.1.0-rc.0
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -250,6 +250,24 @@ export declare abstract class AbstractControl<TValue = any, TRawValue extends TV
250
250
  * validator function as the one that was originally set. If a provided validator is not found,
251
251
  * it is ignored.
252
252
  *
253
+ * @usageNotes
254
+ *
255
+ * ### Reference to a ValidatorFn
256
+ *
257
+ * ```
258
+ * // Reference to the RequiredValidator
259
+ * const ctrl = new FormControl<string | null>('', Validators.required);
260
+ * ctrl.removeValidators(Validators.required);
261
+ *
262
+ * // Reference to anonymous function inside MinValidator
263
+ * const minValidator = Validators.min(3);
264
+ * const ctrl = new FormControl<string | null>('', minValidator);
265
+ * expect(ctrl.hasValidator(minValidator)).toEqual(true)
266
+ * expect(ctrl.hasValidator(Validators.min(3)).toEqual(false)
267
+ *
268
+ * ctrl.removeValidators(minValidator);
269
+ * ```
270
+ *
253
271
  * When you add or remove a validator at run time, you must call
254
272
  * `updateValueAndValidity()` for the new validation to take effect.
255
273
  *
@@ -272,6 +290,22 @@ export declare abstract class AbstractControl<TValue = any, TRawValue extends TV
272
290
  * Check whether a synchronous validator function is present on this control. The provided
273
291
  * validator must be a reference to the exact same function that was provided.
274
292
  *
293
+ * @usageNotes
294
+ *
295
+ * ### Reference to a ValidatorFn
296
+ *
297
+ * ```
298
+ * // Reference to the RequiredValidator
299
+ * const ctrl = new FormControl<number | null>(0, Validators.required);
300
+ * expect(ctrl.hasValidator(Validators.required)).toEqual(true)
301
+ *
302
+ * // Reference to anonymous function inside MinValidator
303
+ * const minValidator = Validators.min(3);
304
+ * const ctrl = new FormControl<number | null>(0, minValidator);
305
+ * expect(ctrl.hasValidator(minValidator)).toEqual(true)
306
+ * expect(ctrl.hasValidator(Validators.min(3)).toEqual(false)
307
+ * ```
308
+ *
275
309
  * @param validator The validator to check for presence. Compared by function reference.
276
310
  * @returns Whether the provided validator was found on this control.
277
311
  */
@@ -1074,7 +1108,7 @@ export declare const COMPOSITION_BUFFER_MODE: InjectionToken<boolean>;
1074
1108
  *
1075
1109
  * @publicApi
1076
1110
  */
1077
- declare type ControlConfig<T> = [T | FormControlState<T>, (ValidatorFn | (ValidatorFn[]))?, (AsyncValidatorFn | AsyncValidatorFn[])?];
1111
+ export declare type ControlConfig<T> = [T | FormControlState<T>, (ValidatorFn | (ValidatorFn[]))?, (AsyncValidatorFn | AsyncValidatorFn[])?];
1078
1112
 
1079
1113
  /**
1080
1114
  * @description
@@ -4797,7 +4831,7 @@ export declare class Validators {
4797
4831
  *
4798
4832
  * Tests the value using a [regular
4799
4833
  * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions)
4800
- * pattern suitable for common usecases. The pattern is based on the definition of a valid email
4834
+ * pattern suitable for common use cases. The pattern is based on the definition of a valid email
4801
4835
  * address in the [WHATWG HTML
4802
4836
  * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with
4803
4837
  * some enhancements to incorporate more RFC rules (such as rules related to domain names and the
@@ -5239,7 +5273,7 @@ export declare type ɵOptionalKeys<T> = {
5239
5273
  export declare type ɵRawValue<T extends AbstractControl | undefined> = T extends AbstractControl<any, any> ? (T['setValue'] extends ((v: infer R) => void) ? R : never) : never;
5240
5274
 
5241
5275
  /**
5242
- * Tokenize splits a string literal S by a delimeter D.
5276
+ * Tokenize splits a string literal S by a delimiter D.
5243
5277
  */
5244
5278
  export declare type ɵTokenize<S extends string, D extends string> = string extends S ? string[] : S extends `${infer T}${D}${infer U}` ? [T, ...ɵTokenize<U, D>] : [
5245
5279
  S
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/forms",
3
- "version": "14.1.0-next.2",
3
+ "version": "14.1.0-rc.0",
4
4
  "description": "Angular - directives and services for creating forms",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -11,9 +11,9 @@
11
11
  "tslib": "^2.3.0"
12
12
  },
13
13
  "peerDependencies": {
14
- "@angular/core": "14.1.0-next.2",
15
- "@angular/common": "14.1.0-next.2",
16
- "@angular/platform-browser": "14.1.0-next.2",
14
+ "@angular/core": "14.1.0-rc.0",
15
+ "@angular/common": "14.1.0-rc.0",
16
+ "@angular/platform-browser": "14.1.0-rc.0",
17
17
  "rxjs": "^6.5.3 || ^7.4.0"
18
18
  },
19
19
  "repository": {