@angular/forms 14.1.0-next.1 → 14.1.0-next.4

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 (33) 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 +10 -10
  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 +6 -6
  19. package/esm2020/src/directives/select_multiple_control_value_accessor.mjs +6 -6
  20. package/esm2020/src/directives/validators.mjs +27 -27
  21. package/esm2020/src/directives.mjs +4 -4
  22. package/esm2020/src/errors.mjs +1 -1
  23. package/esm2020/src/form_builder.mjs +10 -16
  24. package/esm2020/src/form_providers.mjs +8 -8
  25. package/esm2020/src/model/abstract_model.mjs +35 -1
  26. package/esm2020/src/validators.mjs +13 -6
  27. package/esm2020/src/version.mjs +1 -1
  28. package/fesm2015/forms.mjs +177 -142
  29. package/fesm2015/forms.mjs.map +1 -1
  30. package/fesm2020/forms.mjs +177 -142
  31. package/fesm2020/forms.mjs.map +1 -1
  32. package/index.d.ts +35 -1
  33. package/package.json +4 -4
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.1.0-next.1
2
+ * @license Angular v14.1.0-next.4
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
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/forms",
3
- "version": "14.1.0-next.1",
3
+ "version": "14.1.0-next.4",
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.1",
15
- "@angular/common": "14.1.0-next.1",
16
- "@angular/platform-browser": "14.1.0-next.1",
14
+ "@angular/core": "14.1.0-next.4",
15
+ "@angular/common": "14.1.0-next.4",
16
+ "@angular/platform-browser": "14.1.0-next.4",
17
17
  "rxjs": "^6.5.3 || ^7.4.0"
18
18
  },
19
19
  "repository": {