@angular/forms 14.1.0-next.0 → 14.1.0-next.3
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/esm2020/src/directives/abstract_form_group_directive.mjs +3 -3
- package/esm2020/src/directives/checkbox_value_accessor.mjs +3 -3
- package/esm2020/src/directives/control_value_accessor.mjs +6 -6
- package/esm2020/src/directives/default_value_accessor.mjs +3 -3
- package/esm2020/src/directives/ng_control_status.mjs +6 -6
- package/esm2020/src/directives/ng_form.mjs +3 -3
- package/esm2020/src/directives/ng_model.mjs +3 -3
- package/esm2020/src/directives/ng_model_group.mjs +3 -3
- package/esm2020/src/directives/ng_no_validate_directive.mjs +3 -3
- package/esm2020/src/directives/number_value_accessor.mjs +3 -3
- package/esm2020/src/directives/radio_control_value_accessor.mjs +10 -10
- package/esm2020/src/directives/range_value_accessor.mjs +3 -3
- package/esm2020/src/directives/reactive_directives/form_control_directive.mjs +3 -3
- package/esm2020/src/directives/reactive_directives/form_control_name.mjs +3 -3
- package/esm2020/src/directives/reactive_directives/form_group_directive.mjs +3 -3
- package/esm2020/src/directives/reactive_directives/form_group_name.mjs +6 -6
- package/esm2020/src/directives/reactive_errors.mjs +7 -6
- package/esm2020/src/directives/select_control_value_accessor.mjs +6 -6
- package/esm2020/src/directives/select_multiple_control_value_accessor.mjs +6 -6
- package/esm2020/src/directives/validators.mjs +27 -27
- package/esm2020/src/directives.mjs +4 -4
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/form_builder.mjs +10 -16
- package/esm2020/src/form_providers.mjs +8 -8
- package/esm2020/src/model/abstract_model.mjs +35 -1
- package/esm2020/src/model/form_group.mjs +3 -3
- package/esm2020/src/validators.mjs +13 -6
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/forms.mjs +179 -144
- package/fesm2015/forms.mjs.map +1 -1
- package/fesm2020/forms.mjs +179 -144
- package/fesm2020/forms.mjs.map +1 -1
- package/index.d.ts +37 -3
- package/package.json +4 -4
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.1.0-next.
|
|
2
|
+
* @license Angular v14.1.0-next.3
|
|
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
|
*/
|
|
@@ -2989,8 +3023,8 @@ declare type FormHooks = 'change' | 'blur' | 'submit';
|
|
|
2989
3023
|
* @usageNotes
|
|
2990
3024
|
*
|
|
2991
3025
|
* ```
|
|
2992
|
-
* let numbers = new FormRecord({bill: '415-123-456'});
|
|
2993
|
-
* numbers.addControl('bob', '415-234-567');
|
|
3026
|
+
* let numbers = new FormRecord({bill: new FormControl('415-123-456')});
|
|
3027
|
+
* numbers.addControl('bob', new FormControl('415-234-567'));
|
|
2994
3028
|
* numbers.removeControl('bill');
|
|
2995
3029
|
* ```
|
|
2996
3030
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/forms",
|
|
3
|
-
"version": "14.1.0-next.
|
|
3
|
+
"version": "14.1.0-next.3",
|
|
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.
|
|
15
|
-
"@angular/common": "14.1.0-next.
|
|
16
|
-
"@angular/platform-browser": "14.1.0-next.
|
|
14
|
+
"@angular/core": "14.1.0-next.3",
|
|
15
|
+
"@angular/common": "14.1.0-next.3",
|
|
16
|
+
"@angular/platform-browser": "14.1.0-next.3",
|
|
17
17
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|