@vcd/sdk 15.0.3 → 15.0.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.
@@ -1,20 +1,20 @@
1
1
  open_source_licenses.txt
2
2
 
3
- @vcd/sdk 15.0.3 GA
3
+ @vcd/sdk 15.0.4 GA
4
4
  ======================================================================
5
5
 
6
6
  The following copyright statements and licenses apply to various open
7
- source software packages (or portions thereof) that are distributed with
8
- this VMware Product.
7
+ source software packages (or portions thereof) that are included in
8
+ this VMware service.
9
9
 
10
- The VMware Product may also include other VMware components, which may
10
+ The VMware service may also include other VMware components, which may
11
11
  contain additional open source software packages. One or more such
12
12
  open_source_licenses.txt files may therefore accompany this VMware
13
- Product.
13
+ service.
14
14
 
15
- The VMware Product that includes this file does not necessarily use all
16
- the open source software packages referred to below and may also only
17
- use portions of a given package.
15
+ The VMware service that includes this file does not necessarily use all the open
16
+ source software packages referred to below and may also only use portions of a
17
+ given package.
18
18
 
19
19
  ==================== TABLE OF CONTENTS ====================
20
20
 
@@ -23,6 +23,7 @@ this document. This list is provided for your convenience; please read
23
23
  further if you wish to review the copyright notice(s) and the full text
24
24
  of the license associated with each component.
25
25
 
26
+
26
27
  SECTION 1: Apache License, V2.0
27
28
 
28
29
  >>> rxjs-7.8.0
@@ -22468,15 +22469,15 @@ Permission to use, copy, modify, and/or distribute this software for any
22468
22469
  * Use of this source code is governed by an MIT-style license that can be
22469
22470
  * found in the LICENSE file at https://angular.io/license
22470
22471
  -------------------- SECTION 6 --------------------
22471
- Permission to use, copy, modify, and/or distribute this software for any
22472
- purpose with or without fee is hereby granted.
22473
-
22474
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22475
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22476
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22477
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22478
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22479
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22472
+ Permission to use, copy, modify, and/or distribute this software for any
22473
+ purpose with or without fee is hereby granted.
22474
+
22475
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22476
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22477
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22478
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22479
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22480
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22480
22481
  PERFORMANCE OF THIS SOFTWARE.
22481
22482
  -------------------- SECTION 7 --------------------
22482
22483
  Permission to use, copy, modify, and/or distribute this software for any
@@ -22495,15 +22496,15 @@ license
22495
22496
  -------------------- SECTION 9 --------------------
22496
22497
  the Apache License
22497
22498
  -------------------- SECTION 10 --------------------
22498
- Permission to use, copy, modify, and/or distribute this software for any
22499
- purpose with or without fee is hereby granted.
22500
-
22501
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22502
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22503
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22504
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22505
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22506
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22499
+ Permission to use, copy, modify, and/or distribute this software for any
22500
+ purpose with or without fee is hereby granted.
22501
+
22502
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
22503
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
22504
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
22505
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22506
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22507
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22507
22508
  PERFORMANCE OF THIS SOFTWARE.
22508
22509
  -------------------- SECTION 11 --------------------
22509
22510
  Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */
@@ -22580,6 +22581,9 @@ Use of this source code is governed by an MIT-style license that can be * found
22580
22581
  {"version":3,"file":"forms.mjs","sources":["../../../../../../packages/forms/src/directives/control_value_accessor.ts","../../../../../../packages/forms/src/directives/checkbox_value_accessor.ts","../../../../../../packages/forms/src/directives/default_value_accessor.ts","../../../../../../packages/forms/src/validators.ts","../../../../../../packages/forms/src/directives/abstract_control_directive.ts","../../../../../../packages/forms/src/directives/ng_control.ts","../../../../../../packages/forms/src/directives/control_container.ts","../../../../../../packages/forms/src/directives/ng_control_status.ts","../../../../../../packages/forms/src/directives/error_examples.ts","../../../../../../packages/forms/src/directives/reactive_errors.ts","../../../../../../packages/forms/src/model/abstract_model.ts","../../../../../../packages/forms/src/model/form_group.ts","../../../../../../packages/forms/src/directives/shared.ts","../../../../../../packages/forms/src/directives/ng_form.ts","../../../../../../packages/forms/src/util.ts","../../../../../../packages/forms/src/model/form_control.ts","../../../../../../packages/forms/src/directives/abstract_form_group_directive.ts","../../../../../../packages/forms/src/directives/template_driven_errors.ts","../../../../../../packages/forms/src/directives/ng_model_group.ts","../../../../../../packages/forms/src/directives/ng_model.ts","../../../../../../packages/forms/src/directives/ng_no_validate_directive.ts","../../../../../../packages/forms/src/directives/number_value_accessor.ts","../../../../../../packages/forms/src/directives/radio_control_value_accessor.ts","../../../../../../packages/forms/src/directives/range_value_accessor.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_control_directive.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_group_directive.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_group_name.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_control_name.ts","../../../../../../packages/forms/src/directives/select_control_value_accessor.ts","../../../../../../packages/forms/src/directives/select_multiple_control_value_accessor.ts","../../../../../../packages/forms/src/directives/validators.ts","../../../../../../packages/forms/src/directives.ts","../../../../../../packages/forms/src/model/form_array.ts","../../../../../../packages/forms/src/form_builder.ts","../../../../../../packages/forms/src/version.ts","../../../../../../packages/forms/src/form_providers.ts","../../../../../../packages/forms/src/forms.ts","../../../../../../packages/forms/public_api.ts","../../../../../../packages/forms/index.ts","../../../../../../packages/forms/forms.ts"],"sourcesContent":["/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, InjectionToken, Renderer2} from '@angular/core'; /** * @description * Defines an interface that acts as a bridge between the Angular forms API and a * native element in the DOM. * * Implement this interface to create a custom form control directive * that integrates with Angular forms. * * @see DefaultValueAccessor * * @publicApi */ export interface ControlValueAccessor { /** * @description * Writes a new value to the element. * * This method is called by the forms API to write to the view when programmatic * changes from model to view are requested. * * @usageNotes * ### Write a value to the element * * The following example writes a value to the native DOM element. * * ```ts * writeValue(value: any): void { * this._renderer.setProperty(this._elementRef.nativeElement, 'value', value); * } * ``` * * @param obj The new value for the element */ writeValue(obj: any): void; /** * @description * Registers a callback function that is called when the control's value * changes in the UI. * * This method is called by the forms API on initialization to update the form * model when values propagate from the view to the model. * * When implementing the `registerOnChange` method in your own value accessor, * save the given function so your class calls it at the appropriate time. * * @usageNotes * ### Store the change function * * The following example stores the provided function as an internal method. * * ```ts * registerOnChange(fn: (_: any) => void): void { * this._onChange = fn; * } * ``` * * When the value changes in the UI, call the registered * function to allow the forms API to update itself: * * ```ts * host: { * '(change)': '_onChange($event.target.value)' * } * ``` * * @param fn The callback function to register */ registerOnChange(fn: any): void; /** * @description * Registers a callback function that is called by the forms API on initialization * to update the form model on blur. * * When implementing `registerOnTouched` in your own value accessor, save the given * function so your class calls it when the control should be considered * blurred or \"touched\". * * @usageNotes * ### Store the callback function * * The following example stores the provided function as an internal method. * * ```ts * registerOnTouched(fn: any): void { * this._onTouched = fn; * } * ``` * * On blur (or equivalent), your class should call the registered function to allow * the forms API to update itself: * * ```ts * host: { * '(blur)': '_onTouched()' * } * ``` * * @param fn The callback function to register */ registerOnTouched(fn: any): void; /** * @description * Function that is called by the forms API when the control status changes to * or from 'DISABLED'. Depending on the status, it enables or disables the * appropriate DOM element. * * @usageNotes * The following is an example of writing the disabled property to a native DOM element: * * ```ts * setDisabledState(isDisabled: boolean): void { * this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); * } * ``` * * @param isDisabled The disabled status to set on the element */ setDisabledState?(isDisabled: boolean): void; } /** * Base class for all ControlValueAccessor classes defined in Forms package. * Contains common logic and utility functions. * * Note: this is an *internal-only* class and should not be extended or used directly in * applications code. */ @Directive() export class BaseControlValueAccessor { /** * The registered callback function called when a change or input event occurs on the input * element. * @nodoc */ onChange = (_: any) => {}; /** * The registered callback function called when a blur event occurs on the input element. * @nodoc */ onTouched = () => {}; constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {} /** * Helper method that sets a property on a target element using the current Renderer * implementation. * @nodoc */ protected setProperty(key: string, value: any): void { this._renderer.setProperty(this._elementRef.nativeElement, key, value); } /** * Registers a function called when the control is touched. * @nodoc */ registerOnTouched(fn: () => void): void { this.onTouched = fn; } /** * Registers a function called when the control value changes. * @nodoc */ registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; } /** * Sets the \"disabled\" property on the range input element. * @nodoc */ setDisabledState(isDisabled: boolean): void { this.setProperty('disabled', isDisabled); } } /** * Base class for all built-in ControlValueAccessor classes (except DefaultValueAccessor, which is * used in case no other CVAs can be found). We use this class to distinguish between default CVA, * built-in CVAs and custom CVAs, so that Forms logic can recognize built-in CVAs and treat custom * ones with higher priority (when both built-in and custom CVAs are present). * * Note: this is an *internal-only* class and should not be extended or used directly in * applications code. */ @Directive() export class BuiltInControlValueAccessor extends BaseControlValueAccessor { } /** * Used to provide a `ControlValueAccessor` for form controls. * * See `DefaultValueAccessor` for how to implement one. * * @publicApi */ export const NG_VALUE_ACCESSOR = new InjectionToken<ReadonlyArray<ControlValueAccessor>>('NgValueAccessor'); ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const CHECKBOX_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true, }; /** * @description * A `ControlValueAccessor` for writing a value and listening to changes on a checkbox input * element. * * @usageNotes * * ### Using a checkbox with a reactive form. * * The following example shows how to use a checkbox with a reactive form. * * ```ts * const rememberLoginControl = new FormControl(); * ``` * * ``` * <input type=\"checkbox\" [formControl]=\"rememberLoginControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]', host: {'(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()'}, providers: [CHECKBOX_VALUE_ACCESSOR] }) export class CheckboxControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"checked\" property on the input element. * @nodoc */ writeValue(value: any): void { this.setProperty('checked', value); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵgetDOM as getDOM} from '@angular/common'; import {Directive, ElementRef, forwardRef, Inject, InjectionToken, Optional, Renderer2} from '@angular/core'; import {BaseControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; export const DEFAULT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DefaultValueAccessor), multi: true }; /** * We must check whether the agent is Android because composition events * behave differently between iOS and Android. */ function _isAndroid(): boolean { const userAgent = getDOM() ? getDOM().getUserAgent() : ''; return /android (\\d+)/.test(userAgent.toLowerCase()); } /** * @description * Provide this token to control if form directives buffer IME input until * the \"compositionend\" event occurs. * @publicApi */ export const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>('CompositionEventMode'); /** * The default `ControlValueAccessor` for writing a value and listening to changes on input * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * {@searchKeywords ngDefaultControl} * * @usageNotes * * ### Using the default value accessor * * The following example shows how to use an input element that activates the default value accessor * (in this case, a text field). * * ```ts * const firstNameControl = new FormControl(); * ``` * * ``` * <input type=\"text\" [formControl]=\"firstNameControl\"> * ``` * * This value accessor is used by default for `<input type=\"text\">` and `<textarea>` elements, but * you could also use it for custom components that have similar behavior and do not require special * processing. In order to attach the default value accessor to a custom element, add the * `ngDefaultControl` attribute as shown below. * * ``` * <custom-input-component ngDefaultControl [(ngModel)]=\"value\"></custom-input-component> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]', // TODO: vsavkin replace the above selector with the one below it once // https://github.com/angular/angular/issues/3011 is implemented // selector: '[ngModel],[formControl],[formControlName]', host: { '(input)': '$any(this)._handleInput($event.target.value)', '(blur)': 'onTouched()', '(compositionstart)': '$any(this)._compositionStart()', '(compositionend)': '$any(this)._compositionEnd($event.target.value)' }, providers: [DEFAULT_VALUE_ACCESSOR] }) export class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor { /** Whether the user is creating a composition string (IME events). */ private _composing = false; constructor( renderer: Renderer2, elementRef: ElementRef, @Optional() @Inject(COMPOSITION_BUFFER_MODE) private _compositionMode: boolean) { super(renderer, elementRef); if (this._compositionMode == null) { this._compositionMode = !_isAndroid(); } } /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: any): void { const normalizedValue = value == null ? '' : value; this.setProperty('value', normalizedValue); } /** @internal */ _handleInput(value: any): void { if (!this._compositionMode || (this._compositionMode && !this._composing)) { this.onChange(value); } } /** @internal */ _compositionStart(): void { this._composing = true; } /** @internal */ _compositionEnd(value: any): void { this._composing = false; this._compositionMode && this.onChange(value); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {InjectionToken, ɵisObservable as isObservable, ɵisPromise as isPromise, ɵRuntimeError as RuntimeError} from '@angular/core'; import {forkJoin, from, Observable} from 'rxjs'; import {map} from 'rxjs/operators'; import {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './directives/validators'; import {RuntimeErrorCode} from './errors'; import {AbstractControl} from './model/abstract_model'; const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; function isEmptyInputValue(value: any): boolean { /** * Check if the object is a string or array before evaluating the length attribute. * This avoids falsely rejecting objects that contain a custom length attribute. * For example, the object {id: 1, length: 0, width: 0} should not be returned as empty. */ return value == null || ((typeof value === 'string' || Array.isArray(value)) && value.length === 0); } function hasValidLength(value: any): boolean { // non-strict comparison is intentional, to check for both `null` and `undefined` values return value != null && typeof value.length === 'number'; } /** * @description * An `InjectionToken` for registering additional synchronous validators used with * `AbstractControl`s. * * @see `NG_ASYNC_VALIDATORS` * * @usageNotes * * ### Providing a custom validator * * The following example registers a custom validator directive. Adding the validator to the * existing collection of validators requires the `multi: true` option. * * ```typescript * @Directive({ * selector: '[customValidator]', * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] * }) * class CustomValidatorDirective implements Validator { * validate(control: AbstractControl): ValidationErrors | null { * return { 'custom': true }; * } * } * ``` * * @publicApi */ export const NG_VALIDATORS = new InjectionToken<Array<Validator|Function>>('NgValidators'); /** * @description * An `InjectionToken` for registering additional asynchronous validators used with * `AbstractControl`s. * * @see `NG_VALIDATORS` * * @usageNotes * * ### Provide a custom async validator directive * * The following example implements the `AsyncValidator` interface to create an * async validator directive with a custom error key. * * ```typescript * @Directive({ * selector: '[customAsyncValidator]', * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi: * true}] * }) * class CustomAsyncValidatorDirective implements AsyncValidator { * validate(control: AbstractControl): Promise<ValidationErrors|null> { * return Promise.resolve({'custom': true}); * } * } * ``` * * @publicApi */ export const NG_ASYNC_VALIDATORS = new InjectionToken<Array<Validator|Function>>('NgAsyncValidators'); /** * A regular expression that matches valid e-mail addresses. * * At a high level, this regexp matches e-mail addresses of the format `local-part@tld`, where: * - `local-part` consists of one or more of the allowed characters (alphanumeric and some * punctuation symbols). * - `local-part` cannot begin or end with a period (`.`). * - `local-part` cannot be longer than 64 characters. * - `tld` consists of one or more `labels` separated by periods (`.`). For example `localhost` or * `foo.com`. * - A `label` consists of one or more of the allowed characters (alphanumeric, dashes (`-`) and * periods (`.`)). * - A `label` cannot begin or end with a dash (`-`) or a period (`.`). * - A `label` cannot be longer than 63 characters. * - The whole address cannot be longer than 254 characters. * * ## Implementation background * * This regexp was ported over from AngularJS (see there for git history): * https://github.com/angular/angular.js/blob/c133ef836/src/ng/directive/input.js#L27 * It is based on the * [WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with * some enhancements to incorporate more RFC rules (such as rules related to domain names and the * lengths of different parts of the address). The main differences from the WHATWG version are: * - Disallow `local-part` to begin or end with a period (`.`). * - Disallow `local-part` length to exceed 64 characters. * - Disallow total address length to exceed 254 characters. * * See [this commit](https://github.com/angular/angular.js/commit/f3f5cf72e) for more details. */ const EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; /** * @description * Provides a set of built-in validators that can be used by form controls. * * A validator is a function that processes a `FormControl` or collection of * controls and returns an error map or null. A null map means that validation has passed. * * @see [Form Validation](/guide/form-validation) * * @publicApi */ export class Validators { /** * @description * Validator that requires the control's value to be greater than or equal to the provided number. * * @usageNotes * * ### Validate against a minimum of 3 * * ```typescript * const control = new FormControl(2, Validators.min(3)); * * console.log(control.errors); // {min: {min: 3, actual: 2}} * ``` * * @returns A validator function that returns an error map with the * `min` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static min(min: number): ValidatorFn { return minValidator(min); } /** * @description * Validator that requires the control's value to be less than or equal to the provided number. * * @usageNotes * * ### Validate against a maximum of 15 * * ```typescript * const control = new FormControl(16, Validators.max(15)); * * console.log(control.errors); // {max: {max: 15, actual: 16}} * ``` * * @returns A validator function that returns an error map with the * `max` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static max(max: number): ValidatorFn { return maxValidator(max); } /** * @description * Validator that requires the control have a non-empty value. * * @usageNotes * * ### Validate that the field is non-empty * * ```typescript * const control = new FormControl('', Validators.required); * * console.log(control.errors); // {required: true} * ``` * * @returns An error map with the `required` property * if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static required(control: AbstractControl): ValidationErrors|null { return requiredValidator(control); } /** * @description * Validator that requires the control's value be true. This validator is commonly * used for required checkboxes. * * @usageNotes * * ### Validate that the field value is true * * ```typescript * const control = new FormControl('some value', Validators.requiredTrue); * * console.log(control.errors); // {required: true} * ``` * * @returns An error map that contains the `required` property * set to `true` if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static requiredTrue(control: AbstractControl): ValidationErrors|null { return requiredTrueValidator(control); } /** * @description * Validator that requires the control's value pass an email validation test. * * Tests the value using a [regular * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) * pattern suitable for common use cases. The pattern is based on the definition of a valid email * address in the [WHATWG HTML * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with * some enhancements to incorporate more RFC rules (such as rules related to domain names and the * lengths of different parts of the address). * * The differences from the WHATWG version include: * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`). * - Disallow `local-part` to be longer than 64 characters. * - Disallow the whole address to be longer than 254 characters. * * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to * validate the value against a different pattern. * * @usageNotes * * ### Validate that the field matches a valid email pattern * * ```typescript * const control = new FormControl('bad@', Validators.email); * * console.log(control.errors); // {email: true} * ``` * * @returns An error map with the `email` property * if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static email(control: AbstractControl): ValidationErrors|null { return emailValidator(control); } /** * @description * Validator that requires the length of the control's value to be greater than or equal * to the provided minimum length. This validator is also provided by default if you use the * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used * only for types that have a numeric `length` property, such as strings or arrays. The * `minLength` validator logic is also not invoked for values when their `length` property is 0 * (for example in case of an empty string or an empty array), to support optional controls. You * can use the standard `required` validator if empty values should not be considered valid. * * @usageNotes * * ### Validate that the field has a minimum of 3 characters * * ```typescript * const control = new FormControl('ng', Validators.minLength(3)); * * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}} * ``` * * ```html * <input minlength=\"5\"> * ``` * * @returns A validator function that returns an error map with the * `minlength` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static minLength(minLength: number): ValidatorFn { return minLengthValidator(minLength); } /** * @description * Validator that requires the length of the control's value to be less than or equal * to the provided maximum length. This validator is also provided by default if you use the * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used * only for types that have a numeric `length` property, such as strings or arrays. * * @usageNotes * * ### Validate that the field has maximum of 5 characters * * ```typescript * const control = new FormControl('Angular', Validators.maxLength(5)); * * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}} * ``` * * ```html * <input maxlength=\"5\"> * ``` * * @returns A validator function that returns an error map with the * `maxlength` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static maxLength(maxLength: number): ValidatorFn { return maxLengthValidator(maxLength); } /** * @description * Validator that requires the control's value to match a regex pattern. This validator is also * provided by default if you use the HTML5 `pattern` attribute. * * @usageNotes * * ### Validate that the field only contains letters or spaces * * ```typescript * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*')); * * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}} * ``` * * ```html * <input pattern=\"[a-zA-Z ]*\"> * ``` * * ### Pattern matching with the global or sticky flag * * `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern` * can produce different results on the same input when validations are run consecutively. This is * due to how the behavior of `RegExp.prototype.test` is * specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec) * (`RegExp` preserves the index of the last match when the global or sticky flag is used). * Due to this behavior, it is recommended that when using * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky * flag enabled. * * ```typescript * // Not recommended (since the `g` flag is used) * const controlOne = new FormControl('1', Validators.pattern(/foo/g)); * * // Good * const controlTwo = new FormControl('1', Validators.pattern(/foo/)); * ``` * * @param pattern A regular expression to be used as is to test the values, or a string. * If a string is passed, the `^` character is prepended and the `$` character is * appended to the provided string (if not already present), and the resulting regular * expression is used to test the values. * * @returns A validator function that returns an error map with the * `pattern` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static pattern(pattern: string|RegExp): ValidatorFn { return patternValidator(pattern); } /** * @description * Validator that performs no operation. * * @see `updateValueAndValidity()` * */ static nullValidator(control: AbstractControl): ValidationErrors|null { return nullValidator(control); } /** * @description * Compose multiple validators into a single function that returns the union * of the individual error maps for the provided control. * * @returns A validator function that returns an error map with the * merged error maps of the validators if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static compose(validators: null): null; static compose(validators: (ValidatorFn|null|undefined)[]): ValidatorFn|null; static compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null { return compose(validators); } /** * @description * Compose multiple async validators into a single function that returns the union * of the individual error objects for the provided control. * * @returns A validator function that returns an error map with the * merged error objects of the async validators if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null { return composeAsync(validators); } } /** * Validator that requires the control's value to be greater than or equal to the provided number. * See `Validators.min` for additional information. */ export function minValidator(min: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) { return null; // don't validate empty values to allow optional controls } const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min return !isNaN(value) && value < min ? {'min': {'min': min, 'actual': control.value}} : null; }; } /** * Validator that requires the control's value to be less than or equal to the provided number. * See `Validators.max` for additional information. */ export function maxValidator(max: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) { return null; // don't validate empty values to allow optional controls } const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max return !isNaN(value) && value > max ? {'max': {'max': max, 'actual': control.value}} : null; }; } /** * Validator that requires the control have a non-empty value. * See `Validators.required` for additional information. */ export function requiredValidator(control: AbstractControl): ValidationErrors|null { return isEmptyInputValue(control.value) ? {'required': true} : null; } /** * Validator that requires the control's value be true. This validator is commonly * used for required checkboxes. * See `Validators.requiredTrue` for additional information. */ export function requiredTrueValidator(control: AbstractControl): ValidationErrors|null { return control.value === true ? null : {'required': true}; } /** * Validator that requires the control's value pass an email validation test. * See `Validators.email` for additional information. */ export function emailValidator(control: AbstractControl): ValidationErrors|null { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } return EMAIL_REGEXP.test(control.value) ? null : {'email': true}; } /** * Validator that requires the length of the control's value to be greater than or equal * to the provided minimum length. See `Validators.minLength` for additional information. */ export function minLengthValidator(minLength: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) { // don't validate empty values to allow optional controls // don't validate values without `length` property return null; } return control.value.length < minLength ? {'minlength': {'requiredLength': minLength, 'actualLength': control.value.length}} : null; }; } /** * Validator that requires the length of the control's value to be less than or equal * to the provided maximum length. See `Validators.maxLength` for additional information. */ export function maxLengthValidator(maxLength: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { return hasValidLength(control.value) && control.value.length > maxLength ? {'maxlength': {'requiredLength': maxLength, 'actualLength': control.value.length}} : null; }; } /** * Validator that requires the control's value to match a regex pattern. * See `Validators.pattern` for additional information. */ export function patternValidator(pattern: string|RegExp): ValidatorFn { if (!pattern) return nullValidator; let regex: RegExp; let regexStr: string; if (typeof pattern === 'string') { regexStr = ''; if (pattern.charAt(0) !== '^') regexStr += '^'; regexStr += pattern; if (pattern.charAt(pattern.length - 1) !== '$') regexStr += '$'; regex = new RegExp(regexStr); } else { regexStr = pattern.toString(); regex = pattern; } return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } const value: string = control.value; return regex.test(value) ? null : {'pattern': {'requiredPattern': regexStr, 'actualValue': value}}; }; } /** * Function that has `ValidatorFn` shape, but performs no operation. */ export function nullValidator(control: AbstractControl): ValidationErrors|null { return null; } function isPresent(o: any): boolean { return o != null; } export function toObservable(value: any): Observable<any> { const obs = isPromise(value) ? from(value) : value; if (NG_DEV_MODE && !(isObservable(obs))) { let errorMessage = `Expected async validator to return Promise or Observable.`; // A synchronous validator will return object or null. if (typeof value === 'object') { errorMessage += ' Are you using a synchronous validator where an async validator is expected?'; } throw new RuntimeError(RuntimeErrorCode.WRONG_VALIDATOR_RETURN_TYPE, errorMessage); } return obs; } function mergeErrors(arrayOfErrors: (ValidationErrors|null)[]): ValidationErrors|null { let res: {[key: string]: any} = {}; arrayOfErrors.forEach((errors: ValidationErrors|null) => { res = errors != null ? {...res!, ...errors} : res!; }); return Object.keys(res).length === 0 ? null : res; } type GenericValidatorFn = (control: AbstractControl) => any; function executeValidators<V extends GenericValidatorFn>( control: AbstractControl, validators: V[]): ReturnType<V>[] { return validators.map(validator => validator(control)); } function isValidatorFn<V>(validator: V|Validator|AsyncValidator): validator is V { return !(validator as Validator).validate; } /** * Given the list of validators that may contain both functions as well as classes, return the list * of validator functions (convert validator classes into validator functions). This is needed to * have consistent structure in validators list before composing them. * * @param validators The set of validators that may contain validators both in plain function form * as well as represented as a validator class. */ export function normalizeValidators<V>(validators: (V|Validator|AsyncValidator)[]): V[] { return validators.map(validator => { return isValidatorFn<V>(validator) ? validator : ((c: AbstractControl) => validator.validate(c)) as unknown as V; }); } /** * Merges synchronous validators into a single validator function. * See `Validators.compose` for additional information. */ function compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null { if (!validators) return null; const presentValidators: ValidatorFn[] = validators.filter(isPresent) as any; if (presentValidators.length == 0) return null; return function(control: AbstractControl) { return mergeErrors(executeValidators<ValidatorFn>(control, presentValidators)); }; } /** * Accepts a list of validators of different possible shapes (`Validator` and `ValidatorFn`), * normalizes the list (converts everything to `ValidatorFn`) and merges them into a single * validator function. */ export function composeValidators(validators: Array<Validator|ValidatorFn>): ValidatorFn|null { return validators != null ? compose(normalizeValidators<ValidatorFn>(validators)) : null; } /** * Merges asynchronous validators into a single validator function. * See `Validators.composeAsync` for additional information. */ function composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null { if (!validators) return null; const presentValidators: AsyncValidatorFn[] = validators.filter(isPresent) as any; if (presentValidators.length == 0) return null; return function(control: AbstractControl) { const observables = executeValidators<AsyncValidatorFn>(control, presentValidators).map(toObservable); return forkJoin(observables).pipe(map(mergeErrors)); }; } /** * Accepts a list of async validators of different possible shapes (`AsyncValidator` and * `AsyncValidatorFn`), normalizes the list (converts everything to `AsyncValidatorFn`) and merges * them into a single validator function. */ export function composeAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>): AsyncValidatorFn|null { return validators != null ? composeAsync(normalizeValidators<AsyncValidatorFn>(validators)) : null; } /** * Merges raw control validators with a given directive validator and returns the combined list of * validators as an array. */ export function mergeValidators<V>(controlValidators: V|V[]|null, dirValidator: V): V[] { if (controlValidators === null) return [dirValidator]; return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] : [controlValidators, dirValidator]; } /** * Retrieves the list of raw synchronous validators attached to a given control. */ export function getControlValidators(control: AbstractControl): ValidatorFn|ValidatorFn[]|null { return (control as any)._rawValidators as ValidatorFn | ValidatorFn[] | null; } /** * Retrieves the list of raw asynchronous validators attached to a given control. */ export function getControlAsyncValidators(control: AbstractControl): AsyncValidatorFn| AsyncValidatorFn[]|null { return (control as any)._rawAsyncValidators as AsyncValidatorFn | AsyncValidatorFn[] | null; } /** * Accepts a singleton validator, an array, or null, and returns an array type with the provided * validators. * * @param validators A validator, validators, or null. * @returns A validators array. */ export function makeValidatorsArray<T extends ValidatorFn|AsyncValidatorFn>(validators: T|T[]| null): T[] { if (!validators) return []; return Array.isArray(validators) ? validators : [validators]; } /** * Determines whether a validator or validators array has a given validator. * * @param validators The validator or validators to compare against. * @param validator The validator to check. * @returns Whether the validator is present. */ export function hasValidator<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[]|null, validator: T): boolean { return Array.isArray(validators) ? validators.includes(validator) : validators === validator; } /** * Combines two arrays of validators into one. If duplicates are provided, only one will be added. * * @param validators The new validators. * @param currentValidators The base array of current validators. * @returns An array of validators. */ export function addValidators<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[], currentValidators: T|T[]|null): T[] { const current = makeValidatorsArray(currentValidators); const validatorsToAdd = makeValidatorsArray(validators); validatorsToAdd.forEach((v: T) => { // Note: if there are duplicate entries in the new validators array, // only the first one would be added to the current list of validators. // Duplicate ones would be ignored since `hasValidator` would detect // the presence of a validator function and we update the current list in place. if (!hasValidator(current, v)) { current.push(v); } }); return current; } export function removeValidators<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[], currentValidators: T|T[]|null): T[] { return makeValidatorsArray(currentValidators).filter(v => !hasValidator(validators, v)); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Observable} from 'rxjs'; import {AbstractControl} from '../model/abstract_model'; import {composeAsyncValidators, composeValidators} from '../validators'; import {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './validators'; /** * @description * Base class for control directives. * * This class is only used internally in the `ReactiveFormsModule` and the `FormsModule`. * * @publicApi */ export abstract class AbstractControlDirective { /** * @description * A reference to the underlying control. * * @returns the control that backs this directive. Most properties fall through to that instance. */ abstract get control(): AbstractControl|null; /** * @description * Reports the value of the control if it is present, otherwise null. */ get value(): any { return this.control ? this.control.value : null; } /** * @description * Reports whether the control is valid. A control is considered valid if no * validation errors exist with the current value. * If the control is not present, null is returned. */ get valid(): boolean|null { return this.control ? this.control.valid : null; } /** * @description * Reports whether the control is invalid, meaning that an error exists in the input value. * If the control is not present, null is returned. */ get invalid(): boolean|null { return this.control ? this.control.invalid : null; } /** * @description * Reports whether a control is pending, meaning that that async validation is occurring and * errors are not yet available for the input value. If the control is not present, null is * returned. */ get pending(): boolean|null { return this.control ? this.control.pending : null; } /** * @description * Reports whether the control is disabled, meaning that the control is disabled * in the UI and is exempt from validation checks and excluded from aggregate * values of ancestor controls. If the control is not present, null is returned. */ get disabled(): boolean|null { return this.control ? this.control.disabled : null; } /** * @description * Reports whether the control is enabled, meaning that the control is included in ancestor * calculations of validity or value. If the control is not present, null is returned. */ get enabled(): boolean|null { return this.control ? this.control.enabled : null; } /** * @description * Reports the control's validation errors. If the control is not present, null is returned. */ get errors(): ValidationErrors|null { return this.control ? this.control.errors : null; } /** * @description * Reports whether the control is pristine, meaning that the user has not yet changed * the value in the UI. If the control is not present, null is returned. */ get pristine(): boolean|null { return this.control ? this.control.pristine : null; } /** * @description * Reports whether the control is dirty, meaning that the user has changed * the value in the UI. If the control is not present, null is returned. */ get dirty(): boolean|null { return this.control ? this.control.dirty : null; } /** * @description * Reports whether the control is touched, meaning that the user has triggered * a `blur` event on it. If the control is not present, null is returned. */ get touched(): boolean|null { return this.control ? this.control.touched : null; } /** * @description * Reports the validation status of the control. Possible values include: * 'VALID', 'INVALID', 'DISABLED', and 'PENDING'. * If the control is not present, null is returned. */ get status(): string|null { return this.control ? this.control.status : null; } /** * @description * Reports whether the control is untouched, meaning that the user has not yet triggered * a `blur` event on it. If the control is not present, null is returned. */ get untouched(): boolean|null { return this.control ? this.control.untouched : null; } /** * @description * Returns a multicasting observable that emits a validation status whenever it is * calculated for the control. If the control is not present, null is returned. */ get statusChanges(): Observable<any>|null { return this.control ? this.control.statusChanges : null; } /** * @description * Returns a multicasting observable of value changes for the control that emits every time the * value of the control changes in the UI or programmatically. * If the control is not present, null is returned. */ get valueChanges(): Observable<any>|null { return this.control ? this.control.valueChanges : null; } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ get path(): string[]|null { return null; } /** * Contains the result of merging synchronous validators into a single validator function * (combined using `Validators.compose`). */ private _composedValidatorFn: ValidatorFn|null|undefined; /** * Contains the result of merging asynchronous validators into a single validator function * (combined using `Validators.composeAsync`). */ private _composedAsyncValidatorFn: AsyncValidatorFn|null|undefined; /** * Set of synchronous validators as they were provided while calling `setValidators` function. * @internal */ _rawValidators: Array<Validator|ValidatorFn> = []; /** * Set of asynchronous validators as they were provided while calling `setAsyncValidators` * function. * @internal */ _rawAsyncValidators: Array<AsyncValidator|AsyncValidatorFn> = []; /** * Sets synchronous validators for this directive. * @internal */ _setValidators(validators: Array<Validator|ValidatorFn>|undefined): void { this._rawValidators = validators || []; this._composedValidatorFn = composeValidators(this._rawValidators); } /** * Sets asynchronous validators for this directive. * @internal */ _setAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>|undefined): void { this._rawAsyncValidators = validators || []; this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators); } /** * @description * Synchronous validator function composed of all the synchronous validators registered with this * directive. */ get validator(): ValidatorFn|null { return this._composedValidatorFn || null; } /** * @description * Asynchronous validator function composed of all the asynchronous validators registered with * this directive. */ get asyncValidator(): AsyncValidatorFn|null { return this._composedAsyncValidatorFn || null; } /* * The set of callbacks to be invoked when directive instance is being destroyed. */ private _onDestroyCallbacks: (() => void)[] = []; /** * Internal function to register callbacks that should be invoked * when directive instance is being destroyed. * @internal */ _registerOnDestroy(fn: () => void): void { this._onDestroyCallbacks.push(fn); } /** * Internal function to invoke all registered \"on destroy\" callbacks. * Note: calling this function also clears the list of callbacks. * @internal */ _invokeOnDestroyCallbacks(): void { this._onDestroyCallbacks.forEach(fn => fn()); this._onDestroyCallbacks = []; } /** * @description * Resets the control with the provided value if the control is present. */ reset(value: any = undefined): void { if (this.control) this.control.reset(value); } /** * @description * Reports whether the control with the given path has the error specified. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * If no path is given, this method checks for the error on the current control. * * @returns whether the given error is present in the control at the given path. * * If the control is not present, false is returned. */ hasError(errorCode: string, path?: Array<string|number>|string): boolean { return this.control ? this.control.hasError(errorCode, path) : false; } /** * @description * Reports error data for the control with the given path. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * @returns error data for that particular error. If the control or error is not present, * null is returned. */ getError(errorCode: string, path?: Array<string|number>|string): any { return this.control ? this.control.getError(errorCode, path) : null; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbstractControlDirective} from './abstract_control_directive'; import {ControlContainer} from './control_container'; import {ControlValueAccessor} from './control_value_accessor'; /** * @description * A base class that all `FormControl`-based directives extend. It binds a `FormControl` * object to a DOM element. * * @publicApi */ export abstract class NgControl extends AbstractControlDirective { /** * @description * The parent form for the control. * * @internal */ _parent: ControlContainer|null = null; /** * @description * The name for the control */ name: string|number|null = null; /** * @description * The value accessor for the control */ valueAccessor: ControlValueAccessor|null = null; /** * @description * The callback method to update the model from the view when requested * * @param newValue The new value for the view */ abstract viewToModelUpdate(newValue: any): void; } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbstractControlDirective} from './abstract_control_directive'; import {Form} from './form_interface'; /** * @description * A base class for directives that contain multiple registered instances of `NgControl`. * Only used by the forms module. * * @publicApi */ export abstract class ControlContainer extends AbstractControlDirective { /** * @description * The name for the control */ // TODO(issue/24571): remove '!'. name!: string|number|null; /** * @description * The top-level form directive for the control. */ get formDirective(): Form|null { return null; } /** * @description * The path to this group. */ override get path(): string[]|null { return null; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, Optional, Self} from '@angular/core'; import {AbstractControlDirective} from './abstract_control_directive'; import {ControlContainer} from './control_container'; import {NgControl} from './ng_control'; // DO NOT REFACTOR! // Each status is represented by a separate function to make sure that // advanced Closure Compiler optimizations related to property renaming // can work correctly. export class AbstractControlStatus { private _cd: AbstractControlDirective|null; constructor(cd: AbstractControlDirective|null) { this._cd = cd; } protected get isTouched() { return !!this._cd?.control?.touched; } protected get isUntouched() { return !!this._cd?.control?.untouched; } protected get isPristine() { return !!this._cd?.control?.pristine; } protected get isDirty() { return !!this._cd?.control?.dirty; } protected get isValid() { return !!this._cd?.control?.valid; } protected get isInvalid() { return !!this._cd?.control?.invalid; } protected get isPending() { return !!this._cd?.control?.pending; } protected get isSubmitted() { // We check for the `submitted` field from `NgForm` and `FormGroupDirective` classes, but // we avoid instanceof checks to prevent non-tree-shakable references to those types. return !!(this._cd as unknown as {submitted: boolean} | null)?.submitted; } } export const ngControlStatusHost = { '[class.ng-untouched]': 'isUntouched', '[class.ng-touched]': 'isTouched', '[class.ng-pristine]': 'isPristine', '[class.ng-dirty]': 'isDirty', '[class.ng-valid]': 'isValid', '[class.ng-invalid]': 'isInvalid', '[class.ng-pending]': 'isPending', }; export const ngGroupStatusHost = { ...ngControlStatusHost, '[class.ng-submitted]': 'isSubmitted', }; /** * @description * Directive automatically applied to Angular form controls that sets CSS classes * based on control status. * * @usageNotes * * ### CSS classes applied * * The following classes are applied as the properties become true: * * * ng-valid * * ng-invalid * * ng-pending * * ng-pristine * * ng-dirty * * ng-untouched * * ng-touched * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost}) export class NgControlStatus extends AbstractControlStatus { constructor(@Self() cd: NgControl) { super(cd); } } /** * @description * Directive automatically applied to Angular form groups that sets CSS classes * based on control status (valid/invalid/dirty/etc). On groups, this includes the additional * class ng-submitted. * * @see `NgControlStatus` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]', host: ngGroupStatusHost }) export class NgControlStatusGroup extends AbstractControlStatus { constructor(@Optional() @Self() cd: ControlContainer) { super(cd); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export const formControlNameExample = ` <div [formGroup]=\"myGroup\"> <input formControlName=\"firstName\"> </div> In your class: this.myGroup = new FormGroup({ firstName: new FormControl() });`; export const formGroupNameExample = ` <div [formGroup]=\"myGroup\"> <div formGroupName=\"person\"> <input formControlName=\"firstName\"> </div> </div> In your class: this.myGroup = new FormGroup({ person: new FormGroup({ firstName: new FormControl() }) });`; export const formArrayNameExample = ` <div [formGroup]=\"myGroup\"> <div formArrayName=\"cities\"> <div *ngFor=\"let city of cityArray.controls; index as i\"> <input [formControlName]=\"i\"> </div> </div> </div> In your class: this.cityArray = new FormArray([new FormControl('SF')]); this.myGroup = new FormGroup({ cities: this.cityArray });`; export const ngModelGroupExample = ` <form> <div ngModelGroup=\"person\"> <input [(ngModel)]=\"person.name\" name=\"firstName\"> </div> </form>`; export const ngModelWithFormGroupExample = ` <div [formGroup]=\"myGroup\"> <input formControlName=\"firstName\"> <input [(ngModel)]=\"showMoreControls\" [ngModelOptions]=\"{standalone: true}\"> </div> `; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {formArrayNameExample, formControlNameExample, formGroupNameExample, ngModelGroupExample} from './error_examples'; export function controlParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_CONTROL_NAME_MISSING_PARENT, `formControlName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formControlNameExample}`); } export function ngModelGroupException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_CONTROL_NAME_INSIDE_MODEL_GROUP, `formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents that also have a \"form\" prefix: formGroupName, formArrayName, or formGroup. Option 1: Update the parent to be formGroupName (reactive form strategy) ${formGroupNameExample} Option 2: Use ngModel instead of formControlName (template-driven strategy) ${ngModelGroupExample}`); } export function missingFormException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_GROUP_MISSING_INSTANCE, `formGroup expects a FormGroup instance. Please pass one in. Example: ${formControlNameExample}`); } export function groupParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_GROUP_NAME_MISSING_PARENT, `formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formGroupNameExample}`); } export function arrayParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_ARRAY_NAME_MISSING_PARENT, `formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formArrayNameExample}`); } export const disabledAttrWarning = ` It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors. Example: // Specify the \\`disabled\\` property at control creation time: form = new FormGroup({ first: new FormControl({value: 'Nancy', disabled: true}, Validators.required), last: new FormControl('Drew', Validators.required) }); // Controls can also be enabled/disabled after creation: form.get('first')?.enable(); form.get('last')?.disable(); `; export const asyncValidatorsDroppedWithOptsWarning = ` It looks like you're constructing using a FormControl with both an options argument and an async validators argument. Mixing these arguments will cause your async validators to be dropped. You should either put all your validators in the options object, or in separate validators arguments. For example: // Using validators arguments fc = new FormControl(42, Validators.required, myAsyncValidator); // Using AbstractControlOptions fc = new FormControl(42, {validators: Validators.required, asyncValidators: myAV}); // Do NOT mix them: async validators will be dropped! fc = new FormControl(42, {validators: Validators.required}, /* Oops! */ myAsyncValidator); `; export function ngModelWarning(directiveName: string): string { return ` It looks like you're using ngModel on the same form field as ${directiveName}. Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in Angular v6 and will be removed in a future version of Angular. For more information on this, see our API docs here: https://angular.io/api/forms/${ directiveName === 'formControl' ? 'FormControlDirective' : 'FormControlName'}#use-with-ngmodel `; } function describeKey(isFormGroup: boolean, key: string|number): string { return isFormGroup ? `with name: '${key}'` : `at index: ${key}`; } export function noControlsError(isFormGroup: boolean): string { return ` There are no form controls registered with this ${ isFormGroup ? 'group' : 'array'} yet. If you're using ngModel, you may want to check next tick (e.g. use setTimeout). `; } export function missingControlError(isFormGroup: boolean, key: string|number): string { return `Cannot find form control ${describeKey(isFormGroup, key)}`; } export function missingControlValueError(isFormGroup: boolean, key: string|number): string { return `Must supply a value for form control ${describeKey(isFormGroup, key)}`; } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {EventEmitter, ɵRuntimeError as RuntimeError} from '@angular/core'; import {Observable} from 'rxjs'; import {asyncValidatorsDroppedWithOptsWarning, missingControlError, missingControlValueError, noControlsError} from '../directives/reactive_errors'; import {AsyncValidatorFn, ValidationErrors, ValidatorFn} from '../directives/validators'; import {RuntimeErrorCode} from '../errors'; import {FormArray, FormGroup} from '../forms'; import {addValidators, composeAsyncValidators, composeValidators, hasValidator, removeValidators, toObservable} from '../validators'; const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * Reports that a control is valid, meaning that no errors exist in the input value. * * @see `status` */ export const VALID = 'VALID'; /** * Reports that a control is invalid, meaning that an error exists in the input value. * * @see `status` */ export const INVALID = 'INVALID'; /** * Reports that a control is pending, meaning that that async validation is occurring and * errors are not yet available for the input value. * * @see `markAsPending` * @see `status` */ export const PENDING = 'PENDING'; /** * Reports that a control is disabled, meaning that the control is exempt from ancestor * calculations of validity or value. * * @see `markAsDisabled` * @see `status` */ export const DISABLED = 'DISABLED'; /** * A form can have several different statuses. Each * possible status is returned as a string literal. * * * **VALID**: Reports that a control is valid, meaning that no errors exist in the input * value. * * **INVALID**: Reports that a control is invalid, meaning that an error exists in the input * value. * * **PENDING**: Reports that a control is pending, meaning that that async validation is * occurring and errors are not yet available for the input value. * * **DISABLED**: Reports that a control is * disabled, meaning that the control is exempt from ancestor calculations of validity or value. * * @publicApi */ export type FormControlStatus = 'VALID'|'INVALID'|'PENDING'|'DISABLED'; /** * Gets validators from either an options object or given validators. */ export function pickValidators(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions| null): ValidatorFn|ValidatorFn[]|null { return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null; } /** * Creates validator function by combining provided validators. */ function coerceToValidator(validator: ValidatorFn|ValidatorFn[]|null): ValidatorFn|null { return Array.isArray(validator) ? composeValidators(validator) : validator || null; } /** * Gets async validators from either an options object or given validators. */ export function pickAsyncValidators( asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): AsyncValidatorFn| AsyncValidatorFn[]|null { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (isOptionsObj(validatorOrOpts) && asyncValidator) { console.warn(asyncValidatorsDroppedWithOptsWarning); } } return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null; } /** * Creates async validator function by combining provided async validators. */ function coerceToAsyncValidator(asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]| null): AsyncValidatorFn|null { return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator || null; } export type FormHooks = 'change'|'blur'|'submit'; /** * Interface for options provided to an `AbstractControl`. * * @publicApi */ export interface AbstractControlOptions { /** * @description * The list of validators applied to a control. */ validators?: ValidatorFn|ValidatorFn[]|null; /** * @description * The list of async validators applied to control. */ asyncValidators?: AsyncValidatorFn|AsyncValidatorFn[]|null; /** * @description * The event name for control to update upon. */ updateOn?: 'change'|'blur'|'submit'; } export function isOptionsObj(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions| null): validatorOrOpts is AbstractControlOptions { return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === 'object'; } export function assertControlPresent(parent: any, isGroup: boolean, key: string|number): void { const controls = parent.controls as {[key: string|number]: unknown}; const collection = isGroup ? Object.keys(controls) : controls; if (!collection.length) { throw new RuntimeError( RuntimeErrorCode.NO_CONTROLS, NG_DEV_MODE ? noControlsError(isGroup) : ''); } if (!controls[key]) { throw new RuntimeError( RuntimeErrorCode.MISSING_CONTROL, NG_DEV_MODE ? missingControlError(isGroup, key) : ''); } } export function assertAllValuesPresent(control: any, isGroup: boolean, value: any): void { control._forEachChild((_: unknown, key: string|number) => { if (value[key] === undefined) { throw new RuntimeError( RuntimeErrorCode.MISSING_CONTROL_VALUE, NG_DEV_MODE ? missingControlValueError(isGroup, key) : ''); } }); } // IsAny checks if T is `any`, by checking a condition that couldn't possibly be true otherwise. export type ɵIsAny<T, Y, N> = 0 extends(1&T) ? Y : N; /** * `TypedOrUntyped` allows one of two different types to be selected, depending on whether the Forms * class it's applied to is typed or not. * * This is for internal Angular usage to support typed forms; do not directly use it. */ export type ɵTypedOrUntyped<T, Typed, Untyped> = ɵIsAny<T, Untyped, Typed>; /** * Value gives the value type corresponding to a control type. * * Note that the resulting type will follow the same rules as `.value` on your control, group, or * array, including `undefined` for each group element which might be disabled. * * If you are trying to extract a value type for a data model, you probably want {@link RawValue}, * which will not have `undefined` in group keys. * * @usageNotes * * ### `FormControl` value type * * You can extract the value type of a single control: * * ```ts * type NameControl = FormControl<string>; * type NameValue = Value<NameControl>; * ``` * * The resulting type is `string`. * * ### `FormGroup` value type * * Imagine you have an interface defining the controls in your group. You can extract the shape of * the values as follows: * * ```ts * interface PartyFormControls { * address: FormControl<string>; * } * * // Value operates on controls; the object must be wrapped in a FormGroup. * type PartyFormValues = Value<FormGroup<PartyFormControls>>; * ``` * * The resulting type is `{address: string|undefined}`. * * ### `FormArray` value type * * You can extract values from FormArrays as well: * * ```ts * type GuestNamesControls = FormArray<FormControl<string>>; * * type NamesValues = Value<GuestNamesControls>; * ``` * * The resulting type is `string[]`. * * **Internal: not for public use.** */ export type ɵValue<T extends AbstractControl|undefined> = T extends AbstractControl<any, any>? T['value'] : never; /** * RawValue gives the raw value type corresponding to a control type. * * Note that the resulting type will follow the same rules as `.getRawValue()` on your control, * group, or array. This means that all controls inside a group will be required, not optional, * regardless of their disabled state. * * You may also wish to use {@link ɵValue}, which will have `undefined` in group keys (which can be * disabled). * * @usageNotes * * ### `FormGroup` raw value type * * Imagine you have an interface defining the controls in your group. You can extract the shape of * the raw values as follows: * * ```ts * interface PartyFormControls { * address: FormControl<string>; * } * * // RawValue operates on controls; the object must be wrapped in a FormGroup. * type PartyFormValues = RawValue<FormGroup<PartyFormControls>>; * ``` * * The resulting type is `{address: string}`. (Note the absence of `undefined`.) * * **Internal: not for public use.** */ export type ɵRawValue<T extends AbstractControl|undefined> = T extends AbstractControl<any, any>? (T['setValue'] extends((v: infer R) => void) ? R : never) : never; // Disable clang-format to produce clearer formatting for these multiline types. // clang-format off /** * Tokenize splits a string literal S by a delimiter D. */ export type ɵTokenize<S extends string, D extends string> = string extends S ? string[] : /* S must be a literal */ S extends `${infer T}${D}${infer U}` ? [T, ...ɵTokenize<U, D>] : [S] /* Base case */ ; /** * CoerceStrArrToNumArr accepts an array of strings, and converts any numeric string to a number. */ export type ɵCoerceStrArrToNumArr<S> = // Extract the head of the array. S extends [infer Head, ...infer Tail] ? // Using a template literal type, coerce the head to `number` if possible. // Then, recurse on the tail. Head extends `${number}` ? [number, ...ɵCoerceStrArrToNumArr<Tail>] : [Head, ...ɵCoerceStrArrToNumArr<Tail>] : []; /** * Navigate takes a type T and an array K, and returns the type of T[K[0]][K[1]][K[2]]... */ export type ɵNavigate<T, K extends(Array<string|number>)> = T extends object ? /* T must be indexable (object or array) */ (K extends [infer Head, ...infer Tail] ? /* Split K into head and tail */ (Head extends keyof T ? /* head(K) must index T */ (Tail extends(string|number)[] ? /* tail(K) must be an array */ [] extends Tail ? T[Head] : /* base case: K can be split, but Tail is empty */ (ɵNavigate<T[Head], Tail>) /* explore T[head(K)] by tail(K) */ : any) /* tail(K) was not an array, give up */ : never) /* head(K) does not index T, give up */ : any) /* K cannot be split, give up */ : any /* T is not indexable, give up */ ; /** * ɵWriteable removes readonly from all keys. */ export type ɵWriteable<T> = { -readonly[P in keyof T]: T[P] }; /** * GetProperty takes a type T and some property names or indices K. * If K is a dot-separated string, it is tokenized into an array before proceeding. * Then, the type of the nested property at K is computed: T[K[0]][K[1]][K[2]]... * This works with both objects, which are indexed by property name, and arrays, which are indexed * numerically. * * For internal use only. */ export type ɵGetProperty<T, K> = // K is a string K extends string ? ɵGetProperty<T, ɵCoerceStrArrToNumArr<ɵTokenize<K, '.'>>> : // Is is an array ɵWriteable<K> extends Array<string|number> ? ɵNavigate<T, ɵWriteable<K>> : // Fall through permissively if we can't calculate the type of K. any; // clang-format on /** * This is the base class for `FormControl`, `FormGroup`, and `FormArray`. * * It provides some of the shared behavior that all controls and groups of controls have, like * running validators, calculating status, and resetting state. It also defines the properties * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be * instantiated directly. * * The first type parameter TValue represents the value type of the control (`control.value`). * The optional type parameter TRawValue represents the raw value type (`control.getRawValue()`). * * @see [Forms Guide](/guide/forms) * @see [Reactive Forms Guide](/guide/reactive-forms) * @see [Dynamic Forms Guide](/guide/dynamic-form) * * @publicApi */ export abstract class AbstractControl<TValue = any, TRawValue extends TValue = TValue> { /** @internal */ _pendingDirty = false; /** * Indicates that a control has its own pending asynchronous validation in progress. * * @internal */ _hasOwnPendingAsyncValidator = false; /** @internal */ _pendingTouched = false; /** @internal */ _onCollectionChange = () => {}; /** @internal */ _updateOn?: FormHooks; private _parent: FormGroup|FormArray|null = null; private _asyncValidationSubscription: any; /** * Contains the result of merging synchronous validators into a single validator function * (combined using `Validators.compose`). * * @internal */ private _composedValidatorFn!: ValidatorFn|null; /** * Contains the result of merging asynchronous validators into a single validator function * (combined using `Validators.composeAsync`). * * @internal */ private _composedAsyncValidatorFn!: AsyncValidatorFn|null; /** * Synchronous validators as they were provided: * - in `AbstractControl` constructor * - as an argument while calling `setValidators` function * - while calling the setter on the `validator` field (e.g. `control.validator = validatorFn`) * * @internal */ private _rawValidators!: ValidatorFn|ValidatorFn[]|null; /** * Asynchronous validators as they were provided: * - in `AbstractControl` constructor * - as an argument while calling `setAsyncValidators` function * - while calling the setter on the `asyncValidator` field (e.g. `control.asyncValidator = * asyncValidatorFn`) * * @internal */ private _rawAsyncValidators!: AsyncValidatorFn|AsyncValidatorFn[]|null; /** * The current value of the control. * * * For a `FormControl`, the current value. * * For an enabled `FormGroup`, the values of enabled controls as an object * with a key-value pair for each member of the group. * * For a disabled `FormGroup`, the values of all controls as an object * with a key-value pair for each member of the group. * * For a `FormArray`, the values of enabled controls as an array. * */ public readonly value!: TValue; /** * Initialize the AbstractControl instance. * * @param validators The function or array of functions that is used to determine the validity of * this control synchronously. * @param asyncValidators The function or array of functions that is used to determine validity of * this control asynchronously. */ constructor( validators: ValidatorFn|ValidatorFn[]|null, asyncValidators: AsyncValidatorFn|AsyncValidatorFn[]|null) { this._assignValidators(validators); this._assignAsyncValidators(asyncValidators); } /** * Returns the function that is used to determine the validity of this control synchronously. * If multiple validators have been added, this will be a single composed function. * See `Validators.compose()` for additional information. */ get validator(): ValidatorFn|null { return this._composedValidatorFn; } set validator(validatorFn: ValidatorFn|null) { this._rawValidators = this._composedValidatorFn = validatorFn; } /** * Returns the function that is used to determine the validity of this control asynchronously. * If multiple validators have been added, this will be a single composed function. * See `Validators.compose()` for additional information. */ get asyncValidator(): AsyncValidatorFn|null { return this._composedAsyncValidatorFn; } set asyncValidator(asyncValidatorFn: AsyncValidatorFn|null) { this._rawAsyncValidators = this._composedAsyncValidatorFn = asyncValidatorFn; } /** * The parent control. */ get parent(): FormGroup|FormArray|null { return this._parent; } /** * The validation status of the control. * * @see `FormControlStatus` * * These status values are mutually exclusive, so a control cannot be * both valid AND invalid or invalid AND disabled. */ public readonly status!: FormControlStatus; /** * A control is `valid` when its `status` is `VALID`. * * @see {@link AbstractControl.status} * * @returns True if the control has passed all of its validation tests, * false otherwise. */ get valid(): boolean { return this.status === VALID; } /** * A control is `invalid` when its `status` is `INVALID`. * * @see {@link AbstractControl.status} * * @returns True if this control has failed one or more of its validation checks, * false otherwise. */ get invalid(): boolean { return this.status === INVALID; } /** * A control is `pending` when its `status` is `PENDING`. * * @see {@link AbstractControl.status} * * @returns True if this control is in the process of conducting a validation check, * false otherwise. */ get pending(): boolean { return this.status == PENDING; } /** * A control is `disabled` when its `status` is `DISABLED`. * * Disabled controls are exempt from validation checks and * are not included in the aggregate value of their ancestor * controls. * * @see {@link AbstractControl.status} * * @returns True if the control is disabled, false otherwise. */ get disabled(): boolean { return this.status === DISABLED; } /** * A control is `enabled` as long as its `status` is not `DISABLED`. * * @returns True if the control has any status other than 'DISABLED', * false if the status is 'DISABLED'. * * @see {@link AbstractControl.status} * */ get enabled(): boolean { return this.status !== DISABLED; } /** * An object containing any errors generated by failing validation, * or null if there are no errors. */ public readonly errors!: ValidationErrors|null; /** * A control is `pristine` if the user has not yet changed * the value in the UI. * * @returns True if the user has not yet changed the value in the UI; compare `dirty`. * Programmatic changes to a control's value do not mark it dirty. */ public readonly pristine: boolean = true; /** * A control is `dirty` if the user has changed the value * in the UI. * * @returns True if the user has changed the value of this control in the UI; compare `pristine`. * Programmatic changes to a control's value do not mark it dirty. */ get dirty(): boolean { return !this.pristine; } /** * True if the control is marked as `touched`. * * A control is marked `touched` once the user has triggered * a `blur` event on it. */ public readonly touched: boolean = false; /** * True if the control has not been marked as touched * * A control is `untouched` if the user has not yet triggered * a `blur` event on it. */ get untouched(): boolean { return !this.touched; } /** * A multicasting observable that emits an event every time the value of the control changes, in * the UI or programmatically. It also emits an event each time you call enable() or disable() * without passing along {emitEvent: false} as a function argument. */ public readonly valueChanges!: Observable<TValue>; /** * A multicasting observable that emits an event every time the validation `status` of the control * recalculates. * * @see `FormControlStatus` * @see {@link AbstractControl.status} * */ public readonly statusChanges!: Observable<FormControlStatus>; /** * Reports the update strategy of the `AbstractControl` (meaning * the event on which the control updates itself). * Possible values: `'change'` | `'blur'` | `'submit'` * Default value: `'change'` */ get updateOn(): FormHooks { return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change'); } /** * Sets the synchronous validators that are active on this control. Calling * this overwrites any existing synchronous validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * If you want to add a new validator without affecting existing ones, consider * using `addValidators()` method instead. */ setValidators(validators: ValidatorFn|ValidatorFn[]|null): void { this._assignValidators(validators); } /** * Sets the asynchronous validators that are active on this control. Calling this * overwrites any existing asynchronous validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * If you want to add a new validator without affecting existing ones, consider * using `addAsyncValidators()` method instead. */ setAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void { this._assignAsyncValidators(validators); } /** * Add a synchronous validator or validators to this control, without affecting other validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * Adding a validator that already exists will have no effect. If duplicate validator functions * are present in the `validators` array, only the first instance would be added to a form * control. * * @param validators The new validator function or functions to add to this control. */ addValidators(validators: ValidatorFn|ValidatorFn[]): void { this.setValidators(addValidators(validators, this._rawValidators)); } /** * Add an asynchronous validator or validators to this control, without affecting other * validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * Adding a validator that already exists will have no effect. * * @param validators The new asynchronous validator function or functions to add to this control. */ addAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void { this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators)); } /** * Remove a synchronous validator from this control, without affecting other validators. * Validators are compared by function reference; you must pass a reference to the exact same * validator function as the one that was originally set. If a provided validator is not found, * it is ignored. * * @usageNotes * * ### Reference to a ValidatorFn * * ``` * // Reference to the RequiredValidator * const ctrl = new FormControl<string | null>('', Validators.required); * ctrl.removeValidators(Validators.required); * * // Reference to anonymous function inside MinValidator * const minValidator = Validators.min(3); * const ctrl = new FormControl<string | null>('', minValidator); * expect(ctrl.hasValidator(minValidator)).toEqual(true) * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false) * * ctrl.removeValidators(minValidator); * ``` * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * @param validators The validator or validators to remove. */ removeValidators(validators: ValidatorFn|ValidatorFn[]): void { this.setValidators(removeValidators(validators, this._rawValidators)); } /** * Remove an asynchronous validator from this control, without affecting other validators. * Validators are compared by function reference; you must pass a reference to the exact same * validator function as the one that was originally set. If a provided validator is not found, it * is ignored. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * @param validators The asynchronous validator or validators to remove. */ removeAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void { this.setAsyncValidators(removeValidators(validators, this._rawAsyncValidators)); } /** * Check whether a synchronous validator function is present on this control. The provided * validator must be a reference to the exact same function that was provided. * * @usageNotes * * ### Reference to a ValidatorFn * * ``` * // Reference to the RequiredValidator * const ctrl = new FormControl<number | null>(0, Validators.required); * expect(ctrl.hasValidator(Validators.required)).toEqual(true) * * // Reference to anonymous function inside MinValidator * const minValidator = Validators.min(3); * const ctrl = new FormControl<number | null>(0, minValidator); * expect(ctrl.hasValidator(minValidator)).toEqual(true) * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false) * ``` * * @param validator The validator to check for presence. Compared by function reference. * @returns Whether the provided validator was found on this control. */ hasValidator(validator: ValidatorFn): boolean { return hasValidator(this._rawValidators, validator); } /** * Check whether an asynchronous validator function is present on this control. The provided * validator must be a reference to the exact same function that was provided. * * @param validator The asynchronous validator to check for presence. Compared by function * reference. * @returns Whether the provided asynchronous validator was found on this control. */ hasAsyncValidator(validator: AsyncValidatorFn): boolean { return hasValidator(this._rawAsyncValidators, validator); } /** * Empties out the synchronous validator list. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * */ clearValidators(): void { this.validator = null; } /** * Empties out the async validator list. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * */ clearAsyncValidators(): void { this.asyncValidator = null; } /** * Marks the control as `touched`. A control is touched by focus and * blur events that do not change the value. * * @see `markAsUntouched()` * @see `markAsDirty()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsTouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = true; if (this._parent && !opts.onlySelf) { this._parent.markAsTouched(opts); } } /** * Marks the control and all its descendant controls as `touched`. * @see `markAsTouched()` */ markAllAsTouched(): void { this.markAsTouched({onlySelf: true}); this._forEachChild((control: AbstractControl) => control.markAllAsTouched()); } /** * Marks the control as `untouched`. * * If the control has any children, also marks all children as `untouched` * and recalculates the `touched` status of all parent controls. * * @see `markAsTouched()` * @see `markAsDirty()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after the marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsUntouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = false; this._pendingTouched = false; this._forEachChild((control: AbstractControl) => { control.markAsUntouched({onlySelf: true}); }); if (this._parent && !opts.onlySelf) { this._parent._updateTouched(opts); } } /** * Marks the control as `dirty`. A control becomes dirty when * the control's value is changed through the UI; compare `markAsTouched`. * * @see `markAsTouched()` * @see `markAsUntouched()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsDirty(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = false; if (this._parent && !opts.onlySelf) { this._parent.markAsDirty(opts); } } /** * Marks the control as `pristine`. * * If the control has any children, marks all children as `pristine`, * and recalculates the `pristine` status of all parent * controls. * * @see `markAsTouched()` * @see `markAsUntouched()` * @see `markAsDirty()` * * @param opts Configuration options that determine how the control emits events after * marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsPristine(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = true; this._pendingDirty = false; this._forEachChild((control: AbstractControl) => { control.markAsPristine({onlySelf: true}); }); if (this._parent && !opts.onlySelf) { this._parent._updatePristine(opts); } } /** * Marks the control as `pending`. * * A control is pending while the control performs async validation. * * @see {@link AbstractControl.status} * * @param opts Configuration options that determine how the control propagates changes and * emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), the `statusChanges` * observable emits an event with the latest status the control is marked pending. * When false, no events are emitted. * */ markAsPending(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { (this as {status: FormControlStatus}).status = PENDING; if (opts.emitEvent !== false) { (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent && !opts.onlySelf) { this._parent.markAsPending(opts); } } /** * Disables the control. This means the control is exempt from validation checks and * excluded from the aggregate value of any parent. Its status is `DISABLED`. * * If the control has children, all children are also disabled. * * @see {@link AbstractControl.status} * * @param opts Configuration options that determine how the control propagates * changes and emits events after the control is disabled. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is disabled. * When false, no events are emitted. */ disable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { // If parent has been marked artificially dirty we don't want to re-calculate the // parent's dirtiness based on the children. const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); (this as {status: FormControlStatus}).status = DISABLED; (this as {errors: ValidationErrors | null}).errors = null; this._forEachChild((control: AbstractControl) => { control.disable({...opts, onlySelf: true}); }); this._updateValue(); if (opts.emitEvent !== false) { (this.valueChanges as EventEmitter<TValue>).emit(this.value); (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } this._updateAncestors({...opts, skipPristineCheck}); this._onDisabledChange.forEach((changeFn) => changeFn(true)); } /** * Enables the control. This means the control is included in validation checks and * the aggregate value of its parent. Its status recalculates based on its value and * its validators. * * By default, if the control has children, all children are enabled. * * @see {@link AbstractControl.status} * * @param opts Configure options that control how the control propagates changes and * emits events when marked as untouched * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is enabled. * When false, no events are emitted. */ enable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { // If parent has been marked artificially dirty we don't want to re-calculate the // parent's dirtiness based on the children. const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); (this as {status: FormControlStatus}).status = VALID; this._forEachChild((control: AbstractControl) => { control.enable({...opts, onlySelf: true}); }); this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent}); this._updateAncestors({...opts, skipPristineCheck}); this._onDisabledChange.forEach((changeFn) => changeFn(false)); } private _updateAncestors( opts: {onlySelf?: boolean, emitEvent?: boolean, skipPristineCheck?: boolean}): void { if (this._parent && !opts.onlySelf) { this._parent.updateValueAndValidity(opts); if (!opts.skipPristineCheck) { this._parent._updatePristine(); } this._parent._updateTouched(); } } /** * Sets the parent of the control * * @param parent The new parent. */ setParent(parent: FormGroup|FormArray|null): void { this._parent = parent; } /** * Sets the value of the control. Abstract method (implemented in sub-classes). */ abstract setValue(value: TRawValue, options?: Object): void; /** * Patches the value of the control. Abstract method (implemented in sub-classes). */ abstract patchValue(value: TValue, options?: Object): void; /** * Resets the control. Abstract method (implemented in sub-classes). */ abstract reset(value?: TValue, options?: Object): void; /** * The raw value of this control. For most control implementations, the raw value will include * disabled children. */ getRawValue(): any { return this.value; } /** * Recalculates the value and validation status of the control. * * By default, it also updates the value and validity of its ancestors. * * @param opts Configuration options determine how the control propagates changes and emits events * after updates and validity checks are applied. * * `onlySelf`: When true, only update this control. When false or not supplied, * update all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is updated. * When false, no events are emitted. */ updateValueAndValidity(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._setInitialStatus(); this._updateValue(); if (this.enabled) { this._cancelExistingSubscription(); (this as {errors: ValidationErrors | null}).errors = this._runValidator(); (this as {status: FormControlStatus}).status = this._calculateStatus(); if (this.status === VALID || this.status === PENDING) { this._runAsyncValidator(opts.emitEvent); } } if (opts.emitEvent !== false) { (this.valueChanges as EventEmitter<TValue>).emit(this.value); (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent && !opts.onlySelf) { this._parent.updateValueAndValidity(opts); } } /** @internal */ _updateTreeValidity(opts: {emitEvent?: boolean} = {emitEvent: true}): void { this._forEachChild((ctrl: AbstractControl) => ctrl._updateTreeValidity(opts)); this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent}); } private _setInitialStatus() { (this as {status: FormControlStatus}).status = this._allControlsDisabled() ? DISABLED : VALID; } private _runValidator(): ValidationErrors|null { return this.validator ? this.validator(this) : null; } private _runAsyncValidator(emitEvent?: boolean): void { if (this.asyncValidator) { (this as {status: FormControlStatus}).status = PENDING; this._hasOwnPendingAsyncValidator = true; const obs = toObservable(this.asyncValidator(this)); this._asyncValidationSubscription = obs.subscribe((errors: ValidationErrors|null) => { this._hasOwnPendingAsyncValidator = false; // This will trigger the recalculation of the validation status, which depends on // the state of the asynchronous validation (whether it is in progress or not). So, it is // necessary that we have updated the `_hasOwnPendingAsyncValidator` boolean flag first. this.setErrors(errors, {emitEvent}); }); } } private _cancelExistingSubscription(): void { if (this._asyncValidationSubscription) { this._asyncValidationSubscription.unsubscribe(); this._hasOwnPendingAsyncValidator = false; } } /** * Sets errors on a form control when running validations manually, rather than automatically. * * Calling `setErrors` also updates the validity of the parent control. * * @param opts Configuration options that determine how the control propagates * changes and emits events after the control errors are set. * * `emitEvent`: When true or not supplied (the default), the `statusChanges` * observable emits an event after the errors are set. * * @usageNotes * * ### Manually set the errors for a control * * ``` * const login = new FormControl('someLogin'); * login.setErrors({ * notUnique: true * }); * * expect(login.valid).toEqual(false); * expect(login.errors).toEqual({ notUnique: true }); * * login.setValue('someOtherLogin'); * * expect(login.valid).toEqual(true); * ``` */ setErrors(errors: ValidationErrors|null, opts: {emitEvent?: boolean} = {}): void { (this as {errors: ValidationErrors | null}).errors = errors; this._updateControlsErrors(opts.emitEvent !== false); } /** * Retrieves a child control given the control's name or path. * * This signature for get supports strings and `const` arrays (`.get(['foo', 'bar'] as const)`). */ get<P extends string|(readonly(string|number)[])>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null; /** * Retrieves a child control given the control's name or path. * * This signature for `get` supports non-const (mutable) arrays. Inferred type * information will not be as robust, so prefer to pass a `readonly` array if possible. */ get<P extends string|Array<string|number>>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null; /** * Retrieves a child control given the control's name or path. * * @param path A dot-delimited string or array of string/number values that define the path to the * control. If a string is provided, passing it as a string literal will result in improved type * information. Likewise, if an array is provided, passing it `as const` will cause improved type * information to be available. * * @usageNotes * ### Retrieve a nested control * * For example, to get a `name` control nested within a `person` sub-group: * * * `this.form.get('person.name');` * * -OR- * * * `this.form.get(['person', 'name'] as const);` // `as const` gives improved typings * * ### Retrieve a control in a FormArray * * When accessing an element inside a FormArray, you can use an element index. * For example, to get a `price` control from the first element in an `items` array you can use: * * * `this.form.get('items.0.price');` * * -OR- * * * `this.form.get(['items', 0, 'price']);` */ get<P extends string|((string | number)[])>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null { let currPath: Array<string|number>|string = path; if (currPath == null) return null; if (!Array.isArray(currPath)) currPath = currPath.split('.'); if (currPath.length === 0) return null; return currPath.reduce( (control: AbstractControl|null, name) => control && control._find(name), this); } /** * @description * Reports error data for the control with the given path. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * @returns error data for that particular error. If the control or error is not present, * null is returned. */ getError(errorCode: string, path?: Array<string|number>|string): any { const control = path ? this.get(path) : this; return control && control.errors ? control.errors[errorCode] : null; } /** * @description * Reports whether the control with the given path has the error specified. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * If no path is given, this method checks for the error on the current control. * * @returns whether the given error is present in the control at the given path. * * If the control is not present, false is returned. */ hasError(errorCode: string, path?: Array<string|number>|string): boolean { return !!this.getError(errorCode, path); } /** * Retrieves the top-level ancestor of this control. */ get root(): AbstractControl { let x: AbstractControl = this; while (x._parent) { x = x._parent; } return x; } /** @internal */ _updateControlsErrors(emitEvent: boolean): void { (this as {status: FormControlStatus}).status = this._calculateStatus(); if (emitEvent) { (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent) { this._parent._updateControlsErrors(emitEvent); } } /** @internal */ _initObservables() { (this as {valueChanges: Observable<TValue>}).valueChanges = new EventEmitter(); (this as {statusChanges: Observable<FormControlStatus>}).statusChanges = new EventEmitter(); } private _calculateStatus(): FormControlStatus { if (this._allControlsDisabled()) return DISABLED; if (this.errors) return INVALID; if (this._hasOwnPendingAsyncValidator || this._anyControlsHaveStatus(PENDING)) return PENDING; if (this._anyControlsHaveStatus(INVALID)) return INVALID; return VALID; } /** @internal */ abstract _updateValue(): void; /** @internal */ abstract _forEachChild(cb: (c: AbstractControl) => void): void; /** @internal */ abstract _anyControls(condition: (c: AbstractControl) => boolean): boolean; /** @internal */ abstract _allControlsDisabled(): boolean; /** @internal */ abstract _syncPendingControls(): boolean; /** @internal */ _anyControlsHaveStatus(status: FormControlStatus): boolean { return this._anyControls((control: AbstractControl) => control.status === status); } /** @internal */ _anyControlsDirty(): boolean { return this._anyControls((control: AbstractControl) => control.dirty); } /** @internal */ _anyControlsTouched(): boolean { return this._anyControls((control: AbstractControl) => control.touched); } /** @internal */ _updatePristine(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = !this._anyControlsDirty(); if (this._parent && !opts.onlySelf) { this._parent._updatePristine(opts); } } /** @internal */ _updateTouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = this._anyControlsTouched(); if (this._parent && !opts.onlySelf) { this._parent._updateTouched(opts); } } /** @internal */ _onDisabledChange: Array<(isDisabled: boolean) => void> = []; /** @internal */ _registerOnCollectionChange(fn: () => void): void { this._onCollectionChange = fn; } /** @internal */ _setUpdateStrategy(opts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): void { if (isOptionsObj(opts) && opts.updateOn != null) { this._updateOn = opts.updateOn!; } } /** * Check to see if parent has been marked artificially dirty. * * @internal */ private _parentMarkedDirty(onlySelf?: boolean): boolean { const parentDirty = this._parent && this._parent.dirty; return !onlySelf && !!parentDirty && !this._parent!._anyControlsDirty(); } /** @internal */ _find(name: string|number): AbstractControl|null { return null; } /** * Internal implementation of the `setValidators` method. Needs to be separated out into a * different method, because it is called in the constructor and it can break cases where * a control is extended. */ private _assignValidators(validators: ValidatorFn|ValidatorFn[]|null): void { this._rawValidators = Array.isArray(validators) ? validators.slice() : validators; this._composedValidatorFn = coerceToValidator(this._rawValidators); } /** * Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a * different method, because it is called in the constructor and it can break cases where * a control is extended. */ private _assignAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void { this._rawAsyncValidators = Array.isArray(validators) ? validators.slice() : validators; this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {AbstractControl, AbstractControlOptions, assertAllValuesPresent, assertControlPresent, pickAsyncValidators, pickValidators, ɵRawValue, ɵTypedOrUntyped, ɵValue} from './abstract_model'; /** * FormGroupValue extracts the type of `.value` from a FormGroup's inner object type. The untyped * case falls back to {[key: string]: any}. * * Angular uses this type internally to support Typed Forms; do not use it directly. * * For internal use only. */ export type ɵFormGroupValue<T extends {[K in keyof T]?: AbstractControl<any>}> = ɵTypedOrUntyped<T, Partial<{[K in keyof T]: ɵValue<T[K]>}>, {[key: string]: any}>; /** * FormGroupRawValue extracts the type of `.getRawValue()` from a FormGroup's inner object type. The * untyped case falls back to {[key: string]: any}. * * Angular uses this type internally to support Typed Forms; do not use it directly. * * For internal use only. */ export type ɵFormGroupRawValue<T extends {[K in keyof T]?: AbstractControl<any>}> = ɵTypedOrUntyped<T, {[K in keyof T]: ɵRawValue<T[K]>}, {[key: string]: any}>; /** * OptionalKeys returns the union of all optional keys in the object. * * Angular uses this type internally to support Typed Forms; do not use it directly. */ export type ɵOptionalKeys<T> = { [K in keyof T] -?: undefined extends T[K] ? K : never }[keyof T]; /** * Tracks the value and validity state of a group of `FormControl` instances. * * A `FormGroup` aggregates the values of each child `FormControl` into one object, * with each control name as the key. It calculates its status by reducing the status values * of its children. For example, if one of the controls in a group is invalid, the entire * group becomes invalid. * * `FormGroup` is one of the four fundamental building blocks used to define forms in Angular, * along with `FormControl`, `FormArray`, and `FormRecord`. * * When instantiating a `FormGroup`, pass in a collection of child controls as the first * argument. The key for each child registers the name for the control. * * `FormGroup` is intended for use cases where the keys are known ahead of time. * If you need to dynamically add and remove controls, use {@link FormRecord} instead. * * `FormGroup` accepts an optional type parameter `TControl`, which is an object type with inner * control types as values. * * @usageNotes * * ### Create a form group with 2 controls * * ``` * const form = new FormGroup({ * first: new FormControl('Nancy', Validators.minLength(2)), * last: new FormControl('Drew'), * }); * * console.log(form.value); // {first: 'Nancy', last; 'Drew'} * console.log(form.status); // 'VALID' * ``` * * ### The type argument, and optional controls * * `FormGroup` accepts one generic argument, which is an object containing its inner controls. * This type will usually be inferred automatically, but you can always specify it explicitly if you * wish. * * If you have controls that are optional (i.e. they can be removed, you can use the `?` in the * type): * * ``` * const form = new FormGroup<{ * first: FormControl<string|null>, * middle?: FormControl<string|null>, // Middle name is optional. * last: FormControl<string|null>, * }>({ * first: new FormControl('Nancy'), * last: new FormControl('Drew'), * }); * ``` * * ### Create a form group with a group-level validator * * You include group-level validators as the second arg, or group-level async * validators as the third arg. These come in handy when you want to perform validation * that considers the value of more than one child control. * * ``` * const form = new FormGroup({ * password: new FormControl('', Validators.minLength(2)), * passwordConfirm: new FormControl('', Validators.minLength(2)), * }, passwordMatchValidator); * * * function passwordMatchValidator(g: FormGroup) { * return g.get('password').value === g.get('passwordConfirm').value * ? null : {'mismatch': true}; * } * ``` * * Like `FormControl` instances, you choose to pass in * validators and async validators as part of an options object. * * ``` * const form = new FormGroup({ * password: new FormControl('') * passwordConfirm: new FormControl('') * }, { validators: passwordMatchValidator, asyncValidators: otherValidator }); * ``` * * ### Set the updateOn property for all controls in a form group * * The options object is used to set a default value for each child * control's `updateOn` property. If you set `updateOn` to `'blur'` at the * group level, all child controls default to 'blur', unless the child * has explicitly specified a different `updateOn` value. * * ```ts * const c = new FormGroup({ * one: new FormControl() * }, { updateOn: 'blur' }); * ``` * * ### Using a FormGroup with optional controls * * It is possible to have optional controls in a FormGroup. An optional control can be removed later * using `removeControl`, and can be omitted when calling `reset`. Optional controls must be * declared optional in the group's type. * * ```ts * const c = new FormGroup<{one?: FormControl<string>}>({ * one: new FormControl('') * }); * ``` * * Notice that `c.value.one` has type `string|null|undefined`. This is because calling `c.reset({})` * without providing the optional key `one` will cause it to become `null`. * * @publicApi */ export class FormGroup<TControl extends {[K in keyof TControl]: AbstractControl<any>} = any> extends AbstractControl< ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any>, ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any>> { /** * Creates a new `FormGroup` instance. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions * */ constructor( controls: TControl, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this.controls = controls; this._initObservables(); this._setUpdateStrategy(validatorOrOpts); this._setUpControls(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable, // so we set `emitEvent` to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); } public controls: ɵTypedOrUntyped<TControl, TControl, {[key: string]: AbstractControl<any>}>; /** * Registers a control with the group's list of controls. In a strongly-typed group, the control * must be in the group's type (possibly as an optional key). * * This method does not update the value or validity of the control. * Use {@link FormGroup#addControl addControl} instead. * * @param name The control name to register in the collection * @param control Provides the control for the given name */ registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K]; registerControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl<any>): AbstractControl<any>; registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K] { if (this.controls[name]) return (this.controls as any)[name]; this.controls[name] = control; control.setParent(this as FormGroup); control._registerOnCollectionChange(this._onCollectionChange); return control; } /** * Add a control to this group. In a strongly-typed group, the control must be in the group's type * (possibly as an optional key). * * If a control with a given name already exists, it would *not* be replaced with a new one. * If you want to replace an existing control, use the {@link FormGroup#setControl setControl} * method instead. This method also updates the value and validity of the control. * * @param name The control name to add to the collection * @param control Provides the control for the given name * @param options Specifies whether this FormGroup instance should emit events after a new * control is added. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * added. When false, no events are emitted. */ addControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl, options?: {emitEvent?: boolean}): void; addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options?: { emitEvent?: boolean }): void; addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options: { emitEvent?: boolean } = {}): void { this.registerControl(name, control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } removeControl(this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, options?: { emitEvent?: boolean; }): void; removeControl<S extends string>(name: ɵOptionalKeys<TControl>&S, options?: { emitEvent?: boolean; }): void; /** * Remove a control from this group. In a strongly-typed group, required controls cannot be * removed. * * This method also updates the value and validity of the control. * * @param name The control name to remove from the collection * @param options Specifies whether this FormGroup instance should emit events after a * control is removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * removed. When false, no events are emitted. */ removeControl(name: string, options: {emitEvent?: boolean;} = {}): void { if ((this.controls as any)[name]) (this.controls as any)[name]._registerOnCollectionChange(() => {}); delete ((this.controls as any)[name]); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Replace an existing control. In a strongly-typed group, the control must be in the group's type * (possibly as an optional key). * * If a control with a given name does not exist in this `FormGroup`, it will be added. * * @param name The control name to replace in the collection * @param control Provides the control for the given name * @param options Specifies whether this FormGroup instance should emit events after an * existing control is replaced. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * replaced with a new one. When false, no events are emitted. */ setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options?: { emitEvent?: boolean }): void; setControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl, options?: {emitEvent?: boolean}): void; setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options: { emitEvent?: boolean } = {}): void { if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {}); delete (this.controls[name]); if (control) this.registerControl(name, control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Check whether there is an enabled control with the given name in the group. * * Reports false for disabled controls. If you'd like to check for existence in the group * only, use {@link AbstractControl#get get} instead. * * @param controlName The control name to check for existence in the collection * * @returns false for disabled controls, true otherwise. */ contains<K extends string>(controlName: K): boolean; contains(this: FormGroup<{[key: string]: AbstractControl<any>}>, controlName: string): boolean; contains<K extends string&keyof TControl>(controlName: K): boolean { return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled; } /** * Sets the value of the `FormGroup`. It accepts an object that matches * the structure of the group, with control names as keys. * * @usageNotes * ### Set the complete value for the form group * * ``` * const form = new FormGroup({ * first: new FormControl(), * last: new FormControl() * }); * * console.log(form.value); // {first: null, last: null} * * form.setValue({first: 'Nancy', last: 'Drew'}); * console.log(form.value); // {first: 'Nancy', last: 'Drew'} * ``` * * @throws When strict checks fail, such as setting the value of a control * that doesn't exist or if you exclude a value of a control that does exist. * * @param value The new value for the control that matches the structure of the group. * @param options Configuration options that determine how the control propagates changes * and emits events after the value changes. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. */ override setValue(value: ɵFormGroupRawValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { assertAllValuesPresent(this, true, value); (Object.keys(value) as Array<keyof TControl>).forEach(name => { assertControlPresent(this, true, name as any); (this.controls as any)[name].setValue( (value as any)[name], {onlySelf: true, emitEvent: options.emitEvent}); }); this.updateValueAndValidity(options); } /** * Patches the value of the `FormGroup`. It accepts an object with control * names as keys, and does its best to match the values to the correct controls * in the group. * * It accepts both super-sets and sub-sets of the group without throwing an error. * * @usageNotes * ### Patch the value for a form group * * ``` * const form = new FormGroup({ * first: new FormControl(), * last: new FormControl() * }); * console.log(form.value); // {first: null, last: null} * * form.patchValue({first: 'Nancy'}); * console.log(form.value); // {first: 'Nancy', last: null} * ``` * * @param value The object that matches the structure of the group. * @param options Configuration options that determine how the control propagates changes and * emits events after the value is patched. * * `onlySelf`: When true, each change only affects this control and not its parent. Default is * true. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control value * is updated. When false, no events are emitted. The configuration options are passed to * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method. */ override patchValue(value: ɵFormGroupValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { // Even though the `value` argument type doesn't allow `null` and `undefined` values, the // `patchValue` can be called recursively and inner data structures might have these values, so // we just ignore such cases when a field containing FormGroup instance receives `null` or // `undefined` as a value. if (value == null /* both `null` and `undefined` */) return; (Object.keys(value) as Array<keyof TControl>).forEach(name => { // The compiler cannot see through the uninstantiated conditional type of `this.controls`, so // `as any` is required. const control = (this.controls as any)[name]; if (control) { control.patchValue( /* Guaranteed to be present, due to the outer forEach. */ value [name as keyof ɵFormGroupValue<TControl>]!, {onlySelf: true, emitEvent: options.emitEvent}); } }); this.updateValueAndValidity(options); } /** * Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets * the value of all descendants to their default values, or null if no defaults were provided. * * You reset to a specific form state by passing in a map of states * that matches the structure of your form, with control names as keys. The state * is a standalone value or a form state object with both a value and a disabled * status. * * @param value Resets the control with an initial value, * or an object that defines the initial value and disabled state. * * @param options Configuration options that determine how the control propagates changes * and emits events when the group is reset. * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * @usageNotes * * ### Reset the form group values * * ```ts * const form = new FormGroup({ * first: new FormControl('first name'), * last: new FormControl('last name') * }); * * console.log(form.value); // {first: 'first name', last: 'last name'} * * form.reset({ first: 'name', last: 'last name' }); * * console.log(form.value); // {first: 'name', last: 'last name'} * ``` * * ### Reset the form group values and disabled status * * ``` * const form = new FormGroup({ * first: new FormControl('first name'), * last: new FormControl('last name') * }); * * form.reset({ * first: {value: 'name', disabled: true}, * last: 'last' * }); * * console.log(form.value); // {last: 'last'} * console.log(form.get('first').status); // 'DISABLED' * ``` */ override reset( value: ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any> = {} as unknown as ɵFormGroupValue<TControl>, options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._forEachChild((control, name) => { control.reset((value as any)[name], {onlySelf: true, emitEvent: options.emitEvent}); }); this._updatePristine(options); this._updateTouched(options); this.updateValueAndValidity(options); } /** * The aggregate value of the `FormGroup`, including any disabled controls. * * Retrieves all values regardless of disabled status. */ override getRawValue(): ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any> { return this._reduceChildren({}, (acc, control, name) => { (acc as any)[name] = (control as any).getRawValue(); return acc; }) as any; } /** @internal */ override _syncPendingControls(): boolean { let subtreeUpdated = this._reduceChildren(false, (updated: boolean, child) => { return child._syncPendingControls() ? true : updated; }); if (subtreeUpdated) this.updateValueAndValidity({onlySelf: true}); return subtreeUpdated; } /** @internal */ override _forEachChild(cb: (v: any, k: any) => void): void { Object.keys(this.controls).forEach(key => { // The list of controls can change (for ex. controls might be removed) while the loop // is running (as a result of invoking Forms API in `valueChanges` subscription), so we // have to null check before invoking the callback. const control = (this.controls as any)[key]; control && cb(control, key); }); } /** @internal */ _setUpControls(): void { this._forEachChild((control) => { control.setParent(this); control._registerOnCollectionChange(this._onCollectionChange); }); } /** @internal */ override _updateValue(): void { (this as {value: any}).value = this._reduceValue(); } /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { for (const [controlName, control] of Object.entries(this.controls)) { if (this.contains(controlName as any) && condition(control as any)) { return true; } } return false; } /** @internal */ _reduceValue(): Partial<TControl> { let acc: Partial<TControl> = {}; return this._reduceChildren(acc, (acc, control, name) => { if (control.enabled || this.disabled) { acc[name] = control.value; } return acc; }); } /** @internal */ _reduceChildren<T, K extends keyof TControl>( initValue: T, fn: (acc: T, control: TControl[K], name: K) => T): T { let res = initValue; this._forEachChild((control: TControl[K], name: K) => { res = fn(res, control, name); }); return res; } /** @internal */ override _allControlsDisabled(): boolean { for (const controlName of (Object.keys(this.controls) as Array<keyof TControl>)) { if ((this.controls as any)[controlName].enabled) { return false; } } return Object.keys(this.controls).length > 0 || this.disabled; } /** @internal */ override _find(name: string|number): AbstractControl|null { return this.controls.hasOwnProperty(name as string) ? (this.controls as any)[name as keyof TControl] : null; } } interface UntypedFormGroupCtor { new(controls: {[key: string]: AbstractControl}, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormGroup; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormGroup<any>; } /** * UntypedFormGroup is a non-strongly-typed version of @see FormGroup. */ export type UntypedFormGroup = FormGroup<any>; export const UntypedFormGroup: UntypedFormGroupCtor = FormGroup; /** * @description * Asserts that the given control is an instance of `FormGroup` * * @publicApi */ export const isFormGroup = (control: unknown): control is FormGroup => control instanceof FormGroup; /** * Tracks the value and validity state of a collection of `FormControl` instances, each of which has * the same value type. * * `FormRecord` is very similar to {@link FormGroup}, except it can be used with a dynamic keys, * with controls added and removed as needed. * * `FormRecord` accepts one generic argument, which describes the type of the controls it contains. * * @usageNotes * * ``` * let numbers = new FormRecord({bill: new FormControl('415-123-456')}); * numbers.addControl('bob', new FormControl('415-234-567')); * numbers.removeControl('bill'); * ``` * * @publicApi */ export class FormRecord<TControl extends AbstractControl = AbstractControl> extends FormGroup<{[key: string]: TControl}> {} export interface FormRecord<TControl> { /** * Registers a control with the records's list of controls. * * See `FormGroup#registerControl` for additional information. */ registerControl(name: string, control: TControl): TControl; /** * Add a control to this group. * * See `FormGroup#addControl` for additional information. */ addControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void; /** * Remove a control from this group. * * See `FormGroup#removeControl` for additional information. */ removeControl(name: string, options?: {emitEvent?: boolean}): void; /** * Replace an existing control. * * See `FormGroup#setControl` for additional information. */ setControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void; /** * Check whether there is an enabled control with the given name in the group. * * See `FormGroup#contains` for additional information. */ contains(controlName: string): boolean; /** * Sets the value of the `FormRecord`. It accepts an object that matches * the structure of the group, with control names as keys. * * See `FormGroup#setValue` for additional information. */ setValue(value: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * Patches the value of the `FormRecord`. It accepts an object with control * names as keys, and does its best to match the values to the correct controls * in the group. * * See `FormGroup#patchValue` for additional information. */ patchValue(value: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * Resets the `FormRecord`, marks all descendants `pristine` and `untouched` and sets * the value of all descendants to null. * * See `FormGroup#reset` for additional information. */ reset(value?: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * The aggregate value of the `FormRecord`, including any disabled controls. * * See `FormGroup#getRawValue` for additional information. */ getRawValue(): {[key: string]: ɵRawValue<TControl>}; } /** * @description * Asserts that the given control is an instance of `FormRecord` * * @publicApi */ export const isFormRecord = (control: unknown): control is FormRecord => control instanceof FormRecord; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Inject, InjectionToken, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {AbstractControl} from '../model/abstract_model'; import {FormArray} from '../model/form_array'; import {FormControl} from '../model/form_control'; import {FormGroup} from '../model/form_group'; import {getControlAsyncValidators, getControlValidators, mergeValidators} from '../validators'; import {AbstractControlDirective} from './abstract_control_directive'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {BuiltInControlValueAccessor, ControlValueAccessor} from './control_value_accessor'; import {DefaultValueAccessor} from './default_value_accessor'; import {NgControl} from './ng_control'; import {FormArrayName} from './reactive_directives/form_group_name'; import {ngModelWarning} from './reactive_errors'; import {AsyncValidatorFn, Validator, ValidatorFn} from './validators'; /** * Token to provide to allow SetDisabledState to always be called when a CVA is added, regardless of * whether the control is disabled or enabled. * * @see `FormsModule.withConfig` */ export const CALL_SET_DISABLED_STATE = new InjectionToken( 'CallSetDisabledState', {providedIn: 'root', factory: () => setDisabledStateDefault}); /** * The type for CALL_SET_DISABLED_STATE. If `always`, then ControlValueAccessor will always call * `setDisabledState` when attached, which is the most correct behavior. Otherwise, it will only be * called when disabled, which is the legacy behavior for compatibility. * * @publicApi * @see `FormsModule.withConfig` */ export type SetDisabledStateOption = 'whenDisabledForLegacyCode'|'always'; /** * Whether to use the fixed setDisabledState behavior by default. */ export const setDisabledStateDefault: SetDisabledStateOption = 'always'; export function controlPath(name: string|null, parent: ControlContainer): string[] { return [...parent.path!, name!]; } /** * Links a Form control and a Form directive by setting up callbacks (such as `onChange`) on both * instances. This function is typically invoked when form directive is being initialized. * * @param control Form control instance that should be linked. * @param dir Directive that should be linked with a given control. */ export function setUpControl( control: FormControl, dir: NgControl, callSetDisabledState: SetDisabledStateOption = setDisabledStateDefault): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!control) _throwError(dir, 'Cannot find control with'); if (!dir.valueAccessor) _throwMissingValueAccessorError(dir); } setUpValidators(control, dir); dir.valueAccessor!.writeValue(control.value); // The legacy behavior only calls the CVA's `setDisabledState` if the control is disabled. // If the `callSetDisabledState` option is set to `always`, then this bug is fixed and // the method is always called. if (control.disabled || callSetDisabledState === 'always') { dir.valueAccessor!.setDisabledState?.(control.disabled); } setUpViewChangePipeline(control, dir); setUpModelChangePipeline(control, dir); setUpBlurPipeline(control, dir); setUpDisabledChangeHandler(control, dir); } /** * Reverts configuration performed by the `setUpControl` control function. * Effectively disconnects form control with a given form directive. * This function is typically invoked when corresponding form directive is being destroyed. * * @param control Form control which should be cleaned up. * @param dir Directive that should be disconnected from a given control. * @param validateControlPresenceOnChange Flag that indicates whether onChange handler should * contain asserts to verify that it's not called once directive is destroyed. We need this flag * to avoid potentially breaking changes caused by better control cleanup introduced in #39235. */ export function cleanUpControl( control: FormControl|null, dir: NgControl, validateControlPresenceOnChange: boolean = true): void { const noop = () => { if (validateControlPresenceOnChange && (typeof ngDevMode === 'undefined' || ngDevMode)) { _noControlError(dir); } }; // The `valueAccessor` field is typically defined on FromControl and FormControlName directive // instances and there is a logic in `selectValueAccessor` function that throws if it's not the // case. We still check the presence of `valueAccessor` before invoking its methods to make sure // that cleanup works correctly if app code or tests are setup to ignore the error thrown from // `selectValueAccessor`. See https://github.com/angular/angular/issues/40521. if (dir.valueAccessor) { dir.valueAccessor.registerOnChange(noop); dir.valueAccessor.registerOnTouched(noop); } cleanUpValidators(control, dir); if (control) { dir._invokeOnDestroyCallbacks(); control._registerOnCollectionChange(() => {}); } } function registerOnValidatorChange<V>(validators: (V|Validator)[], onChange: () => void): void { validators.forEach((validator: V|Validator) => { if ((<Validator>validator).registerOnValidatorChange) (<Validator>validator).registerOnValidatorChange!(onChange); }); } /** * Sets up disabled change handler function on a given form control if ControlValueAccessor * associated with a given directive instance supports the `setDisabledState` call. * * @param control Form control where disabled change handler should be setup. * @param dir Corresponding directive instance associated with this control. */ export function setUpDisabledChangeHandler(control: FormControl, dir: NgControl): void { if (dir.valueAccessor!.setDisabledState) { const onDisabledChange = (isDisabled: boolean) => { dir.valueAccessor!.setDisabledState!(isDisabled); }; control.registerOnDisabledChange(onDisabledChange); // Register a callback function to cleanup disabled change handler // from a control instance when a directive is destroyed. dir._registerOnDestroy(() => { control._unregisterOnDisabledChange(onDisabledChange); }); } } /** * Sets up sync and async directive validators on provided form control. * This function merges validators from the directive into the validators of the control. * * @param control Form control where directive validators should be setup. * @param dir Directive instance that contains validators to be setup. */ export function setUpValidators(control: AbstractControl, dir: AbstractControlDirective): void { const validators = getControlValidators(control); if (dir.validator !== null) { control.setValidators(mergeValidators<ValidatorFn>(validators, dir.validator)); } else if (typeof validators === 'function') { // If sync validators are represented by a single validator function, we force the // `Validators.compose` call to happen by executing the `setValidators` function with // an array that contains that function. We need this to avoid possible discrepancies in // validators behavior, so sync validators are always processed by the `Validators.compose`. // Note: we should consider moving this logic inside the `setValidators` function itself, so we // have consistent behavior on AbstractControl API level. The same applies to the async // validators logic below. control.setValidators([validators]); } const asyncValidators = getControlAsyncValidators(control); if (dir.asyncValidator !== null) { control.setAsyncValidators( mergeValidators<AsyncValidatorFn>(asyncValidators, dir.asyncValidator)); } else if (typeof asyncValidators === 'function') { control.setAsyncValidators([asyncValidators]); } // Re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4 const onValidatorChange = () => control.updateValueAndValidity(); registerOnValidatorChange<ValidatorFn>(dir._rawValidators, onValidatorChange); registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, onValidatorChange); } /** * Cleans up sync and async directive validators on provided form control. * This function reverts the setup performed by the `setUpValidators` function, i.e. * removes directive-specific validators from a given control instance. * * @param control Form control from where directive validators should be removed. * @param dir Directive instance that contains validators to be removed. * @returns true if a control was updated as a result of this action. */ export function cleanUpValidators( control: AbstractControl|null, dir: AbstractControlDirective): boolean { let isControlUpdated = false; if (control !== null) { if (dir.validator !== null) { const validators = getControlValidators(control); if (Array.isArray(validators) && validators.length > 0) { // Filter out directive validator function. const updatedValidators = validators.filter((validator) => validator !== dir.validator); if (updatedValidators.length !== validators.length) { isControlUpdated = true; control.setValidators(updatedValidators); } } } if (dir.asyncValidator !== null) { const asyncValidators = getControlAsyncValidators(control); if (Array.isArray(asyncValidators) && asyncValidators.length > 0) { // Filter out directive async validator function. const updatedAsyncValidators = asyncValidators.filter((asyncValidator) => asyncValidator !== dir.asyncValidator); if (updatedAsyncValidators.length !== asyncValidators.length) { isControlUpdated = true; control.setAsyncValidators(updatedAsyncValidators); } } } } // Clear onValidatorChange callbacks by providing a noop function. const noop = () => {}; registerOnValidatorChange<ValidatorFn>(dir._rawValidators, noop); registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, noop); return isControlUpdated; } function setUpViewChangePipeline(control: FormControl, dir: NgControl): void { dir.valueAccessor!.registerOnChange((newValue: any) => { control._pendingValue = newValue; control._pendingChange = true; control._pendingDirty = true; if (control.updateOn === 'change') updateControl(control, dir); }); } function setUpBlurPipeline(control: FormControl, dir: NgControl): void { dir.valueAccessor!.registerOnTouched(() => { control._pendingTouched = true; if (control.updateOn === 'blur' && control._pendingChange) updateControl(control, dir); if (control.updateOn !== 'submit') control.markAsTouched(); }); } function updateControl(control: FormControl, dir: NgControl): void { if (control._pendingDirty) control.markAsDirty(); control.setValue(control._pendingValue, {emitModelToViewChange: false}); dir.viewToModelUpdate(control._pendingValue); control._pendingChange = false; } function setUpModelChangePipeline(control: FormControl, dir: NgControl): void { const onChange = (newValue?: any, emitModelEvent?: boolean) => { // control -> view dir.valueAccessor!.writeValue(newValue); // control -> ngModel if (emitModelEvent) dir.viewToModelUpdate(newValue); }; control.registerOnChange(onChange); // Register a callback function to cleanup onChange handler // from a control instance when a directive is destroyed. dir._registerOnDestroy(() => { control._unregisterOnChange(onChange); }); } /** * Links a FormGroup or FormArray instance and corresponding Form directive by setting up validators * present in the view. * * @param control FormGroup or FormArray instance that should be linked. * @param dir Directive that provides view validators. */ export function setUpFormContainer( control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName) { if (control == null && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'Cannot find control with'); setUpValidators(control, dir); } /** * Reverts the setup performed by the `setUpFormContainer` function. * * @param control FormGroup or FormArray instance that should be cleaned up. * @param dir Directive that provided view validators. * @returns true if a control was updated as a result of this action. */ export function cleanUpFormContainer( control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName): boolean { return cleanUpValidators(control, dir); } function _noControlError(dir: NgControl) { return _throwError(dir, 'There is no FormControl instance attached to form control element with'); } function _throwError(dir: AbstractControlDirective, message: string): void { const messageEnd = _describeControlLocation(dir); throw new Error(`${message} ${messageEnd}`); } function _describeControlLocation(dir: AbstractControlDirective): string { const path = dir.path; if (path && path.length > 1) return `path: '${path.join(' -> ')}'`; if (path?.[0]) return `name: '${path}'`; return 'unspecified name attribute'; } function _throwMissingValueAccessorError(dir: AbstractControlDirective) { const loc = _describeControlLocation(dir); throw new RuntimeError( RuntimeErrorCode.NG_MISSING_VALUE_ACCESSOR, `No value accessor for form control ${loc}.`); } function _throwInvalidValueAccessorError(dir: AbstractControlDirective) { const loc = _describeControlLocation(dir); throw new RuntimeError( RuntimeErrorCode.NG_VALUE_ACCESSOR_NOT_PROVIDED, `Value accessor was not provided as an array for form control with ${loc}. ` + `Check that the \\`NG_VALUE_ACCESSOR\\` token is configured as a \\`multi: true\\` provider.`); } export function isPropertyUpdated(changes: {[key: string]: any}, viewModel: any): boolean { if (!changes.hasOwnProperty('model')) return false; const change = changes['model']; if (change.isFirstChange()) return true; return !Object.is(viewModel, change.currentValue); } export function isBuiltInAccessor(valueAccessor: ControlValueAccessor): boolean { // Check if a given value accessor is an instance of a class that directly extends // `BuiltInControlValueAccessor` one. return Object.getPrototypeOf(valueAccessor.constructor) === BuiltInControlValueAccessor; } export function syncPendingControls(form: FormGroup, directives: Set<NgControl>|NgControl[]): void { form._syncPendingControls(); directives.forEach((dir: NgControl) => { const control = dir.control as FormControl; if (control.updateOn === 'submit' && control._pendingChange) { dir.viewToModelUpdate(control._pendingValue); control._pendingChange = false; } }); } // TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented export function selectValueAccessor( dir: NgControl, valueAccessors: ControlValueAccessor[]): ControlValueAccessor|null { if (!valueAccessors) return null; if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwInvalidValueAccessorError(dir); let defaultAccessor: ControlValueAccessor|undefined = undefined; let builtinAccessor: ControlValueAccessor|undefined = undefined; let customAccessor: ControlValueAccessor|undefined = undefined; valueAccessors.forEach((v: ControlValueAccessor) => { if (v.constructor === DefaultValueAccessor) { defaultAccessor = v; } else if (isBuiltInAccessor(v)) { if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'More than one built-in value accessor matches form control with'); builtinAccessor = v; } else { if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'More than one custom value accessor matches form control with'); customAccessor = v; } }); if (customAccessor) return customAccessor; if (builtinAccessor) return builtinAccessor; if (defaultAccessor) return defaultAccessor; if (typeof ngDevMode === 'undefined' || ngDevMode) { _throwError(dir, 'No valid value accessor for form control with'); } return null; } export function removeListItem<T>(list: T[], el: T): void { const index = list.indexOf(el); if (index > -1) list.splice(index, 1); } // TODO(kara): remove after deprecation period export function _ngModelWarning( name: string, type: {_ngModelWarningSentOnce: boolean}, instance: {_ngModelWarningSent: boolean}, warningConfig: string|null) { if (warningConfig === 'never') return; if (((warningConfig === null || warningConfig === 'once') && !type._ngModelWarningSentOnce) || (warningConfig === 'always' && !instance._ngModelWarningSent)) { console.warn(ngModelWarning(name)); type._ngModelWarningSentOnce = true; instance._ngModelWarningSent = true; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AfterViewInit, Directive, EventEmitter, forwardRef, Inject, Input, Optional, Provider, Self} from '@angular/core'; import {AbstractControl, FormHooks} from '../model/abstract_model'; import {FormControl} from '../model/form_control'; import {FormGroup} from '../model/form_group'; import {composeAsyncValidators, composeValidators, NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {ControlContainer} from './control_container'; import {Form} from './form_interface'; import {NgControl} from './ng_control'; import {NgModel} from './ng_model'; import {NgModelGroup} from './ng_model_group'; import {CALL_SET_DISABLED_STATE, SetDisabledStateOption, setUpControl, setUpFormContainer, syncPendingControls} from './shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; const formDirectiveProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => NgForm) }; const resolvedPromise = (() => Promise.resolve())(); /** * @description * Creates a top-level `FormGroup` instance and binds it to a form * to track aggregate form value and validation status. * * As soon as you import the `FormsModule`, this directive becomes active by default on * all `<form>` tags. You don't need to add a special selector. * * You optionally export the directive into a local template variable using `ngForm` as the key * (ex: `#myForm=\"ngForm\"`). This is optional, but useful. Many properties from the underlying * `FormGroup` instance are duplicated on the directive itself, so a reference to it * gives you access to the aggregate value and validity status of the form, as well as * user interaction properties like `dirty` and `touched`. * * To register child controls with the form, use `NgModel` with a `name` * attribute. You may use `NgModelGroup` to create sub-groups within the form. * * If necessary, listen to the directive's `ngSubmit` event to be notified when the user has * triggered a form submission. The `ngSubmit` event emits the original form * submission event. * * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`. * To import the `FormsModule` but skip its usage in some forms, * for example, to use native HTML5 validation, add the `ngNoForm` and the `<form>` * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is * unnecessary because the `<form>` tags are inert. In that case, you would * refrain from using the `formGroup` directive. * * @usageNotes * * ### Listening for form submission * * The following example shows how to capture the form values from the \"ngSubmit\" event. * * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} * * ### Setting the update options * * The following example shows you how to change the \"updateOn\" option from its default using * ngFormOptions. * * ```html * <form [ngFormOptions]=\"{updateOn: 'blur'}\"> * <input name=\"one\" ngModel> <!-- this ngModel will update on blur --> * </form> * ``` * * ### Native DOM validation UI * * In order to prevent the native DOM form validation UI from interfering with Angular's form * validation, Angular automatically adds the `novalidate` attribute on any `<form>` whenever * `FormModule` or `ReactiveFormModule` are imported into the application. * If you want to explicitly enable native DOM validation UI with Angular forms, you can add the * `ngNativeValidate` attribute to the `<form>` element: * * ```html * <form ngNativeValidate> * ... * </form> * ``` * * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]', providers: [formDirectiveProvider], host: {'(submit)': 'onSubmit($event)', '(reset)': 'onReset()'}, outputs: ['ngSubmit'], exportAs: 'ngForm' }) export class NgForm extends ControlContainer implements Form, AfterViewInit { /** * @description * Returns whether the form submission has been triggered. */ public readonly submitted: boolean = false; private _directives = new Set<NgModel>(); /** * @description * The `FormGroup` instance created for this form. */ form: FormGroup; /** * @description * Event emitter for the \"ngSubmit\" event */ ngSubmit = new EventEmitter(); /** * @description * Tracks options for the `NgForm` instance. * * **updateOn**: Sets the default `updateOn` value for all child `NgModels` below it * unless explicitly set by a child `NgModel` using `ngModelOptions`). Defaults to 'change'. * Possible values: `'change'` | `'blur'` | `'submit'`. * */ // TODO(issue/24571): remove '!'. @Input('ngFormOptions') options!: {updateOn?: FormHooks}; constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this.form = new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators)); } /** @nodoc */ ngAfterViewInit() { this._setUpdateStrategy(); } /** * @description * The directive instance. */ override get formDirective(): Form { return this; } /** * @description * The internal `FormGroup` instance. */ override get control(): FormGroup { return this.form; } /** * @description * Returns an array representing the path to this group. Because this directive * always lives at the top level of a form, it is always an empty array. */ override get path(): string[] { return []; } /** * @description * Returns a map of the controls in this group. */ get controls(): {[key: string]: AbstractControl} { return this.form.controls; } /** * @description * Method that sets up the control directive in this group, re-calculates its value * and validity, and adds the instance to the internal list of directives. * * @param dir The `NgModel` directive instance. */ addControl(dir: NgModel): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); (dir as {control: FormControl}).control = <FormControl>container.registerControl(dir.name, dir.control); setUpControl(dir.control, dir, this.callSetDisabledState); dir.control.updateValueAndValidity({emitEvent: false}); this._directives.add(dir); }); } /** * @description * Retrieves the `FormControl` instance from the provided `NgModel` directive. * * @param dir The `NgModel` directive instance. */ getControl(dir: NgModel): FormControl { return <FormControl>this.form.get(dir.path); } /** * @description * Removes the `NgModel` instance from the internal list of directives * * @param dir The `NgModel` directive instance. */ removeControl(dir: NgModel): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); if (container) { container.removeControl(dir.name); } this._directives.delete(dir); }); } /** * @description * Adds a new `NgModelGroup` directive instance to the form. * * @param dir The `NgModelGroup` directive instance. */ addFormGroup(dir: NgModelGroup): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); const group = new FormGroup({}); setUpFormContainer(group, dir); container.registerControl(dir.name, group); group.updateValueAndValidity({emitEvent: false}); }); } /** * @description * Removes the `NgModelGroup` directive instance from the form. * * @param dir The `NgModelGroup` directive instance. */ removeFormGroup(dir: NgModelGroup): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); if (container) { container.removeControl(dir.name); } }); } /** * @description * Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance * * @param dir The `NgModelGroup` directive instance. */ getFormGroup(dir: NgModelGroup): FormGroup { return <FormGroup>this.form.get(dir.path); } /** * Sets the new value for the provided `NgControl` directive. * * @param dir The `NgControl` directive instance. * @param value The new value for the directive's control. */ updateModel(dir: NgControl, value: any): void { resolvedPromise.then(() => { const ctrl = <FormControl>this.form.get(dir.path!); ctrl.setValue(value); }); } /** * @description * Sets the value for this `FormGroup`. * * @param value The new value */ setValue(value: {[key: string]: any}): void { this.control.setValue(value); } /** * @description * Method called when the \"submit\" event is triggered on the form. * Triggers the `ngSubmit` emitter to emit the \"submit\" event as its payload. * * @param $event The \"submit\" event object */ onSubmit($event: Event): boolean { (this as {submitted: boolean}).submitted = true; syncPendingControls(this.form, this._directives); this.ngSubmit.emit($event); // Forms with `method=\"dialog\"` have some special behavior // that won't reload the page and that shouldn't be prevented. return ($event?.target as HTMLFormElement | null)?.method === 'dialog'; } /** * @description * Method called when the \"reset\" event is triggered on the form. */ onReset(): void { this.resetForm(); } /** * @description * Resets the form to an initial value and resets its submitted status. * * @param value The new value for the form. */ resetForm(value: any = undefined): void { this.form.reset(value); (this as {submitted: boolean}).submitted = false; } private _setUpdateStrategy() { if (this.options && this.options.updateOn != null) { this.form._updateOn = this.options.updateOn; } } private _findContainer(path: string[]): FormGroup { path.pop(); return path.length ? <FormGroup>this.form.get(path) : this.form; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export function removeListItem<T>(list: T[], el: T): void { const index = list.indexOf(el); if (index > -1) list.splice(index, 1); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {removeListItem} from '../util'; import {AbstractControl, AbstractControlOptions, isOptionsObj, pickAsyncValidators, pickValidators} from './abstract_model'; /** * FormControlState is a boxed form value. It is an object with a `value` key and a `disabled` key. * * @publicApi */ export interface FormControlState<T> { value: T; disabled: boolean; } /** * Interface for options provided to a `FormControl`. * * This interface extends all options from {@link AbstractControlOptions}, plus some options * unique to `FormControl`. * * @publicApi */ export interface FormControlOptions extends AbstractControlOptions { /** * @description * Whether to use the initial value used to construct the `FormControl` as its default value * as well. If this option is false or not provided, the default value of a FormControl is `null`. * When a FormControl is reset without an explicit value, its value reverts to * its default value. */ nonNullable?: boolean; /** * @deprecated Use `nonNullable` instead. */ initialValueIsDefault?: boolean; } /** * Tracks the value and validation status of an individual form control. * * This is one of the four fundamental building blocks of Angular forms, along with * `FormGroup`, `FormArray` and `FormRecord`. It extends the `AbstractControl` class that * implements most of the base functionality for accessing the value, validation status, * user interactions and events. * * `FormControl` takes a single generic argument, which describes the type of its value. This * argument always implicitly includes `null` because the control can be reset. To change this * behavior, set `nonNullable` or see the usage notes below. * * See [usage examples below](#usage-notes). * * @see `AbstractControl` * @see [Reactive Forms Guide](guide/reactive-forms) * @see [Usage Notes](#usage-notes) * * @publicApi * * @overriddenImplementation ɵFormControlCtor * * @usageNotes * * ### Initializing Form Controls * * Instantiate a `FormControl`, with an initial value. * * ```ts * const control = new FormControl('some value'); * console.log(control.value); // 'some value' * ``` * * The following example initializes the control with a form state object. The `value` * and `disabled` keys are required in this case. * * ```ts * const control = new FormControl({ value: 'n/a', disabled: true }); * console.log(control.value); // 'n/a' * console.log(control.status); // 'DISABLED' * ``` * * The following example initializes the control with a synchronous validator. * * ```ts * const control = new FormControl('', Validators.required); * console.log(control.value); // '' * console.log(control.status); // 'INVALID' * ``` * * The following example initializes the control using an options object. * * ```ts * const control = new FormControl('', { * validators: Validators.required, * asyncValidators: myAsyncValidator * }); * ``` * * ### The single type argument * * `FormControl` accepts a generic argument, which describes the type of its value. * In most cases, this argument will be inferred. * * If you are initializing the control to `null`, or you otherwise wish to provide a * wider type, you may specify the argument explicitly: * * ``` * let fc = new FormControl<string|null>(null); * fc.setValue('foo'); * ``` * * You might notice that `null` is always added to the type of the control. * This is because the control will become `null` if you call `reset`. You can change * this behavior by setting `{nonNullable: true}`. * * ### Configure the control to update on a blur event * * Set the `updateOn` option to `'blur'` to update on the blur `event`. * * ```ts * const control = new FormControl('', { updateOn: 'blur' }); * ``` * * ### Configure the control to update on a submit event * * Set the `updateOn` option to `'submit'` to update on a submit `event`. * * ```ts * const control = new FormControl('', { updateOn: 'submit' }); * ``` * * ### Reset the control back to a specific value * * You reset to a specific form state by passing through a standalone * value or a form state object that contains both a value and a disabled state * (these are the only two properties that cannot be calculated). * * ```ts * const control = new FormControl('Nancy'); * * console.log(control.value); // 'Nancy' * * control.reset('Drew'); * * console.log(control.value); // 'Drew' * ``` * * ### Reset the control to its initial value * * If you wish to always reset the control to its initial value (instead of null), * you can pass the `nonNullable` option: * * ``` * const control = new FormControl('Nancy', {nonNullable: true}); * * console.log(control.value); // 'Nancy' * * control.reset(); * * console.log(control.value); // 'Nancy' * ``` * * ### Reset the control back to an initial value and disabled * * ``` * const control = new FormControl('Nancy'); * * console.log(control.value); // 'Nancy' * console.log(control.status); // 'VALID' * * control.reset({ value: 'Drew', disabled: true }); * * console.log(control.value); // 'Drew' * console.log(control.status); // 'DISABLED' * ``` */ export interface FormControl<TValue = any> extends AbstractControl<TValue> { /** * The default value of this FormControl, used whenever the control is reset without an explicit * value. See {@link FormControlOptions#nonNullable} for more information on configuring * a default value. */ readonly defaultValue: TValue; /** @internal */ _onChange: Function[]; /** * This field holds a pending value that has not yet been applied to the form's value. * @internal */ _pendingValue: TValue; /** @internal */ _pendingChange: boolean; /** * Sets a new value for the form control. * * @param value The new value for the control. * @param options Configuration options that determine how the control propagates changes * and emits events when the value changes. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. * * `emitModelToViewChange`: When true or not supplied (the default), each change triggers an * `onChange` event to * update the view. * * `emitViewToModelChange`: When true or not supplied (the default), each change triggers an * `ngModelChange` * event to update the model. * */ setValue(value: TValue, options?: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean }): void; /** * Patches the value of a control. * * This function is functionally the same as {@link FormControl#setValue setValue} at this level. * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and * `FormArrays`, where it does behave differently. * * @see `setValue` for options */ patchValue(value: TValue, options?: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean }): void; /** * Resets the form control, marking it `pristine` and `untouched`, and resetting * the value. The new value will be the provided value (if passed), `null`, or the initial value * if `nonNullable` was set in the constructor via {@link FormControlOptions}. * * ```ts * // By default, the control will reset to null. * const dog = new FormControl('spot'); * dog.reset(); // dog.value is null * * // If this flag is set, the control will instead reset to the initial value. * const cat = new FormControl('tabby', {nonNullable: true}); * cat.reset(); // cat.value is \"tabby\" * * // A value passed to reset always takes precedence. * const fish = new FormControl('finn', {nonNullable: true}); * fish.reset('bubble'); // fish.value is \"bubble\" * ``` * * @param formState Resets the control with an initial value, * or an object that defines the initial value and disabled state. * * @param options Configuration options that determine how the control propagates changes * and emits events after the value changes. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * */ reset(formState?: TValue|FormControlState<TValue>, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * For a simple FormControl, the raw value is equivalent to the value. */ getRawValue(): TValue; /** * @internal */ _updateValue(): void; /** * @internal */ _anyControls(condition: (c: AbstractControl) => boolean): boolean; /** * @internal */ _allControlsDisabled(): boolean; /** * Register a listener for change events. * * @param fn The method that is called when the value changes */ registerOnChange(fn: Function): void; /** * Internal function to unregister a change events listener. * @internal */ _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void; /** * Register a listener for disabled events. * * @param fn The method that is called when the disabled status changes. */ registerOnDisabledChange(fn: (isDisabled: boolean) => void): void; /** * Internal function to unregister a disabled event listener. * @internal */ _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void; /** * @internal */ _forEachChild(cb: (c: AbstractControl) => void): void; /** @internal */ _syncPendingControls(): boolean; } // This internal interface is present to avoid a naming clash, resulting in the wrong `FormControl` // symbol being used. type FormControlInterface<TValue = any> = FormControl<TValue>; /** * Various available constructors for `FormControl`. * Do not use this interface directly. Instead, use `FormControl`: * ``` * const fc = new FormControl('foo'); * ``` * This symbol is prefixed with ɵ to make plain that it is an internal symbol. */ export interface ɵFormControlCtor { /** * Construct a FormControl with no initial value or validators. */ new(): FormControl<any>; /** * Creates a new `FormControl` instance. * * @param formState Initializes the control with an initial value, * or an object that defines the initial value and disabled state. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or a `FormControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions */ new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{nonNullable: true}): FormControl<T>; /** * @deprecated Use `nonNullable` instead. */ new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{ initialValueIsDefault: true }): FormControl<T>; /** * @deprecated When passing an `options` argument, the `asyncValidator` argument has no effect. */ new<T = any>( value: FormControlState<T>|T, opts: FormControlOptions, asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]): FormControl<T|null>; new<T = any>( value: FormControlState<T>|T, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T|null>; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormControl<any>; } function isFormControlState(formState: unknown): formState is FormControlState<unknown> { return typeof formState === 'object' && formState !== null && Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState; } export const FormControl: ɵFormControlCtor = (class FormControl<TValue = any> extends AbstractControl< TValue> implements FormControlInterface<TValue> { /** @publicApi */ public readonly defaultValue: TValue = null as unknown as TValue; /** @internal */ _onChange: Array<Function> = []; /** @internal */ _pendingValue!: TValue; /** @internal */ _pendingChange: boolean = false; constructor( // formState and defaultValue will only be null if T is nullable formState: FormControlState<TValue>|TValue = null as unknown as TValue, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super( pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this._applyFormState(formState); this._setUpdateStrategy(validatorOrOpts); this._initObservables(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. // The status should be broadcasted via the `statusChanges` observable, so we set // `emitEvent` to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); if (isOptionsObj(validatorOrOpts) && (validatorOrOpts.nonNullable || validatorOrOpts.initialValueIsDefault)) { if (isFormControlState(formState)) { this.defaultValue = formState.value; } else { this.defaultValue = formState; } } } override setValue(value: TValue, options: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean } = {}): void { (this as {value: TValue}).value = this._pendingValue = value; if (this._onChange.length && options.emitModelToViewChange !== false) { this._onChange.forEach( (changeFn) => changeFn(this.value, options.emitViewToModelChange !== false)); } this.updateValueAndValidity(options); } override patchValue(value: TValue, options: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean } = {}): void { this.setValue(value, options); } override reset( formState: TValue|FormControlState<TValue> = this.defaultValue, options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._applyFormState(formState); this.markAsPristine(options); this.markAsUntouched(options); this.setValue(this.value, options); this._pendingChange = false; } /** @internal */ override _updateValue(): void {} /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { return false; } /** @internal */ override _allControlsDisabled(): boolean { return this.disabled; } registerOnChange(fn: Function): void { this._onChange.push(fn); } /** @internal */ _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void { removeListItem(this._onChange, fn); } registerOnDisabledChange(fn: (isDisabled: boolean) => void): void { this._onDisabledChange.push(fn); } /** @internal */ _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void { removeListItem(this._onDisabledChange, fn); } /** @internal */ override _forEachChild(cb: (c: AbstractControl) => void): void {} /** @internal */ override _syncPendingControls(): boolean { if (this.updateOn === 'submit') { if (this._pendingDirty) this.markAsDirty(); if (this._pendingTouched) this.markAsTouched(); if (this._pendingChange) { this.setValue(this._pendingValue, {onlySelf: true, emitModelToViewChange: false}); return true; } } return false; } private _applyFormState(formState: FormControlState<TValue>|TValue) { if (isFormControlState(formState)) { (this as {value: TValue}).value = this._pendingValue = formState.value; formState.disabled ? this.disable({onlySelf: true, emitEvent: false}) : this.enable({onlySelf: true, emitEvent: false}); } else { (this as {value: TValue}).value = this._pendingValue = formState; } } }); interface UntypedFormControlCtor { new(): UntypedFormControl; new(formState?: any, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormControl; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormControl<any>; } /** * UntypedFormControl is a non-strongly-typed version of @see FormControl. */ export type UntypedFormControl = FormControl<any>; export const UntypedFormControl: UntypedFormControlCtor = FormControl; /** * @description * Asserts that the given control is an instance of `FormControl` * * @publicApi */ export const isFormControl = (control: unknown): control is FormControl => control instanceof FormControl; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, OnDestroy, OnInit} from '@angular/core'; import {FormGroup} from '../model/form_group'; import {ControlContainer} from './control_container'; import {Form} from './form_interface'; import {controlPath} from './shared'; /** * @description * A base class for code shared between the `NgModelGroup` and `FormGroupName` directives. * * @publicApi */ @Directive() export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy { /** * @description * The parent control for the group * * @internal */ // TODO(issue/24571): remove '!'. _parent!: ControlContainer; /** @nodoc */ ngOnInit(): void { this._checkParentType(); // Register the group with its parent group. this.formDirective!.addFormGroup(this); } /** @nodoc */ ngOnDestroy(): void { if (this.formDirective) { // Remove the group from its parent group. this.formDirective.removeFormGroup(this); } } /** * @description * The `FormGroup` bound to this directive. */ override get control(): FormGroup { return this.formDirective!.getFormGroup(this); } /** * @description * The path to this group from the top-level directive. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); } /** * @description * The top-level directive for this group if present, otherwise null. */ override get formDirective(): Form|null { return this._parent ? this._parent.formDirective : null; } /** @internal */ _checkParentType(): void {} } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {formControlNameExample, formGroupNameExample, ngModelGroupExample, ngModelWithFormGroupExample} from './error_examples'; export function modelParentException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODEL_IN_FORM_GROUP, ` ngModel cannot be used to register form controls with a parent formGroup directive. Try using formGroup's partner directive \"formControlName\" instead. Example: ${formControlNameExample} Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions: Example: ${ngModelWithFormGroupExample}`); } export function formGroupNameException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODEL_IN_FORM_GROUP_NAME, ` ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive. Option 1: Use formControlName instead of ngModel (reactive strategy): ${formGroupNameExample} Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy): ${ngModelGroupExample}`); } export function missingNameException(): Error { return new RuntimeError( RuntimeErrorCode.NGMODEL_WITHOUT_NAME, `If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone' in ngModelOptions. Example 1: <input [(ngModel)]=\"person.firstName\" name=\"first\"> Example 2: <input [(ngModel)]=\"person.firstName\" [ngModelOptions]=\"{standalone: true}\">`); } export function modelGroupParentException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODELGROUP_IN_FORM_GROUP, ` ngModelGroup cannot be used with a parent formGroup directive. Option 1: Use formGroupName instead of ngModelGroup (reactive strategy): ${formGroupNameExample} Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy): ${ngModelGroupExample}`); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Host, Inject, Input, OnDestroy, OnInit, Optional, Self, SkipSelf} from '@angular/core'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {NgForm} from './ng_form'; import {modelGroupParentException} from './template_driven_errors'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; export const modelGroupProvider: any = { provide: ControlContainer, useExisting: forwardRef(() => NgModelGroup) }; /** * @description * Creates and binds a `FormGroup` instance to a DOM element. * * This directive can only be used as a child of `NgForm` (within `<form>` tags). * * Use this directive to validate a sub-group of your form separately from the * rest of your form, or if some values in your domain model make more sense * to consume together in a nested object. * * Provide a name for the sub-group and it will become the key * for the sub-group in the form's full value. If you need direct access, export the directive into * a local template variable using `ngModelGroup` (ex: `#myGroup=\"ngModelGroup\"`). * * @usageNotes * * ### Consuming controls in a grouping * * The following example shows you how to combine controls together in a sub-group * of the form. * * {@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'} * * @ngModule FormsModule * @publicApi */ @Directive({selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup'}) export class NgModelGroup extends AbstractFormGroupDirective implements OnInit, OnDestroy { /** * @description * Tracks the name of the `NgModelGroup` bound to the directive. The name corresponds * to a key in the parent `NgForm`. */ // TODO(issue/24571): remove '!'. @Input('ngModelGroup') override name!: string; constructor( @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @internal */ override _checkParentType(): void { if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw modelGroupParentException(); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ChangeDetectorRef, Directive, EventEmitter, forwardRef, Host, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core'; import {FormHooks} from '../model/abstract_model'; import {FormControl} from '../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {NgControl} from './ng_control'; import {NgForm} from './ng_form'; import {NgModelGroup} from './ng_model_group'; import {CALL_SET_DISABLED_STATE, controlPath, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from './shared'; import {formGroupNameException, missingNameException, modelParentException} from './template_driven_errors'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; const formControlBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => NgModel) }; /** * `ngModel` forces an additional change detection run when its inputs change: * E.g.: * ``` * <div>{{myModel.valid}}</div> * <input [(ngModel)]=\"myValue\" #myModel=\"ngModel\"> * ``` * I.e. `ngModel` can export itself on the element and then be used in the template. * Normally, this would result in expressions before the `input` that use the exported directive * to have an old value as they have been * dirty checked before. As this is a very common case for `ngModel`, we added this second change * detection run. * * Notes: * - this is just one extra run no matter how many `ngModel`s have been changed. * - this is a general problem when using `exportAs` for directives! */ const resolvedPromise = (() => Promise.resolve())(); /** * @description * Creates a `FormControl` instance from a domain model and binds it * to a form control element. * * The `FormControl` instance tracks the value, user interaction, and * validation status of the control and keeps the view synced with the model. If used * within a parent form, the directive also registers itself with the form as a child * control. * * This directive is used by itself or as part of a larger form. Use the * `ngModel` selector to activate it. * * It accepts a domain model as an optional `Input`. If you have a one-way binding * to `ngModel` with `[]` syntax, changing the domain model's value in the component * class sets the value in the view. If you have a two-way binding with `[()]` syntax * (also known as 'banana-in-a-box syntax'), the value in the UI always syncs back to * the domain model in your class. * * To inspect the properties of the associated `FormControl` (like the validity state), * export the directive into a local template variable using `ngModel` as the key (ex: * `#myVar=\"ngModel\"`). You can then access the control using the directive's `control` property. * However, the most commonly used properties (like `valid` and `dirty`) also exist on the control * for direct access. See a full list of properties directly available in * `AbstractControlDirective`. * * @see `RadioControlValueAccessor` * @see `SelectControlValueAccessor` * * @usageNotes * * ### Using ngModel on a standalone control * * The following examples show a simple standalone control using `ngModel`: * * {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'} * * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute * so that the control can be registered with the parent form under that name. * * In the context of a parent form, it's often unnecessary to include one-way or two-way binding, * as the parent form syncs the value for you. You access its properties by exporting it into a * local template variable using `ngForm` such as (`#f=\"ngForm\"`). Use the variable where * needed on form submission. * * If you do need to populate initial values into your form, using a one-way binding for * `ngModel` tends to be sufficient as long as you use the exported form's value rather * than the domain model's value on submit. * * ### Using ngModel within a form * * The following example shows controls using `ngModel` within a form: * * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} * * ### Using a standalone ngModel within a group * * The following example shows you how to use a standalone ngModel control * within a form. This controls the display of the form, but doesn't contain form data. * * ```html * <form> * <input name=\"login\" ngModel placeholder=\"Login\"> * <input type=\"checkbox\" ngModel [ngModelOptions]=\"{standalone: true}\"> Show more options? * </form> * <!-- form value: {login: ''} --> * ``` * * ### Setting the ngModel `name` attribute through options * * The following example shows you an alternate way to set the name attribute. Here, * an attribute identified as name is used within a custom form control component. To still be able * to specify the NgModel's name, you must specify it using the `ngModelOptions` input instead. * * ```html * <form> * <my-custom-form-control name=\"Nancy\" ngModel [ngModelOptions]=\"{name: 'user'}\"> * </my-custom-form-control> * </form> * <!-- form value: {user: ''} --> * ``` * * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[ngModel]:not([formControlName]):not([formControl])', providers: [formControlBinding], exportAs: 'ngModel' }) export class NgModel extends NgControl implements OnChanges, OnDestroy { public override readonly control: FormControl = new FormControl(); // At runtime we coerce arbitrary values assigned to the \"disabled\" input to a \"boolean\". // This is not reflected in the type of the property because outside of templates, consumers // should only deal with booleans. In templates, a string is allowed for convenience and to // match the native \"disabled attribute\" semantics which can be observed on input elements. // This static member tells the compiler that values of type \"string\" can also be assigned // to the input in a template. /** @nodoc */ static ngAcceptInputType_isDisabled: boolean|string; /** @internal */ _registered = false; /** * Internal reference to the view model value. * @nodoc */ viewModel: any; /** * @description * Tracks the name bound to the directive. If a parent form exists, it * uses this name as a key to retrieve this control's value. */ // TODO(issue/24571): remove '!'. @Input() override name!: string; /** * @description * Tracks whether the control is disabled. */ // TODO(issue/24571): remove '!'. @Input('disabled') isDisabled!: boolean; /** * @description * Tracks the value bound to this directive. */ @Input('ngModel') model: any; /** * @description * Tracks the configuration options for this `ngModel` instance. * * **name**: An alternative to setting the name attribute on the form control element. See * the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel` * as a standalone control. * * **standalone**: When set to true, the `ngModel` will not register itself with its parent form, * and acts as if it's not in the form. Defaults to false. If no parent form exists, this option * has no effect. * * **updateOn**: Defines the event upon which the form control value and validity update. * Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`. * */ // TODO(issue/24571): remove '!'. @Input('ngModelOptions') options!: {name?: string, standalone?: boolean, updateOn?: FormHooks}; /** * @description * Event emitter for producing the `ngModelChange` event after * the view model updates. */ @Output('ngModelChange') update = new EventEmitter(); constructor( @Optional() @Host() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(ChangeDetectorRef) private _changeDetectorRef?: ChangeDetectorRef|null, @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges) { this._checkForErrors(); if (!this._registered || 'name' in changes) { if (this._registered) { this._checkName(); if (this.formDirective) { // We can't call `formDirective.removeControl(this)`, because the `name` has already been // changed. We also can't reset the name temporarily since the logic in `removeControl` // is inside a promise and it won't run immediately. We work around it by giving it an // object with the same shape instead. const oldName = changes['name'].previousValue; this.formDirective.removeControl({name: oldName, path: this._getPath(oldName)}); } } this._setUpControl(); } if ('isDisabled' in changes) { this._updateDisabled(changes); } if (isPropertyUpdated(changes, this.viewModel)) { this._updateValue(this.model); this.viewModel = this.model; } } /** @nodoc */ ngOnDestroy(): void { this.formDirective && this.formDirective.removeControl(this); } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return this._getPath(this.name); } /** * @description * The top-level directive for this control if present, otherwise null. */ get formDirective(): any { return this._parent ? this._parent.formDirective : null; } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value emitted by `ngModelChange`. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } private _setUpControl(): void { this._setUpdateStrategy(); this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this); this._registered = true; } private _setUpdateStrategy(): void { if (this.options && this.options.updateOn != null) { this.control._updateOn = this.options.updateOn; } } private _isStandalone(): boolean { return !this._parent || !!(this.options && this.options.standalone); } private _setUpStandalone(): void { setUpControl(this.control, this, this.callSetDisabledState); this.control.updateValueAndValidity({emitEvent: false}); } private _checkForErrors(): void { if (!this._isStandalone()) { this._checkParentType(); } this._checkName(); } private _checkParentType(): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!(this._parent instanceof NgModelGroup) && this._parent instanceof AbstractFormGroupDirective) { throw formGroupNameException(); } else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) { throw modelParentException(); } } } private _checkName(): void { if (this.options && this.options.name) this.name = this.options.name; if (!this._isStandalone() && !this.name && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw missingNameException(); } } private _updateValue(value: any): void { resolvedPromise.then(() => { this.control.setValue(value, {emitViewToModelChange: false}); this._changeDetectorRef?.markForCheck(); }); } private _updateDisabled(changes: SimpleChanges) { const disabledValue = changes['isDisabled'].currentValue; // checking for 0 to avoid breaking change const isDisabled = disabledValue !== 0 && coerceToBoolean(disabledValue); resolvedPromise.then(() => { if (isDisabled && !this.control.disabled) { this.control.disable(); } else if (!isDisabled && this.control.disabled) { this.control.enable(); } this._changeDetectorRef?.markForCheck(); }); } private _getPath(controlName: string): string[] { return this._parent ? controlPath(controlName, this._parent) : [controlName]; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive} from '@angular/core'; /** * @description * * Adds `novalidate` attribute to all forms by default. * * `novalidate` is used to disable browser's native form validation. * * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute: * * ``` * <form ngNativeValidate></form> * ``` * * @publicApi * @ngModule ReactiveFormsModule * @ngModule FormsModule */ @Directive({ selector: 'form:not([ngNoForm]):not([ngNativeValidate])', host: {'novalidate': ''}, }) export class ɵNgNoValidate { } export {ɵNgNoValidate as NgNoValidate}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const NUMBER_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NumberValueAccessor), multi: true }; /** * @description * The `ControlValueAccessor` for writing a number value and listening to number input changes. * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` * directives. * * @usageNotes * * ### Using a number input with a reactive form. * * The following example shows how to use a number input with a reactive form. * * ```ts * const totalCountControl = new FormControl(); * ``` * * ``` * <input type=\"number\" [formControl]=\"totalCountControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]', host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, providers: [NUMBER_VALUE_ACCESSOR] }) export class NumberValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: number): void { // The value needs to be normalized for IE9, otherwise it is set to 'null' when null const normalizedValue = value == null ? '' : value; this.setProperty('value', normalizedValue); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: number|null) => void): void { this.onChange = (value) => { fn(value == '' ? null : parseFloat(value)); }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, inject, Injectable, Injector, Input, NgModule, OnDestroy, OnInit, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {NgControl} from './ng_control'; import {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './shared'; const RADIO_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RadioControlValueAccessor), multi: true }; function throwNameError() { throw new RuntimeError(RuntimeErrorCode.NAME_AND_FORM_CONTROL_NAME_MUST_MATCH, ` If you define both a name and a formControlName attribute on your radio button, their values must match. Ex: <input type=\"radio\" formControlName=\"food\" name=\"food\"> `); } /** * Internal-only NgModule that works as a host for the `RadioControlRegistry` tree-shakable * provider. Note: the `InternalFormsSharedModule` can not be used here directly, since it's * declared *after* the `RadioControlRegistry` class and the `providedIn` doesn't support * `forwardRef` logic. */ @NgModule() export class RadioControlRegistryModule { } /** * @description * Class used by Angular to track radio buttons. For internal use only. */ @Injectable({providedIn: RadioControlRegistryModule}) export class RadioControlRegistry { private _accessors: any[] = []; /** * @description * Adds a control to the internal registry. For internal use only. */ add(control: NgControl, accessor: RadioControlValueAccessor) { this._accessors.push([control, accessor]); } /** * @description * Removes a control from the internal registry. For internal use only. */ remove(accessor: RadioControlValueAccessor) { for (let i = this._accessors.length - 1; i >= 0; --i) { if (this._accessors[i][1] === accessor) { this._accessors.splice(i, 1); return; } } } /** * @description * Selects a radio button. For internal use only. */ select(accessor: RadioControlValueAccessor) { this._accessors.forEach((c) => { if (this._isSameGroup(c, accessor) && c[1] !== accessor) { c[1].fireUncheck(accessor.value); } }); } private _isSameGroup( controlPair: [NgControl, RadioControlValueAccessor], accessor: RadioControlValueAccessor): boolean { if (!controlPair[0].control) return false; return controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name; } } /** * @description * The `ControlValueAccessor` for writing radio control values and listening to radio control * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @usageNotes * * ### Using radio buttons with reactive form directives * * The follow example shows how to use radio buttons in a reactive form. When using radio buttons in * a reactive form, radio buttons in the same group should have the same `formControlName`. * Providing a `name` attribute is optional. * * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'} * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]', host: {'(change)': 'onChange()', '(blur)': 'onTouched()'}, providers: [RADIO_VALUE_ACCESSOR] }) export class RadioControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor, OnDestroy, OnInit { /** @internal */ // TODO(issue/24571): remove '!'. _state!: boolean; /** @internal */ // TODO(issue/24571): remove '!'. _control!: NgControl; /** @internal */ // TODO(issue/24571): remove '!'. _fn!: Function; private setDisabledStateFired = false; /** * The registered callback function called when a change event occurs on the input element. * Note: we declare `onChange` here (also used as host listener) as a function with no arguments * to override the `onChange` function (which expects 1 argument) in the parent * `BaseControlValueAccessor` class. * @nodoc */ override onChange = () => {}; /** * @description * Tracks the name of the radio input element. */ // TODO(issue/24571): remove '!'. @Input() name!: string; /** * @description * Tracks the name of the `FormControl` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. */ // TODO(issue/24571): remove '!'. @Input() formControlName!: string; /** * @description * Tracks the value of the radio input element */ @Input() value: any; private callSetDisabledState = inject(CALL_SET_DISABLED_STATE, {optional: true}) ?? setDisabledStateDefault; constructor( renderer: Renderer2, elementRef: ElementRef, private _registry: RadioControlRegistry, private _injector: Injector) { super(renderer, elementRef); } /** @nodoc */ ngOnInit(): void { this._control = this._injector.get(NgControl); this._checkName(); this._registry.add(this._control, this); } /** @nodoc */ ngOnDestroy(): void { this._registry.remove(this); } /** * Sets the \"checked\" property value on the radio input element. * @nodoc */ writeValue(value: any): void { this._state = value === this.value; this.setProperty('checked', this._state); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: any) => {}): void { this._fn = fn; this.onChange = () => { fn(this.value); this._registry.select(this); }; } /** @nodoc */ override setDisabledState(isDisabled: boolean): void { /** * `setDisabledState` is supposed to be called whenever the disabled state of a control changes, * including upon control creation. However, a longstanding bug caused the method to not fire * when an *enabled* control was attached. This bug was fixed in v15 in #47576. * * This had a side effect: previously, it was possible to instantiate a reactive form control * with `[attr.disabled]=true`, even though the the corresponding control was enabled in the * model. This resulted in a mismatch between the model and the DOM. Now, because * `setDisabledState` is always called, the value in the DOM will be immediately overwritten * with the \"correct\" enabled value. * * However, the fix also created an exceptional case: radio buttons. Because Reactive Forms * models the entire group of radio buttons as a single `FormControl`, there is no way to * control the disabled state for individual radios, so they can no longer be configured as * disabled. Thus, we keep the old behavior for radio buttons, so that `[attr.disabled]` * continues to work. Specifically, we drop the first call to `setDisabledState` if `disabled` * is `false`, and we are not in legacy mode. */ if (this.setDisabledStateFired || isDisabled || this.callSetDisabledState === 'whenDisabledForLegacyCode') { this.setProperty('disabled', isDisabled); } this.setDisabledStateFired = true; } /** * Sets the \"value\" on the radio input element and unchecks it. * * @param value */ fireUncheck(value: any): void { this.writeValue(value); } private _checkName(): void { if (this.name && this.formControlName && this.name !== this.formControlName && (typeof ngDevMode === 'undefined' || ngDevMode)) { throwNameError(); } if (!this.name && this.formControlName) this.name = this.formControlName; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const RANGE_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RangeValueAccessor), multi: true }; /** * @description * The `ControlValueAccessor` for writing a range value and listening to range input changes. * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` * directives. * * @usageNotes * * ### Using a range input with a reactive form * * The following example shows how to use a range input with a reactive form. * * ```ts * const ageControl = new FormControl(); * ``` * * ``` * <input type=\"range\" [formControl]=\"ageControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]', host: { '(change)': 'onChange($event.target.value)', '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' }, providers: [RANGE_VALUE_ACCESSOR] }) export class RangeValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: any): void { this.setProperty('value', parseFloat(value)); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: number|null) => void): void { this.onChange = (value) => { fn(value == '' ? null : parseFloat(value)); }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Inject, InjectionToken, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges} from '@angular/core'; import {FormControl} from '../../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '../control_value_accessor'; import {NgControl} from '../ng_control'; import {disabledAttrWarning} from '../reactive_errors'; import {_ngModelWarning, CALL_SET_DISABLED_STATE, cleanUpControl, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; /** * Token to provide to turn off the ngModel warning on formControl and formControlName. */ export const NG_MODEL_WITH_FORM_CONTROL_WARNING = new InjectionToken('NgModelWithFormControlWarning'); const formControlBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => FormControlDirective) }; /** * @description * Synchronizes a standalone `FormControl` instance to a form control element. * * Note that support for using the `ngModel` input property and `ngModelChange` event with reactive * form directives was deprecated in Angular v6 and is scheduled for removal in * a future version of Angular. * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `FormControl` * @see `AbstractControl` * * @usageNotes * * The following example shows how to register a standalone control and set its value. * * {@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formControl]', providers: [formControlBinding], exportAs: 'ngForm'}) export class FormControlDirective extends NgControl implements OnChanges, OnDestroy { /** * Internal reference to the view model value. * @nodoc */ viewModel: any; /** * @description * Tracks the `FormControl` instance bound to the directive. */ // TODO(issue/24571): remove '!'. @Input('formControl') form!: FormControl; /** * @description * Triggers a warning in dev mode that this input should not be used with reactive forms. */ @Input('disabled') set isDisabled(isDisabled: boolean) { if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(disabledAttrWarning); } } // TODO(kara): remove next 4 properties once deprecation period is over /** @deprecated as of v6 */ @Input('ngModel') model: any; /** @deprecated as of v6 */ @Output('ngModelChange') update = new EventEmitter(); /** * @description * Static property used to track whether any ngModel warnings have been sent across * all instances of FormControlDirective. Used to support warning config of \"once\". * * @internal */ static _ngModelWarningSentOnce = false; /** * @description * Instance property used to track whether an ngModel warning has been sent out for this * particular `FormControlDirective` instance. Used to support warning config of \"always\". * * @internal */ _ngModelWarningSent = false; constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(NG_MODEL_WITH_FORM_CONTROL_WARNING) private _ngModelWarningConfig: string| null, @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { if (this._isControlChanged(changes)) { const previousForm = changes['form'].previousValue; if (previousForm) { cleanUpControl(previousForm, this, /* validateControlPresenceOnChange */ false); } setUpControl(this.form, this, this.callSetDisabledState); this.form.updateValueAndValidity({emitEvent: false}); } if (isPropertyUpdated(changes, this.viewModel)) { if (typeof ngDevMode === 'undefined' || ngDevMode) { _ngModelWarning('formControl', FormControlDirective, this, this._ngModelWarningConfig); } this.form.setValue(this.model); this.viewModel = this.model; } } /** @nodoc */ ngOnDestroy() { if (this.form) { cleanUpControl(this.form, this, /* validateControlPresenceOnChange */ false); } } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return []; } /** * @description * The `FormControl` bound to this directive. */ override get control(): FormControl { return this.form; } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value for the view model. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } private _isControlChanged(changes: {[key: string]: any}): boolean { return changes.hasOwnProperty('form'); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges} from '@angular/core'; import {FormArray} from '../../model/form_array'; import {FormControl, isFormControl} from '../../model/form_control'; import {FormGroup} from '../../model/form_group'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {ControlContainer} from '../control_container'; import {Form} from '../form_interface'; import {missingFormException} from '../reactive_errors'; import {CALL_SET_DISABLED_STATE, cleanUpControl, cleanUpFormContainer, cleanUpValidators, removeListItem, SetDisabledStateOption, setUpControl, setUpFormContainer, setUpValidators, syncPendingControls} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {FormControlName} from './form_control_name'; import {FormArrayName, FormGroupName} from './form_group_name'; const formDirectiveProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => FormGroupDirective) }; /** * @description * * Binds an existing `FormGroup` or `FormRecord` to a DOM element. * * This directive accepts an existing `FormGroup` instance. It will then use this * `FormGroup` instance to match any child `FormControl`, `FormGroup`/`FormRecord`, * and `FormArray` instances to child `FormControlName`, `FormGroupName`, * and `FormArrayName` directives. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `AbstractControl` * * @usageNotes * ### Register Form Group * * The following example registers a `FormGroup` with first name and last name controls, * and listens for the *ngSubmit* event when the button is clicked. * * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({ selector: '[formGroup]', providers: [formDirectiveProvider], host: {'(submit)': 'onSubmit($event)', '(reset)': 'onReset()'}, exportAs: 'ngForm' }) export class FormGroupDirective extends ControlContainer implements Form, OnChanges, OnDestroy { /** * @description * Reports whether the form submission has been triggered. */ public readonly submitted: boolean = false; /** * Reference to an old form group input value, which is needed to cleanup old instance in case it * was replaced with a new one. */ private _oldForm: FormGroup|undefined; /** * Callback that should be invoked when controls in FormGroup or FormArray collection change * (added or removed). This callback triggers corresponding DOM updates. */ private readonly _onCollectionChange = () => this._updateDomValue(); /** * @description * Tracks the list of added `FormControlName` instances */ directives: FormControlName[] = []; /** * @description * Tracks the `FormGroup` bound to this directive. */ @Input('formGroup') form: FormGroup = null!; /** * @description * Emits an event when the form submission has been triggered. */ @Output() ngSubmit = new EventEmitter(); constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { this._checkFormPresent(); if (changes.hasOwnProperty('form')) { this._updateValidators(); this._updateDomValue(); this._updateRegistrations(); this._oldForm = this.form; } } /** @nodoc */ ngOnDestroy() { if (this.form) { cleanUpValidators(this.form, this); // Currently the `onCollectionChange` callback is rewritten each time the // `_registerOnCollectionChange` function is invoked. The implication is that cleanup should // happen *only* when the `onCollectionChange` callback was set by this directive instance. // Otherwise it might cause overriding a callback of some other directive instances. We should // consider updating this logic later to make it similar to how `onChange` callbacks are // handled, see https://github.com/angular/angular/issues/39732 for additional info. if (this.form._onCollectionChange === this._onCollectionChange) { this.form._registerOnCollectionChange(() => {}); } } } /** * @description * Returns this directive's instance. */ override get formDirective(): Form { return this; } /** * @description * Returns the `FormGroup` bound to this directive. */ override get control(): FormGroup { return this.form; } /** * @description * Returns an array representing the path to this group. Because this directive * always lives at the top level of a form, it always an empty array. */ override get path(): string[] { return []; } /** * @description * Method that sets up the control directive in this group, re-calculates its value * and validity, and adds the instance to the internal list of directives. * * @param dir The `FormControlName` directive instance. */ addControl(dir: FormControlName): FormControl { const ctrl: any = this.form.get(dir.path); setUpControl(ctrl, dir, this.callSetDisabledState); ctrl.updateValueAndValidity({emitEvent: false}); this.directives.push(dir); return ctrl; } /** * @description * Retrieves the `FormControl` instance from the provided `FormControlName` directive * * @param dir The `FormControlName` directive instance. */ getControl(dir: FormControlName): FormControl { return <FormControl>this.form.get(dir.path); } /** * @description * Removes the `FormControlName` instance from the internal list of directives * * @param dir The `FormControlName` directive instance. */ removeControl(dir: FormControlName): void { cleanUpControl(dir.control || null, dir, /* validateControlPresenceOnChange */ false); removeListItem(this.directives, dir); } /** * Adds a new `FormGroupName` directive instance to the form. * * @param dir The `FormGroupName` directive instance. */ addFormGroup(dir: FormGroupName): void { this._setUpFormContainer(dir); } /** * Performs the necessary cleanup when a `FormGroupName` directive instance is removed from the * view. * * @param dir The `FormGroupName` directive instance. */ removeFormGroup(dir: FormGroupName): void { this._cleanUpFormContainer(dir); } /** * @description * Retrieves the `FormGroup` for a provided `FormGroupName` directive instance * * @param dir The `FormGroupName` directive instance. */ getFormGroup(dir: FormGroupName): FormGroup { return <FormGroup>this.form.get(dir.path); } /** * Performs the necessary setup when a `FormArrayName` directive instance is added to the view. * * @param dir The `FormArrayName` directive instance. */ addFormArray(dir: FormArrayName): void { this._setUpFormContainer(dir); } /** * Performs the necessary cleanup when a `FormArrayName` directive instance is removed from the * view. * * @param dir The `FormArrayName` directive instance. */ removeFormArray(dir: FormArrayName): void { this._cleanUpFormContainer(dir); } /** * @description * Retrieves the `FormArray` for a provided `FormArrayName` directive instance. * * @param dir The `FormArrayName` directive instance. */ getFormArray(dir: FormArrayName): FormArray { return <FormArray>this.form.get(dir.path); } /** * Sets the new value for the provided `FormControlName` directive. * * @param dir The `FormControlName` directive instance. * @param value The new value for the directive's control. */ updateModel(dir: FormControlName, value: any): void { const ctrl = <FormControl>this.form.get(dir.path); ctrl.setValue(value); } /** * @description * Method called with the \"submit\" event is triggered on the form. * Triggers the `ngSubmit` emitter to emit the \"submit\" event as its payload. * * @param $event The \"submit\" event object */ onSubmit($event: Event): boolean { (this as {submitted: boolean}).submitted = true; syncPendingControls(this.form, this.directives); this.ngSubmit.emit($event); // Forms with `method=\"dialog\"` have some special behavior that won't reload the page and that // shouldn't be prevented. Note that we need to null check the `event` and the `target`, because // some internal apps call this method directly with the wrong arguments. return ($event?.target as HTMLFormElement | null)?.method === 'dialog'; } /** * @description * Method called when the \"reset\" event is triggered on the form. */ onReset(): void { this.resetForm(); } /** * @description * Resets the form to an initial value and resets its submitted status. * * @param value The new value for the form. */ resetForm(value: any = undefined): void { this.form.reset(value); (this as {submitted: boolean}).submitted = false; } /** @internal */ _updateDomValue() { this.directives.forEach(dir => { const oldCtrl = dir.control; const newCtrl = this.form.get(dir.path); if (oldCtrl !== newCtrl) { // Note: the value of the `dir.control` may not be defined, for example when it's a first // `FormControl` that is added to a `FormGroup` instance (via `addControl` call). cleanUpControl(oldCtrl || null, dir); // Check whether new control at the same location inside the corresponding `FormGroup` is an // instance of `FormControl` and perform control setup only if that's the case. // Note: we don't need to clear the list of directives (`this.directives`) here, it would be // taken care of in the `removeControl` method invoked when corresponding `formControlName` // directive instance is being removed (invoked from `FormControlName.ngOnDestroy`). if (isFormControl(newCtrl)) { setUpControl(newCtrl, dir, this.callSetDisabledState); (dir as {control: FormControl}).control = newCtrl; } } }); this.form._updateTreeValidity({emitEvent: false}); } private _setUpFormContainer(dir: FormArrayName|FormGroupName): void { const ctrl: any = this.form.get(dir.path); setUpFormContainer(ctrl, dir); // NOTE: this operation looks unnecessary in case no new validators were added in // `setUpFormContainer` call. Consider updating this code to match the logic in // `_cleanUpFormContainer` function. ctrl.updateValueAndValidity({emitEvent: false}); } private _cleanUpFormContainer(dir: FormArrayName|FormGroupName): void { if (this.form) { const ctrl: any = this.form.get(dir.path); if (ctrl) { const isControlUpdated = cleanUpFormContainer(ctrl, dir); if (isControlUpdated) { // Run validity check only in case a control was updated (i.e. view validators were // removed) as removing view validators might cause validity to change. ctrl.updateValueAndValidity({emitEvent: false}); } } } } private _updateRegistrations() { this.form._registerOnCollectionChange(this._onCollectionChange); if (this._oldForm) { this._oldForm._registerOnCollectionChange(() => {}); } } private _updateValidators() { setUpValidators(this.form, this); if (this._oldForm) { cleanUpValidators(this._oldForm, this); } } private _checkFormPresent() { if (!this.form && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw missingFormException(); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Host, Inject, Input, OnDestroy, OnInit, Optional, Provider, Self, SkipSelf} from '@angular/core'; import {FormArray} from '../../model/form_array'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {AbstractFormGroupDirective} from '../abstract_form_group_directive'; import {ControlContainer} from '../control_container'; import {arrayParentException, groupParentException} from '../reactive_errors'; import {controlPath} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {FormGroupDirective} from './form_group_directive'; const formGroupNameProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => FormGroupName) }; /** * @description * * Syncs a nested `FormGroup` or `FormRecord` to a DOM element. * * This directive can only be used with a parent `FormGroupDirective`. * * It accepts the string name of the nested `FormGroup` or `FormRecord` to link, and * looks for a `FormGroup` or `FormRecord` registered with that name in the parent * `FormGroup` instance you passed into `FormGroupDirective`. * * Use nested form groups to validate a sub-group of a * form separately from the rest or to group the values of certain * controls into their own nested object. * * @see [Reactive Forms Guide](guide/reactive-forms) * * @usageNotes * * ### Access the group by name * * The following example uses the `AbstractControl.get` method to access the * associated `FormGroup` * * ```ts * this.form.get('name'); * ``` * * ### Access individual controls in the group * * The following example uses the `AbstractControl.get` method to access * individual controls within the group using dot syntax. * * ```ts * this.form.get('name.first'); * ``` * * ### Register a nested `FormGroup`. * * The following example registers a nested *name* `FormGroup` within an existing `FormGroup`, * and provides methods to retrieve the nested `FormGroup` and individual controls. * * {@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formGroupName]', providers: [formGroupNameProvider]}) export class FormGroupName extends AbstractFormGroupDirective implements OnInit, OnDestroy { /** * @description * Tracks the name of the `FormGroup` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form groups to be bound * to indices when iterating over groups in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formGroupName') override name!: string|number|null; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @internal */ override _checkParentType(): void { if (_hasInvalidParent(this._parent) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw groupParentException(); } } } export const formArrayNameProvider: any = { provide: ControlContainer, useExisting: forwardRef(() => FormArrayName) }; /** * @description * * Syncs a nested `FormArray` to a DOM element. * * This directive is designed to be used with a parent `FormGroupDirective` (selector: * `[formGroup]`). * * It accepts the string name of the nested `FormArray` you want to link, and * will look for a `FormArray` registered with that name in the parent * `FormGroup` instance you passed into `FormGroupDirective`. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `AbstractControl` * * @usageNotes * * ### Example * * {@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formArrayName]', providers: [formArrayNameProvider]}) export class FormArrayName extends ControlContainer implements OnInit, OnDestroy { /** @internal */ _parent: ControlContainer; /** * @description * Tracks the name of the `FormArray` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form arrays to be bound * to indices when iterating over arrays in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formArrayName') override name!: string|number|null; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** * A lifecycle method called when the directive's inputs are initialized. For internal use only. * @throws If the directive does not have a valid parent. * @nodoc */ ngOnInit(): void { this._checkParentType(); this.formDirective!.addFormArray(this); } /** * A lifecycle method called before the directive's instance is destroyed. For internal use only. * @nodoc */ ngOnDestroy(): void { if (this.formDirective) { this.formDirective.removeFormArray(this); } } /** * @description * The `FormArray` bound to this directive. */ override get control(): FormArray { return this.formDirective!.getFormArray(this); } /** * @description * The top-level directive for this group if present, otherwise null. */ override get formDirective(): FormGroupDirective|null { return this._parent ? <FormGroupDirective>this._parent.formDirective : null; } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); } private _checkParentType(): void { if (_hasInvalidParent(this._parent) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw arrayParentException(); } } } function _hasInvalidParent(parent: ControlContainer): boolean { return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && !(parent instanceof FormArrayName); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Host, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges, SkipSelf} from '@angular/core'; import {FormControl} from '../../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {AbstractFormGroupDirective} from '../abstract_form_group_directive'; import {ControlContainer} from '../control_container'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '../control_value_accessor'; import {NgControl} from '../ng_control'; import {controlParentException, disabledAttrWarning, ngModelGroupException} from '../reactive_errors'; import {_ngModelWarning, controlPath, isPropertyUpdated, selectValueAccessor} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {NG_MODEL_WITH_FORM_CONTROL_WARNING} from './form_control_directive'; import {FormGroupDirective} from './form_group_directive'; import {FormArrayName, FormGroupName} from './form_group_name'; const controlNameBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => FormControlName) }; /** * @description * Syncs a `FormControl` in an existing `FormGroup` to a form control * element by name. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `FormControl` * @see `AbstractControl` * * @usageNotes * * ### Register `FormControl` within a group * * The following example shows how to register multiple form controls within a form group * and set their value. * * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} * * To see `formControlName` examples with different form control types, see: * * * Radio buttons: `RadioControlValueAccessor` * * Selects: `SelectControlValueAccessor` * * ### Use with ngModel is deprecated * * Support for using the `ngModel` input property and `ngModelChange` event with reactive * form directives has been deprecated in Angular v6 and is scheduled for removal in * a future version of Angular. * * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formControlName]', providers: [controlNameBinding]}) export class FormControlName extends NgControl implements OnChanges, OnDestroy { private _added = false; /** * Internal reference to the view model value. * @internal */ viewModel: any; /** * @description * Tracks the `FormControl` instance bound to the directive. */ // TODO(issue/24571): remove '!'. override readonly control!: FormControl; /** * @description * Tracks the name of the `FormControl` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form controls to be bound * to indices when iterating over controls in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formControlName') override name!: string|number|null; /** * @description * Triggers a warning in dev mode that this input should not be used with reactive forms. */ @Input('disabled') set isDisabled(isDisabled: boolean) { if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(disabledAttrWarning); } } // TODO(kara): remove next 4 properties once deprecation period is over /** @deprecated as of v6 */ @Input('ngModel') model: any; /** @deprecated as of v6 */ @Output('ngModelChange') update = new EventEmitter(); /** * @description * Static property used to track whether any ngModel warnings have been sent across * all instances of FormControlName. Used to support warning config of \"once\". * * @internal */ static _ngModelWarningSentOnce = false; /** * @description * Instance property used to track whether an ngModel warning has been sent out for this * particular FormControlName instance. Used to support warning config of \"always\". * * @internal */ _ngModelWarningSent = false; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(NG_MODEL_WITH_FORM_CONTROL_WARNING) private _ngModelWarningConfig: string| null) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges) { if (!this._added) this._setUpControl(); if (isPropertyUpdated(changes, this.viewModel)) { if (typeof ngDevMode === 'undefined' || ngDevMode) { _ngModelWarning('formControlName', FormControlName, this, this._ngModelWarningConfig); } this.viewModel = this.model; this.formDirective.updateModel(this, this.model); } } /** @nodoc */ ngOnDestroy(): void { if (this.formDirective) { this.formDirective.removeControl(this); } } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value for the view model. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent!); } /** * @description * The top-level directive for this group if present, otherwise null. */ get formDirective(): any { return this._parent ? this._parent.formDirective : null; } private _checkParentType(): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!(this._parent instanceof FormGroupName) && this._parent instanceof AbstractFormGroupDirective) { throw ngModelGroupException(); } else if ( !(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) && !(this._parent instanceof FormArrayName)) { throw controlParentException(); } } } private _setUpControl() { this._checkParentType(); (this as {control: FormControl}).control = this.formDirective.addControl(this); this._added = true; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Host, Input, OnDestroy, Optional, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const SELECT_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectControlValueAccessor), multi: true }; function _buildValueString(id: string|null, value: any): string { if (id == null) return `${value}`; if (value && typeof value === 'object') value = 'Object'; return `${id}: ${value}`.slice(0, 50); } function _extractId(valueString: string): string { return valueString.split(':')[0]; } /** * @description * The `ControlValueAccessor` for writing select control values and listening to select control * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @usageNotes * * ### Using select controls in a reactive form * * The following examples show how to use a select control in a reactive form. * * {@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'} * * ### Using select controls in a template-driven form * * To use a select in a template-driven form, simply add an `ngModel` and a `name` * attribute to the main `<select>` tag. * * {@example forms/ts/selectControl/select_control_example.ts region='Component'} * * ### Customizing option selection * * Angular uses object identity to select option. It's possible for the identities of items * to change while the data does not. This can happen, for example, if the items are produced * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the * second response will produce objects with different identities. * * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. * `compareWith` takes a **function** which has two arguments: `option1` and `option2`. * If `compareWith` is given, Angular selects option by the return value of the function. * * ```ts * const selectedCountriesControl = new FormControl(); * ``` * * ``` * <select [compareWith]=\"compareFn\" [formControl]=\"selectedCountriesControl\"> * <option *ngFor=\"let country of countries\" [ngValue]=\"country\"> * {{country.name}} * </option> * </select> * * compareFn(c1: Country, c2: Country): boolean { * return c1 && c2 ? c1.id === c2.id : c1 === c2; * } * ``` * * **Note:** We listen to the 'change' event because 'input' events aren't fired * for selects in IE, see: * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event#browser_compatibility * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]', host: {'(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, providers: [SELECT_VALUE_ACCESSOR] }) export class SelectControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** @nodoc */ value: any; /** @internal */ _optionMap: Map<string, any> = new Map<string, any>(); /** @internal */ _idCounter: number = 0; /** * @description * Tracks the option comparison algorithm for tracking identities when * checking for changes. */ @Input() set compareWith(fn: (o1: any, o2: any) => boolean) { if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new RuntimeError( RuntimeErrorCode.COMPAREWITH_NOT_A_FN, `compareWith must be a function, but received ${JSON.stringify(fn)}`); } this._compareWith = fn; } private _compareWith: (o1: any, o2: any) => boolean = Object.is; /** * Sets the \"value\" property on the select element. * @nodoc */ writeValue(value: any): void { this.value = value; const id: string|null = this._getOptionId(value); const valueString = _buildValueString(id, value); this.setProperty('value', valueString); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (value: any) => any): void { this.onChange = (valueString: string) => { this.value = this._getOptionValue(valueString); fn(this.value); }; } /** @internal */ _registerOption(): string { return (this._idCounter++).toString(); } /** @internal */ _getOptionId(value: any): string|null { for (const id of Array.from(this._optionMap.keys())) { if (this._compareWith(this._optionMap.get(id), value)) return id; } return null; } /** @internal */ _getOptionValue(valueString: string): any { const id: string = _extractId(valueString); return this._optionMap.has(id) ? this._optionMap.get(id) : valueString; } } /** * @description * Marks `<option>` as dynamic, so Angular can be notified when options change. * * @see `SelectControlValueAccessor` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: 'option'}) export class NgSelectOption implements OnDestroy { /** * @description * ID of the option element */ // TODO(issue/24571): remove '!'. id!: string; constructor( private _element: ElementRef, private _renderer: Renderer2, @Optional() @Host() private _select: SelectControlValueAccessor) { if (this._select) this.id = this._select._registerOption(); } /** * @description * Tracks the value bound to the option element. Unlike the value binding, * ngValue supports binding to objects. */ @Input('ngValue') set ngValue(value: any) { if (this._select == null) return; this._select._optionMap.set(this.id, value); this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } /** * @description * Tracks simple string values bound to the option element. * For objects, use the `ngValue` input binding. */ @Input('value') set value(value: any) { this._setElementValue(value); if (this._select) this._select.writeValue(this._select.value); } /** @internal */ _setElementValue(value: string): void { this._renderer.setProperty(this._element.nativeElement, 'value', value); } /** @nodoc */ ngOnDestroy(): void { if (this._select) { this._select._optionMap.delete(this.id); this._select.writeValue(this._select.value); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Host, Input, OnDestroy, Optional, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const SELECT_MULTIPLE_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectMultipleControlValueAccessor), multi: true }; function _buildValueString(id: string, value: any): string { if (id == null) return `${value}`; if (typeof value === 'string') value = `'${value}'`; if (value && typeof value === 'object') value = 'Object'; return `${id}: ${value}`.slice(0, 50); } function _extractId(valueString: string): string { return valueString.split(':')[0]; } /** Mock interface for HTML Options */ interface HTMLOption { value: string; selected: boolean; } /** Mock interface for HTMLCollection */ abstract class HTMLCollection { // TODO(issue/24571): remove '!'. length!: number; abstract item(_: number): HTMLOption; } /** * @description * The `ControlValueAccessor` for writing multi-select control values and listening to multi-select * control changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @see `SelectControlValueAccessor` * * @usageNotes * * ### Using a multi-select control * * The follow example shows you how to use a multi-select control with a reactive form. * * ```ts * const countryControl = new FormControl(); * ``` * * ``` * <select multiple name=\"countries\" [formControl]=\"countryControl\"> * <option *ngFor=\"let country of countries\" [ngValue]=\"country\"> * {{ country.name }} * </option> * </select> * ``` * * ### Customizing option selection * * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. * See the `SelectControlValueAccessor` for usage. * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]', host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'}, providers: [SELECT_MULTIPLE_VALUE_ACCESSOR] }) export class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * The current value. * @nodoc */ value: any; /** @internal */ _optionMap: Map<string, ɵNgSelectMultipleOption> = new Map<string, ɵNgSelectMultipleOption>(); /** @internal */ _idCounter: number = 0; /** * @description * Tracks the option comparison algorithm for tracking identities when * checking for changes. */ @Input() set compareWith(fn: (o1: any, o2: any) => boolean) { if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new RuntimeError( RuntimeErrorCode.COMPAREWITH_NOT_A_FN, `compareWith must be a function, but received ${JSON.stringify(fn)}`); } this._compareWith = fn; } private _compareWith: (o1: any, o2: any) => boolean = Object.is; /** * Sets the \"value\" property on one or of more of the select's options. * @nodoc */ writeValue(value: any): void { this.value = value; let optionSelectedStateSetter: (opt: ɵNgSelectMultipleOption, o: any) => void; if (Array.isArray(value)) { // convert values to ids const ids = value.map((v) => this._getOptionId(v)); optionSelectedStateSetter = (opt, o) => { opt._setSelected(ids.indexOf(o.toString()) > -1); }; } else { optionSelectedStateSetter = (opt, o) => { opt._setSelected(false); }; } this._optionMap.forEach(optionSelectedStateSetter); } /** * Registers a function called when the control value changes * and writes an array of the selected options. * @nodoc */ override registerOnChange(fn: (value: any) => any): void { this.onChange = (element: HTMLSelectElement) => { const selected: Array<any> = []; const selectedOptions = element.selectedOptions; if (selectedOptions !== undefined) { const options = selectedOptions; for (let i = 0; i < options.length; i++) { const opt = options[i]; const val = this._getOptionValue(opt.value); selected.push(val); } } // Degrade to use `options` when `selectedOptions` property is not available. // Note: the `selectedOptions` is available in all supported browsers, but the Domino lib // doesn't have it currently, see https://github.com/fgnass/domino/issues/177. else { const options = element.options; for (let i = 0; i < options.length; i++) { const opt = options[i]; if (opt.selected) { const val = this._getOptionValue(opt.value); selected.push(val); } } } this.value = selected; fn(selected); }; } /** @internal */ _registerOption(value: ɵNgSelectMultipleOption): string { const id: string = (this._idCounter++).toString(); this._optionMap.set(id, value); return id; } /** @internal */ _getOptionId(value: any): string|null { for (const id of Array.from(this._optionMap.keys())) { if (this._compareWith(this._optionMap.get(id)!._value, value)) return id; } return null; } /** @internal */ _getOptionValue(valueString: string): any { const id: string = _extractId(valueString); return this._optionMap.has(id) ? this._optionMap.get(id)!._value : valueString; } } /** * @description * Marks `<option>` as dynamic, so Angular can be notified when options change. * * @see `SelectMultipleControlValueAccessor` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: 'option'}) export class ɵNgSelectMultipleOption implements OnDestroy { // TODO(issue/24571): remove '!'. id!: string; /** @internal */ _value: any; constructor( private _element: ElementRef, private _renderer: Renderer2, @Optional() @Host() private _select: SelectMultipleControlValueAccessor) { if (this._select) { this.id = this._select._registerOption(this); } } /** * @description * Tracks the value bound to the option element. Unlike the value binding, * ngValue supports binding to objects. */ @Input('ngValue') set ngValue(value: any) { if (this._select == null) return; this._value = value; this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } /** * @description * Tracks simple string values bound to the option element. * For objects, use the `ngValue` input binding. */ @Input('value') set value(value: any) { if (this._select) { this._value = value; this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } else { this._setElementValue(value); } } /** @internal */ _setElementValue(value: string): void { this._renderer.setProperty(this._element.nativeElement, 'value', value); } /** @internal */ _setSelected(selected: boolean) { this._renderer.setProperty(this._element.nativeElement, 'selected', selected); } /** @nodoc */ ngOnDestroy(): void { if (this._select) { this._select._optionMap.delete(this.id); this._select.writeValue(this._select.value); } } } export {ɵNgSelectMultipleOption as NgSelectMultipleOption}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Input, OnChanges, Provider, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core'; import {Observable} from 'rxjs'; import {AbstractControl} from '../model/abstract_model'; import {emailValidator, maxLengthValidator, maxValidator, minLengthValidator, minValidator, NG_VALIDATORS, nullValidator, patternValidator, requiredTrueValidator, requiredValidator} from '../validators'; /** * Method that updates string to integer if not already a number * * @param value The value to convert to integer. * @returns value of parameter converted to number or integer. */ function toInteger(value: string|number): number { return typeof value === 'number' ? value : parseInt(value, 10); } /** * Method that ensures that provided value is a float (and converts it to float if needed). * * @param value The value to convert to float. * @returns value of parameter converted to number or float. */ function toFloat(value: string|number): number { return typeof value === 'number' ? value : parseFloat(value); } /** * @description * Defines the map of errors returned from failed validation checks. * * @publicApi */ export type ValidationErrors = { [key: string]: any }; /** * @description * An interface implemented by classes that perform synchronous validation. * * @usageNotes * * ### Provide a custom validator * * The following example implements the `Validator` interface to create a * validator directive with a custom error key. * * ```typescript * @Directive({ * selector: '[customValidator]', * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] * }) * class CustomValidatorDirective implements Validator { * validate(control: AbstractControl): ValidationErrors|null { * return {'custom': true}; * } * } * ``` * * @publicApi */ export interface Validator { /** * @description * Method that performs synchronous validation against the provided control. * * @param control The control to validate against. * * @returns A map of validation errors if validation fails, * otherwise null. */ validate(control: AbstractControl): ValidationErrors|null; /** * @description * Registers a callback function to call when the validator inputs change. * * @param fn The callback function */ registerOnValidatorChange?(fn: () => void): void; } /** * A base class for Validator-based Directives. The class contains common logic shared across such * Directives. * * For internal use only, this class is not intended for use outside of the Forms package. */ @Directive() abstract class AbstractValidatorDirective implements Validator, OnChanges { private _validator: ValidatorFn = nullValidator; private _onChange!: () => void; /** * A flag that tracks whether this validator is enabled. * * Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of * directive classes that extend this base class. * @internal */ _enabled?: boolean; /** * Name of an input that matches directive selector attribute (e.g. `minlength` for * `MinLengthDirective`). An input with a given name might contain configuration information (like * `minlength='10'`) or a flag that indicates whether validator should be enabled (like * `[required]='false'`). * * @internal */ abstract inputName: string; /** * Creates an instance of a validator (specific to a directive that extends this base class). * * @internal */ abstract createValidator(input: unknown): ValidatorFn; /** * Performs the necessary input normalization based on a specific logic of a Directive. * For example, the function might be used to convert string-based representation of the * `minlength` input to an integer value that can later be used in the `Validators.minLength` * validator. * * @internal */ abstract normalizeInput(input: unknown): unknown; /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { if (this.inputName in changes) { const input = this.normalizeInput(changes[this.inputName].currentValue); this._enabled = this.enabled(input); this._validator = this._enabled ? this.createValidator(input) : nullValidator; if (this._onChange) { this._onChange(); } } } /** @nodoc */ validate(control: AbstractControl): ValidationErrors|null { return this._validator(control); } /** @nodoc */ registerOnValidatorChange(fn: () => void): void { this._onChange = fn; } /** * @description * Determines whether this validator should be active or not based on an input. * Base class implementation checks whether an input is defined (if the value is different from * `null` and `undefined`). Validator classes that extend this base class can override this * function with the logic specific to a particular validator directive. */ enabled(input: unknown): boolean { return input != null /* both `null` and `undefined` */; } } /** * @description * Provider which adds `MaxValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MAX_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MaxValidator), multi: true }; /** * A directive which installs the {@link MaxValidator} for any `formControlName`, * `formControl`, or control with `ngModel` that also has a `max` attribute. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a max validator * * The following example shows how to add a max validator to an input attached to an * ngModel binding. * * ```html * <input type=\"number\" ngModel max=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]', providers: [MAX_VALIDATOR], host: {'[attr.max]': '_enabled ? max : null'} }) export class MaxValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the max bound to this directive. */ @Input() max!: string|number|null; /** @internal */ override inputName = 'max'; /** @internal */ override normalizeInput = (input: string|number): number => toFloat(input); /** @internal */ override createValidator = (max: number): ValidatorFn => maxValidator(max); } /** * @description * Provider which adds `MinValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MIN_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MinValidator), multi: true }; /** * A directive which installs the {@link MinValidator} for any `formControlName`, * `formControl`, or control with `ngModel` that also has a `min` attribute. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a min validator * * The following example shows how to add a min validator to an input attached to an * ngModel binding. * * ```html * <input type=\"number\" ngModel min=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]', providers: [MIN_VALIDATOR], host: {'[attr.min]': '_enabled ? min : null'} }) export class MinValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the min bound to this directive. */ @Input() min!: string|number|null; /** @internal */ override inputName = 'min'; /** @internal */ override normalizeInput = (input: string|number): number => toFloat(input); /** @internal */ override createValidator = (min: number): ValidatorFn => minValidator(min); } /** * @description * An interface implemented by classes that perform asynchronous validation. * * @usageNotes * * ### Provide a custom async validator directive * * The following example implements the `AsyncValidator` interface to create an * async validator directive with a custom error key. * * ```typescript * import { of } from 'rxjs'; * * @Directive({ * selector: '[customAsyncValidator]', * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi: * true}] * }) * class CustomAsyncValidatorDirective implements AsyncValidator { * validate(control: AbstractControl): Observable<ValidationErrors|null> { * return of({'custom': true}); * } * } * ``` * * @publicApi */ export interface AsyncValidator extends Validator { /** * @description * Method that performs async validation against the provided control. * * @param control The control to validate against. * * @returns A promise or observable that resolves a map of validation errors * if validation fails, otherwise null. */ validate(control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>; } /** * @description * Provider which adds `RequiredValidator` to the `NG_VALIDATORS` multi-provider list. */ export const REQUIRED_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => RequiredValidator), multi: true }; /** * @description * Provider which adds `CheckboxRequiredValidator` to the `NG_VALIDATORS` multi-provider list. */ export const CHECKBOX_REQUIRED_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => CheckboxRequiredValidator), multi: true }; /** * @description * A directive that adds the `required` validator to any controls marked with the * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a required validator using template-driven forms * * ``` * <input name=\"fullName\" ngModel required> * ``` * * @ngModule FormsModule * @ngModule ReactiveFormsModule * @publicApi */ @Directive({ selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]', providers: [REQUIRED_VALIDATOR], host: {'[attr.required]': '_enabled ? \"\" : null'} }) export class RequiredValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the required attribute bound to this directive. */ @Input() required!: boolean|string; /** @internal */ override inputName = 'required'; /** @internal */ override normalizeInput = coerceToBoolean; /** @internal */ override createValidator = (input: boolean): ValidatorFn => requiredValidator; /** @nodoc */ override enabled(input: boolean): boolean { return input; } } /** * A Directive that adds the `required` validator to checkbox controls marked with the * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a required checkbox validator using template-driven forms * * The following example shows how to add a checkbox required validator to an input attached to an * ngModel binding. * * ``` * <input type=\"checkbox\" name=\"active\" ngModel required> * ``` * * @publicApi * @ngModule FormsModule * @ngModule ReactiveFormsModule */ @Directive({ selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]', providers: [CHECKBOX_REQUIRED_VALIDATOR], host: {'[attr.required]': '_enabled ? \"\" : null'} }) export class CheckboxRequiredValidator extends RequiredValidator { /** @internal */ override createValidator = (input: unknown): ValidatorFn => requiredTrueValidator; } /** * @description * Provider which adds `EmailValidator` to the `NG_VALIDATORS` multi-provider list. */ export const EMAIL_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => EmailValidator), multi: true }; /** * A directive that adds the `email` validator to controls marked with the * `email` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * The email validation is based on the WHATWG HTML specification with some enhancements to * incorporate more RFC rules. More information can be found on the [Validators.email * page](api/forms/Validators#email). * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding an email validator * * The following example shows how to add an email validator to an input attached to an ngModel * binding. * * ``` * <input type=\"email\" name=\"email\" ngModel email> * <input type=\"email\" name=\"email\" ngModel email=\"true\"> * <input type=\"email\" name=\"email\" ngModel [email]=\"true\"> * ``` * * @publicApi * @ngModule FormsModule * @ngModule ReactiveFormsModule */ @Directive({ selector: '[email][formControlName],[email][formControl],[email][ngModel]', providers: [EMAIL_VALIDATOR] }) export class EmailValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the email attribute bound to this directive. */ @Input() email!: boolean|string; /** @internal */ override inputName = 'email'; /** @internal */ override normalizeInput = coerceToBoolean; /** @internal */ override createValidator = (input: number): ValidatorFn => emailValidator; /** @nodoc */ override enabled(input: boolean): boolean { return input; } } /** * @description * A function that receives a control and synchronously returns a map of * validation errors if present, otherwise null. * * @publicApi */ export interface ValidatorFn { (control: AbstractControl): ValidationErrors|null; } /** * @description * A function that receives a control and returns a Promise or observable * that emits validation errors if present, otherwise null. * * @publicApi */ export interface AsyncValidatorFn { (control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>; } /** * @description * Provider which adds `MinLengthValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MIN_LENGTH_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MinLengthValidator), multi: true }; /** * A directive that adds minimum length validation to controls marked with the * `minlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a minimum length validator * * The following example shows how to add a minimum length validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel minlength=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]', providers: [MIN_LENGTH_VALIDATOR], host: {'[attr.minlength]': '_enabled ? minlength : null'} }) export class MinLengthValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the minimum length bound to this directive. */ @Input() minlength!: string|number|null; /** @internal */ override inputName = 'minlength'; /** @internal */ override normalizeInput = (input: string|number): number => toInteger(input); /** @internal */ override createValidator = (minlength: number): ValidatorFn => minLengthValidator(minlength); } /** * @description * Provider which adds `MaxLengthValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MAX_LENGTH_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MaxLengthValidator), multi: true }; /** * A directive that adds max length validation to controls marked with the * `maxlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a maximum length validator * * The following example shows how to add a maximum length validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel maxlength=\"25\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]', providers: [MAX_LENGTH_VALIDATOR], host: {'[attr.maxlength]': '_enabled ? maxlength : null'} }) export class MaxLengthValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the minimum length bound to this directive. */ @Input() maxlength!: string|number|null; /** @internal */ override inputName = 'maxlength'; /** @internal */ override normalizeInput = (input: string|number): number => toInteger(input); /** @internal */ override createValidator = (maxlength: number): ValidatorFn => maxLengthValidator(maxlength); } /** * @description * Provider which adds `PatternValidator` to the `NG_VALIDATORS` multi-provider list. */ export const PATTERN_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => PatternValidator), multi: true }; /** * @description * A directive that adds regex pattern validation to controls marked with the * `pattern` attribute. The regex must match the entire control value. * The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a pattern validator * * The following example shows how to add a pattern validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel pattern=\"[a-zA-Z ]*\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]', providers: [PATTERN_VALIDATOR], host: {'[attr.pattern]': '_enabled ? pattern : null'} }) export class PatternValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the pattern bound to this directive. */ @Input() pattern!: string|RegExp; // This input is always defined, since the name matches selector. /** @internal */ override inputName = 'pattern'; /** @internal */ override normalizeInput = (input: string|RegExp): string|RegExp => input; /** @internal */ override createValidator = (input: string|RegExp): ValidatorFn => patternValidator(input); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {NgModule, Type} from '@angular/core'; import {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; import {DefaultValueAccessor} from './directives/default_value_accessor'; import {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; import {NgForm} from './directives/ng_form'; import {NgModel} from './directives/ng_model'; import {NgModelGroup} from './directives/ng_model_group'; import {NgNoValidate} from './directives/ng_no_validate_directive'; import {NumberValueAccessor} from './directives/number_value_accessor'; import {RadioControlRegistryModule, RadioControlValueAccessor} from './directives/radio_control_value_accessor'; import {RangeValueAccessor} from './directives/range_value_accessor'; import {FormControlDirective} from './directives/reactive_directives/form_control_directive'; import {FormControlName} from './directives/reactive_directives/form_control_name'; import {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; import {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; import {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; import {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor'; import {CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, PatternValidator, RequiredValidator} from './directives/validators'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {ControlValueAccessor} from './directives/control_value_accessor'; export {DefaultValueAccessor} from './directives/default_value_accessor'; export {NgControl} from './directives/ng_control'; export {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; export {NgForm} from './directives/ng_form'; export {NgModel} from './directives/ng_model'; export {NgModelGroup} from './directives/ng_model_group'; export {NumberValueAccessor} from './directives/number_value_accessor'; export {RadioControlValueAccessor} from './directives/radio_control_value_accessor'; export {RangeValueAccessor} from './directives/range_value_accessor'; export {FormControlDirective, NG_MODEL_WITH_FORM_CONTROL_WARNING} from './directives/reactive_directives/form_control_directive'; export {FormControlName} from './directives/reactive_directives/form_control_name'; export {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; export {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; export {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; export {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor'; export {CALL_SET_DISABLED_STATE} from './directives/shared'; export const SHARED_FORM_DIRECTIVES: Type<any>[] = [ NgNoValidate, NgSelectOption, NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator, ]; export const TEMPLATE_DRIVEN_DIRECTIVES: Type<any>[] = [NgModel, NgModelGroup, NgForm]; export const REACTIVE_DRIVEN_DIRECTIVES: Type<any>[] = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName]; /** * Internal module used for sharing directives between FormsModule and ReactiveFormsModule */ @NgModule({ declarations: SHARED_FORM_DIRECTIVES, imports: [RadioControlRegistryModule], exports: SHARED_FORM_DIRECTIVES, }) export class ɵInternalFormsSharedModule { } export {ɵInternalFormsSharedModule as InternalFormsSharedModule}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {AbstractControl, AbstractControlOptions, assertAllValuesPresent, assertControlPresent, pickAsyncValidators, pickValidators, ɵRawValue, ɵTypedOrUntyped, ɵValue} from './abstract_model'; /** * FormArrayValue extracts the type of `.value` from a FormArray's element type, and wraps it in an * array. * * Angular uses this type internally to support Typed Forms; do not use it directly. The untyped * case falls back to any[]. */ export type ɵFormArrayValue<T extends AbstractControl<any>> = ɵTypedOrUntyped<T, Array<ɵValue<T>>, any[]>; /** * FormArrayRawValue extracts the type of `.getRawValue()` from a FormArray's element type, and * wraps it in an array. The untyped case falls back to any[]. * * Angular uses this type internally to support Typed Forms; do not use it directly. */ export type ɵFormArrayRawValue<T extends AbstractControl<any>> = ɵTypedOrUntyped<T, Array<ɵRawValue<T>>, any[]>; /** * Tracks the value and validity state of an array of `FormControl`, * `FormGroup` or `FormArray` instances. * * A `FormArray` aggregates the values of each child `FormControl` into an array. * It calculates its status by reducing the status values of its children. For example, if one of * the controls in a `FormArray` is invalid, the entire array becomes invalid. * * `FormArray` accepts one generic argument, which is the type of the controls inside. * If you need a heterogenous array, use {@link UntypedFormArray}. * * `FormArray` is one of the four fundamental building blocks used to define forms in Angular, * along with `FormControl`, `FormGroup`, and `FormRecord`. * * @usageNotes * * ### Create an array of form controls * * ``` * const arr = new FormArray([ * new FormControl('Nancy', Validators.minLength(2)), * new FormControl('Drew'), * ]); * * console.log(arr.value); // ['Nancy', 'Drew'] * console.log(arr.status); // 'VALID' * ``` * * ### Create a form array with array-level validators * * You include array-level validators and async validators. These come in handy * when you want to perform validation that considers the value of more than one child * control. * * The two types of validators are passed in separately as the second and third arg * respectively, or together as part of an options object. * * ``` * const arr = new FormArray([ * new FormControl('Nancy'), * new FormControl('Drew') * ], {validators: myValidator, asyncValidators: myAsyncValidator}); * ``` * * ### Set the updateOn property for all controls in a form array * * The options object is used to set a default value for each child * control's `updateOn` property. If you set `updateOn` to `'blur'` at the * array level, all child controls default to 'blur', unless the child * has explicitly specified a different `updateOn` value. * * ```ts * const arr = new FormArray([ * new FormControl() * ], {updateOn: 'blur'}); * ``` * * ### Adding or removing controls from a form array * * To change the controls in the array, use the `push`, `insert`, `removeAt` or `clear` methods * in `FormArray` itself. These methods ensure the controls are properly tracked in the * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate * the `FormArray` directly, as that result in strange and unexpected behavior such * as broken change detection. * * @publicApi */ export class FormArray<TControl extends AbstractControl<any> = any> extends AbstractControl< ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any>, ɵTypedOrUntyped<TControl, ɵFormArrayRawValue<TControl>, any>> { /** * Creates a new `FormArray` instance. * * @param controls An array of child controls. Each child control is given an index * where it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions * */ constructor( controls: Array<TControl>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this.controls = controls; this._initObservables(); this._setUpdateStrategy(validatorOrOpts); this._setUpControls(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent` // to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); } public controls: ɵTypedOrUntyped<TControl, Array<TControl>, Array<AbstractControl<any>>>; /** * Get the `AbstractControl` at the given `index` in the array. * * @param index Index in the array to retrieve the control. If `index` is negative, it will wrap * around from the back, and if index is greatly negative (less than `-length`), the result is * undefined. This behavior is the same as `Array.at(index)`. */ at(index: number): ɵTypedOrUntyped<TControl, TControl, AbstractControl<any>> { return (this.controls as any)[this._adjustIndex(index)]; } /** * Insert a new `AbstractControl` at the end of the array. * * @param control Form control to be inserted * @param options Specifies whether this FormArray instance should emit events after a new * control is added. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * inserted. When false, no events are emitted. */ push(control: TControl, options: {emitEvent?: boolean} = {}): void { this.controls.push(control); this._registerControl(control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Insert a new `AbstractControl` at the given `index` in the array. * * @param index Index in the array to insert the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), prepends to the array. * This behavior is the same as `Array.splice(index, 0, control)`. * @param control Form control to be inserted * @param options Specifies whether this FormArray instance should emit events after a new * control is inserted. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * inserted. When false, no events are emitted. */ insert(index: number, control: TControl, options: {emitEvent?: boolean} = {}): void { this.controls.splice(index, 0, control); this._registerControl(control); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Remove the control at the given `index` in the array. * * @param index Index in the array to remove the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), removes the first * element. This behavior is the same as `Array.splice(index, 1)`. * @param options Specifies whether this FormArray instance should emit events after a * control is removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * removed. When false, no events are emitted. */ removeAt(index: number, options: {emitEvent?: boolean} = {}): void { // Adjust the index, then clamp it at no less than 0 to prevent undesired underflows. let adjustedIndex = this._adjustIndex(index); if (adjustedIndex < 0) adjustedIndex = 0; if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {}); this.controls.splice(adjustedIndex, 1); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Replace an existing control. * * @param index Index in the array to replace the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), replaces the first * element. This behavior is the same as `Array.splice(index, 1, control)`. * @param control The `AbstractControl` control to replace the existing control * @param options Specifies whether this FormArray instance should emit events after an * existing control is replaced with a new one. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * replaced with a new one. When false, no events are emitted. */ setControl(index: number, control: TControl, options: {emitEvent?: boolean} = {}): void { // Adjust the index, then clamp it at no less than 0 to prevent undesired underflows. let adjustedIndex = this._adjustIndex(index); if (adjustedIndex < 0) adjustedIndex = 0; if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {}); this.controls.splice(adjustedIndex, 1); if (control) { this.controls.splice(adjustedIndex, 0, control); this._registerControl(control); } this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Length of the control array. */ get length(): number { return this.controls.length; } /** * Sets the value of the `FormArray`. It accepts an array that matches * the structure of the control. * * This method performs strict checks, and throws an error if you try * to set the value of a control that doesn't exist or if you exclude the * value of a control. * * @usageNotes * ### Set the values for the controls in the form array * * ``` * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.value); // [null, null] * * arr.setValue(['Nancy', 'Drew']); * console.log(arr.value); // ['Nancy', 'Drew'] * ``` * * @param value Array of values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. */ override setValue(value: ɵFormArrayRawValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { assertAllValuesPresent(this, false, value); value.forEach((newValue: any, index: number) => { assertControlPresent(this, false, index); this.at(index).setValue(newValue, {onlySelf: true, emitEvent: options.emitEvent}); }); this.updateValueAndValidity(options); } /** * Patches the value of the `FormArray`. It accepts an array that matches the * structure of the control, and does its best to match the values to the correct * controls in the group. * * It accepts both super-sets and sub-sets of the array without throwing an error. * * @usageNotes * ### Patch the values for controls in a form array * * ``` * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.value); // [null, null] * * arr.patchValue(['Nancy']); * console.log(arr.value); // ['Nancy', null] * ``` * * @param value Array of latest values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control * value is updated. When false, no events are emitted. The configuration options are passed to * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method. */ override patchValue(value: ɵFormArrayValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { // Even though the `value` argument type doesn't allow `null` and `undefined` values, the // `patchValue` can be called recursively and inner data structures might have these values, // so we just ignore such cases when a field containing FormArray instance receives `null` or // `undefined` as a value. if (value == null /* both `null` and `undefined` */) return; value.forEach((newValue, index) => { if (this.at(index)) { this.at(index).patchValue(newValue, {onlySelf: true, emitEvent: options.emitEvent}); } }); this.updateValueAndValidity(options); } /** * Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the * value of all descendants to null or null maps. * * You reset to a specific form state by passing in an array of states * that matches the structure of the control. The state is a standalone value * or a form state object with both a value and a disabled status. * * @usageNotes * ### Reset the values in a form array * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * arr.reset(['name', 'last name']); * * console.log(arr.value); // ['name', 'last name'] * ``` * * ### Reset the values in a form array and the disabled status for the first control * * ``` * arr.reset([ * {value: 'name', disabled: true}, * 'last' * ]); * * console.log(arr.value); // ['last'] * console.log(arr.at(0).status); // 'DISABLED' * ``` * * @param value Array of values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. */ override reset(value: ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any> = [], options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { this._forEachChild((control: AbstractControl, index: number) => { control.reset(value[index], {onlySelf: true, emitEvent: options.emitEvent}); }); this._updatePristine(options); this._updateTouched(options); this.updateValueAndValidity(options); } /** * The aggregate value of the array, including any disabled controls. * * Reports all values regardless of disabled status. */ override getRawValue(): ɵFormArrayRawValue<TControl> { return this.controls.map((control: AbstractControl) => control.getRawValue()); } /** * Remove all controls in the `FormArray`. * * @param options Specifies whether this FormArray instance should emit events after all * controls are removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when all controls * in this FormArray instance are removed. When false, no events are emitted. * * @usageNotes * ### Remove all elements from a FormArray * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.length); // 2 * * arr.clear(); * console.log(arr.length); // 0 * ``` * * It's a simpler and more efficient alternative to removing all elements one by one: * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * * while (arr.length) { * arr.removeAt(0); * } * ``` */ clear(options: {emitEvent?: boolean} = {}): void { if (this.controls.length < 1) return; this._forEachChild((control) => control._registerOnCollectionChange(() => {})); this.controls.splice(0); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Adjusts a negative index by summing it with the length of the array. For very negative * indices, the result may remain negative. * @internal */ private _adjustIndex(index: number): number { return index < 0 ? index + this.length : index; } /** @internal */ override _syncPendingControls(): boolean { let subtreeUpdated = (this.controls as any).reduce((updated: any, child: any) => { return child._syncPendingControls() ? true : updated; }, false); if (subtreeUpdated) this.updateValueAndValidity({onlySelf: true}); return subtreeUpdated; } /** @internal */ override _forEachChild(cb: (c: AbstractControl, index: number) => void): void { this.controls.forEach((control: AbstractControl, index: number) => { cb(control, index); }); } /** @internal */ override _updateValue(): void { (this as {value: any}).value = this.controls.filter((control) => control.enabled || this.disabled) .map((control) => control.value); } /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { return this.controls.some((control) => control.enabled && condition(control)); } /** @internal */ _setUpControls(): void { this._forEachChild((control) => this._registerControl(control)); } /** @internal */ override _allControlsDisabled(): boolean { for (const control of this.controls) { if (control.enabled) return false; } return this.controls.length > 0 || this.disabled; } private _registerControl(control: AbstractControl) { control.setParent(this); control._registerOnCollectionChange(this._onCollectionChange); } /** @internal */ override _find(name: string|number): AbstractControl|null { return this.at(name as number) ?? null; } } interface UntypedFormArrayCtor { new(controls: AbstractControl[], validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormArray; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormArray<any>; } /** * UntypedFormArray is a non-strongly-typed version of @see FormArray, which * permits heterogenous controls. */ export type UntypedFormArray = FormArray<any>; export const UntypedFormArray: UntypedFormArrayCtor = FormArray; /** * @description * Asserts that the given control is an instance of `FormArray` * * @publicApi */ export const isFormArray = (control: unknown): control is FormArray => control instanceof FormArray; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {inject, Injectable} from '@angular/core'; import {AsyncValidatorFn, ValidatorFn} from './directives/validators'; import {AbstractControl, AbstractControlOptions, FormHooks} from './model/abstract_model'; import {FormArray, UntypedFormArray} from './model/form_array'; import {FormControl, FormControlOptions, FormControlState, UntypedFormControl} from './model/form_control'; import {FormGroup, FormRecord, UntypedFormGroup} from './model/form_group'; function isAbstractControlOptions(options: AbstractControlOptions|{[key: string]: any}|null| undefined): options is AbstractControlOptions { return !!options && ((options as AbstractControlOptions).asyncValidators !== undefined || (options as AbstractControlOptions).validators !== undefined || (options as AbstractControlOptions).updateOn !== undefined); } /** * The union of all validator types that can be accepted by a ControlConfig. */ type ValidatorConfig = ValidatorFn|AsyncValidatorFn|ValidatorFn[]|AsyncValidatorFn[]; /** * The compiler may not always be able to prove that the elements of the control config are a tuple * (i.e. occur in a fixed order). This slightly looser type is used for inference, to catch cases * where the compiler cannot prove order and position. * * For example, consider the simple case `fb.group({foo: ['bar', Validators.required]})`. The * compiler will infer this as an array, not as a tuple. */ type PermissiveControlConfig<T> = Array<T|FormControlState<T>|ValidatorConfig>; /** * Helper type to allow the compiler to accept [XXXX, { updateOn: string }] as a valid shorthand * argument for .group() */ interface PermissiveAbstractControlOptions extends Omit<AbstractControlOptions, 'updateOn'> { updateOn?: string; } /** * ControlConfig<T> is a tuple containing a value of type T, plus optional validators and async * validators. * * @publicApi */ export type ControlConfig<T> = [T|FormControlState<T>, (ValidatorFn|(ValidatorFn[]))?, (AsyncValidatorFn|AsyncValidatorFn[])?]; // Disable clang-format to produce clearer formatting for this multiline type. // clang-format off /** * FormBuilder accepts values in various container shapes, as well as raw values. * Element returns the appropriate corresponding model class, given the container T. * The flag N, if not never, makes the resulting `FormControl` have N in its type. */ export type ɵElement<T, N extends null> = // The `extends` checks are wrapped in arrays in order to prevent TypeScript from applying type unions // through the distributive conditional type. This is the officially recommended solution: // https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types // // Identify FormControl container types. [T] extends [FormControl<infer U>] ? FormControl<U> : // Or FormControl containers that are optional in their parent group. [T] extends [FormControl<infer U>|undefined] ? FormControl<U> : // FormGroup containers. [T] extends [FormGroup<infer U>] ? FormGroup<U> : // Optional FormGroup containers. [T] extends [FormGroup<infer U>|undefined] ? FormGroup<U> : // FormRecord containers. [T] extends [FormRecord<infer U>] ? FormRecord<U> : // Optional FormRecord containers. [T] extends [FormRecord<infer U>|undefined] ? FormRecord<U> : // FormArray containers. [T] extends [FormArray<infer U>] ? FormArray<U> : // Optional FormArray containers. [T] extends [FormArray<infer U>|undefined] ? FormArray<U> : // Otherwise unknown AbstractControl containers. [T] extends [AbstractControl<infer U>] ? AbstractControl<U> : // Optional AbstractControl containers. [T] extends [AbstractControl<infer U>|undefined] ? AbstractControl<U> : // FormControlState object container, which produces a nullable control. [T] extends [FormControlState<infer U>] ? FormControl<U|N> : // A ControlConfig tuple, which produces a nullable control. [T] extends [PermissiveControlConfig<infer U>] ? FormControl<Exclude<U, ValidatorConfig| PermissiveAbstractControlOptions>|N> : FormControl<T|N>; // clang-format on /** * @description * Creates an `AbstractControl` from a user-specified configuration. * * The `FormBuilder` provides syntactic sugar that shortens creating instances of a * `FormControl`, `FormGroup`, or `FormArray`. It reduces the amount of boilerplate needed to * build complex forms. * * @see [Reactive Forms Guide](guide/reactive-forms) * * @publicApi */ @Injectable({providedIn: 'root'}) export class FormBuilder { private useNonNullable: boolean = false; /** * @description * Returns a FormBuilder in which automatically constructed @see FormControl} elements * have `{nonNullable: true}` and are non-nullable. * * **Constructing non-nullable controls** * * When constructing a control, it will be non-nullable, and will reset to its initial value. * * ```ts * let nnfb = new FormBuilder().nonNullable; * let name = nnfb.control('Alex'); // FormControl<string> * name.reset(); * console.log(name); // 'Alex' * ``` * * **Constructing non-nullable groups or arrays** * * When constructing a group or array, all automatically created inner controls will be * non-nullable, and will reset to their initial values. * * ```ts * let nnfb = new FormBuilder().nonNullable; * let name = nnfb.group({who: 'Alex'}); // FormGroup<{who: FormControl<string>}> * name.reset(); * console.log(name); // {who: 'Alex'} * ``` * **Constructing *nullable* fields on groups or arrays** * * It is still possible to have a nullable field. In particular, any `FormControl` which is * *already* constructed will not be altered. For example: * * ```ts * let nnfb = new FormBuilder().nonNullable; * // FormGroup<{who: FormControl<string|null>}> * let name = nnfb.group({who: new FormControl('Alex')}); * name.reset(); console.log(name); // {who: null} * ``` * * Because the inner control is constructed explicitly by the caller, the builder has * no control over how it is created, and cannot exclude the `null`. */ get nonNullable(): NonNullableFormBuilder { const nnfb = new FormBuilder(); nnfb.useNonNullable = true; return nnfb as NonNullableFormBuilder; } /** * @description * Constructs a new `FormGroup` instance. Accepts a single generic argument, which is an object * containing all the keys and corresponding inner control types. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param options Configuration options object for the `FormGroup`. The object should have the * `AbstractControlOptions` type and might contain the following fields: * * `validators`: A synchronous validator function, or an array of validator functions. * * `asyncValidators`: A single async validator or array of async validator functions. * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur' * | submit'). */ group<T extends {}>( controls: T, options?: AbstractControlOptions|null, ): FormGroup<{[K in keyof T]: ɵElement<T[K], null>}>; /** * @description * Constructs a new `FormGroup` instance. * * @deprecated This API is not typesafe and can result in issues with Closure Compiler renaming. * Use the `FormBuilder#group` overload with `AbstractControlOptions` instead. * Note that `AbstractControlOptions` expects `validators` and `asyncValidators` to be valid * validators. If you have custom validators, make sure their validation function parameter is * `AbstractControl` and not a sub-class, such as `FormGroup`. These functions will be called * with an object of type `AbstractControl` and that cannot be automatically downcast to a * subclass, so TypeScript sees this as an error. For example, change the `(group: FormGroup) => * ValidationErrors|null` signature to be `(group: AbstractControl) => ValidationErrors|null`. * * @param controls A record of child controls. The key for each child is the name * under which the control is registered. * * @param options Configuration options object for the `FormGroup`. The legacy configuration * object consists of: * * `validator`: A synchronous validator function, or an array of validator functions. * * `asyncValidator`: A single async validator or array of async validator functions * Note: the legacy format is deprecated and might be removed in one of the next major versions * of Angular. */ group( controls: {[key: string]: any}, options: {[key: string]: any}, ): FormGroup; group(controls: {[key: string]: any}, options: AbstractControlOptions|{[key: string]: any}|null = null): FormGroup { const reducedControls = this._reduceControls(controls); let newOptions: FormControlOptions = {}; if (isAbstractControlOptions(options)) { // `options` are `AbstractControlOptions` newOptions = options; } else if (options !== null) { // `options` are legacy form group options newOptions.validators = (options as any).validator; newOptions.asyncValidators = (options as any).asyncValidator; } return new FormGroup(reducedControls, newOptions); } /** * @description * Constructs a new `FormRecord` instance. Accepts a single generic argument, which is an object * containing all the keys and corresponding inner control types. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param options Configuration options object for the `FormRecord`. The object should have the * `AbstractControlOptions` type and might contain the following fields: * * `validators`: A synchronous validator function, or an array of validator functions. * * `asyncValidators`: A single async validator or array of async validator functions. * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur' * | submit'). */ record<T>(controls: {[key: string]: T}, options: AbstractControlOptions|null = null): FormRecord<ɵElement<T, null>> { const reducedControls = this._reduceControls(controls); // Cast to `any` because the inferred types are not as specific as Element. return new FormRecord(reducedControls, options) as any; } /** @deprecated Use `nonNullable` instead. */ control<T>(formState: T|FormControlState<T>, opts: FormControlOptions&{ initialValueIsDefault: true }): FormControl<T>; control<T>(formState: T|FormControlState<T>, opts: FormControlOptions&{nonNullable: true}): FormControl<T>; /** * @deprecated When passing an `options` argument, the `asyncValidator` argument has no effect. */ control<T>( formState: T|FormControlState<T>, opts: FormControlOptions, asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]): FormControl<T|null>; control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T|null>; /** * @description * Constructs a new `FormControl` with the given state, validators and options. Sets * `{nonNullable: true}` in the options to get a non-nullable control. Otherwise, the * control will be nullable. Accepts a single generic argument, which is the type of the * control's value. * * @param formState Initializes the control with an initial state value, or * with an object that contains both a value and a disabled status. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or a `FormControlOptions` object that contains * validation functions and a validation trigger. * * @param asyncValidator A single async validator or array of async validator * functions. * * @usageNotes * * ### Initialize a control as disabled * * The following example returns a control with an initial value in a disabled state. * * <code-example path=\"forms/ts/formBuilder/form_builder_example.ts\" region=\"disabled-control\"> * </code-example> */ control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl { let newOptions: FormControlOptions = {}; if (!this.useNonNullable) { return new FormControl(formState, validatorOrOpts, asyncValidator); } if (isAbstractControlOptions(validatorOrOpts)) { // If the second argument is options, then they are copied. newOptions = validatorOrOpts; } else { // If the other arguments are validators, they are copied into an options object. newOptions.validators = validatorOrOpts; newOptions.asyncValidators = asyncValidator; } return new FormControl<T>(formState, {...newOptions, nonNullable: true}); } /** * Constructs a new `FormArray` from the given array of configurations, * validators and options. Accepts a single generic argument, which is the type of each control * inside the array. * * @param controls An array of child controls or control configs. Each child control is given an * index when it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of such functions, or an * `AbstractControlOptions` object that contains * validation functions and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions. */ array<T>( controls: Array<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormArray<ɵElement<T, null>> { const createdControls = controls.map(c => this._createControl(c)); // Cast to `any` because the inferred types are not as specific as Element. return new FormArray(createdControls, validatorOrOpts, asyncValidator) as any; } /** @internal */ _reduceControls<T>(controls: {[k: string]: T|ControlConfig<T>|FormControlState<T>|AbstractControl<T>}): {[key: string]: AbstractControl} { const createdControls: {[key: string]: AbstractControl} = {}; Object.keys(controls).forEach(controlName => { createdControls[controlName] = this._createControl(controls[controlName]); }); return createdControls; } /** @internal */ _createControl<T>(controls: T|FormControlState<T>|ControlConfig<T>|FormControl<T>| AbstractControl<T>): FormControl<T>|FormControl<T|null>|AbstractControl<T> { if (controls instanceof FormControl) { return controls as FormControl<T>; } else if (controls instanceof AbstractControl) { // A control; just return it return controls; } else if (Array.isArray(controls)) { // ControlConfig Tuple const value: T|FormControlState<T> = controls[0]; const validator: ValidatorFn|ValidatorFn[]|null = controls.length > 1 ? controls[1]! : null; const asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]|null = controls.length > 2 ? controls[2]! : null; return this.control<T>(value, validator, asyncValidator); } else { // T or FormControlState<T> return this.control<T>(controls); } } } /** * @description * `NonNullableFormBuilder` is similar to {@link FormBuilder}, but automatically constructed * {@link FormControl} elements have `{nonNullable: true}` and are non-nullable. * * @publicApi */ @Injectable({ providedIn: 'root', useFactory: () => inject(FormBuilder).nonNullable, }) export abstract class NonNullableFormBuilder { /** * Similar to `FormBuilder#group`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract group<T extends {}>( controls: T, options?: AbstractControlOptions|null, ): FormGroup<{[K in keyof T]: ɵElement<T[K], never>}>; /** * Similar to `FormBuilder#record`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract record<T>( controls: {[key: string]: T}, options?: AbstractControlOptions|null, ): FormRecord<ɵElement<T, never>>; /** * Similar to `FormBuilder#array`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract array<T>( controls: Array<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormArray<ɵElement<T, never>>; /** * Similar to `FormBuilder#control`, except this overridden version of `control` forces * `nonNullable` to be `true`, resulting in the control always being non-nullable. */ abstract control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T>; } /** * UntypedFormBuilder is the same as @see FormBuilder, but it provides untyped controls. */ @Injectable({providedIn: 'root'}) export class UntypedFormBuilder extends FormBuilder { /** * Like `FormBuilder#group`, except the resulting group is untyped. */ override group( controlsConfig: {[key: string]: any}, options?: AbstractControlOptions|null, ): UntypedFormGroup; /** * @deprecated This API is not typesafe and can result in issues with Closure Compiler renaming. * Use the `FormBuilder#group` overload with `AbstractControlOptions` instead. */ override group( controlsConfig: {[key: string]: any}, options: {[key: string]: any}, ): UntypedFormGroup; override group( controlsConfig: {[key: string]: any}, options: AbstractControlOptions|{[key: string]: any}|null = null): UntypedFormGroup { return super.group(controlsConfig, options); } /** * Like `FormBuilder#control`, except the resulting control is untyped. */ override control( formState: any, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormControl { return super.control(formState, validatorOrOpts, asyncValidator); } /** * Like `FormBuilder#array`, except the resulting array is untyped. */ override array( controlsConfig: any[], validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormArray { return super.array(controlsConfig, validatorOrOpts, asyncValidator); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * Entry point for all public APIs of the forms package. */ import {Version} from '@angular/core'; /** * @publicApi */ export const VERSION = new Version('15.2.0'); ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ModuleWithProviders, NgModule} from '@angular/core'; import {InternalFormsSharedModule, NG_MODEL_WITH_FORM_CONTROL_WARNING, REACTIVE_DRIVEN_DIRECTIVES, TEMPLATE_DRIVEN_DIRECTIVES} from './directives'; import {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './directives/shared'; /** * Exports the required providers and directives for template-driven forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `RadioControlRegistry` * * @see [Forms Overview](/guide/forms-overview) * @see [Template-driven Forms Guide](/guide/forms) * * @publicApi */ @NgModule({ declarations: TEMPLATE_DRIVEN_DIRECTIVES, exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES] }) export class FormsModule { /** * @description * Provides options for configuring the forms module. * * @param opts An object of configuration options * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts: { callSetDisabledState?: SetDisabledStateOption, }): ModuleWithProviders<FormsModule> { return { ngModule: FormsModule, providers: [{ provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault }] }; } } /** * Exports the required infrastructure and directives for reactive forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `FormBuilder` * * `RadioControlRegistry` * * @see [Forms Overview](guide/forms-overview) * @see [Reactive Forms Guide](guide/reactive-forms) * * @publicApi */ @NgModule({ declarations: [REACTIVE_DRIVEN_DIRECTIVES], exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES] }) export class ReactiveFormsModule { /** * @description * Provides options for configuring the reactive forms module. * * @param opts An object of configuration options * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel` * binding is used with reactive form directives. * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts: { /** @deprecated as of v6 */ warnOnNgModelWithFormControl?: 'never'|'once'| 'always', callSetDisabledState?: SetDisabledStateOption, }): ModuleWithProviders<ReactiveFormsModule> { return { ngModule: ReactiveFormsModule, providers: [ { provide: NG_MODEL_WITH_FORM_CONTROL_WARNING, useValue: opts.warnOnNgModelWithFormControl ?? 'always' }, { provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault } ] }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * This module is used for handling user input, by defining and building a `FormGroup` that * consists of `FormControl` objects, and mapping them onto the DOM. `FormControl` * objects can then be used to read information from the form DOM elements. * * Forms providers are not included in default providers; you must import these providers * explicitly. */ export {ɵInternalFormsSharedModule} from './directives'; export {AbstractControlDirective} from './directives/abstract_control_directive'; export {AbstractFormGroupDirective} from './directives/abstract_form_group_directive'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {ControlContainer} from './directives/control_container'; export {ControlValueAccessor, NG_VALUE_ACCESSOR} from './directives/control_value_accessor'; export {COMPOSITION_BUFFER_MODE, DefaultValueAccessor} from './directives/default_value_accessor'; export {Form} from './directives/form_interface'; export {NgControl} from './directives/ng_control'; export {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; export {NgForm} from './directives/ng_form'; export {NgModel} from './directives/ng_model'; export {NgModelGroup} from './directives/ng_model_group'; export {ɵNgNoValidate} from './directives/ng_no_validate_directive'; export {NumberValueAccessor} from './directives/number_value_accessor'; export {RadioControlValueAccessor} from './directives/radio_control_value_accessor'; export {RangeValueAccessor} from './directives/range_value_accessor'; export {FormControlDirective} from './directives/reactive_directives/form_control_directive'; export {FormControlName} from './directives/reactive_directives/form_control_name'; export {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; export {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; export {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; export {SelectMultipleControlValueAccessor, ɵNgSelectMultipleOption} from './directives/select_multiple_control_value_accessor'; export {SetDisabledStateOption} from './directives/shared'; export {AsyncValidator, AsyncValidatorFn, CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, PatternValidator, RequiredValidator, ValidationErrors, Validator, ValidatorFn} from './directives/validators'; export {ControlConfig, FormBuilder, NonNullableFormBuilder, UntypedFormBuilder, ɵElement} from './form_builder'; export {AbstractControl, AbstractControlOptions, FormControlStatus, ɵCoerceStrArrToNumArr, ɵGetProperty, ɵNavigate, ɵRawValue, ɵTokenize, ɵTypedOrUntyped, ɵValue, ɵWriteable} from './model/abstract_model'; export {FormArray, isFormArray, UntypedFormArray, ɵFormArrayRawValue, ɵFormArrayValue} from './model/form_array'; export {FormControl, FormControlOptions, FormControlState, isFormControl, UntypedFormControl, ɵFormControlCtor} from './model/form_control'; export {FormGroup, FormRecord, isFormGroup, isFormRecord, UntypedFormGroup, ɵFormGroupRawValue, ɵFormGroupValue, ɵOptionalKeys} from './model/form_group'; export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './validators'; export {VERSION} from './version'; export * from './form_providers'; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * Entry point for all public APIs of this package. */ export * from './src/forms'; // This file only reexports content of the `src` folder. Keep it that way. ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // This file is not used to build this module. It is only used during editing // by the TypeScript language service and during build for verification. `ngc` // replaces this file with production index.ts when it rewrites private symbol // names. export * from './public_api'; ","/** * Generated bundle index. Do not edit. */ export * from './index'; "],"names":["getDOM","NG_DEV_MODE","isPromise","isObservable","RuntimeError","i1.NgControl","i2.ControlContainer","removeListItem","formDirectiveProvider","resolvedPromise","i1.ControlContainer","formControlBinding","coerceToBoolean","_buildValueString","_extractId","NgNoValidate","NgSelectMultipleOption","InternalFormsSharedModule","i1.NgModel","i2.NgModelGroup","i3.NgForm","i4.FormControlDirective","i5.FormGroupDirective","i6.FormControlName","i7.FormGroupName","i7.FormArrayName"],"mappings":";;;;;;;;;;;;AAqIA;;;;;;AAMG;MAEU,wBAAwB,CAAA;IAcnC,WAAoB,CAAA,SAAoB,EAAU,WAAuB,EAAA;AAArD,QAAA,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;AAAU,QAAA,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;AAbzE;;;;AAIG;QACH,IAAA,CAAA,QAAQ,GAAG,CAAC,CAAM,KAAM,GAAC,CAAC;AAE1B;;;AAGG;AACH,QAAA,IAAA,CAAA,SAAS,GAAG,MAAK,GAAG,CAAC;KAEwD;AAE7E;;;;AAIG;IACO,WAAW,CAAC,GAAW,EAAE,KAAU,EAAA;AAC3C,QAAA,IAAI,CAAC,SAAS,CAAC,WA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E,CAAA,EAAA,GAAA,IAAI,CAAC,oBAAoB,mCAAI,uBAAuB;AAC/D,iBAAA;AACF,aAAA;SACF,CAAC;KACH;;2HA7BU,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,qHAFpBA,0BAAyB,EAAAI,oBAAA,EAAAC,kBAAA,EAAAC,eAAA,EAAAC,aAAA,EAAAC,aAAA,CAAA,EAAA,CAAA,CAAA;AAExB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpBR,0BAAyB,CAAA,EAAA,CAAA,CAAA;sGAExB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,0BAA0B,CAAC;AAC1C,oBAAA,OAAO,EAAE,CAACA,0BAAyB,EAAE,0BAA0B,CAAC;iBACjE,CAAA;;;AC3DD;;;;;;;;;AASG;;ACTH;;;;AAIG;AAGH;;ACPA;;ACRA;;AAEG;;;;"}
22581
22582
  -------------------- SECTION 47 --------------------
22582
22583
  {"version":3,"file":"forms.mjs","sources":["../../../../../../packages/forms/src/directives/control_value_accessor.ts","../../../../../../packages/forms/src/directives/checkbox_value_accessor.ts","../../../../../../packages/forms/src/directives/default_value_accessor.ts","../../../../../../packages/forms/src/validators.ts","../../../../../../packages/forms/src/directives/abstract_control_directive.ts","../../../../../../packages/forms/src/directives/control_container.ts","../../../../../../packages/forms/src/directives/ng_control.ts","../../../../../../packages/forms/src/directives/ng_control_status.ts","../../../../../../packages/forms/src/directives/error_examples.ts","../../../../../../packages/forms/src/directives/reactive_errors.ts","../../../../../../packages/forms/src/model/abstract_model.ts","../../../../../../packages/forms/src/model/form_group.ts","../../../../../../packages/forms/src/directives/shared.ts","../../../../../../packages/forms/src/directives/ng_form.ts","../../../../../../packages/forms/src/util.ts","../../../../../../packages/forms/src/model/form_control.ts","../../../../../../packages/forms/src/directives/abstract_form_group_directive.ts","../../../../../../packages/forms/src/directives/template_driven_errors.ts","../../../../../../packages/forms/src/directives/ng_model_group.ts","../../../../../../packages/forms/src/directives/ng_model.ts","../../../../../../packages/forms/src/directives/ng_no_validate_directive.ts","../../../../../../packages/forms/src/directives/number_value_accessor.ts","../../../../../../packages/forms/src/directives/radio_control_value_accessor.ts","../../../../../../packages/forms/src/directives/range_value_accessor.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_control_directive.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_group_directive.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_group_name.ts","../../../../../../packages/forms/src/directives/reactive_directives/form_control_name.ts","../../../../../../packages/forms/src/directives/select_control_value_accessor.ts","../../../../../../packages/forms/src/directives/select_multiple_control_value_accessor.ts","../../../../../../packages/forms/src/directives/validators.ts","../../../../../../packages/forms/src/directives.ts","../../../../../../packages/forms/src/model/form_array.ts","../../../../../../packages/forms/src/form_builder.ts","../../../../../../packages/forms/src/version.ts","../../../../../../packages/forms/src/form_providers.ts","../../../../../../packages/forms/src/forms.ts","../../../../../../packages/forms/public_api.ts","../../../../../../packages/forms/index.ts","../../../../../../packages/forms/forms.ts"],"sourcesContent":["/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, InjectionToken, Renderer2} from '@angular/core'; /** * @description * Defines an interface that acts as a bridge between the Angular forms API and a * native element in the DOM. * * Implement this interface to create a custom form control directive * that integrates with Angular forms. * * @see DefaultValueAccessor * * @publicApi */ export interface ControlValueAccessor { /** * @description * Writes a new value to the element. * * This method is called by the forms API to write to the view when programmatic * changes from model to view are requested. * * @usageNotes * ### Write a value to the element * * The following example writes a value to the native DOM element. * * ```ts * writeValue(value: any): void { * this._renderer.setProperty(this._elementRef.nativeElement, 'value', value); * } * ``` * * @param obj The new value for the element */ writeValue(obj: any): void; /** * @description * Registers a callback function that is called when the control's value * changes in the UI. * * This method is called by the forms API on initialization to update the form * model when values propagate from the view to the model. * * When implementing the `registerOnChange` method in your own value accessor, * save the given function so your class calls it at the appropriate time. * * @usageNotes * ### Store the change function * * The following example stores the provided function as an internal method. * * ```ts * registerOnChange(fn: (_: any) => void): void { * this._onChange = fn; * } * ``` * * When the value changes in the UI, call the registered * function to allow the forms API to update itself: * * ```ts * host: { * '(change)': '_onChange($event.target.value)' * } * ``` * * @param fn The callback function to register */ registerOnChange(fn: any): void; /** * @description * Registers a callback function that is called by the forms API on initialization * to update the form model on blur. * * When implementing `registerOnTouched` in your own value accessor, save the given * function so your class calls it when the control should be considered * blurred or \"touched\". * * @usageNotes * ### Store the callback function * * The following example stores the provided function as an internal method. * * ```ts * registerOnTouched(fn: any): void { * this._onTouched = fn; * } * ``` * * On blur (or equivalent), your class should call the registered function to allow * the forms API to update itself: * * ```ts * host: { * '(blur)': '_onTouched()' * } * ``` * * @param fn The callback function to register */ registerOnTouched(fn: any): void; /** * @description * Function that is called by the forms API when the control status changes to * or from 'DISABLED'. Depending on the status, it enables or disables the * appropriate DOM element. * * @usageNotes * The following is an example of writing the disabled property to a native DOM element: * * ```ts * setDisabledState(isDisabled: boolean): void { * this._renderer.setProperty(this._elementRef.nativeElement, 'disabled', isDisabled); * } * ``` * * @param isDisabled The disabled status to set on the element */ setDisabledState?(isDisabled: boolean): void; } /** * Base class for all ControlValueAccessor classes defined in Forms package. * Contains common logic and utility functions. * * Note: this is an *internal-only* class and should not be extended or used directly in * applications code. */ @Directive() export class BaseControlValueAccessor { /** * The registered callback function called when a change or input event occurs on the input * element. * @nodoc */ onChange = (_: any) => {}; /** * The registered callback function called when a blur event occurs on the input element. * @nodoc */ onTouched = () => {}; constructor(private _renderer: Renderer2, private _elementRef: ElementRef) {} /** * Helper method that sets a property on a target element using the current Renderer * implementation. * @nodoc */ protected setProperty(key: string, value: any): void { this._renderer.setProperty(this._elementRef.nativeElement, key, value); } /** * Registers a function called when the control is touched. * @nodoc */ registerOnTouched(fn: () => void): void { this.onTouched = fn; } /** * Registers a function called when the control value changes. * @nodoc */ registerOnChange(fn: (_: any) => {}): void { this.onChange = fn; } /** * Sets the \"disabled\" property on the range input element. * @nodoc */ setDisabledState(isDisabled: boolean): void { this.setProperty('disabled', isDisabled); } } /** * Base class for all built-in ControlValueAccessor classes (except DefaultValueAccessor, which is * used in case no other CVAs can be found). We use this class to distinguish between default CVA, * built-in CVAs and custom CVAs, so that Forms logic can recognize built-in CVAs and treat custom * ones with higher priority (when both built-in and custom CVAs are present). * * Note: this is an *internal-only* class and should not be extended or used directly in * applications code. */ @Directive() export class BuiltInControlValueAccessor extends BaseControlValueAccessor { } /** * Used to provide a `ControlValueAccessor` for form controls. * * See `DefaultValueAccessor` for how to implement one. * * @publicApi */ export const NG_VALUE_ACCESSOR = new InjectionToken<ReadonlyArray<ControlValueAccessor>>('NgValueAccessor'); ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const CHECKBOX_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => CheckboxControlValueAccessor), multi: true, }; /** * @description * A `ControlValueAccessor` for writing a value and listening to changes on a checkbox input * element. * * @usageNotes * * ### Using a checkbox with a reactive form. * * The following example shows how to use a checkbox with a reactive form. * * ```ts * const rememberLoginControl = new FormControl(); * ``` * * ``` * <input type=\"checkbox\" [formControl]=\"rememberLoginControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]', host: {'(change)': 'onChange($event.target.checked)', '(blur)': 'onTouched()'}, providers: [CHECKBOX_VALUE_ACCESSOR] }) export class CheckboxControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"checked\" property on the input element. * @nodoc */ writeValue(value: any): void { this.setProperty('checked', value); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵgetDOM as getDOM} from '@angular/common'; import {Directive, ElementRef, forwardRef, Inject, InjectionToken, Optional, Renderer2} from '@angular/core'; import {BaseControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; export const DEFAULT_VALUE_ACCESSOR: any = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => DefaultValueAccessor), multi: true }; /** * We must check whether the agent is Android because composition events * behave differently between iOS and Android. */ function _isAndroid(): boolean { const userAgent = getDOM() ? getDOM().getUserAgent() : ''; return /android (\\d+)/.test(userAgent.toLowerCase()); } /** * @description * Provide this token to control if form directives buffer IME input until * the \"compositionend\" event occurs. * @publicApi */ export const COMPOSITION_BUFFER_MODE = new InjectionToken<boolean>('CompositionEventMode'); /** * The default `ControlValueAccessor` for writing a value and listening to changes on input * elements. The accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * {@searchKeywords ngDefaultControl} * * @usageNotes * * ### Using the default value accessor * * The following example shows how to use an input element that activates the default value accessor * (in this case, a text field). * * ```ts * const firstNameControl = new FormControl(); * ``` * * ``` * <input type=\"text\" [formControl]=\"firstNameControl\"> * ``` * * This value accessor is used by default for `<input type=\"text\">` and `<textarea>` elements, but * you could also use it for custom components that have similar behavior and do not require special * processing. In order to attach the default value accessor to a custom element, add the * `ngDefaultControl` attribute as shown below. * * ``` * <custom-input-component ngDefaultControl [(ngModel)]=\"value\"></custom-input-component> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]', // TODO: vsavkin replace the above selector with the one below it once // https://github.com/angular/angular/issues/3011 is implemented // selector: '[ngModel],[formControl],[formControlName]', host: { '(input)': '$any(this)._handleInput($event.target.value)', '(blur)': 'onTouched()', '(compositionstart)': '$any(this)._compositionStart()', '(compositionend)': '$any(this)._compositionEnd($event.target.value)' }, providers: [DEFAULT_VALUE_ACCESSOR] }) export class DefaultValueAccessor extends BaseControlValueAccessor implements ControlValueAccessor { /** Whether the user is creating a composition string (IME events). */ private _composing = false; constructor( renderer: Renderer2, elementRef: ElementRef, @Optional() @Inject(COMPOSITION_BUFFER_MODE) private _compositionMode: boolean) { super(renderer, elementRef); if (this._compositionMode == null) { this._compositionMode = !_isAndroid(); } } /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: any): void { const normalizedValue = value == null ? '' : value; this.setProperty('value', normalizedValue); } /** @internal */ _handleInput(value: any): void { if (!this._compositionMode || (this._compositionMode && !this._composing)) { this.onChange(value); } } /** @internal */ _compositionStart(): void { this._composing = true; } /** @internal */ _compositionEnd(value: any): void { this._composing = false; this._compositionMode && this.onChange(value); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {InjectionToken, ɵisObservable as isObservable, ɵisPromise as isPromise, ɵRuntimeError as RuntimeError} from '@angular/core'; import {forkJoin, from, Observable} from 'rxjs'; import {map} from 'rxjs/operators'; import {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './directives/validators'; import {RuntimeErrorCode} from './errors'; import {AbstractControl} from './model/abstract_model'; const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; function isEmptyInputValue(value: any): boolean { /** * Check if the object is a string or array before evaluating the length attribute. * This avoids falsely rejecting objects that contain a custom length attribute. * For example, the object {id: 1, length: 0, width: 0} should not be returned as empty. */ return value == null || ((typeof value === 'string' || Array.isArray(value)) && value.length === 0); } function hasValidLength(value: any): boolean { // non-strict comparison is intentional, to check for both `null` and `undefined` values return value != null && typeof value.length === 'number'; } /** * @description * An `InjectionToken` for registering additional synchronous validators used with * `AbstractControl`s. * * @see `NG_ASYNC_VALIDATORS` * * @usageNotes * * ### Providing a custom validator * * The following example registers a custom validator directive. Adding the validator to the * existing collection of validators requires the `multi: true` option. * * ```typescript * @Directive({ * selector: '[customValidator]', * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] * }) * class CustomValidatorDirective implements Validator { * validate(control: AbstractControl): ValidationErrors | null { * return { 'custom': true }; * } * } * ``` * * @publicApi */ export const NG_VALIDATORS = new InjectionToken<Array<Validator|Function>>('NgValidators'); /** * @description * An `InjectionToken` for registering additional asynchronous validators used with * `AbstractControl`s. * * @see `NG_VALIDATORS` * * @usageNotes * * ### Provide a custom async validator directive * * The following example implements the `AsyncValidator` interface to create an * async validator directive with a custom error key. * * ```typescript * @Directive({ * selector: '[customAsyncValidator]', * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi: * true}] * }) * class CustomAsyncValidatorDirective implements AsyncValidator { * validate(control: AbstractControl): Promise<ValidationErrors|null> { * return Promise.resolve({'custom': true}); * } * } * ``` * * @publicApi */ export const NG_ASYNC_VALIDATORS = new InjectionToken<Array<Validator|Function>>('NgAsyncValidators'); /** * A regular expression that matches valid e-mail addresses. * * At a high level, this regexp matches e-mail addresses of the format `local-part@tld`, where: * - `local-part` consists of one or more of the allowed characters (alphanumeric and some * punctuation symbols). * - `local-part` cannot begin or end with a period (`.`). * - `local-part` cannot be longer than 64 characters. * - `tld` consists of one or more `labels` separated by periods (`.`). For example `localhost` or * `foo.com`. * - A `label` consists of one or more of the allowed characters (alphanumeric, dashes (`-`) and * periods (`.`)). * - A `label` cannot begin or end with a dash (`-`) or a period (`.`). * - A `label` cannot be longer than 63 characters. * - The whole address cannot be longer than 254 characters. * * ## Implementation background * * This regexp was ported over from AngularJS (see there for git history): * https://github.com/angular/angular.js/blob/c133ef836/src/ng/directive/input.js#L27 * It is based on the * [WHATWG version](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with * some enhancements to incorporate more RFC rules (such as rules related to domain names and the * lengths of different parts of the address). The main differences from the WHATWG version are: * - Disallow `local-part` to begin or end with a period (`.`). * - Disallow `local-part` length to exceed 64 characters. * - Disallow total address length to exceed 254 characters. * * See [this commit](https://github.com/angular/angular.js/commit/f3f5cf72e) for more details. */ const EMAIL_REGEXP = /^(?=.{1,254}$)(?=.{1,64}@)[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; /** * @description * Provides a set of built-in validators that can be used by form controls. * * A validator is a function that processes a `FormControl` or collection of * controls and returns an error map or null. A null map means that validation has passed. * * @see [Form Validation](/guide/form-validation) * * @publicApi */ export class Validators { /** * @description * Validator that requires the control's value to be greater than or equal to the provided number. * * @usageNotes * * ### Validate against a minimum of 3 * * ```typescript * const control = new FormControl(2, Validators.min(3)); * * console.log(control.errors); // {min: {min: 3, actual: 2}} * ``` * * @returns A validator function that returns an error map with the * `min` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static min(min: number): ValidatorFn { return minValidator(min); } /** * @description * Validator that requires the control's value to be less than or equal to the provided number. * * @usageNotes * * ### Validate against a maximum of 15 * * ```typescript * const control = new FormControl(16, Validators.max(15)); * * console.log(control.errors); // {max: {max: 15, actual: 16}} * ``` * * @returns A validator function that returns an error map with the * `max` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static max(max: number): ValidatorFn { return maxValidator(max); } /** * @description * Validator that requires the control have a non-empty value. * * @usageNotes * * ### Validate that the field is non-empty * * ```typescript * const control = new FormControl('', Validators.required); * * console.log(control.errors); // {required: true} * ``` * * @returns An error map with the `required` property * if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static required(control: AbstractControl): ValidationErrors|null { return requiredValidator(control); } /** * @description * Validator that requires the control's value be true. This validator is commonly * used for required checkboxes. * * @usageNotes * * ### Validate that the field value is true * * ```typescript * const control = new FormControl('some value', Validators.requiredTrue); * * console.log(control.errors); // {required: true} * ``` * * @returns An error map that contains the `required` property * set to `true` if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static requiredTrue(control: AbstractControl): ValidationErrors|null { return requiredTrueValidator(control); } /** * @description * Validator that requires the control's value pass an email validation test. * * Tests the value using a [regular * expression](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) * pattern suitable for common use cases. The pattern is based on the definition of a valid email * address in the [WHATWG HTML * specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) with * some enhancements to incorporate more RFC rules (such as rules related to domain names and the * lengths of different parts of the address). * * The differences from the WHATWG version include: * - Disallow `local-part` (the part before the `@` symbol) to begin or end with a period (`.`). * - Disallow `local-part` to be longer than 64 characters. * - Disallow the whole address to be longer than 254 characters. * * If this pattern does not satisfy your business needs, you can use `Validators.pattern()` to * validate the value against a different pattern. * * @usageNotes * * ### Validate that the field matches a valid email pattern * * ```typescript * const control = new FormControl('bad@', Validators.email); * * console.log(control.errors); // {email: true} * ``` * * @returns An error map with the `email` property * if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static email(control: AbstractControl): ValidationErrors|null { return emailValidator(control); } /** * @description * Validator that requires the length of the control's value to be greater than or equal * to the provided minimum length. This validator is also provided by default if you use the * the HTML5 `minlength` attribute. Note that the `minLength` validator is intended to be used * only for types that have a numeric `length` property, such as strings or arrays. The * `minLength` validator logic is also not invoked for values when their `length` property is 0 * (for example in case of an empty string or an empty array), to support optional controls. You * can use the standard `required` validator if empty values should not be considered valid. * * @usageNotes * * ### Validate that the field has a minimum of 3 characters * * ```typescript * const control = new FormControl('ng', Validators.minLength(3)); * * console.log(control.errors); // {minlength: {requiredLength: 3, actualLength: 2}} * ``` * * ```html * <input minlength=\"5\"> * ``` * * @returns A validator function that returns an error map with the * `minlength` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static minLength(minLength: number): ValidatorFn { return minLengthValidator(minLength); } /** * @description * Validator that requires the length of the control's value to be less than or equal * to the provided maximum length. This validator is also provided by default if you use the * the HTML5 `maxlength` attribute. Note that the `maxLength` validator is intended to be used * only for types that have a numeric `length` property, such as strings or arrays. * * @usageNotes * * ### Validate that the field has maximum of 5 characters * * ```typescript * const control = new FormControl('Angular', Validators.maxLength(5)); * * console.log(control.errors); // {maxlength: {requiredLength: 5, actualLength: 7}} * ``` * * ```html * <input maxlength=\"5\"> * ``` * * @returns A validator function that returns an error map with the * `maxlength` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static maxLength(maxLength: number): ValidatorFn { return maxLengthValidator(maxLength); } /** * @description * Validator that requires the control's value to match a regex pattern. This validator is also * provided by default if you use the HTML5 `pattern` attribute. * * @usageNotes * * ### Validate that the field only contains letters or spaces * * ```typescript * const control = new FormControl('1', Validators.pattern('[a-zA-Z ]*')); * * console.log(control.errors); // {pattern: {requiredPattern: '^[a-zA-Z ]*$', actualValue: '1'}} * ``` * * ```html * <input pattern=\"[a-zA-Z ]*\"> * ``` * * ### Pattern matching with the global or sticky flag * * `RegExp` objects created with the `g` or `y` flags that are passed into `Validators.pattern` * can produce different results on the same input when validations are run consecutively. This is * due to how the behavior of `RegExp.prototype.test` is * specified in [ECMA-262](https://tc39.es/ecma262/#sec-regexpbuiltinexec) * (`RegExp` preserves the index of the last match when the global or sticky flag is used). * Due to this behavior, it is recommended that when using * `Validators.pattern` you **do not** pass in a `RegExp` object with either the global or sticky * flag enabled. * * ```typescript * // Not recommended (since the `g` flag is used) * const controlOne = new FormControl('1', Validators.pattern(/foo/g)); * * // Good * const controlTwo = new FormControl('1', Validators.pattern(/foo/)); * ``` * * @param pattern A regular expression to be used as is to test the values, or a string. * If a string is passed, the `^` character is prepended and the `$` character is * appended to the provided string (if not already present), and the resulting regular * expression is used to test the values. * * @returns A validator function that returns an error map with the * `pattern` property if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static pattern(pattern: string|RegExp): ValidatorFn { return patternValidator(pattern); } /** * @description * Validator that performs no operation. * * @see `updateValueAndValidity()` * */ static nullValidator(control: AbstractControl): ValidationErrors|null { return nullValidator(control); } /** * @description * Compose multiple validators into a single function that returns the union * of the individual error maps for the provided control. * * @returns A validator function that returns an error map with the * merged error maps of the validators if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static compose(validators: null): null; static compose(validators: (ValidatorFn|null|undefined)[]): ValidatorFn|null; static compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null { return compose(validators); } /** * @description * Compose multiple async validators into a single function that returns the union * of the individual error objects for the provided control. * * @returns A validator function that returns an error map with the * merged error objects of the async validators if the validation check fails, otherwise `null`. * * @see `updateValueAndValidity()` * */ static composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null { return composeAsync(validators); } } /** * Validator that requires the control's value to be greater than or equal to the provided number. * See `Validators.min` for additional information. */ export function minValidator(min: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || isEmptyInputValue(min)) { return null; // don't validate empty values to allow optional controls } const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // minimum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-min return !isNaN(value) && value < min ? {'min': {'min': min, 'actual': control.value}} : null; }; } /** * Validator that requires the control's value to be less than or equal to the provided number. * See `Validators.max` for additional information. */ export function maxValidator(max: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || isEmptyInputValue(max)) { return null; // don't validate empty values to allow optional controls } const value = parseFloat(control.value); // Controls with NaN values after parsing should be treated as not having a // maximum, per the HTML forms spec: https://www.w3.org/TR/html5/forms.html#attr-input-max return !isNaN(value) && value > max ? {'max': {'max': max, 'actual': control.value}} : null; }; } /** * Validator that requires the control have a non-empty value. * See `Validators.required` for additional information. */ export function requiredValidator(control: AbstractControl): ValidationErrors|null { return isEmptyInputValue(control.value) ? {'required': true} : null; } /** * Validator that requires the control's value be true. This validator is commonly * used for required checkboxes. * See `Validators.requiredTrue` for additional information. */ export function requiredTrueValidator(control: AbstractControl): ValidationErrors|null { return control.value === true ? null : {'required': true}; } /** * Validator that requires the control's value pass an email validation test. * See `Validators.email` for additional information. */ export function emailValidator(control: AbstractControl): ValidationErrors|null { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } return EMAIL_REGEXP.test(control.value) ? null : {'email': true}; } /** * Validator that requires the length of the control's value to be greater than or equal * to the provided minimum length. See `Validators.minLength` for additional information. */ export function minLengthValidator(minLength: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value) || !hasValidLength(control.value)) { // don't validate empty values to allow optional controls // don't validate values without `length` property return null; } return control.value.length < minLength ? {'minlength': {'requiredLength': minLength, 'actualLength': control.value.length}} : null; }; } /** * Validator that requires the length of the control's value to be less than or equal * to the provided maximum length. See `Validators.maxLength` for additional information. */ export function maxLengthValidator(maxLength: number): ValidatorFn { return (control: AbstractControl): ValidationErrors|null => { return hasValidLength(control.value) && control.value.length > maxLength ? {'maxlength': {'requiredLength': maxLength, 'actualLength': control.value.length}} : null; }; } /** * Validator that requires the control's value to match a regex pattern. * See `Validators.pattern` for additional information. */ export function patternValidator(pattern: string|RegExp): ValidatorFn { if (!pattern) return nullValidator; let regex: RegExp; let regexStr: string; if (typeof pattern === 'string') { regexStr = ''; if (pattern.charAt(0) !== '^') regexStr += '^'; regexStr += pattern; if (pattern.charAt(pattern.length - 1) !== '$') regexStr += '$'; regex = new RegExp(regexStr); } else { regexStr = pattern.toString(); regex = pattern; } return (control: AbstractControl): ValidationErrors|null => { if (isEmptyInputValue(control.value)) { return null; // don't validate empty values to allow optional controls } const value: string = control.value; return regex.test(value) ? null : {'pattern': {'requiredPattern': regexStr, 'actualValue': value}}; }; } /** * Function that has `ValidatorFn` shape, but performs no operation. */ export function nullValidator(control: AbstractControl): ValidationErrors|null { return null; } function isPresent(o: any): boolean { return o != null; } export function toObservable(value: any): Observable<any> { const obs = isPromise(value) ? from(value) : value; if (NG_DEV_MODE && !(isObservable(obs))) { let errorMessage = `Expected async validator to return Promise or Observable.`; // A synchronous validator will return object or null. if (typeof value === 'object') { errorMessage += ' Are you using a synchronous validator where an async validator is expected?'; } throw new RuntimeError(RuntimeErrorCode.WRONG_VALIDATOR_RETURN_TYPE, errorMessage); } return obs; } function mergeErrors(arrayOfErrors: (ValidationErrors|null)[]): ValidationErrors|null { let res: {[key: string]: any} = {}; arrayOfErrors.forEach((errors: ValidationErrors|null) => { res = errors != null ? {...res!, ...errors} : res!; }); return Object.keys(res).length === 0 ? null : res; } type GenericValidatorFn = (control: AbstractControl) => any; function executeValidators<V extends GenericValidatorFn>( control: AbstractControl, validators: V[]): ReturnType<V>[] { return validators.map(validator => validator(control)); } function isValidatorFn<V>(validator: V|Validator|AsyncValidator): validator is V { return !(validator as Validator).validate; } /** * Given the list of validators that may contain both functions as well as classes, return the list * of validator functions (convert validator classes into validator functions). This is needed to * have consistent structure in validators list before composing them. * * @param validators The set of validators that may contain validators both in plain function form * as well as represented as a validator class. */ export function normalizeValidators<V>(validators: (V|Validator|AsyncValidator)[]): V[] { return validators.map(validator => { return isValidatorFn<V>(validator) ? validator : ((c: AbstractControl) => validator.validate(c)) as unknown as V; }); } /** * Merges synchronous validators into a single validator function. * See `Validators.compose` for additional information. */ function compose(validators: (ValidatorFn|null|undefined)[]|null): ValidatorFn|null { if (!validators) return null; const presentValidators: ValidatorFn[] = validators.filter(isPresent) as any; if (presentValidators.length == 0) return null; return function(control: AbstractControl) { return mergeErrors(executeValidators<ValidatorFn>(control, presentValidators)); }; } /** * Accepts a list of validators of different possible shapes (`Validator` and `ValidatorFn`), * normalizes the list (converts everything to `ValidatorFn`) and merges them into a single * validator function. */ export function composeValidators(validators: Array<Validator|ValidatorFn>): ValidatorFn|null { return validators != null ? compose(normalizeValidators<ValidatorFn>(validators)) : null; } /** * Merges asynchronous validators into a single validator function. * See `Validators.composeAsync` for additional information. */ function composeAsync(validators: (AsyncValidatorFn|null)[]): AsyncValidatorFn|null { if (!validators) return null; const presentValidators: AsyncValidatorFn[] = validators.filter(isPresent) as any; if (presentValidators.length == 0) return null; return function(control: AbstractControl) { const observables = executeValidators<AsyncValidatorFn>(control, presentValidators).map(toObservable); return forkJoin(observables).pipe(map(mergeErrors)); }; } /** * Accepts a list of async validators of different possible shapes (`AsyncValidator` and * `AsyncValidatorFn`), normalizes the list (converts everything to `AsyncValidatorFn`) and merges * them into a single validator function. */ export function composeAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>): AsyncValidatorFn|null { return validators != null ? composeAsync(normalizeValidators<AsyncValidatorFn>(validators)) : null; } /** * Merges raw control validators with a given directive validator and returns the combined list of * validators as an array. */ export function mergeValidators<V>(controlValidators: V|V[]|null, dirValidator: V): V[] { if (controlValidators === null) return [dirValidator]; return Array.isArray(controlValidators) ? [...controlValidators, dirValidator] : [controlValidators, dirValidator]; } /** * Retrieves the list of raw synchronous validators attached to a given control. */ export function getControlValidators(control: AbstractControl): ValidatorFn|ValidatorFn[]|null { return (control as any)._rawValidators as ValidatorFn | ValidatorFn[] | null; } /** * Retrieves the list of raw asynchronous validators attached to a given control. */ export function getControlAsyncValidators(control: AbstractControl): AsyncValidatorFn| AsyncValidatorFn[]|null { return (control as any)._rawAsyncValidators as AsyncValidatorFn | AsyncValidatorFn[] | null; } /** * Accepts a singleton validator, an array, or null, and returns an array type with the provided * validators. * * @param validators A validator, validators, or null. * @returns A validators array. */ export function makeValidatorsArray<T extends ValidatorFn|AsyncValidatorFn>(validators: T|T[]| null): T[] { if (!validators) return []; return Array.isArray(validators) ? validators : [validators]; } /** * Determines whether a validator or validators array has a given validator. * * @param validators The validator or validators to compare against. * @param validator The validator to check. * @returns Whether the validator is present. */ export function hasValidator<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[]|null, validator: T): boolean { return Array.isArray(validators) ? validators.includes(validator) : validators === validator; } /** * Combines two arrays of validators into one. If duplicates are provided, only one will be added. * * @param validators The new validators. * @param currentValidators The base array of current validators. * @returns An array of validators. */ export function addValidators<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[], currentValidators: T|T[]|null): T[] { const current = makeValidatorsArray(currentValidators); const validatorsToAdd = makeValidatorsArray(validators); validatorsToAdd.forEach((v: T) => { // Note: if there are duplicate entries in the new validators array, // only the first one would be added to the current list of validators. // Duplicate ones would be ignored since `hasValidator` would detect // the presence of a validator function and we update the current list in place. if (!hasValidator(current, v)) { current.push(v); } }); return current; } export function removeValidators<T extends ValidatorFn|AsyncValidatorFn>( validators: T|T[], currentValidators: T|T[]|null): T[] { return makeValidatorsArray(currentValidators).filter(v => !hasValidator(validators, v)); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Observable} from 'rxjs'; import {AbstractControl} from '../model/abstract_model'; import {composeAsyncValidators, composeValidators} from '../validators'; import {AsyncValidator, AsyncValidatorFn, ValidationErrors, Validator, ValidatorFn} from './validators'; /** * @description * Base class for control directives. * * This class is only used internally in the `ReactiveFormsModule` and the `FormsModule`. * * @publicApi */ export abstract class AbstractControlDirective { /** * @description * A reference to the underlying control. * * @returns the control that backs this directive. Most properties fall through to that instance. */ abstract get control(): AbstractControl|null; /** * @description * Reports the value of the control if it is present, otherwise null. */ get value(): any { return this.control ? this.control.value : null; } /** * @description * Reports whether the control is valid. A control is considered valid if no * validation errors exist with the current value. * If the control is not present, null is returned. */ get valid(): boolean|null { return this.control ? this.control.valid : null; } /** * @description * Reports whether the control is invalid, meaning that an error exists in the input value. * If the control is not present, null is returned. */ get invalid(): boolean|null { return this.control ? this.control.invalid : null; } /** * @description * Reports whether a control is pending, meaning that that async validation is occurring and * errors are not yet available for the input value. If the control is not present, null is * returned. */ get pending(): boolean|null { return this.control ? this.control.pending : null; } /** * @description * Reports whether the control is disabled, meaning that the control is disabled * in the UI and is exempt from validation checks and excluded from aggregate * values of ancestor controls. If the control is not present, null is returned. */ get disabled(): boolean|null { return this.control ? this.control.disabled : null; } /** * @description * Reports whether the control is enabled, meaning that the control is included in ancestor * calculations of validity or value. If the control is not present, null is returned. */ get enabled(): boolean|null { return this.control ? this.control.enabled : null; } /** * @description * Reports the control's validation errors. If the control is not present, null is returned. */ get errors(): ValidationErrors|null { return this.control ? this.control.errors : null; } /** * @description * Reports whether the control is pristine, meaning that the user has not yet changed * the value in the UI. If the control is not present, null is returned. */ get pristine(): boolean|null { return this.control ? this.control.pristine : null; } /** * @description * Reports whether the control is dirty, meaning that the user has changed * the value in the UI. If the control is not present, null is returned. */ get dirty(): boolean|null { return this.control ? this.control.dirty : null; } /** * @description * Reports whether the control is touched, meaning that the user has triggered * a `blur` event on it. If the control is not present, null is returned. */ get touched(): boolean|null { return this.control ? this.control.touched : null; } /** * @description * Reports the validation status of the control. Possible values include: * 'VALID', 'INVALID', 'DISABLED', and 'PENDING'. * If the control is not present, null is returned. */ get status(): string|null { return this.control ? this.control.status : null; } /** * @description * Reports whether the control is untouched, meaning that the user has not yet triggered * a `blur` event on it. If the control is not present, null is returned. */ get untouched(): boolean|null { return this.control ? this.control.untouched : null; } /** * @description * Returns a multicasting observable that emits a validation status whenever it is * calculated for the control. If the control is not present, null is returned. */ get statusChanges(): Observable<any>|null { return this.control ? this.control.statusChanges : null; } /** * @description * Returns a multicasting observable of value changes for the control that emits every time the * value of the control changes in the UI or programmatically. * If the control is not present, null is returned. */ get valueChanges(): Observable<any>|null { return this.control ? this.control.valueChanges : null; } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ get path(): string[]|null { return null; } /** * Contains the result of merging synchronous validators into a single validator function * (combined using `Validators.compose`). */ private _composedValidatorFn: ValidatorFn|null|undefined; /** * Contains the result of merging asynchronous validators into a single validator function * (combined using `Validators.composeAsync`). */ private _composedAsyncValidatorFn: AsyncValidatorFn|null|undefined; /** * Set of synchronous validators as they were provided while calling `setValidators` function. * @internal */ _rawValidators: Array<Validator|ValidatorFn> = []; /** * Set of asynchronous validators as they were provided while calling `setAsyncValidators` * function. * @internal */ _rawAsyncValidators: Array<AsyncValidator|AsyncValidatorFn> = []; /** * Sets synchronous validators for this directive. * @internal */ _setValidators(validators: Array<Validator|ValidatorFn>|undefined): void { this._rawValidators = validators || []; this._composedValidatorFn = composeValidators(this._rawValidators); } /** * Sets asynchronous validators for this directive. * @internal */ _setAsyncValidators(validators: Array<AsyncValidator|AsyncValidatorFn>|undefined): void { this._rawAsyncValidators = validators || []; this._composedAsyncValidatorFn = composeAsyncValidators(this._rawAsyncValidators); } /** * @description * Synchronous validator function composed of all the synchronous validators registered with this * directive. */ get validator(): ValidatorFn|null { return this._composedValidatorFn || null; } /** * @description * Asynchronous validator function composed of all the asynchronous validators registered with * this directive. */ get asyncValidator(): AsyncValidatorFn|null { return this._composedAsyncValidatorFn || null; } /* * The set of callbacks to be invoked when directive instance is being destroyed. */ private _onDestroyCallbacks: (() => void)[] = []; /** * Internal function to register callbacks that should be invoked * when directive instance is being destroyed. * @internal */ _registerOnDestroy(fn: () => void): void { this._onDestroyCallbacks.push(fn); } /** * Internal function to invoke all registered \"on destroy\" callbacks. * Note: calling this function also clears the list of callbacks. * @internal */ _invokeOnDestroyCallbacks(): void { this._onDestroyCallbacks.forEach(fn => fn()); this._onDestroyCallbacks = []; } /** * @description * Resets the control with the provided value if the control is present. */ reset(value: any = undefined): void { if (this.control) this.control.reset(value); } /** * @description * Reports whether the control with the given path has the error specified. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * If no path is given, this method checks for the error on the current control. * * @returns whether the given error is present in the control at the given path. * * If the control is not present, false is returned. */ hasError(errorCode: string, path?: Array<string|number>|string): boolean { return this.control ? this.control.hasError(errorCode, path) : false; } /** * @description * Reports error data for the control with the given path. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * @returns error data for that particular error. If the control or error is not present, * null is returned. */ getError(errorCode: string, path?: Array<string|number>|string): any { return this.control ? this.control.getError(errorCode, path) : null; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbstractControlDirective} from './abstract_control_directive'; import {Form} from './form_interface'; /** * @description * A base class for directives that contain multiple registered instances of `NgControl`. * Only used by the forms module. * * @publicApi */ export abstract class ControlContainer extends AbstractControlDirective { /** * @description * The name for the control */ // TODO(issue/24571): remove '!'. name!: string|number|null; /** * @description * The top-level form directive for the control. */ get formDirective(): Form|null { return null; } /** * @description * The path to this group. */ override get path(): string[]|null { return null; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AbstractControlDirective} from './abstract_control_directive'; import {ControlContainer} from './control_container'; import {ControlValueAccessor} from './control_value_accessor'; /** * @description * A base class that all `FormControl`-based directives extend. It binds a `FormControl` * object to a DOM element. * * @publicApi */ export abstract class NgControl extends AbstractControlDirective { /** * @description * The parent form for the control. * * @internal */ _parent: ControlContainer|null = null; /** * @description * The name for the control */ name: string|number|null = null; /** * @description * The value accessor for the control */ valueAccessor: ControlValueAccessor|null = null; /** * @description * The callback method to update the model from the view when requested * * @param newValue The new value for the view */ abstract viewToModelUpdate(newValue: any): void; } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, Optional, Self} from '@angular/core'; import {AbstractControlDirective} from './abstract_control_directive'; import {ControlContainer} from './control_container'; import {NgControl} from './ng_control'; // DO NOT REFACTOR! // Each status is represented by a separate function to make sure that // advanced Closure Compiler optimizations related to property renaming // can work correctly. export class AbstractControlStatus { private _cd: AbstractControlDirective|null; constructor(cd: AbstractControlDirective|null) { this._cd = cd; } protected get isTouched() { return !!this._cd?.control?.touched; } protected get isUntouched() { return !!this._cd?.control?.untouched; } protected get isPristine() { return !!this._cd?.control?.pristine; } protected get isDirty() { return !!this._cd?.control?.dirty; } protected get isValid() { return !!this._cd?.control?.valid; } protected get isInvalid() { return !!this._cd?.control?.invalid; } protected get isPending() { return !!this._cd?.control?.pending; } protected get isSubmitted() { // We check for the `submitted` field from `NgForm` and `FormGroupDirective` classes, but // we avoid instanceof checks to prevent non-tree-shakable references to those types. return !!(this._cd as unknown as {submitted: boolean} | null)?.submitted; } } export const ngControlStatusHost = { '[class.ng-untouched]': 'isUntouched', '[class.ng-touched]': 'isTouched', '[class.ng-pristine]': 'isPristine', '[class.ng-dirty]': 'isDirty', '[class.ng-valid]': 'isValid', '[class.ng-invalid]': 'isInvalid', '[class.ng-pending]': 'isPending', }; export const ngGroupStatusHost = { ...ngControlStatusHost, '[class.ng-submitted]': 'isSubmitted', }; /** * @description * Directive automatically applied to Angular form controls that sets CSS classes * based on control status. * * @usageNotes * * ### CSS classes applied * * The following classes are applied as the properties become true: * * * ng-valid * * ng-invalid * * ng-pending * * ng-pristine * * ng-dirty * * ng-untouched * * ng-touched * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: '[formControlName],[ngModel],[formControl]', host: ngControlStatusHost}) export class NgControlStatus extends AbstractControlStatus { constructor(@Self() cd: NgControl) { super(cd); } } /** * @description * Directive automatically applied to Angular form groups that sets CSS classes * based on control status (valid/invalid/dirty/etc). On groups, this includes the additional * class ng-submitted. * * @see `NgControlStatus` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]', host: ngGroupStatusHost }) export class NgControlStatusGroup extends AbstractControlStatus { constructor(@Optional() @Self() cd: ControlContainer) { super(cd); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export const formControlNameExample = ` <div [formGroup]=\"myGroup\"> <input formControlName=\"firstName\"> </div> In your class: this.myGroup = new FormGroup({ firstName: new FormControl() });`; export const formGroupNameExample = ` <div [formGroup]=\"myGroup\"> <div formGroupName=\"person\"> <input formControlName=\"firstName\"> </div> </div> In your class: this.myGroup = new FormGroup({ person: new FormGroup({ firstName: new FormControl() }) });`; export const formArrayNameExample = ` <div [formGroup]=\"myGroup\"> <div formArrayName=\"cities\"> <div *ngFor=\"let city of cityArray.controls; index as i\"> <input [formControlName]=\"i\"> </div> </div> </div> In your class: this.cityArray = new FormArray([new FormControl('SF')]); this.myGroup = new FormGroup({ cities: this.cityArray });`; export const ngModelGroupExample = ` <form> <div ngModelGroup=\"person\"> <input [(ngModel)]=\"person.name\" name=\"firstName\"> </div> </form>`; export const ngModelWithFormGroupExample = ` <div [formGroup]=\"myGroup\"> <input formControlName=\"firstName\"> <input [(ngModel)]=\"showMoreControls\" [ngModelOptions]=\"{standalone: true}\"> </div> `; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {formArrayNameExample, formControlNameExample, formGroupNameExample, ngModelGroupExample} from './error_examples'; export function controlParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_CONTROL_NAME_MISSING_PARENT, `formControlName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formControlNameExample}`); } export function ngModelGroupException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_CONTROL_NAME_INSIDE_MODEL_GROUP, `formControlName cannot be used with an ngModelGroup parent. It is only compatible with parents that also have a \"form\" prefix: formGroupName, formArrayName, or formGroup. Option 1: Update the parent to be formGroupName (reactive form strategy) ${formGroupNameExample} Option 2: Use ngModel instead of formControlName (template-driven strategy) ${ngModelGroupExample}`); } export function missingFormException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_GROUP_MISSING_INSTANCE, `formGroup expects a FormGroup instance. Please pass one in. Example: ${formControlNameExample}`); } export function groupParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_GROUP_NAME_MISSING_PARENT, `formGroupName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formGroupNameExample}`); } export function arrayParentException(): Error { return new RuntimeError( RuntimeErrorCode.FORM_ARRAY_NAME_MISSING_PARENT, `formArrayName must be used with a parent formGroup directive. You'll want to add a formGroup directive and pass it an existing FormGroup instance (you can create one in your class). Example: ${formArrayNameExample}`); } export const disabledAttrWarning = ` It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors. Example: // Specify the \\`disabled\\` property at control creation time: form = new FormGroup({ first: new FormControl({value: 'Nancy', disabled: true}, Validators.required), last: new FormControl('Drew', Validators.required) }); // Controls can also be enabled/disabled after creation: form.get('first')?.enable(); form.get('last')?.disable(); `; export const asyncValidatorsDroppedWithOptsWarning = ` It looks like you're constructing using a FormControl with both an options argument and an async validators argument. Mixing these arguments will cause your async validators to be dropped. You should either put all your validators in the options object, or in separate validators arguments. For example: // Using validators arguments fc = new FormControl(42, Validators.required, myAsyncValidator); // Using AbstractControlOptions fc = new FormControl(42, {validators: Validators.required, asyncValidators: myAV}); // Do NOT mix them: async validators will be dropped! fc = new FormControl(42, {validators: Validators.required}, /* Oops! */ myAsyncValidator); `; export function ngModelWarning(directiveName: string): string { return ` It looks like you're using ngModel on the same form field as ${directiveName}. Support for using the ngModel input property and ngModelChange event with reactive form directives has been deprecated in Angular v6 and will be removed in a future version of Angular. For more information on this, see our API docs here: https://angular.io/api/forms/${ directiveName === 'formControl' ? 'FormControlDirective' : 'FormControlName'}#use-with-ngmodel `; } function describeKey(isFormGroup: boolean, key: string|number): string { return isFormGroup ? `with name: '${key}'` : `at index: ${key}`; } export function noControlsError(isFormGroup: boolean): string { return ` There are no form controls registered with this ${ isFormGroup ? 'group' : 'array'} yet. If you're using ngModel, you may want to check next tick (e.g. use setTimeout). `; } export function missingControlError(isFormGroup: boolean, key: string|number): string { return `Cannot find form control ${describeKey(isFormGroup, key)}`; } export function missingControlValueError(isFormGroup: boolean, key: string|number): string { return `Must supply a value for form control ${describeKey(isFormGroup, key)}`; } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {EventEmitter, ɵRuntimeError as RuntimeError} from '@angular/core'; import {Observable} from 'rxjs'; import {asyncValidatorsDroppedWithOptsWarning, missingControlError, missingControlValueError, noControlsError} from '../directives/reactive_errors'; import {AsyncValidatorFn, ValidationErrors, ValidatorFn} from '../directives/validators'; import {RuntimeErrorCode} from '../errors'; import {FormArray, FormGroup} from '../forms'; import {addValidators, composeAsyncValidators, composeValidators, hasValidator, removeValidators, toObservable} from '../validators'; const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode; /** * Reports that a control is valid, meaning that no errors exist in the input value. * * @see `status` */ export const VALID = 'VALID'; /** * Reports that a control is invalid, meaning that an error exists in the input value. * * @see `status` */ export const INVALID = 'INVALID'; /** * Reports that a control is pending, meaning that that async validation is occurring and * errors are not yet available for the input value. * * @see `markAsPending` * @see `status` */ export const PENDING = 'PENDING'; /** * Reports that a control is disabled, meaning that the control is exempt from ancestor * calculations of validity or value. * * @see `markAsDisabled` * @see `status` */ export const DISABLED = 'DISABLED'; /** * A form can have several different statuses. Each * possible status is returned as a string literal. * * * **VALID**: Reports that a control is valid, meaning that no errors exist in the input * value. * * **INVALID**: Reports that a control is invalid, meaning that an error exists in the input * value. * * **PENDING**: Reports that a control is pending, meaning that that async validation is * occurring and errors are not yet available for the input value. * * **DISABLED**: Reports that a control is * disabled, meaning that the control is exempt from ancestor calculations of validity or value. * * @publicApi */ export type FormControlStatus = 'VALID'|'INVALID'|'PENDING'|'DISABLED'; /** * Gets validators from either an options object or given validators. */ export function pickValidators(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions| null): ValidatorFn|ValidatorFn[]|null { return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.validators : validatorOrOpts) || null; } /** * Creates validator function by combining provided validators. */ function coerceToValidator(validator: ValidatorFn|ValidatorFn[]|null): ValidatorFn|null { return Array.isArray(validator) ? composeValidators(validator) : validator || null; } /** * Gets async validators from either an options object or given validators. */ export function pickAsyncValidators( asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): AsyncValidatorFn| AsyncValidatorFn[]|null { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (isOptionsObj(validatorOrOpts) && asyncValidator) { console.warn(asyncValidatorsDroppedWithOptsWarning); } } return (isOptionsObj(validatorOrOpts) ? validatorOrOpts.asyncValidators : asyncValidator) || null; } /** * Creates async validator function by combining provided async validators. */ function coerceToAsyncValidator(asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]| null): AsyncValidatorFn|null { return Array.isArray(asyncValidator) ? composeAsyncValidators(asyncValidator) : asyncValidator || null; } export type FormHooks = 'change'|'blur'|'submit'; /** * Interface for options provided to an `AbstractControl`. * * @publicApi */ export interface AbstractControlOptions { /** * @description * The list of validators applied to a control. */ validators?: ValidatorFn|ValidatorFn[]|null; /** * @description * The list of async validators applied to control. */ asyncValidators?: AsyncValidatorFn|AsyncValidatorFn[]|null; /** * @description * The event name for control to update upon. */ updateOn?: 'change'|'blur'|'submit'; } export function isOptionsObj(validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions| null): validatorOrOpts is AbstractControlOptions { return validatorOrOpts != null && !Array.isArray(validatorOrOpts) && typeof validatorOrOpts === 'object'; } export function assertControlPresent(parent: any, isGroup: boolean, key: string|number): void { const controls = parent.controls as {[key: string|number]: unknown}; const collection = isGroup ? Object.keys(controls) : controls; if (!collection.length) { throw new RuntimeError( RuntimeErrorCode.NO_CONTROLS, NG_DEV_MODE ? noControlsError(isGroup) : ''); } if (!controls[key]) { throw new RuntimeError( RuntimeErrorCode.MISSING_CONTROL, NG_DEV_MODE ? missingControlError(isGroup, key) : ''); } } export function assertAllValuesPresent(control: any, isGroup: boolean, value: any): void { control._forEachChild((_: unknown, key: string|number) => { if (value[key] === undefined) { throw new RuntimeError( RuntimeErrorCode.MISSING_CONTROL_VALUE, NG_DEV_MODE ? missingControlValueError(isGroup, key) : ''); } }); } // IsAny checks if T is `any`, by checking a condition that couldn't possibly be true otherwise. export type ɵIsAny<T, Y, N> = 0 extends(1&T) ? Y : N; /** * `TypedOrUntyped` allows one of two different types to be selected, depending on whether the Forms * class it's applied to is typed or not. * * This is for internal Angular usage to support typed forms; do not directly use it. */ export type ɵTypedOrUntyped<T, Typed, Untyped> = ɵIsAny<T, Untyped, Typed>; /** * Value gives the value type corresponding to a control type. * * Note that the resulting type will follow the same rules as `.value` on your control, group, or * array, including `undefined` for each group element which might be disabled. * * If you are trying to extract a value type for a data model, you probably want {@link RawValue}, * which will not have `undefined` in group keys. * * @usageNotes * * ### `FormControl` value type * * You can extract the value type of a single control: * * ```ts * type NameControl = FormControl<string>; * type NameValue = Value<NameControl>; * ``` * * The resulting type is `string`. * * ### `FormGroup` value type * * Imagine you have an interface defining the controls in your group. You can extract the shape of * the values as follows: * * ```ts * interface PartyFormControls { * address: FormControl<string>; * } * * // Value operates on controls; the object must be wrapped in a FormGroup. * type PartyFormValues = Value<FormGroup<PartyFormControls>>; * ``` * * The resulting type is `{address: string|undefined}`. * * ### `FormArray` value type * * You can extract values from FormArrays as well: * * ```ts * type GuestNamesControls = FormArray<FormControl<string>>; * * type NamesValues = Value<GuestNamesControls>; * ``` * * The resulting type is `string[]`. * * **Internal: not for public use.** */ export type ɵValue<T extends AbstractControl|undefined> = T extends AbstractControl<any, any>? T['value'] : never; /** * RawValue gives the raw value type corresponding to a control type. * * Note that the resulting type will follow the same rules as `.getRawValue()` on your control, * group, or array. This means that all controls inside a group will be required, not optional, * regardless of their disabled state. * * You may also wish to use {@link ɵValue}, which will have `undefined` in group keys (which can be * disabled). * * @usageNotes * * ### `FormGroup` raw value type * * Imagine you have an interface defining the controls in your group. You can extract the shape of * the raw values as follows: * * ```ts * interface PartyFormControls { * address: FormControl<string>; * } * * // RawValue operates on controls; the object must be wrapped in a FormGroup. * type PartyFormValues = RawValue<FormGroup<PartyFormControls>>; * ``` * * The resulting type is `{address: string}`. (Note the absence of `undefined`.) * * **Internal: not for public use.** */ export type ɵRawValue<T extends AbstractControl|undefined> = T extends AbstractControl<any, any>? (T['setValue'] extends((v: infer R) => void) ? R : never) : never; // Disable clang-format to produce clearer formatting for these multiline types. // clang-format off /** * Tokenize splits a string literal S by a delimiter D. */ export type ɵTokenize<S extends string, D extends string> = string extends S ? string[] : /* S must be a literal */ S extends `${infer T}${D}${infer U}` ? [T, ...ɵTokenize<U, D>] : [S] /* Base case */ ; /** * CoerceStrArrToNumArr accepts an array of strings, and converts any numeric string to a number. */ export type ɵCoerceStrArrToNumArr<S> = // Extract the head of the array. S extends [infer Head, ...infer Tail] ? // Using a template literal type, coerce the head to `number` if possible. // Then, recurse on the tail. Head extends `${number}` ? [number, ...ɵCoerceStrArrToNumArr<Tail>] : [Head, ...ɵCoerceStrArrToNumArr<Tail>] : []; /** * Navigate takes a type T and an array K, and returns the type of T[K[0]][K[1]][K[2]]... */ export type ɵNavigate<T, K extends(Array<string|number>)> = T extends object ? /* T must be indexable (object or array) */ (K extends [infer Head, ...infer Tail] ? /* Split K into head and tail */ (Head extends keyof T ? /* head(K) must index T */ (Tail extends(string|number)[] ? /* tail(K) must be an array */ [] extends Tail ? T[Head] : /* base case: K can be split, but Tail is empty */ (ɵNavigate<T[Head], Tail>) /* explore T[head(K)] by tail(K) */ : any) /* tail(K) was not an array, give up */ : never) /* head(K) does not index T, give up */ : any) /* K cannot be split, give up */ : any /* T is not indexable, give up */ ; /** * ɵWriteable removes readonly from all keys. */ export type ɵWriteable<T> = { -readonly[P in keyof T]: T[P] }; /** * GetProperty takes a type T and some property names or indices K. * If K is a dot-separated string, it is tokenized into an array before proceeding. * Then, the type of the nested property at K is computed: T[K[0]][K[1]][K[2]]... * This works with both objects, which are indexed by property name, and arrays, which are indexed * numerically. * * For internal use only. */ export type ɵGetProperty<T, K> = // K is a string K extends string ? ɵGetProperty<T, ɵCoerceStrArrToNumArr<ɵTokenize<K, '.'>>> : // Is is an array ɵWriteable<K> extends Array<string|number> ? ɵNavigate<T, ɵWriteable<K>> : // Fall through permissively if we can't calculate the type of K. any; // clang-format on /** * This is the base class for `FormControl`, `FormGroup`, and `FormArray`. * * It provides some of the shared behavior that all controls and groups of controls have, like * running validators, calculating status, and resetting state. It also defines the properties * that are shared between all sub-classes, like `value`, `valid`, and `dirty`. It shouldn't be * instantiated directly. * * The first type parameter TValue represents the value type of the control (`control.value`). * The optional type parameter TRawValue represents the raw value type (`control.getRawValue()`). * * @see [Forms Guide](/guide/forms) * @see [Reactive Forms Guide](/guide/reactive-forms) * @see [Dynamic Forms Guide](/guide/dynamic-form) * * @publicApi */ export abstract class AbstractControl<TValue = any, TRawValue extends TValue = TValue> { /** @internal */ _pendingDirty = false; /** * Indicates that a control has its own pending asynchronous validation in progress. * * @internal */ _hasOwnPendingAsyncValidator = false; /** @internal */ _pendingTouched = false; /** @internal */ _onCollectionChange = () => {}; /** @internal */ _updateOn?: FormHooks; private _parent: FormGroup|FormArray|null = null; private _asyncValidationSubscription: any; /** * Contains the result of merging synchronous validators into a single validator function * (combined using `Validators.compose`). * * @internal */ private _composedValidatorFn!: ValidatorFn|null; /** * Contains the result of merging asynchronous validators into a single validator function * (combined using `Validators.composeAsync`). * * @internal */ private _composedAsyncValidatorFn!: AsyncValidatorFn|null; /** * Synchronous validators as they were provided: * - in `AbstractControl` constructor * - as an argument while calling `setValidators` function * - while calling the setter on the `validator` field (e.g. `control.validator = validatorFn`) * * @internal */ private _rawValidators!: ValidatorFn|ValidatorFn[]|null; /** * Asynchronous validators as they were provided: * - in `AbstractControl` constructor * - as an argument while calling `setAsyncValidators` function * - while calling the setter on the `asyncValidator` field (e.g. `control.asyncValidator = * asyncValidatorFn`) * * @internal */ private _rawAsyncValidators!: AsyncValidatorFn|AsyncValidatorFn[]|null; /** * The current value of the control. * * * For a `FormControl`, the current value. * * For an enabled `FormGroup`, the values of enabled controls as an object * with a key-value pair for each member of the group. * * For a disabled `FormGroup`, the values of all controls as an object * with a key-value pair for each member of the group. * * For a `FormArray`, the values of enabled controls as an array. * */ public readonly value!: TValue; /** * Initialize the AbstractControl instance. * * @param validators The function or array of functions that is used to determine the validity of * this control synchronously. * @param asyncValidators The function or array of functions that is used to determine validity of * this control asynchronously. */ constructor( validators: ValidatorFn|ValidatorFn[]|null, asyncValidators: AsyncValidatorFn|AsyncValidatorFn[]|null) { this._assignValidators(validators); this._assignAsyncValidators(asyncValidators); } /** * Returns the function that is used to determine the validity of this control synchronously. * If multiple validators have been added, this will be a single composed function. * See `Validators.compose()` for additional information. */ get validator(): ValidatorFn|null { return this._composedValidatorFn; } set validator(validatorFn: ValidatorFn|null) { this._rawValidators = this._composedValidatorFn = validatorFn; } /** * Returns the function that is used to determine the validity of this control asynchronously. * If multiple validators have been added, this will be a single composed function. * See `Validators.compose()` for additional information. */ get asyncValidator(): AsyncValidatorFn|null { return this._composedAsyncValidatorFn; } set asyncValidator(asyncValidatorFn: AsyncValidatorFn|null) { this._rawAsyncValidators = this._composedAsyncValidatorFn = asyncValidatorFn; } /** * The parent control. */ get parent(): FormGroup|FormArray|null { return this._parent; } /** * The validation status of the control. * * @see `FormControlStatus` * * These status values are mutually exclusive, so a control cannot be * both valid AND invalid or invalid AND disabled. */ public readonly status!: FormControlStatus; /** * A control is `valid` when its `status` is `VALID`. * * @see {@link AbstractControl.status} * * @returns True if the control has passed all of its validation tests, * false otherwise. */ get valid(): boolean { return this.status === VALID; } /** * A control is `invalid` when its `status` is `INVALID`. * * @see {@link AbstractControl.status} * * @returns True if this control has failed one or more of its validation checks, * false otherwise. */ get invalid(): boolean { return this.status === INVALID; } /** * A control is `pending` when its `status` is `PENDING`. * * @see {@link AbstractControl.status} * * @returns True if this control is in the process of conducting a validation check, * false otherwise. */ get pending(): boolean { return this.status == PENDING; } /** * A control is `disabled` when its `status` is `DISABLED`. * * Disabled controls are exempt from validation checks and * are not included in the aggregate value of their ancestor * controls. * * @see {@link AbstractControl.status} * * @returns True if the control is disabled, false otherwise. */ get disabled(): boolean { return this.status === DISABLED; } /** * A control is `enabled` as long as its `status` is not `DISABLED`. * * @returns True if the control has any status other than 'DISABLED', * false if the status is 'DISABLED'. * * @see {@link AbstractControl.status} * */ get enabled(): boolean { return this.status !== DISABLED; } /** * An object containing any errors generated by failing validation, * or null if there are no errors. */ public readonly errors!: ValidationErrors|null; /** * A control is `pristine` if the user has not yet changed * the value in the UI. * * @returns True if the user has not yet changed the value in the UI; compare `dirty`. * Programmatic changes to a control's value do not mark it dirty. */ public readonly pristine: boolean = true; /** * A control is `dirty` if the user has changed the value * in the UI. * * @returns True if the user has changed the value of this control in the UI; compare `pristine`. * Programmatic changes to a control's value do not mark it dirty. */ get dirty(): boolean { return !this.pristine; } /** * True if the control is marked as `touched`. * * A control is marked `touched` once the user has triggered * a `blur` event on it. */ public readonly touched: boolean = false; /** * True if the control has not been marked as touched * * A control is `untouched` if the user has not yet triggered * a `blur` event on it. */ get untouched(): boolean { return !this.touched; } /** * A multicasting observable that emits an event every time the value of the control changes, in * the UI or programmatically. It also emits an event each time you call enable() or disable() * without passing along {emitEvent: false} as a function argument. */ public readonly valueChanges!: Observable<TValue>; /** * A multicasting observable that emits an event every time the validation `status` of the control * recalculates. * * @see `FormControlStatus` * @see {@link AbstractControl.status} * */ public readonly statusChanges!: Observable<FormControlStatus>; /** * Reports the update strategy of the `AbstractControl` (meaning * the event on which the control updates itself). * Possible values: `'change'` | `'blur'` | `'submit'` * Default value: `'change'` */ get updateOn(): FormHooks { return this._updateOn ? this._updateOn : (this.parent ? this.parent.updateOn : 'change'); } /** * Sets the synchronous validators that are active on this control. Calling * this overwrites any existing synchronous validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * If you want to add a new validator without affecting existing ones, consider * using `addValidators()` method instead. */ setValidators(validators: ValidatorFn|ValidatorFn[]|null): void { this._assignValidators(validators); } /** * Sets the asynchronous validators that are active on this control. Calling this * overwrites any existing asynchronous validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * If you want to add a new validator without affecting existing ones, consider * using `addAsyncValidators()` method instead. */ setAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void { this._assignAsyncValidators(validators); } /** * Add a synchronous validator or validators to this control, without affecting other validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * Adding a validator that already exists will have no effect. If duplicate validator functions * are present in the `validators` array, only the first instance would be added to a form * control. * * @param validators The new validator function or functions to add to this control. */ addValidators(validators: ValidatorFn|ValidatorFn[]): void { this.setValidators(addValidators(validators, this._rawValidators)); } /** * Add an asynchronous validator or validators to this control, without affecting other * validators. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * Adding a validator that already exists will have no effect. * * @param validators The new asynchronous validator function or functions to add to this control. */ addAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void { this.setAsyncValidators(addValidators(validators, this._rawAsyncValidators)); } /** * Remove a synchronous validator from this control, without affecting other validators. * Validators are compared by function reference; you must pass a reference to the exact same * validator function as the one that was originally set. If a provided validator is not found, * it is ignored. * * @usageNotes * * ### Reference to a ValidatorFn * * ``` * // Reference to the RequiredValidator * const ctrl = new FormControl<string | null>('', Validators.required); * ctrl.removeValidators(Validators.required); * * // Reference to anonymous function inside MinValidator * const minValidator = Validators.min(3); * const ctrl = new FormControl<string | null>('', minValidator); * expect(ctrl.hasValidator(minValidator)).toEqual(true) * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false) * * ctrl.removeValidators(minValidator); * ``` * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * @param validators The validator or validators to remove. */ removeValidators(validators: ValidatorFn|ValidatorFn[]): void { this.setValidators(removeValidators(validators, this._rawValidators)); } /** * Remove an asynchronous validator from this control, without affecting other validators. * Validators are compared by function reference; you must pass a reference to the exact same * validator function as the one that was originally set. If a provided validator is not found, it * is ignored. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * * @param validators The asynchronous validator or validators to remove. */ removeAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]): void { this.setAsyncValidators(removeValidators(validators, this._rawAsyncValidators)); } /** * Check whether a synchronous validator function is present on this control. The provided * validator must be a reference to the exact same function that was provided. * * @usageNotes * * ### Reference to a ValidatorFn * * ``` * // Reference to the RequiredValidator * const ctrl = new FormControl<number | null>(0, Validators.required); * expect(ctrl.hasValidator(Validators.required)).toEqual(true) * * // Reference to anonymous function inside MinValidator * const minValidator = Validators.min(3); * const ctrl = new FormControl<number | null>(0, minValidator); * expect(ctrl.hasValidator(minValidator)).toEqual(true) * expect(ctrl.hasValidator(Validators.min(3))).toEqual(false) * ``` * * @param validator The validator to check for presence. Compared by function reference. * @returns Whether the provided validator was found on this control. */ hasValidator(validator: ValidatorFn): boolean { return hasValidator(this._rawValidators, validator); } /** * Check whether an asynchronous validator function is present on this control. The provided * validator must be a reference to the exact same function that was provided. * * @param validator The asynchronous validator to check for presence. Compared by function * reference. * @returns Whether the provided asynchronous validator was found on this control. */ hasAsyncValidator(validator: AsyncValidatorFn): boolean { return hasValidator(this._rawAsyncValidators, validator); } /** * Empties out the synchronous validator list. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * */ clearValidators(): void { this.validator = null; } /** * Empties out the async validator list. * * When you add or remove a validator at run time, you must call * `updateValueAndValidity()` for the new validation to take effect. * */ clearAsyncValidators(): void { this.asyncValidator = null; } /** * Marks the control as `touched`. A control is touched by focus and * blur events that do not change the value. * * @see `markAsUntouched()` * @see `markAsDirty()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsTouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = true; if (this._parent && !opts.onlySelf) { this._parent.markAsTouched(opts); } } /** * Marks the control and all its descendant controls as `touched`. * @see `markAsTouched()` */ markAllAsTouched(): void { this.markAsTouched({onlySelf: true}); this._forEachChild((control: AbstractControl) => control.markAllAsTouched()); } /** * Marks the control as `untouched`. * * If the control has any children, also marks all children as `untouched` * and recalculates the `touched` status of all parent controls. * * @see `markAsTouched()` * @see `markAsDirty()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after the marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsUntouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = false; this._pendingTouched = false; this._forEachChild((control: AbstractControl) => { control.markAsUntouched({onlySelf: true}); }); if (this._parent && !opts.onlySelf) { this._parent._updateTouched(opts); } } /** * Marks the control as `dirty`. A control becomes dirty when * the control's value is changed through the UI; compare `markAsTouched`. * * @see `markAsTouched()` * @see `markAsUntouched()` * @see `markAsPristine()` * * @param opts Configuration options that determine how the control propagates changes * and emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsDirty(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = false; if (this._parent && !opts.onlySelf) { this._parent.markAsDirty(opts); } } /** * Marks the control as `pristine`. * * If the control has any children, marks all children as `pristine`, * and recalculates the `pristine` status of all parent * controls. * * @see `markAsTouched()` * @see `markAsUntouched()` * @see `markAsDirty()` * * @param opts Configuration options that determine how the control emits events after * marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. */ markAsPristine(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = true; this._pendingDirty = false; this._forEachChild((control: AbstractControl) => { control.markAsPristine({onlySelf: true}); }); if (this._parent && !opts.onlySelf) { this._parent._updatePristine(opts); } } /** * Marks the control as `pending`. * * A control is pending while the control performs async validation. * * @see {@link AbstractControl.status} * * @param opts Configuration options that determine how the control propagates changes and * emits events after marking is applied. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), the `statusChanges` * observable emits an event with the latest status the control is marked pending. * When false, no events are emitted. * */ markAsPending(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { (this as {status: FormControlStatus}).status = PENDING; if (opts.emitEvent !== false) { (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent && !opts.onlySelf) { this._parent.markAsPending(opts); } } /** * Disables the control. This means the control is exempt from validation checks and * excluded from the aggregate value of any parent. Its status is `DISABLED`. * * If the control has children, all children are also disabled. * * @see {@link AbstractControl.status} * * @param opts Configuration options that determine how the control propagates * changes and emits events after the control is disabled. * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is disabled. * When false, no events are emitted. */ disable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { // If parent has been marked artificially dirty we don't want to re-calculate the // parent's dirtiness based on the children. const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); (this as {status: FormControlStatus}).status = DISABLED; (this as {errors: ValidationErrors | null}).errors = null; this._forEachChild((control: AbstractControl) => { control.disable({...opts, onlySelf: true}); }); this._updateValue(); if (opts.emitEvent !== false) { (this.valueChanges as EventEmitter<TValue>).emit(this.value); (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } this._updateAncestors({...opts, skipPristineCheck}); this._onDisabledChange.forEach((changeFn) => changeFn(true)); } /** * Enables the control. This means the control is included in validation checks and * the aggregate value of its parent. Its status recalculates based on its value and * its validators. * * By default, if the control has children, all children are enabled. * * @see {@link AbstractControl.status} * * @param opts Configure options that control how the control propagates changes and * emits events when marked as untouched * * `onlySelf`: When true, mark only this control. When false or not supplied, * marks all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is enabled. * When false, no events are emitted. */ enable(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { // If parent has been marked artificially dirty we don't want to re-calculate the // parent's dirtiness based on the children. const skipPristineCheck = this._parentMarkedDirty(opts.onlySelf); (this as {status: FormControlStatus}).status = VALID; this._forEachChild((control: AbstractControl) => { control.enable({...opts, onlySelf: true}); }); this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent}); this._updateAncestors({...opts, skipPristineCheck}); this._onDisabledChange.forEach((changeFn) => changeFn(false)); } private _updateAncestors( opts: {onlySelf?: boolean, emitEvent?: boolean, skipPristineCheck?: boolean}): void { if (this._parent && !opts.onlySelf) { this._parent.updateValueAndValidity(opts); if (!opts.skipPristineCheck) { this._parent._updatePristine(); } this._parent._updateTouched(); } } /** * Sets the parent of the control * * @param parent The new parent. */ setParent(parent: FormGroup|FormArray|null): void { this._parent = parent; } /** * Sets the value of the control. Abstract method (implemented in sub-classes). */ abstract setValue(value: TRawValue, options?: Object): void; /** * Patches the value of the control. Abstract method (implemented in sub-classes). */ abstract patchValue(value: TValue, options?: Object): void; /** * Resets the control. Abstract method (implemented in sub-classes). */ abstract reset(value?: TValue, options?: Object): void; /** * The raw value of this control. For most control implementations, the raw value will include * disabled children. */ getRawValue(): any { return this.value; } /** * Recalculates the value and validation status of the control. * * By default, it also updates the value and validity of its ancestors. * * @param opts Configuration options determine how the control propagates changes and emits events * after updates and validity checks are applied. * * `onlySelf`: When true, only update this control. When false or not supplied, * update all direct ancestors. Default is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is updated. * When false, no events are emitted. */ updateValueAndValidity(opts: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._setInitialStatus(); this._updateValue(); if (this.enabled) { this._cancelExistingSubscription(); (this as {errors: ValidationErrors | null}).errors = this._runValidator(); (this as {status: FormControlStatus}).status = this._calculateStatus(); if (this.status === VALID || this.status === PENDING) { this._runAsyncValidator(opts.emitEvent); } } if (opts.emitEvent !== false) { (this.valueChanges as EventEmitter<TValue>).emit(this.value); (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent && !opts.onlySelf) { this._parent.updateValueAndValidity(opts); } } /** @internal */ _updateTreeValidity(opts: {emitEvent?: boolean} = {emitEvent: true}): void { this._forEachChild((ctrl: AbstractControl) => ctrl._updateTreeValidity(opts)); this.updateValueAndValidity({onlySelf: true, emitEvent: opts.emitEvent}); } private _setInitialStatus() { (this as {status: FormControlStatus}).status = this._allControlsDisabled() ? DISABLED : VALID; } private _runValidator(): ValidationErrors|null { return this.validator ? this.validator(this) : null; } private _runAsyncValidator(emitEvent?: boolean): void { if (this.asyncValidator) { (this as {status: FormControlStatus}).status = PENDING; this._hasOwnPendingAsyncValidator = true; const obs = toObservable(this.asyncValidator(this)); this._asyncValidationSubscription = obs.subscribe((errors: ValidationErrors|null) => { this._hasOwnPendingAsyncValidator = false; // This will trigger the recalculation of the validation status, which depends on // the state of the asynchronous validation (whether it is in progress or not). So, it is // necessary that we have updated the `_hasOwnPendingAsyncValidator` boolean flag first. this.setErrors(errors, {emitEvent}); }); } } private _cancelExistingSubscription(): void { if (this._asyncValidationSubscription) { this._asyncValidationSubscription.unsubscribe(); this._hasOwnPendingAsyncValidator = false; } } /** * Sets errors on a form control when running validations manually, rather than automatically. * * Calling `setErrors` also updates the validity of the parent control. * * @param opts Configuration options that determine how the control propagates * changes and emits events after the control errors are set. * * `emitEvent`: When true or not supplied (the default), the `statusChanges` * observable emits an event after the errors are set. * * @usageNotes * * ### Manually set the errors for a control * * ``` * const login = new FormControl('someLogin'); * login.setErrors({ * notUnique: true * }); * * expect(login.valid).toEqual(false); * expect(login.errors).toEqual({ notUnique: true }); * * login.setValue('someOtherLogin'); * * expect(login.valid).toEqual(true); * ``` */ setErrors(errors: ValidationErrors|null, opts: {emitEvent?: boolean} = {}): void { (this as {errors: ValidationErrors | null}).errors = errors; this._updateControlsErrors(opts.emitEvent !== false); } /** * Retrieves a child control given the control's name or path. * * This signature for get supports strings and `const` arrays (`.get(['foo', 'bar'] as const)`). */ get<P extends string|(readonly(string|number)[])>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null; /** * Retrieves a child control given the control's name or path. * * This signature for `get` supports non-const (mutable) arrays. Inferred type * information will not be as robust, so prefer to pass a `readonly` array if possible. */ get<P extends string|Array<string|number>>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null; /** * Retrieves a child control given the control's name or path. * * @param path A dot-delimited string or array of string/number values that define the path to the * control. If a string is provided, passing it as a string literal will result in improved type * information. Likewise, if an array is provided, passing it `as const` will cause improved type * information to be available. * * @usageNotes * ### Retrieve a nested control * * For example, to get a `name` control nested within a `person` sub-group: * * * `this.form.get('person.name');` * * -OR- * * * `this.form.get(['person', 'name'] as const);` // `as const` gives improved typings * * ### Retrieve a control in a FormArray * * When accessing an element inside a FormArray, you can use an element index. * For example, to get a `price` control from the first element in an `items` array you can use: * * * `this.form.get('items.0.price');` * * -OR- * * * `this.form.get(['items', 0, 'price']);` */ get<P extends string|((string | number)[])>(path: P): AbstractControl<ɵGetProperty<TRawValue, P>>|null { let currPath: Array<string|number>|string = path; if (currPath == null) return null; if (!Array.isArray(currPath)) currPath = currPath.split('.'); if (currPath.length === 0) return null; return currPath.reduce( (control: AbstractControl|null, name) => control && control._find(name), this); } /** * @description * Reports error data for the control with the given path. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * @returns error data for that particular error. If the control or error is not present, * null is returned. */ getError(errorCode: string, path?: Array<string|number>|string): any { const control = path ? this.get(path) : this; return control && control.errors ? control.errors[errorCode] : null; } /** * @description * Reports whether the control with the given path has the error specified. * * @param errorCode The code of the error to check * @param path A list of control names that designates how to move from the current control * to the control that should be queried for errors. * * @usageNotes * For example, for the following `FormGroup`: * * ``` * form = new FormGroup({ * address: new FormGroup({ street: new FormControl() }) * }); * ``` * * The path to the 'street' control from the root form would be 'address' -> 'street'. * * It can be provided to this method in one of two formats: * * 1. An array of string control names, e.g. `['address', 'street']` * 1. A period-delimited list of control names in one string, e.g. `'address.street'` * * If no path is given, this method checks for the error on the current control. * * @returns whether the given error is present in the control at the given path. * * If the control is not present, false is returned. */ hasError(errorCode: string, path?: Array<string|number>|string): boolean { return !!this.getError(errorCode, path); } /** * Retrieves the top-level ancestor of this control. */ get root(): AbstractControl { let x: AbstractControl = this; while (x._parent) { x = x._parent; } return x; } /** @internal */ _updateControlsErrors(emitEvent: boolean): void { (this as {status: FormControlStatus}).status = this._calculateStatus(); if (emitEvent) { (this.statusChanges as EventEmitter<FormControlStatus>).emit(this.status); } if (this._parent) { this._parent._updateControlsErrors(emitEvent); } } /** @internal */ _initObservables() { (this as {valueChanges: Observable<TValue>}).valueChanges = new EventEmitter(); (this as {statusChanges: Observable<FormControlStatus>}).statusChanges = new EventEmitter(); } private _calculateStatus(): FormControlStatus { if (this._allControlsDisabled()) return DISABLED; if (this.errors) return INVALID; if (this._hasOwnPendingAsyncValidator || this._anyControlsHaveStatus(PENDING)) return PENDING; if (this._anyControlsHaveStatus(INVALID)) return INVALID; return VALID; } /** @internal */ abstract _updateValue(): void; /** @internal */ abstract _forEachChild(cb: (c: AbstractControl) => void): void; /** @internal */ abstract _anyControls(condition: (c: AbstractControl) => boolean): boolean; /** @internal */ abstract _allControlsDisabled(): boolean; /** @internal */ abstract _syncPendingControls(): boolean; /** @internal */ _anyControlsHaveStatus(status: FormControlStatus): boolean { return this._anyControls((control: AbstractControl) => control.status === status); } /** @internal */ _anyControlsDirty(): boolean { return this._anyControls((control: AbstractControl) => control.dirty); } /** @internal */ _anyControlsTouched(): boolean { return this._anyControls((control: AbstractControl) => control.touched); } /** @internal */ _updatePristine(opts: {onlySelf?: boolean} = {}): void { (this as {pristine: boolean}).pristine = !this._anyControlsDirty(); if (this._parent && !opts.onlySelf) { this._parent._updatePristine(opts); } } /** @internal */ _updateTouched(opts: {onlySelf?: boolean} = {}): void { (this as {touched: boolean}).touched = this._anyControlsTouched(); if (this._parent && !opts.onlySelf) { this._parent._updateTouched(opts); } } /** @internal */ _onDisabledChange: Array<(isDisabled: boolean) => void> = []; /** @internal */ _registerOnCollectionChange(fn: () => void): void { this._onCollectionChange = fn; } /** @internal */ _setUpdateStrategy(opts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null): void { if (isOptionsObj(opts) && opts.updateOn != null) { this._updateOn = opts.updateOn!; } } /** * Check to see if parent has been marked artificially dirty. * * @internal */ private _parentMarkedDirty(onlySelf?: boolean): boolean { const parentDirty = this._parent && this._parent.dirty; return !onlySelf && !!parentDirty && !this._parent!._anyControlsDirty(); } /** @internal */ _find(name: string|number): AbstractControl|null { return null; } /** * Internal implementation of the `setValidators` method. Needs to be separated out into a * different method, because it is called in the constructor and it can break cases where * a control is extended. */ private _assignValidators(validators: ValidatorFn|ValidatorFn[]|null): void { this._rawValidators = Array.isArray(validators) ? validators.slice() : validators; this._composedValidatorFn = coerceToValidator(this._rawValidators); } /** * Internal implementation of the `setAsyncValidators` method. Needs to be separated out into a * different method, because it is called in the constructor and it can break cases where * a control is extended. */ private _assignAsyncValidators(validators: AsyncValidatorFn|AsyncValidatorFn[]|null): void { this._rawAsyncValidators = Array.isArray(validators) ? validators.slice() : validators; this._composedAsyncValidatorFn = coerceToAsyncValidator(this._rawAsyncValidators); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {AbstractControl, AbstractControlOptions, assertAllValuesPresent, assertControlPresent, pickAsyncValidators, pickValidators, ɵRawValue, ɵTypedOrUntyped, ɵValue} from './abstract_model'; /** * FormGroupValue extracts the type of `.value` from a FormGroup's inner object type. The untyped * case falls back to {[key: string]: any}. * * Angular uses this type internally to support Typed Forms; do not use it directly. * * For internal use only. */ export type ɵFormGroupValue<T extends {[K in keyof T]?: AbstractControl<any>}> = ɵTypedOrUntyped<T, Partial<{[K in keyof T]: ɵValue<T[K]>}>, {[key: string]: any}>; /** * FormGroupRawValue extracts the type of `.getRawValue()` from a FormGroup's inner object type. The * untyped case falls back to {[key: string]: any}. * * Angular uses this type internally to support Typed Forms; do not use it directly. * * For internal use only. */ export type ɵFormGroupRawValue<T extends {[K in keyof T]?: AbstractControl<any>}> = ɵTypedOrUntyped<T, {[K in keyof T]: ɵRawValue<T[K]>}, {[key: string]: any}>; /** * OptionalKeys returns the union of all optional keys in the object. * * Angular uses this type internally to support Typed Forms; do not use it directly. */ export type ɵOptionalKeys<T> = { [K in keyof T] -?: undefined extends T[K] ? K : never }[keyof T]; /** * Tracks the value and validity state of a group of `FormControl` instances. * * A `FormGroup` aggregates the values of each child `FormControl` into one object, * with each control name as the key. It calculates its status by reducing the status values * of its children. For example, if one of the controls in a group is invalid, the entire * group becomes invalid. * * `FormGroup` is one of the four fundamental building blocks used to define forms in Angular, * along with `FormControl`, `FormArray`, and `FormRecord`. * * When instantiating a `FormGroup`, pass in a collection of child controls as the first * argument. The key for each child registers the name for the control. * * `FormGroup` is intended for use cases where the keys are known ahead of time. * If you need to dynamically add and remove controls, use {@link FormRecord} instead. * * `FormGroup` accepts an optional type parameter `TControl`, which is an object type with inner * control types as values. * * @usageNotes * * ### Create a form group with 2 controls * * ``` * const form = new FormGroup({ * first: new FormControl('Nancy', Validators.minLength(2)), * last: new FormControl('Drew'), * }); * * console.log(form.value); // {first: 'Nancy', last; 'Drew'} * console.log(form.status); // 'VALID' * ``` * * ### The type argument, and optional controls * * `FormGroup` accepts one generic argument, which is an object containing its inner controls. * This type will usually be inferred automatically, but you can always specify it explicitly if you * wish. * * If you have controls that are optional (i.e. they can be removed, you can use the `?` in the * type): * * ``` * const form = new FormGroup<{ * first: FormControl<string|null>, * middle?: FormControl<string|null>, // Middle name is optional. * last: FormControl<string|null>, * }>({ * first: new FormControl('Nancy'), * last: new FormControl('Drew'), * }); * ``` * * ### Create a form group with a group-level validator * * You include group-level validators as the second arg, or group-level async * validators as the third arg. These come in handy when you want to perform validation * that considers the value of more than one child control. * * ``` * const form = new FormGroup({ * password: new FormControl('', Validators.minLength(2)), * passwordConfirm: new FormControl('', Validators.minLength(2)), * }, passwordMatchValidator); * * * function passwordMatchValidator(g: FormGroup) { * return g.get('password').value === g.get('passwordConfirm').value * ? null : {'mismatch': true}; * } * ``` * * Like `FormControl` instances, you choose to pass in * validators and async validators as part of an options object. * * ``` * const form = new FormGroup({ * password: new FormControl('') * passwordConfirm: new FormControl('') * }, { validators: passwordMatchValidator, asyncValidators: otherValidator }); * ``` * * ### Set the updateOn property for all controls in a form group * * The options object is used to set a default value for each child * control's `updateOn` property. If you set `updateOn` to `'blur'` at the * group level, all child controls default to 'blur', unless the child * has explicitly specified a different `updateOn` value. * * ```ts * const c = new FormGroup({ * one: new FormControl() * }, { updateOn: 'blur' }); * ``` * * ### Using a FormGroup with optional controls * * It is possible to have optional controls in a FormGroup. An optional control can be removed later * using `removeControl`, and can be omitted when calling `reset`. Optional controls must be * declared optional in the group's type. * * ```ts * const c = new FormGroup<{one?: FormControl<string>}>({ * one: new FormControl('') * }); * ``` * * Notice that `c.value.one` has type `string|null|undefined`. This is because calling `c.reset({})` * without providing the optional key `one` will cause it to become `null`. * * @publicApi */ export class FormGroup<TControl extends {[K in keyof TControl]: AbstractControl<any>} = any> extends AbstractControl< ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any>, ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any>> { /** * Creates a new `FormGroup` instance. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions * */ constructor( controls: TControl, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this.controls = controls; this._initObservables(); this._setUpdateStrategy(validatorOrOpts); this._setUpControls(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. The status should be broadcasted via the `statusChanges` observable, // so we set `emitEvent` to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); } public controls: ɵTypedOrUntyped<TControl, TControl, {[key: string]: AbstractControl<any>}>; /** * Registers a control with the group's list of controls. In a strongly-typed group, the control * must be in the group's type (possibly as an optional key). * * This method does not update the value or validity of the control. * Use {@link FormGroup#addControl addControl} instead. * * @param name The control name to register in the collection * @param control Provides the control for the given name */ registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K]; registerControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl<any>): AbstractControl<any>; registerControl<K extends string&keyof TControl>(name: K, control: TControl[K]): TControl[K] { if (this.controls[name]) return (this.controls as any)[name]; this.controls[name] = control; control.setParent(this as FormGroup); control._registerOnCollectionChange(this._onCollectionChange); return control; } /** * Add a control to this group. In a strongly-typed group, the control must be in the group's type * (possibly as an optional key). * * If a control with a given name already exists, it would *not* be replaced with a new one. * If you want to replace an existing control, use the {@link FormGroup#setControl setControl} * method instead. This method also updates the value and validity of the control. * * @param name The control name to add to the collection * @param control Provides the control for the given name * @param options Specifies whether this FormGroup instance should emit events after a new * control is added. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * added. When false, no events are emitted. */ addControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl, options?: {emitEvent?: boolean}): void; addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options?: { emitEvent?: boolean }): void; addControl<K extends string&keyof TControl>(name: K, control: Required<TControl>[K], options: { emitEvent?: boolean } = {}): void { this.registerControl(name, control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } removeControl(this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, options?: { emitEvent?: boolean; }): void; removeControl<S extends string>(name: ɵOptionalKeys<TControl>&S, options?: { emitEvent?: boolean; }): void; /** * Remove a control from this group. In a strongly-typed group, required controls cannot be * removed. * * This method also updates the value and validity of the control. * * @param name The control name to remove from the collection * @param options Specifies whether this FormGroup instance should emit events after a * control is removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * removed. When false, no events are emitted. */ removeControl(name: string, options: {emitEvent?: boolean;} = {}): void { if ((this.controls as any)[name]) (this.controls as any)[name]._registerOnCollectionChange(() => {}); delete ((this.controls as any)[name]); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Replace an existing control. In a strongly-typed group, the control must be in the group's type * (possibly as an optional key). * * If a control with a given name does not exist in this `FormGroup`, it will be added. * * @param name The control name to replace in the collection * @param control Provides the control for the given name * @param options Specifies whether this FormGroup instance should emit events after an * existing control is replaced. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * replaced with a new one. When false, no events are emitted. */ setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options?: { emitEvent?: boolean }): void; setControl( this: FormGroup<{[key: string]: AbstractControl<any>}>, name: string, control: AbstractControl, options?: {emitEvent?: boolean}): void; setControl<K extends string&keyof TControl>(name: K, control: TControl[K], options: { emitEvent?: boolean } = {}): void { if (this.controls[name]) this.controls[name]._registerOnCollectionChange(() => {}); delete (this.controls[name]); if (control) this.registerControl(name, control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Check whether there is an enabled control with the given name in the group. * * Reports false for disabled controls. If you'd like to check for existence in the group * only, use {@link AbstractControl#get get} instead. * * @param controlName The control name to check for existence in the collection * * @returns false for disabled controls, true otherwise. */ contains<K extends string>(controlName: K): boolean; contains(this: FormGroup<{[key: string]: AbstractControl<any>}>, controlName: string): boolean; contains<K extends string&keyof TControl>(controlName: K): boolean { return this.controls.hasOwnProperty(controlName) && this.controls[controlName].enabled; } /** * Sets the value of the `FormGroup`. It accepts an object that matches * the structure of the group, with control names as keys. * * @usageNotes * ### Set the complete value for the form group * * ``` * const form = new FormGroup({ * first: new FormControl(), * last: new FormControl() * }); * * console.log(form.value); // {first: null, last: null} * * form.setValue({first: 'Nancy', last: 'Drew'}); * console.log(form.value); // {first: 'Nancy', last: 'Drew'} * ``` * * @throws When strict checks fail, such as setting the value of a control * that doesn't exist or if you exclude a value of a control that does exist. * * @param value The new value for the control that matches the structure of the group. * @param options Configuration options that determine how the control propagates changes * and emits events after the value changes. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. */ override setValue(value: ɵFormGroupRawValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { assertAllValuesPresent(this, true, value); (Object.keys(value) as Array<keyof TControl>).forEach(name => { assertControlPresent(this, true, name as any); (this.controls as any)[name].setValue( (value as any)[name], {onlySelf: true, emitEvent: options.emitEvent}); }); this.updateValueAndValidity(options); } /** * Patches the value of the `FormGroup`. It accepts an object with control * names as keys, and does its best to match the values to the correct controls * in the group. * * It accepts both super-sets and sub-sets of the group without throwing an error. * * @usageNotes * ### Patch the value for a form group * * ``` * const form = new FormGroup({ * first: new FormControl(), * last: new FormControl() * }); * console.log(form.value); // {first: null, last: null} * * form.patchValue({first: 'Nancy'}); * console.log(form.value); // {first: 'Nancy', last: null} * ``` * * @param value The object that matches the structure of the group. * @param options Configuration options that determine how the control propagates changes and * emits events after the value is patched. * * `onlySelf`: When true, each change only affects this control and not its parent. Default is * true. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control value * is updated. When false, no events are emitted. The configuration options are passed to * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method. */ override patchValue(value: ɵFormGroupValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { // Even though the `value` argument type doesn't allow `null` and `undefined` values, the // `patchValue` can be called recursively and inner data structures might have these values, so // we just ignore such cases when a field containing FormGroup instance receives `null` or // `undefined` as a value. if (value == null /* both `null` and `undefined` */) return; (Object.keys(value) as Array<keyof TControl>).forEach(name => { // The compiler cannot see through the uninstantiated conditional type of `this.controls`, so // `as any` is required. const control = (this.controls as any)[name]; if (control) { control.patchValue( /* Guaranteed to be present, due to the outer forEach. */ value [name as keyof ɵFormGroupValue<TControl>]!, {onlySelf: true, emitEvent: options.emitEvent}); } }); this.updateValueAndValidity(options); } /** * Resets the `FormGroup`, marks all descendants `pristine` and `untouched` and sets * the value of all descendants to their default values, or null if no defaults were provided. * * You reset to a specific form state by passing in a map of states * that matches the structure of your form, with control names as keys. The state * is a standalone value or a form state object with both a value and a disabled * status. * * @param value Resets the control with an initial value, * or an object that defines the initial value and disabled state. * * @param options Configuration options that determine how the control propagates changes * and emits events when the group is reset. * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * @usageNotes * * ### Reset the form group values * * ```ts * const form = new FormGroup({ * first: new FormControl('first name'), * last: new FormControl('last name') * }); * * console.log(form.value); // {first: 'first name', last: 'last name'} * * form.reset({ first: 'name', last: 'last name' }); * * console.log(form.value); // {first: 'name', last: 'last name'} * ``` * * ### Reset the form group values and disabled status * * ``` * const form = new FormGroup({ * first: new FormControl('first name'), * last: new FormControl('last name') * }); * * form.reset({ * first: {value: 'name', disabled: true}, * last: 'last' * }); * * console.log(form.value); // {last: 'last'} * console.log(form.get('first').status); // 'DISABLED' * ``` */ override reset( value: ɵTypedOrUntyped<TControl, ɵFormGroupValue<TControl>, any> = {} as unknown as ɵFormGroupValue<TControl>, options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._forEachChild((control, name) => { control.reset((value as any)[name], {onlySelf: true, emitEvent: options.emitEvent}); }); this._updatePristine(options); this._updateTouched(options); this.updateValueAndValidity(options); } /** * The aggregate value of the `FormGroup`, including any disabled controls. * * Retrieves all values regardless of disabled status. */ override getRawValue(): ɵTypedOrUntyped<TControl, ɵFormGroupRawValue<TControl>, any> { return this._reduceChildren({}, (acc, control, name) => { (acc as any)[name] = (control as any).getRawValue(); return acc; }) as any; } /** @internal */ override _syncPendingControls(): boolean { let subtreeUpdated = this._reduceChildren(false, (updated: boolean, child) => { return child._syncPendingControls() ? true : updated; }); if (subtreeUpdated) this.updateValueAndValidity({onlySelf: true}); return subtreeUpdated; } /** @internal */ override _forEachChild(cb: (v: any, k: any) => void): void { Object.keys(this.controls).forEach(key => { // The list of controls can change (for ex. controls might be removed) while the loop // is running (as a result of invoking Forms API in `valueChanges` subscription), so we // have to null check before invoking the callback. const control = (this.controls as any)[key]; control && cb(control, key); }); } /** @internal */ _setUpControls(): void { this._forEachChild((control) => { control.setParent(this); control._registerOnCollectionChange(this._onCollectionChange); }); } /** @internal */ override _updateValue(): void { (this as {value: any}).value = this._reduceValue(); } /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { for (const [controlName, control] of Object.entries(this.controls)) { if (this.contains(controlName as any) && condition(control as any)) { return true; } } return false; } /** @internal */ _reduceValue(): Partial<TControl> { let acc: Partial<TControl> = {}; return this._reduceChildren(acc, (acc, control, name) => { if (control.enabled || this.disabled) { acc[name] = control.value; } return acc; }); } /** @internal */ _reduceChildren<T, K extends keyof TControl>( initValue: T, fn: (acc: T, control: TControl[K], name: K) => T): T { let res = initValue; this._forEachChild((control: TControl[K], name: K) => { res = fn(res, control, name); }); return res; } /** @internal */ override _allControlsDisabled(): boolean { for (const controlName of (Object.keys(this.controls) as Array<keyof TControl>)) { if ((this.controls as any)[controlName].enabled) { return false; } } return Object.keys(this.controls).length > 0 || this.disabled; } /** @internal */ override _find(name: string|number): AbstractControl|null { return this.controls.hasOwnProperty(name as string) ? (this.controls as any)[name as keyof TControl] : null; } } interface UntypedFormGroupCtor { new(controls: {[key: string]: AbstractControl}, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormGroup; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormGroup<any>; } /** * UntypedFormGroup is a non-strongly-typed version of @see FormGroup. */ export type UntypedFormGroup = FormGroup<any>; export const UntypedFormGroup: UntypedFormGroupCtor = FormGroup; /** * @description * Asserts that the given control is an instance of `FormGroup` * * @publicApi */ export const isFormGroup = (control: unknown): control is FormGroup => control instanceof FormGroup; /** * Tracks the value and validity state of a collection of `FormControl` instances, each of which has * the same value type. * * `FormRecord` is very similar to {@link FormGroup}, except it can be used with a dynamic keys, * with controls added and removed as needed. * * `FormRecord` accepts one generic argument, which describes the type of the controls it contains. * * @usageNotes * * ``` * let numbers = new FormRecord({bill: new FormControl('415-123-456')}); * numbers.addControl('bob', new FormControl('415-234-567')); * numbers.removeControl('bill'); * ``` * * @publicApi */ export class FormRecord<TControl extends AbstractControl = AbstractControl> extends FormGroup<{[key: string]: TControl}> {} export interface FormRecord<TControl> { /** * Registers a control with the records's list of controls. * * See `FormGroup#registerControl` for additional information. */ registerControl(name: string, control: TControl): TControl; /** * Add a control to this group. * * See `FormGroup#addControl` for additional information. */ addControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void; /** * Remove a control from this group. * * See `FormGroup#removeControl` for additional information. */ removeControl(name: string, options?: {emitEvent?: boolean}): void; /** * Replace an existing control. * * See `FormGroup#setControl` for additional information. */ setControl(name: string, control: TControl, options?: {emitEvent?: boolean}): void; /** * Check whether there is an enabled control with the given name in the group. * * See `FormGroup#contains` for additional information. */ contains(controlName: string): boolean; /** * Sets the value of the `FormRecord`. It accepts an object that matches * the structure of the group, with control names as keys. * * See `FormGroup#setValue` for additional information. */ setValue(value: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * Patches the value of the `FormRecord`. It accepts an object with control * names as keys, and does its best to match the values to the correct controls * in the group. * * See `FormGroup#patchValue` for additional information. */ patchValue(value: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * Resets the `FormRecord`, marks all descendants `pristine` and `untouched` and sets * the value of all descendants to null. * * See `FormGroup#reset` for additional information. */ reset(value?: {[key: string]: ɵValue<TControl>}, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * The aggregate value of the `FormRecord`, including any disabled controls. * * See `FormGroup#getRawValue` for additional information. */ getRawValue(): {[key: string]: ɵRawValue<TControl>}; } /** * @description * Asserts that the given control is an instance of `FormRecord` * * @publicApi */ export const isFormRecord = (control: unknown): control is FormRecord => control instanceof FormRecord; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Inject, InjectionToken, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {AbstractControl} from '../model/abstract_model'; import {FormArray} from '../model/form_array'; import {FormControl} from '../model/form_control'; import {FormGroup} from '../model/form_group'; import {getControlAsyncValidators, getControlValidators, mergeValidators} from '../validators'; import {AbstractControlDirective} from './abstract_control_directive'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {BuiltInControlValueAccessor, ControlValueAccessor} from './control_value_accessor'; import {DefaultValueAccessor} from './default_value_accessor'; import {NgControl} from './ng_control'; import {FormArrayName} from './reactive_directives/form_group_name'; import {ngModelWarning} from './reactive_errors'; import {AsyncValidatorFn, Validator, ValidatorFn} from './validators'; /** * Token to provide to allow SetDisabledState to always be called when a CVA is added, regardless of * whether the control is disabled or enabled. * * @see `FormsModule.withConfig` */ export const CALL_SET_DISABLED_STATE = new InjectionToken( 'CallSetDisabledState', {providedIn: 'root', factory: () => setDisabledStateDefault}); /** * The type for CALL_SET_DISABLED_STATE. If `always`, then ControlValueAccessor will always call * `setDisabledState` when attached, which is the most correct behavior. Otherwise, it will only be * called when disabled, which is the legacy behavior for compatibility. * * @publicApi * @see `FormsModule.withConfig` */ export type SetDisabledStateOption = 'whenDisabledForLegacyCode'|'always'; /** * Whether to use the fixed setDisabledState behavior by default. */ export const setDisabledStateDefault: SetDisabledStateOption = 'always'; export function controlPath(name: string|null, parent: ControlContainer): string[] { return [...parent.path!, name!]; } /** * Links a Form control and a Form directive by setting up callbacks (such as `onChange`) on both * instances. This function is typically invoked when form directive is being initialized. * * @param control Form control instance that should be linked. * @param dir Directive that should be linked with a given control. */ export function setUpControl( control: FormControl, dir: NgControl, callSetDisabledState: SetDisabledStateOption = setDisabledStateDefault): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!control) _throwError(dir, 'Cannot find control with'); if (!dir.valueAccessor) _throwMissingValueAccessorError(dir); } setUpValidators(control, dir); dir.valueAccessor!.writeValue(control.value); // The legacy behavior only calls the CVA's `setDisabledState` if the control is disabled. // If the `callSetDisabledState` option is set to `always`, then this bug is fixed and // the method is always called. if (control.disabled || callSetDisabledState === 'always') { dir.valueAccessor!.setDisabledState?.(control.disabled); } setUpViewChangePipeline(control, dir); setUpModelChangePipeline(control, dir); setUpBlurPipeline(control, dir); setUpDisabledChangeHandler(control, dir); } /** * Reverts configuration performed by the `setUpControl` control function. * Effectively disconnects form control with a given form directive. * This function is typically invoked when corresponding form directive is being destroyed. * * @param control Form control which should be cleaned up. * @param dir Directive that should be disconnected from a given control. * @param validateControlPresenceOnChange Flag that indicates whether onChange handler should * contain asserts to verify that it's not called once directive is destroyed. We need this flag * to avoid potentially breaking changes caused by better control cleanup introduced in #39235. */ export function cleanUpControl( control: FormControl|null, dir: NgControl, validateControlPresenceOnChange: boolean = true): void { const noop = () => { if (validateControlPresenceOnChange && (typeof ngDevMode === 'undefined' || ngDevMode)) { _noControlError(dir); } }; // The `valueAccessor` field is typically defined on FromControl and FormControlName directive // instances and there is a logic in `selectValueAccessor` function that throws if it's not the // case. We still check the presence of `valueAccessor` before invoking its methods to make sure // that cleanup works correctly if app code or tests are setup to ignore the error thrown from // `selectValueAccessor`. See https://github.com/angular/angular/issues/40521. if (dir.valueAccessor) { dir.valueAccessor.registerOnChange(noop); dir.valueAccessor.registerOnTouched(noop); } cleanUpValidators(control, dir); if (control) { dir._invokeOnDestroyCallbacks(); control._registerOnCollectionChange(() => {}); } } function registerOnValidatorChange<V>(validators: (V|Validator)[], onChange: () => void): void { validators.forEach((validator: V|Validator) => { if ((<Validator>validator).registerOnValidatorChange) (<Validator>validator).registerOnValidatorChange!(onChange); }); } /** * Sets up disabled change handler function on a given form control if ControlValueAccessor * associated with a given directive instance supports the `setDisabledState` call. * * @param control Form control where disabled change handler should be setup. * @param dir Corresponding directive instance associated with this control. */ export function setUpDisabledChangeHandler(control: FormControl, dir: NgControl): void { if (dir.valueAccessor!.setDisabledState) { const onDisabledChange = (isDisabled: boolean) => { dir.valueAccessor!.setDisabledState!(isDisabled); }; control.registerOnDisabledChange(onDisabledChange); // Register a callback function to cleanup disabled change handler // from a control instance when a directive is destroyed. dir._registerOnDestroy(() => { control._unregisterOnDisabledChange(onDisabledChange); }); } } /** * Sets up sync and async directive validators on provided form control. * This function merges validators from the directive into the validators of the control. * * @param control Form control where directive validators should be setup. * @param dir Directive instance that contains validators to be setup. */ export function setUpValidators(control: AbstractControl, dir: AbstractControlDirective): void { const validators = getControlValidators(control); if (dir.validator !== null) { control.setValidators(mergeValidators<ValidatorFn>(validators, dir.validator)); } else if (typeof validators === 'function') { // If sync validators are represented by a single validator function, we force the // `Validators.compose` call to happen by executing the `setValidators` function with // an array that contains that function. We need this to avoid possible discrepancies in // validators behavior, so sync validators are always processed by the `Validators.compose`. // Note: we should consider moving this logic inside the `setValidators` function itself, so we // have consistent behavior on AbstractControl API level. The same applies to the async // validators logic below. control.setValidators([validators]); } const asyncValidators = getControlAsyncValidators(control); if (dir.asyncValidator !== null) { control.setAsyncValidators( mergeValidators<AsyncValidatorFn>(asyncValidators, dir.asyncValidator)); } else if (typeof asyncValidators === 'function') { control.setAsyncValidators([asyncValidators]); } // Re-run validation when validator binding changes, e.g. minlength=3 -> minlength=4 const onValidatorChange = () => control.updateValueAndValidity(); registerOnValidatorChange<ValidatorFn>(dir._rawValidators, onValidatorChange); registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, onValidatorChange); } /** * Cleans up sync and async directive validators on provided form control. * This function reverts the setup performed by the `setUpValidators` function, i.e. * removes directive-specific validators from a given control instance. * * @param control Form control from where directive validators should be removed. * @param dir Directive instance that contains validators to be removed. * @returns true if a control was updated as a result of this action. */ export function cleanUpValidators( control: AbstractControl|null, dir: AbstractControlDirective): boolean { let isControlUpdated = false; if (control !== null) { if (dir.validator !== null) { const validators = getControlValidators(control); if (Array.isArray(validators) && validators.length > 0) { // Filter out directive validator function. const updatedValidators = validators.filter((validator) => validator !== dir.validator); if (updatedValidators.length !== validators.length) { isControlUpdated = true; control.setValidators(updatedValidators); } } } if (dir.asyncValidator !== null) { const asyncValidators = getControlAsyncValidators(control); if (Array.isArray(asyncValidators) && asyncValidators.length > 0) { // Filter out directive async validator function. const updatedAsyncValidators = asyncValidators.filter((asyncValidator) => asyncValidator !== dir.asyncValidator); if (updatedAsyncValidators.length !== asyncValidators.length) { isControlUpdated = true; control.setAsyncValidators(updatedAsyncValidators); } } } } // Clear onValidatorChange callbacks by providing a noop function. const noop = () => {}; registerOnValidatorChange<ValidatorFn>(dir._rawValidators, noop); registerOnValidatorChange<AsyncValidatorFn>(dir._rawAsyncValidators, noop); return isControlUpdated; } function setUpViewChangePipeline(control: FormControl, dir: NgControl): void { dir.valueAccessor!.registerOnChange((newValue: any) => { control._pendingValue = newValue; control._pendingChange = true; control._pendingDirty = true; if (control.updateOn === 'change') updateControl(control, dir); }); } function setUpBlurPipeline(control: FormControl, dir: NgControl): void { dir.valueAccessor!.registerOnTouched(() => { control._pendingTouched = true; if (control.updateOn === 'blur' && control._pendingChange) updateControl(control, dir); if (control.updateOn !== 'submit') control.markAsTouched(); }); } function updateControl(control: FormControl, dir: NgControl): void { if (control._pendingDirty) control.markAsDirty(); control.setValue(control._pendingValue, {emitModelToViewChange: false}); dir.viewToModelUpdate(control._pendingValue); control._pendingChange = false; } function setUpModelChangePipeline(control: FormControl, dir: NgControl): void { const onChange = (newValue?: any, emitModelEvent?: boolean) => { // control -> view dir.valueAccessor!.writeValue(newValue); // control -> ngModel if (emitModelEvent) dir.viewToModelUpdate(newValue); }; control.registerOnChange(onChange); // Register a callback function to cleanup onChange handler // from a control instance when a directive is destroyed. dir._registerOnDestroy(() => { control._unregisterOnChange(onChange); }); } /** * Links a FormGroup or FormArray instance and corresponding Form directive by setting up validators * present in the view. * * @param control FormGroup or FormArray instance that should be linked. * @param dir Directive that provides view validators. */ export function setUpFormContainer( control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName) { if (control == null && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'Cannot find control with'); setUpValidators(control, dir); } /** * Reverts the setup performed by the `setUpFormContainer` function. * * @param control FormGroup or FormArray instance that should be cleaned up. * @param dir Directive that provided view validators. * @returns true if a control was updated as a result of this action. */ export function cleanUpFormContainer( control: FormGroup|FormArray, dir: AbstractFormGroupDirective|FormArrayName): boolean { return cleanUpValidators(control, dir); } function _noControlError(dir: NgControl) { return _throwError(dir, 'There is no FormControl instance attached to form control element with'); } function _throwError(dir: AbstractControlDirective, message: string): void { const messageEnd = _describeControlLocation(dir); throw new Error(`${message} ${messageEnd}`); } function _describeControlLocation(dir: AbstractControlDirective): string { const path = dir.path; if (path && path.length > 1) return `path: '${path.join(' -> ')}'`; if (path?.[0]) return `name: '${path}'`; return 'unspecified name attribute'; } function _throwMissingValueAccessorError(dir: AbstractControlDirective) { const loc = _describeControlLocation(dir); throw new RuntimeError( RuntimeErrorCode.NG_MISSING_VALUE_ACCESSOR, `No value accessor for form control ${loc}.`); } function _throwInvalidValueAccessorError(dir: AbstractControlDirective) { const loc = _describeControlLocation(dir); throw new RuntimeError( RuntimeErrorCode.NG_VALUE_ACCESSOR_NOT_PROVIDED, `Value accessor was not provided as an array for form control with ${loc}. ` + `Check that the \\`NG_VALUE_ACCESSOR\\` token is configured as a \\`multi: true\\` provider.`); } export function isPropertyUpdated(changes: {[key: string]: any}, viewModel: any): boolean { if (!changes.hasOwnProperty('model')) return false; const change = changes['model']; if (change.isFirstChange()) return true; return !Object.is(viewModel, change.currentValue); } export function isBuiltInAccessor(valueAccessor: ControlValueAccessor): boolean { // Check if a given value accessor is an instance of a class that directly extends // `BuiltInControlValueAccessor` one. return Object.getPrototypeOf(valueAccessor.constructor) === BuiltInControlValueAccessor; } export function syncPendingControls(form: FormGroup, directives: Set<NgControl>|NgControl[]): void { form._syncPendingControls(); directives.forEach((dir: NgControl) => { const control = dir.control as FormControl; if (control.updateOn === 'submit' && control._pendingChange) { dir.viewToModelUpdate(control._pendingValue); control._pendingChange = false; } }); } // TODO: vsavkin remove it once https://github.com/angular/angular/issues/3011 is implemented export function selectValueAccessor( dir: NgControl, valueAccessors: ControlValueAccessor[]): ControlValueAccessor|null { if (!valueAccessors) return null; if (!Array.isArray(valueAccessors) && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwInvalidValueAccessorError(dir); let defaultAccessor: ControlValueAccessor|undefined = undefined; let builtinAccessor: ControlValueAccessor|undefined = undefined; let customAccessor: ControlValueAccessor|undefined = undefined; valueAccessors.forEach((v: ControlValueAccessor) => { if (v.constructor === DefaultValueAccessor) { defaultAccessor = v; } else if (isBuiltInAccessor(v)) { if (builtinAccessor && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'More than one built-in value accessor matches form control with'); builtinAccessor = v; } else { if (customAccessor && (typeof ngDevMode === 'undefined' || ngDevMode)) _throwError(dir, 'More than one custom value accessor matches form control with'); customAccessor = v; } }); if (customAccessor) return customAccessor; if (builtinAccessor) return builtinAccessor; if (defaultAccessor) return defaultAccessor; if (typeof ngDevMode === 'undefined' || ngDevMode) { _throwError(dir, 'No valid value accessor for form control with'); } return null; } export function removeListItem<T>(list: T[], el: T): void { const index = list.indexOf(el); if (index > -1) list.splice(index, 1); } // TODO(kara): remove after deprecation period export function _ngModelWarning( name: string, type: {_ngModelWarningSentOnce: boolean}, instance: {_ngModelWarningSent: boolean}, warningConfig: string|null) { if (warningConfig === 'never') return; if (((warningConfig === null || warningConfig === 'once') && !type._ngModelWarningSentOnce) || (warningConfig === 'always' && !instance._ngModelWarningSent)) { console.warn(ngModelWarning(name)); type._ngModelWarningSentOnce = true; instance._ngModelWarningSent = true; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AfterViewInit, Directive, EventEmitter, forwardRef, Inject, Input, Optional, Provider, Self} from '@angular/core'; import {AbstractControl, FormHooks} from '../model/abstract_model'; import {FormControl} from '../model/form_control'; import {FormGroup} from '../model/form_group'; import {composeAsyncValidators, composeValidators, NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {ControlContainer} from './control_container'; import {Form} from './form_interface'; import {NgControl} from './ng_control'; import {NgModel} from './ng_model'; import {NgModelGroup} from './ng_model_group'; import {CALL_SET_DISABLED_STATE, SetDisabledStateOption, setUpControl, setUpFormContainer, syncPendingControls} from './shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; const formDirectiveProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => NgForm) }; const resolvedPromise = (() => Promise.resolve())(); /** * @description * Creates a top-level `FormGroup` instance and binds it to a form * to track aggregate form value and validation status. * * As soon as you import the `FormsModule`, this directive becomes active by default on * all `<form>` tags. You don't need to add a special selector. * * You optionally export the directive into a local template variable using `ngForm` as the key * (ex: `#myForm=\"ngForm\"`). This is optional, but useful. Many properties from the underlying * `FormGroup` instance are duplicated on the directive itself, so a reference to it * gives you access to the aggregate value and validity status of the form, as well as * user interaction properties like `dirty` and `touched`. * * To register child controls with the form, use `NgModel` with a `name` * attribute. You may use `NgModelGroup` to create sub-groups within the form. * * If necessary, listen to the directive's `ngSubmit` event to be notified when the user has * triggered a form submission. The `ngSubmit` event emits the original form * submission event. * * In template driven forms, all `<form>` tags are automatically tagged as `NgForm`. * To import the `FormsModule` but skip its usage in some forms, * for example, to use native HTML5 validation, add the `ngNoForm` and the `<form>` * tags won't create an `NgForm` directive. In reactive forms, using `ngNoForm` is * unnecessary because the `<form>` tags are inert. In that case, you would * refrain from using the `formGroup` directive. * * @usageNotes * * ### Listening for form submission * * The following example shows how to capture the form values from the \"ngSubmit\" event. * * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} * * ### Setting the update options * * The following example shows you how to change the \"updateOn\" option from its default using * ngFormOptions. * * ```html * <form [ngFormOptions]=\"{updateOn: 'blur'}\"> * <input name=\"one\" ngModel> <!-- this ngModel will update on blur --> * </form> * ``` * * ### Native DOM validation UI * * In order to prevent the native DOM form validation UI from interfering with Angular's form * validation, Angular automatically adds the `novalidate` attribute on any `<form>` whenever * `FormModule` or `ReactiveFormModule` are imported into the application. * If you want to explicitly enable native DOM validation UI with Angular forms, you can add the * `ngNativeValidate` attribute to the `<form>` element: * * ```html * <form ngNativeValidate> * ... * </form> * ``` * * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]', providers: [formDirectiveProvider], host: {'(submit)': 'onSubmit($event)', '(reset)': 'onReset()'}, outputs: ['ngSubmit'], exportAs: 'ngForm' }) export class NgForm extends ControlContainer implements Form, AfterViewInit { /** * @description * Returns whether the form submission has been triggered. */ public readonly submitted: boolean = false; private _directives = new Set<NgModel>(); /** * @description * The `FormGroup` instance created for this form. */ form: FormGroup; /** * @description * Event emitter for the \"ngSubmit\" event */ ngSubmit = new EventEmitter(); /** * @description * Tracks options for the `NgForm` instance. * * **updateOn**: Sets the default `updateOn` value for all child `NgModels` below it * unless explicitly set by a child `NgModel` using `ngModelOptions`). Defaults to 'change'. * Possible values: `'change'` | `'blur'` | `'submit'`. * */ // TODO(issue/24571): remove '!'. @Input('ngFormOptions') options!: {updateOn?: FormHooks}; constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this.form = new FormGroup({}, composeValidators(validators), composeAsyncValidators(asyncValidators)); } /** @nodoc */ ngAfterViewInit() { this._setUpdateStrategy(); } /** * @description * The directive instance. */ override get formDirective(): Form { return this; } /** * @description * The internal `FormGroup` instance. */ override get control(): FormGroup { return this.form; } /** * @description * Returns an array representing the path to this group. Because this directive * always lives at the top level of a form, it is always an empty array. */ override get path(): string[] { return []; } /** * @description * Returns a map of the controls in this group. */ get controls(): {[key: string]: AbstractControl} { return this.form.controls; } /** * @description * Method that sets up the control directive in this group, re-calculates its value * and validity, and adds the instance to the internal list of directives. * * @param dir The `NgModel` directive instance. */ addControl(dir: NgModel): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); (dir as {control: FormControl}).control = <FormControl>container.registerControl(dir.name, dir.control); setUpControl(dir.control, dir, this.callSetDisabledState); dir.control.updateValueAndValidity({emitEvent: false}); this._directives.add(dir); }); } /** * @description * Retrieves the `FormControl` instance from the provided `NgModel` directive. * * @param dir The `NgModel` directive instance. */ getControl(dir: NgModel): FormControl { return <FormControl>this.form.get(dir.path); } /** * @description * Removes the `NgModel` instance from the internal list of directives * * @param dir The `NgModel` directive instance. */ removeControl(dir: NgModel): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); if (container) { container.removeControl(dir.name); } this._directives.delete(dir); }); } /** * @description * Adds a new `NgModelGroup` directive instance to the form. * * @param dir The `NgModelGroup` directive instance. */ addFormGroup(dir: NgModelGroup): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); const group = new FormGroup({}); setUpFormContainer(group, dir); container.registerControl(dir.name, group); group.updateValueAndValidity({emitEvent: false}); }); } /** * @description * Removes the `NgModelGroup` directive instance from the form. * * @param dir The `NgModelGroup` directive instance. */ removeFormGroup(dir: NgModelGroup): void { resolvedPromise.then(() => { const container = this._findContainer(dir.path); if (container) { container.removeControl(dir.name); } }); } /** * @description * Retrieves the `FormGroup` for a provided `NgModelGroup` directive instance * * @param dir The `NgModelGroup` directive instance. */ getFormGroup(dir: NgModelGroup): FormGroup { return <FormGroup>this.form.get(dir.path); } /** * Sets the new value for the provided `NgControl` directive. * * @param dir The `NgControl` directive instance. * @param value The new value for the directive's control. */ updateModel(dir: NgControl, value: any): void { resolvedPromise.then(() => { const ctrl = <FormControl>this.form.get(dir.path!); ctrl.setValue(value); }); } /** * @description * Sets the value for this `FormGroup`. * * @param value The new value */ setValue(value: {[key: string]: any}): void { this.control.setValue(value); } /** * @description * Method called when the \"submit\" event is triggered on the form. * Triggers the `ngSubmit` emitter to emit the \"submit\" event as its payload. * * @param $event The \"submit\" event object */ onSubmit($event: Event): boolean { (this as {submitted: boolean}).submitted = true; syncPendingControls(this.form, this._directives); this.ngSubmit.emit($event); // Forms with `method=\"dialog\"` have some special behavior // that won't reload the page and that shouldn't be prevented. return ($event?.target as HTMLFormElement | null)?.method === 'dialog'; } /** * @description * Method called when the \"reset\" event is triggered on the form. */ onReset(): void { this.resetForm(); } /** * @description * Resets the form to an initial value and resets its submitted status. * * @param value The new value for the form. */ resetForm(value: any = undefined): void { this.form.reset(value); (this as {submitted: boolean}).submitted = false; } private _setUpdateStrategy() { if (this.options && this.options.updateOn != null) { this.form._updateOn = this.options.updateOn; } } private _findContainer(path: string[]): FormGroup { path.pop(); return path.length ? <FormGroup>this.form.get(path) : this.form; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export function removeListItem<T>(list: T[], el: T): void { const index = list.indexOf(el); if (index > -1) list.splice(index, 1); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {removeListItem} from '../util'; import {AbstractControl, AbstractControlOptions, isOptionsObj, pickAsyncValidators, pickValidators} from './abstract_model'; /** * FormControlState is a boxed form value. It is an object with a `value` key and a `disabled` key. * * @publicApi */ export interface FormControlState<T> { value: T; disabled: boolean; } /** * Interface for options provided to a `FormControl`. * * This interface extends all options from {@link AbstractControlOptions}, plus some options * unique to `FormControl`. * * @publicApi */ export interface FormControlOptions extends AbstractControlOptions { /** * @description * Whether to use the initial value used to construct the `FormControl` as its default value * as well. If this option is false or not provided, the default value of a FormControl is `null`. * When a FormControl is reset without an explicit value, its value reverts to * its default value. */ nonNullable?: boolean; /** * @deprecated Use `nonNullable` instead. */ initialValueIsDefault?: boolean; } /** * Tracks the value and validation status of an individual form control. * * This is one of the four fundamental building blocks of Angular forms, along with * `FormGroup`, `FormArray` and `FormRecord`. It extends the `AbstractControl` class that * implements most of the base functionality for accessing the value, validation status, * user interactions and events. * * `FormControl` takes a single generic argument, which describes the type of its value. This * argument always implicitly includes `null` because the control can be reset. To change this * behavior, set `nonNullable` or see the usage notes below. * * See [usage examples below](#usage-notes). * * @see `AbstractControl` * @see [Reactive Forms Guide](guide/reactive-forms) * @see [Usage Notes](#usage-notes) * * @publicApi * * @overriddenImplementation ɵFormControlCtor * * @usageNotes * * ### Initializing Form Controls * * Instantiate a `FormControl`, with an initial value. * * ```ts * const control = new FormControl('some value'); * console.log(control.value); // 'some value' * ``` * * The following example initializes the control with a form state object. The `value` * and `disabled` keys are required in this case. * * ```ts * const control = new FormControl({ value: 'n/a', disabled: true }); * console.log(control.value); // 'n/a' * console.log(control.status); // 'DISABLED' * ``` * * The following example initializes the control with a synchronous validator. * * ```ts * const control = new FormControl('', Validators.required); * console.log(control.value); // '' * console.log(control.status); // 'INVALID' * ``` * * The following example initializes the control using an options object. * * ```ts * const control = new FormControl('', { * validators: Validators.required, * asyncValidators: myAsyncValidator * }); * ``` * * ### The single type argument * * `FormControl` accepts a generic argument, which describes the type of its value. * In most cases, this argument will be inferred. * * If you are initializing the control to `null`, or you otherwise wish to provide a * wider type, you may specify the argument explicitly: * * ``` * let fc = new FormControl<string|null>(null); * fc.setValue('foo'); * ``` * * You might notice that `null` is always added to the type of the control. * This is because the control will become `null` if you call `reset`. You can change * this behavior by setting `{nonNullable: true}`. * * ### Configure the control to update on a blur event * * Set the `updateOn` option to `'blur'` to update on the blur `event`. * * ```ts * const control = new FormControl('', { updateOn: 'blur' }); * ``` * * ### Configure the control to update on a submit event * * Set the `updateOn` option to `'submit'` to update on a submit `event`. * * ```ts * const control = new FormControl('', { updateOn: 'submit' }); * ``` * * ### Reset the control back to a specific value * * You reset to a specific form state by passing through a standalone * value or a form state object that contains both a value and a disabled state * (these are the only two properties that cannot be calculated). * * ```ts * const control = new FormControl('Nancy'); * * console.log(control.value); // 'Nancy' * * control.reset('Drew'); * * console.log(control.value); // 'Drew' * ``` * * ### Reset the control to its initial value * * If you wish to always reset the control to its initial value (instead of null), * you can pass the `nonNullable` option: * * ``` * const control = new FormControl('Nancy', {nonNullable: true}); * * console.log(control.value); // 'Nancy' * * control.reset(); * * console.log(control.value); // 'Nancy' * ``` * * ### Reset the control back to an initial value and disabled * * ``` * const control = new FormControl('Nancy'); * * console.log(control.value); // 'Nancy' * console.log(control.status); // 'VALID' * * control.reset({ value: 'Drew', disabled: true }); * * console.log(control.value); // 'Drew' * console.log(control.status); // 'DISABLED' * ``` */ export interface FormControl<TValue = any> extends AbstractControl<TValue> { /** * The default value of this FormControl, used whenever the control is reset without an explicit * value. See {@link FormControlOptions#nonNullable} for more information on configuring * a default value. */ readonly defaultValue: TValue; /** @internal */ _onChange: Function[]; /** * This field holds a pending value that has not yet been applied to the form's value. * @internal */ _pendingValue: TValue; /** @internal */ _pendingChange: boolean; /** * Sets a new value for the form control. * * @param value The new value for the control. * @param options Configuration options that determine how the control propagates changes * and emits events when the value changes. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. * * `emitModelToViewChange`: When true or not supplied (the default), each change triggers an * `onChange` event to * update the view. * * `emitViewToModelChange`: When true or not supplied (the default), each change triggers an * `ngModelChange` * event to update the model. * */ setValue(value: TValue, options?: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean }): void; /** * Patches the value of a control. * * This function is functionally the same as {@link FormControl#setValue setValue} at this level. * It exists for symmetry with {@link FormGroup#patchValue patchValue} on `FormGroups` and * `FormArrays`, where it does behave differently. * * @see `setValue` for options */ patchValue(value: TValue, options?: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean }): void; /** * Resets the form control, marking it `pristine` and `untouched`, and resetting * the value. The new value will be the provided value (if passed), `null`, or the initial value * if `nonNullable` was set in the constructor via {@link FormControlOptions}. * * ```ts * // By default, the control will reset to null. * const dog = new FormControl('spot'); * dog.reset(); // dog.value is null * * // If this flag is set, the control will instead reset to the initial value. * const cat = new FormControl('tabby', {nonNullable: true}); * cat.reset(); // cat.value is \"tabby\" * * // A value passed to reset always takes precedence. * const fish = new FormControl('finn', {nonNullable: true}); * fish.reset('bubble'); // fish.value is \"bubble\" * ``` * * @param formState Resets the control with an initial value, * or an object that defines the initial value and disabled state. * * @param options Configuration options that determine how the control propagates changes * and emits events after the value changes. * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default is * false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * */ reset(formState?: TValue|FormControlState<TValue>, options?: { onlySelf?: boolean, emitEvent?: boolean }): void; /** * For a simple FormControl, the raw value is equivalent to the value. */ getRawValue(): TValue; /** * @internal */ _updateValue(): void; /** * @internal */ _anyControls(condition: (c: AbstractControl) => boolean): boolean; /** * @internal */ _allControlsDisabled(): boolean; /** * Register a listener for change events. * * @param fn The method that is called when the value changes */ registerOnChange(fn: Function): void; /** * Internal function to unregister a change events listener. * @internal */ _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void; /** * Register a listener for disabled events. * * @param fn The method that is called when the disabled status changes. */ registerOnDisabledChange(fn: (isDisabled: boolean) => void): void; /** * Internal function to unregister a disabled event listener. * @internal */ _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void; /** * @internal */ _forEachChild(cb: (c: AbstractControl) => void): void; /** @internal */ _syncPendingControls(): boolean; } // This internal interface is present to avoid a naming clash, resulting in the wrong `FormControl` // symbol being used. type FormControlInterface<TValue = any> = FormControl<TValue>; /** * Various available constructors for `FormControl`. * Do not use this interface directly. Instead, use `FormControl`: * ``` * const fc = new FormControl('foo'); * ``` * This symbol is prefixed with ɵ to make plain that it is an internal symbol. */ export interface ɵFormControlCtor { /** * Construct a FormControl with no initial value or validators. */ new(): FormControl<any>; /** * Creates a new `FormControl` instance. * * @param formState Initializes the control with an initial value, * or an object that defines the initial value and disabled state. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or a `FormControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions */ new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{nonNullable: true}): FormControl<T>; /** * @deprecated Use `nonNullable` instead. */ new<T = any>(value: FormControlState<T>|T, opts: FormControlOptions&{ initialValueIsDefault: true }): FormControl<T>; /** * @deprecated When passing an `options` argument, the `asyncValidator` argument has no effect. */ new<T = any>( value: FormControlState<T>|T, opts: FormControlOptions, asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]): FormControl<T|null>; new<T = any>( value: FormControlState<T>|T, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T|null>; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormControl<any>; } function isFormControlState(formState: unknown): formState is FormControlState<unknown> { return typeof formState === 'object' && formState !== null && Object.keys(formState).length === 2 && 'value' in formState && 'disabled' in formState; } export const FormControl: ɵFormControlCtor = (class FormControl<TValue = any> extends AbstractControl< TValue> implements FormControlInterface<TValue> { /** @publicApi */ public readonly defaultValue: TValue = null as unknown as TValue; /** @internal */ _onChange: Array<Function> = []; /** @internal */ _pendingValue!: TValue; /** @internal */ _pendingChange: boolean = false; constructor( // formState and defaultValue will only be null if T is nullable formState: FormControlState<TValue>|TValue = null as unknown as TValue, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super( pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this._applyFormState(formState); this._setUpdateStrategy(validatorOrOpts); this._initObservables(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. // The status should be broadcasted via the `statusChanges` observable, so we set // `emitEvent` to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); if (isOptionsObj(validatorOrOpts) && (validatorOrOpts.nonNullable || validatorOrOpts.initialValueIsDefault)) { if (isFormControlState(formState)) { this.defaultValue = formState.value; } else { this.defaultValue = formState; } } } override setValue(value: TValue, options: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean } = {}): void { (this as {value: TValue}).value = this._pendingValue = value; if (this._onChange.length && options.emitModelToViewChange !== false) { this._onChange.forEach( (changeFn) => changeFn(this.value, options.emitViewToModelChange !== false)); } this.updateValueAndValidity(options); } override patchValue(value: TValue, options: { onlySelf?: boolean, emitEvent?: boolean, emitModelToViewChange?: boolean, emitViewToModelChange?: boolean } = {}): void { this.setValue(value, options); } override reset( formState: TValue|FormControlState<TValue> = this.defaultValue, options: {onlySelf?: boolean, emitEvent?: boolean} = {}): void { this._applyFormState(formState); this.markAsPristine(options); this.markAsUntouched(options); this.setValue(this.value, options); this._pendingChange = false; } /** @internal */ override _updateValue(): void {} /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { return false; } /** @internal */ override _allControlsDisabled(): boolean { return this.disabled; } registerOnChange(fn: Function): void { this._onChange.push(fn); } /** @internal */ _unregisterOnChange(fn: (value?: any, emitModelEvent?: boolean) => void): void { removeListItem(this._onChange, fn); } registerOnDisabledChange(fn: (isDisabled: boolean) => void): void { this._onDisabledChange.push(fn); } /** @internal */ _unregisterOnDisabledChange(fn: (isDisabled: boolean) => void): void { removeListItem(this._onDisabledChange, fn); } /** @internal */ override _forEachChild(cb: (c: AbstractControl) => void): void {} /** @internal */ override _syncPendingControls(): boolean { if (this.updateOn === 'submit') { if (this._pendingDirty) this.markAsDirty(); if (this._pendingTouched) this.markAsTouched(); if (this._pendingChange) { this.setValue(this._pendingValue, {onlySelf: true, emitModelToViewChange: false}); return true; } } return false; } private _applyFormState(formState: FormControlState<TValue>|TValue) { if (isFormControlState(formState)) { (this as {value: TValue}).value = this._pendingValue = formState.value; formState.disabled ? this.disable({onlySelf: true, emitEvent: false}) : this.enable({onlySelf: true, emitEvent: false}); } else { (this as {value: TValue}).value = this._pendingValue = formState; } } }); interface UntypedFormControlCtor { new(): UntypedFormControl; new(formState?: any, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormControl; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormControl<any>; } /** * UntypedFormControl is a non-strongly-typed version of @see FormControl. */ export type UntypedFormControl = FormControl<any>; export const UntypedFormControl: UntypedFormControlCtor = FormControl; /** * @description * Asserts that the given control is an instance of `FormControl` * * @publicApi */ export const isFormControl = (control: unknown): control is FormControl => control instanceof FormControl; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, OnDestroy, OnInit} from '@angular/core'; import {FormGroup} from '../model/form_group'; import {ControlContainer} from './control_container'; import {Form} from './form_interface'; import {controlPath} from './shared'; /** * @description * A base class for code shared between the `NgModelGroup` and `FormGroupName` directives. * * @publicApi */ @Directive() export class AbstractFormGroupDirective extends ControlContainer implements OnInit, OnDestroy { /** * @description * The parent control for the group * * @internal */ // TODO(issue/24571): remove '!'. _parent!: ControlContainer; /** @nodoc */ ngOnInit(): void { this._checkParentType(); // Register the group with its parent group. this.formDirective!.addFormGroup(this); } /** @nodoc */ ngOnDestroy(): void { if (this.formDirective) { // Remove the group from its parent group. this.formDirective.removeFormGroup(this); } } /** * @description * The `FormGroup` bound to this directive. */ override get control(): FormGroup { return this.formDirective!.getFormGroup(this); } /** * @description * The path to this group from the top-level directive. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); } /** * @description * The top-level directive for this group if present, otherwise null. */ override get formDirective(): Form|null { return this._parent ? this._parent.formDirective : null; } /** @internal */ _checkParentType(): void {} } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {formControlNameExample, formGroupNameExample, ngModelGroupExample, ngModelWithFormGroupExample} from './error_examples'; export function modelParentException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODEL_IN_FORM_GROUP, ` ngModel cannot be used to register form controls with a parent formGroup directive. Try using formGroup's partner directive \"formControlName\" instead. Example: ${formControlNameExample} Or, if you'd like to avoid registering this form control, indicate that it's standalone in ngModelOptions: Example: ${ngModelWithFormGroupExample}`); } export function formGroupNameException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODEL_IN_FORM_GROUP_NAME, ` ngModel cannot be used to register form controls with a parent formGroupName or formArrayName directive. Option 1: Use formControlName instead of ngModel (reactive strategy): ${formGroupNameExample} Option 2: Update ngModel's parent be ngModelGroup (template-driven strategy): ${ngModelGroupExample}`); } export function missingNameException(): Error { return new RuntimeError( RuntimeErrorCode.NGMODEL_WITHOUT_NAME, `If ngModel is used within a form tag, either the name attribute must be set or the form control must be defined as 'standalone' in ngModelOptions. Example 1: <input [(ngModel)]=\"person.firstName\" name=\"first\"> Example 2: <input [(ngModel)]=\"person.firstName\" [ngModelOptions]=\"{standalone: true}\">`); } export function modelGroupParentException(): Error { return new RuntimeError(RuntimeErrorCode.NGMODELGROUP_IN_FORM_GROUP, ` ngModelGroup cannot be used with a parent formGroup directive. Option 1: Use formGroupName instead of ngModelGroup (reactive strategy): ${formGroupNameExample} Option 2: Use a regular form tag instead of the formGroup directive (template-driven strategy): ${ngModelGroupExample}`); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Host, Inject, Input, OnDestroy, OnInit, Optional, Self, SkipSelf} from '@angular/core'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {NgForm} from './ng_form'; import {modelGroupParentException} from './template_driven_errors'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; export const modelGroupProvider: any = { provide: ControlContainer, useExisting: forwardRef(() => NgModelGroup) }; /** * @description * Creates and binds a `FormGroup` instance to a DOM element. * * This directive can only be used as a child of `NgForm` (within `<form>` tags). * * Use this directive to validate a sub-group of your form separately from the * rest of your form, or if some values in your domain model make more sense * to consume together in a nested object. * * Provide a name for the sub-group and it will become the key * for the sub-group in the form's full value. If you need direct access, export the directive into * a local template variable using `ngModelGroup` (ex: `#myGroup=\"ngModelGroup\"`). * * @usageNotes * * ### Consuming controls in a grouping * * The following example shows you how to combine controls together in a sub-group * of the form. * * {@example forms/ts/ngModelGroup/ng_model_group_example.ts region='Component'} * * @ngModule FormsModule * @publicApi */ @Directive({selector: '[ngModelGroup]', providers: [modelGroupProvider], exportAs: 'ngModelGroup'}) export class NgModelGroup extends AbstractFormGroupDirective implements OnInit, OnDestroy { /** * @description * Tracks the name of the `NgModelGroup` bound to the directive. The name corresponds * to a key in the parent `NgForm`. */ // TODO(issue/24571): remove '!'. @Input('ngModelGroup') override name!: string; constructor( @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @internal */ override _checkParentType(): void { if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw modelGroupParentException(); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ChangeDetectorRef, Directive, EventEmitter, forwardRef, Host, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core'; import {FormHooks} from '../model/abstract_model'; import {FormControl} from '../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../validators'; import {AbstractFormGroupDirective} from './abstract_form_group_directive'; import {ControlContainer} from './control_container'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {NgControl} from './ng_control'; import {NgForm} from './ng_form'; import {NgModelGroup} from './ng_model_group'; import {CALL_SET_DISABLED_STATE, controlPath, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from './shared'; import {formGroupNameException, missingNameException, modelParentException} from './template_driven_errors'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from './validators'; const formControlBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => NgModel) }; /** * `ngModel` forces an additional change detection run when its inputs change: * E.g.: * ``` * <div>{{myModel.valid}}</div> * <input [(ngModel)]=\"myValue\" #myModel=\"ngModel\"> * ``` * I.e. `ngModel` can export itself on the element and then be used in the template. * Normally, this would result in expressions before the `input` that use the exported directive * to have an old value as they have been * dirty checked before. As this is a very common case for `ngModel`, we added this second change * detection run. * * Notes: * - this is just one extra run no matter how many `ngModel`s have been changed. * - this is a general problem when using `exportAs` for directives! */ const resolvedPromise = (() => Promise.resolve())(); /** * @description * Creates a `FormControl` instance from a domain model and binds it * to a form control element. * * The `FormControl` instance tracks the value, user interaction, and * validation status of the control and keeps the view synced with the model. If used * within a parent form, the directive also registers itself with the form as a child * control. * * This directive is used by itself or as part of a larger form. Use the * `ngModel` selector to activate it. * * It accepts a domain model as an optional `Input`. If you have a one-way binding * to `ngModel` with `[]` syntax, changing the domain model's value in the component * class sets the value in the view. If you have a two-way binding with `[()]` syntax * (also known as 'banana-in-a-box syntax'), the value in the UI always syncs back to * the domain model in your class. * * To inspect the properties of the associated `FormControl` (like the validity state), * export the directive into a local template variable using `ngModel` as the key (ex: * `#myVar=\"ngModel\"`). You can then access the control using the directive's `control` property. * However, the most commonly used properties (like `valid` and `dirty`) also exist on the control * for direct access. See a full list of properties directly available in * `AbstractControlDirective`. * * @see `RadioControlValueAccessor` * @see `SelectControlValueAccessor` * * @usageNotes * * ### Using ngModel on a standalone control * * The following examples show a simple standalone control using `ngModel`: * * {@example forms/ts/simpleNgModel/simple_ng_model_example.ts region='Component'} * * When using the `ngModel` within `<form>` tags, you'll also need to supply a `name` attribute * so that the control can be registered with the parent form under that name. * * In the context of a parent form, it's often unnecessary to include one-way or two-way binding, * as the parent form syncs the value for you. You access its properties by exporting it into a * local template variable using `ngForm` such as (`#f=\"ngForm\"`). Use the variable where * needed on form submission. * * If you do need to populate initial values into your form, using a one-way binding for * `ngModel` tends to be sufficient as long as you use the exported form's value rather * than the domain model's value on submit. * * ### Using ngModel within a form * * The following example shows controls using `ngModel` within a form: * * {@example forms/ts/simpleForm/simple_form_example.ts region='Component'} * * ### Using a standalone ngModel within a group * * The following example shows you how to use a standalone ngModel control * within a form. This controls the display of the form, but doesn't contain form data. * * ```html * <form> * <input name=\"login\" ngModel placeholder=\"Login\"> * <input type=\"checkbox\" ngModel [ngModelOptions]=\"{standalone: true}\"> Show more options? * </form> * <!-- form value: {login: ''} --> * ``` * * ### Setting the ngModel `name` attribute through options * * The following example shows you an alternate way to set the name attribute. Here, * an attribute identified as name is used within a custom form control component. To still be able * to specify the NgModel's name, you must specify it using the `ngModelOptions` input instead. * * ```html * <form> * <my-custom-form-control name=\"Nancy\" ngModel [ngModelOptions]=\"{name: 'user'}\"> * </my-custom-form-control> * </form> * <!-- form value: {user: ''} --> * ``` * * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[ngModel]:not([formControlName]):not([formControl])', providers: [formControlBinding], exportAs: 'ngModel' }) export class NgModel extends NgControl implements OnChanges, OnDestroy { public override readonly control: FormControl = new FormControl(); // At runtime we coerce arbitrary values assigned to the \"disabled\" input to a \"boolean\". // This is not reflected in the type of the property because outside of templates, consumers // should only deal with booleans. In templates, a string is allowed for convenience and to // match the native \"disabled attribute\" semantics which can be observed on input elements. // This static member tells the compiler that values of type \"string\" can also be assigned // to the input in a template. /** @nodoc */ static ngAcceptInputType_isDisabled: boolean|string; /** @internal */ _registered = false; /** * Internal reference to the view model value. * @nodoc */ viewModel: any; /** * @description * Tracks the name bound to the directive. If a parent form exists, it * uses this name as a key to retrieve this control's value. */ // TODO(issue/24571): remove '!'. @Input() override name!: string; /** * @description * Tracks whether the control is disabled. */ // TODO(issue/24571): remove '!'. @Input('disabled') isDisabled!: boolean; /** * @description * Tracks the value bound to this directive. */ @Input('ngModel') model: any; /** * @description * Tracks the configuration options for this `ngModel` instance. * * **name**: An alternative to setting the name attribute on the form control element. See * the [example](api/forms/NgModel#using-ngmodel-on-a-standalone-control) for using `NgModel` * as a standalone control. * * **standalone**: When set to true, the `ngModel` will not register itself with its parent form, * and acts as if it's not in the form. Defaults to false. If no parent form exists, this option * has no effect. * * **updateOn**: Defines the event upon which the form control value and validity update. * Defaults to 'change'. Possible values: `'change'` | `'blur'` | `'submit'`. * */ // TODO(issue/24571): remove '!'. @Input('ngModelOptions') options!: {name?: string, standalone?: boolean, updateOn?: FormHooks}; /** * @description * Event emitter for producing the `ngModelChange` event after * the view model updates. */ @Output('ngModelChange') update = new EventEmitter(); constructor( @Optional() @Host() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(ChangeDetectorRef) private _changeDetectorRef?: ChangeDetectorRef|null, @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges) { this._checkForErrors(); if (!this._registered || 'name' in changes) { if (this._registered) { this._checkName(); if (this.formDirective) { // We can't call `formDirective.removeControl(this)`, because the `name` has already been // changed. We also can't reset the name temporarily since the logic in `removeControl` // is inside a promise and it won't run immediately. We work around it by giving it an // object with the same shape instead. const oldName = changes['name'].previousValue; this.formDirective.removeControl({name: oldName, path: this._getPath(oldName)}); } } this._setUpControl(); } if ('isDisabled' in changes) { this._updateDisabled(changes); } if (isPropertyUpdated(changes, this.viewModel)) { this._updateValue(this.model); this.viewModel = this.model; } } /** @nodoc */ ngOnDestroy(): void { this.formDirective && this.formDirective.removeControl(this); } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return this._getPath(this.name); } /** * @description * The top-level directive for this control if present, otherwise null. */ get formDirective(): any { return this._parent ? this._parent.formDirective : null; } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value emitted by `ngModelChange`. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } private _setUpControl(): void { this._setUpdateStrategy(); this._isStandalone() ? this._setUpStandalone() : this.formDirective.addControl(this); this._registered = true; } private _setUpdateStrategy(): void { if (this.options && this.options.updateOn != null) { this.control._updateOn = this.options.updateOn; } } private _isStandalone(): boolean { return !this._parent || !!(this.options && this.options.standalone); } private _setUpStandalone(): void { setUpControl(this.control, this, this.callSetDisabledState); this.control.updateValueAndValidity({emitEvent: false}); } private _checkForErrors(): void { if (!this._isStandalone()) { this._checkParentType(); } this._checkName(); } private _checkParentType(): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!(this._parent instanceof NgModelGroup) && this._parent instanceof AbstractFormGroupDirective) { throw formGroupNameException(); } else if (!(this._parent instanceof NgModelGroup) && !(this._parent instanceof NgForm)) { throw modelParentException(); } } } private _checkName(): void { if (this.options && this.options.name) this.name = this.options.name; if (!this._isStandalone() && !this.name && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw missingNameException(); } } private _updateValue(value: any): void { resolvedPromise.then(() => { this.control.setValue(value, {emitViewToModelChange: false}); this._changeDetectorRef?.markForCheck(); }); } private _updateDisabled(changes: SimpleChanges) { const disabledValue = changes['isDisabled'].currentValue; // checking for 0 to avoid breaking change const isDisabled = disabledValue !== 0 && coerceToBoolean(disabledValue); resolvedPromise.then(() => { if (isDisabled && !this.control.disabled) { this.control.disable(); } else if (!isDisabled && this.control.disabled) { this.control.enable(); } this._changeDetectorRef?.markForCheck(); }); } private _getPath(controlName: string): string[] { return this._parent ? controlPath(controlName, this._parent) : [controlName]; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive} from '@angular/core'; /** * @description * * Adds `novalidate` attribute to all forms by default. * * `novalidate` is used to disable browser's native form validation. * * If you want to use native validation with Angular forms, just add `ngNativeValidate` attribute: * * ``` * <form ngNativeValidate></form> * ``` * * @publicApi * @ngModule ReactiveFormsModule * @ngModule FormsModule */ @Directive({ selector: 'form:not([ngNoForm]):not([ngNativeValidate])', host: {'novalidate': ''}, }) export class ɵNgNoValidate { } export {ɵNgNoValidate as NgNoValidate}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const NUMBER_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NumberValueAccessor), multi: true }; /** * @description * The `ControlValueAccessor` for writing a number value and listening to number input changes. * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` * directives. * * @usageNotes * * ### Using a number input with a reactive form. * * The following example shows how to use a number input with a reactive form. * * ```ts * const totalCountControl = new FormControl(); * ``` * * ``` * <input type=\"number\" [formControl]=\"totalCountControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]', host: {'(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, providers: [NUMBER_VALUE_ACCESSOR] }) export class NumberValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: number): void { // The value needs to be normalized for IE9, otherwise it is set to 'null' when null const normalizedValue = value == null ? '' : value; this.setProperty('value', normalizedValue); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: number|null) => void): void { this.onChange = (value) => { fn(value == '' ? null : parseFloat(value)); }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, inject, Injectable, Injector, Input, NgModule, OnDestroy, OnInit, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; import {NgControl} from './ng_control'; import {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './shared'; const RADIO_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RadioControlValueAccessor), multi: true }; function throwNameError() { throw new RuntimeError(RuntimeErrorCode.NAME_AND_FORM_CONTROL_NAME_MUST_MATCH, ` If you define both a name and a formControlName attribute on your radio button, their values must match. Ex: <input type=\"radio\" formControlName=\"food\" name=\"food\"> `); } /** * Internal-only NgModule that works as a host for the `RadioControlRegistry` tree-shakable * provider. Note: the `InternalFormsSharedModule` can not be used here directly, since it's * declared *after* the `RadioControlRegistry` class and the `providedIn` doesn't support * `forwardRef` logic. */ @NgModule() export class RadioControlRegistryModule { } /** * @description * Class used by Angular to track radio buttons. For internal use only. */ @Injectable({providedIn: RadioControlRegistryModule}) export class RadioControlRegistry { private _accessors: any[] = []; /** * @description * Adds a control to the internal registry. For internal use only. */ add(control: NgControl, accessor: RadioControlValueAccessor) { this._accessors.push([control, accessor]); } /** * @description * Removes a control from the internal registry. For internal use only. */ remove(accessor: RadioControlValueAccessor) { for (let i = this._accessors.length - 1; i >= 0; --i) { if (this._accessors[i][1] === accessor) { this._accessors.splice(i, 1); return; } } } /** * @description * Selects a radio button. For internal use only. */ select(accessor: RadioControlValueAccessor) { this._accessors.forEach((c) => { if (this._isSameGroup(c, accessor) && c[1] !== accessor) { c[1].fireUncheck(accessor.value); } }); } private _isSameGroup( controlPair: [NgControl, RadioControlValueAccessor], accessor: RadioControlValueAccessor): boolean { if (!controlPair[0].control) return false; return controlPair[0]._parent === accessor._control._parent && controlPair[1].name === accessor.name; } } /** * @description * The `ControlValueAccessor` for writing radio control values and listening to radio control * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @usageNotes * * ### Using radio buttons with reactive form directives * * The follow example shows how to use radio buttons in a reactive form. When using radio buttons in * a reactive form, radio buttons in the same group should have the same `formControlName`. * Providing a `name` attribute is optional. * * {@example forms/ts/reactiveRadioButtons/reactive_radio_button_example.ts region='Reactive'} * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]', host: {'(change)': 'onChange()', '(blur)': 'onTouched()'}, providers: [RADIO_VALUE_ACCESSOR] }) export class RadioControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor, OnDestroy, OnInit { /** @internal */ // TODO(issue/24571): remove '!'. _state!: boolean; /** @internal */ // TODO(issue/24571): remove '!'. _control!: NgControl; /** @internal */ // TODO(issue/24571): remove '!'. _fn!: Function; private setDisabledStateFired = false; /** * The registered callback function called when a change event occurs on the input element. * Note: we declare `onChange` here (also used as host listener) as a function with no arguments * to override the `onChange` function (which expects 1 argument) in the parent * `BaseControlValueAccessor` class. * @nodoc */ override onChange = () => {}; /** * @description * Tracks the name of the radio input element. */ // TODO(issue/24571): remove '!'. @Input() name!: string; /** * @description * Tracks the name of the `FormControl` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. */ // TODO(issue/24571): remove '!'. @Input() formControlName!: string; /** * @description * Tracks the value of the radio input element */ @Input() value: any; private callSetDisabledState = inject(CALL_SET_DISABLED_STATE, {optional: true}) ?? setDisabledStateDefault; constructor( renderer: Renderer2, elementRef: ElementRef, private _registry: RadioControlRegistry, private _injector: Injector) { super(renderer, elementRef); } /** @nodoc */ ngOnInit(): void { this._control = this._injector.get(NgControl); this._checkName(); this._registry.add(this._control, this); } /** @nodoc */ ngOnDestroy(): void { this._registry.remove(this); } /** * Sets the \"checked\" property value on the radio input element. * @nodoc */ writeValue(value: any): void { this._state = value === this.value; this.setProperty('checked', this._state); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: any) => {}): void { this._fn = fn; this.onChange = () => { fn(this.value); this._registry.select(this); }; } /** @nodoc */ override setDisabledState(isDisabled: boolean): void { /** * `setDisabledState` is supposed to be called whenever the disabled state of a control changes, * including upon control creation. However, a longstanding bug caused the method to not fire * when an *enabled* control was attached. This bug was fixed in v15 in #47576. * * This had a side effect: previously, it was possible to instantiate a reactive form control * with `[attr.disabled]=true`, even though the the corresponding control was enabled in the * model. This resulted in a mismatch between the model and the DOM. Now, because * `setDisabledState` is always called, the value in the DOM will be immediately overwritten * with the \"correct\" enabled value. * * However, the fix also created an exceptional case: radio buttons. Because Reactive Forms * models the entire group of radio buttons as a single `FormControl`, there is no way to * control the disabled state for individual radios, so they can no longer be configured as * disabled. Thus, we keep the old behavior for radio buttons, so that `[attr.disabled]` * continues to work. Specifically, we drop the first call to `setDisabledState` if `disabled` * is `false`, and we are not in legacy mode. */ if (this.setDisabledStateFired || isDisabled || this.callSetDisabledState === 'whenDisabledForLegacyCode') { this.setProperty('disabled', isDisabled); } this.setDisabledStateFired = true; } /** * Sets the \"value\" on the radio input element and unchecks it. * * @param value */ fireUncheck(value: any): void { this.writeValue(value); } private _checkName(): void { if (this.name && this.formControlName && this.name !== this.formControlName && (typeof ngDevMode === 'undefined' || ngDevMode)) { throwNameError(); } if (!this.name && this.formControlName) this.name = this.formControlName; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Provider} from '@angular/core'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const RANGE_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => RangeValueAccessor), multi: true }; /** * @description * The `ControlValueAccessor` for writing a range value and listening to range input changes. * The value accessor is used by the `FormControlDirective`, `FormControlName`, and `NgModel` * directives. * * @usageNotes * * ### Using a range input with a reactive form * * The following example shows how to use a range input with a reactive form. * * ```ts * const ageControl = new FormControl(); * ``` * * ``` * <input type=\"range\" [formControl]=\"ageControl\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=range][formControlName],input[type=range][formControl],input[type=range][ngModel]', host: { '(change)': 'onChange($event.target.value)', '(input)': 'onChange($event.target.value)', '(blur)': 'onTouched()' }, providers: [RANGE_VALUE_ACCESSOR] }) export class RangeValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * Sets the \"value\" property on the input element. * @nodoc */ writeValue(value: any): void { this.setProperty('value', parseFloat(value)); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (_: number|null) => void): void { this.onChange = (value) => { fn(value == '' ? null : parseFloat(value)); }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Inject, InjectionToken, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges} from '@angular/core'; import {FormControl} from '../../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '../control_value_accessor'; import {NgControl} from '../ng_control'; import {disabledAttrWarning} from '../reactive_errors'; import {_ngModelWarning, CALL_SET_DISABLED_STATE, cleanUpControl, isPropertyUpdated, selectValueAccessor, SetDisabledStateOption, setUpControl} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; /** * Token to provide to turn off the ngModel warning on formControl and formControlName. */ export const NG_MODEL_WITH_FORM_CONTROL_WARNING = new InjectionToken('NgModelWithFormControlWarning'); const formControlBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => FormControlDirective) }; /** * @description * Synchronizes a standalone `FormControl` instance to a form control element. * * Note that support for using the `ngModel` input property and `ngModelChange` event with reactive * form directives was deprecated in Angular v6 and is scheduled for removal in * a future version of Angular. * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `FormControl` * @see `AbstractControl` * * @usageNotes * * The following example shows how to register a standalone control and set its value. * * {@example forms/ts/simpleFormControl/simple_form_control_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formControl]', providers: [formControlBinding], exportAs: 'ngForm'}) export class FormControlDirective extends NgControl implements OnChanges, OnDestroy { /** * Internal reference to the view model value. * @nodoc */ viewModel: any; /** * @description * Tracks the `FormControl` instance bound to the directive. */ // TODO(issue/24571): remove '!'. @Input('formControl') form!: FormControl; /** * @description * Triggers a warning in dev mode that this input should not be used with reactive forms. */ @Input('disabled') set isDisabled(isDisabled: boolean) { if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(disabledAttrWarning); } } // TODO(kara): remove next 4 properties once deprecation period is over /** @deprecated as of v6 */ @Input('ngModel') model: any; /** @deprecated as of v6 */ @Output('ngModelChange') update = new EventEmitter(); /** * @description * Static property used to track whether any ngModel warnings have been sent across * all instances of FormControlDirective. Used to support warning config of \"once\". * * @internal */ static _ngModelWarningSentOnce = false; /** * @description * Instance property used to track whether an ngModel warning has been sent out for this * particular `FormControlDirective` instance. Used to support warning config of \"always\". * * @internal */ _ngModelWarningSent = false; constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(NG_MODEL_WITH_FORM_CONTROL_WARNING) private _ngModelWarningConfig: string| null, @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { if (this._isControlChanged(changes)) { const previousForm = changes['form'].previousValue; if (previousForm) { cleanUpControl(previousForm, this, /* validateControlPresenceOnChange */ false); } setUpControl(this.form, this, this.callSetDisabledState); this.form.updateValueAndValidity({emitEvent: false}); } if (isPropertyUpdated(changes, this.viewModel)) { if (typeof ngDevMode === 'undefined' || ngDevMode) { _ngModelWarning('formControl', FormControlDirective, this, this._ngModelWarningConfig); } this.form.setValue(this.model); this.viewModel = this.model; } } /** @nodoc */ ngOnDestroy() { if (this.form) { cleanUpControl(this.form, this, /* validateControlPresenceOnChange */ false); } } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return []; } /** * @description * The `FormControl` bound to this directive. */ override get control(): FormControl { return this.form; } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value for the view model. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } private _isControlChanged(changes: {[key: string]: any}): boolean { return changes.hasOwnProperty('form'); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges} from '@angular/core'; import {FormArray} from '../../model/form_array'; import {FormControl, isFormControl} from '../../model/form_control'; import {FormGroup} from '../../model/form_group'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {ControlContainer} from '../control_container'; import {Form} from '../form_interface'; import {missingFormException} from '../reactive_errors'; import {CALL_SET_DISABLED_STATE, cleanUpControl, cleanUpFormContainer, cleanUpValidators, removeListItem, SetDisabledStateOption, setUpControl, setUpFormContainer, setUpValidators, syncPendingControls} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {FormControlName} from './form_control_name'; import {FormArrayName, FormGroupName} from './form_group_name'; const formDirectiveProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => FormGroupDirective) }; /** * @description * * Binds an existing `FormGroup` or `FormRecord` to a DOM element. * * This directive accepts an existing `FormGroup` instance. It will then use this * `FormGroup` instance to match any child `FormControl`, `FormGroup`/`FormRecord`, * and `FormArray` instances to child `FormControlName`, `FormGroupName`, * and `FormArrayName` directives. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `AbstractControl` * * @usageNotes * ### Register Form Group * * The following example registers a `FormGroup` with first name and last name controls, * and listens for the *ngSubmit* event when the button is clicked. * * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({ selector: '[formGroup]', providers: [formDirectiveProvider], host: {'(submit)': 'onSubmit($event)', '(reset)': 'onReset()'}, exportAs: 'ngForm' }) export class FormGroupDirective extends ControlContainer implements Form, OnChanges, OnDestroy { /** * @description * Reports whether the form submission has been triggered. */ public readonly submitted: boolean = false; /** * Reference to an old form group input value, which is needed to cleanup old instance in case it * was replaced with a new one. */ private _oldForm: FormGroup|undefined; /** * Callback that should be invoked when controls in FormGroup or FormArray collection change * (added or removed). This callback triggers corresponding DOM updates. */ private readonly _onCollectionChange = () => this._updateDomValue(); /** * @description * Tracks the list of added `FormControlName` instances */ directives: FormControlName[] = []; /** * @description * Tracks the `FormGroup` bound to this directive. */ @Input('formGroup') form: FormGroup = null!; /** * @description * Emits an event when the form submission has been triggered. */ @Output() ngSubmit = new EventEmitter(); constructor( @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Inject(CALL_SET_DISABLED_STATE) private callSetDisabledState?: SetDisabledStateOption) { super(); this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { this._checkFormPresent(); if (changes.hasOwnProperty('form')) { this._updateValidators(); this._updateDomValue(); this._updateRegistrations(); this._oldForm = this.form; } } /** @nodoc */ ngOnDestroy() { if (this.form) { cleanUpValidators(this.form, this); // Currently the `onCollectionChange` callback is rewritten each time the // `_registerOnCollectionChange` function is invoked. The implication is that cleanup should // happen *only* when the `onCollectionChange` callback was set by this directive instance. // Otherwise it might cause overriding a callback of some other directive instances. We should // consider updating this logic later to make it similar to how `onChange` callbacks are // handled, see https://github.com/angular/angular/issues/39732 for additional info. if (this.form._onCollectionChange === this._onCollectionChange) { this.form._registerOnCollectionChange(() => {}); } } } /** * @description * Returns this directive's instance. */ override get formDirective(): Form { return this; } /** * @description * Returns the `FormGroup` bound to this directive. */ override get control(): FormGroup { return this.form; } /** * @description * Returns an array representing the path to this group. Because this directive * always lives at the top level of a form, it always an empty array. */ override get path(): string[] { return []; } /** * @description * Method that sets up the control directive in this group, re-calculates its value * and validity, and adds the instance to the internal list of directives. * * @param dir The `FormControlName` directive instance. */ addControl(dir: FormControlName): FormControl { const ctrl: any = this.form.get(dir.path); setUpControl(ctrl, dir, this.callSetDisabledState); ctrl.updateValueAndValidity({emitEvent: false}); this.directives.push(dir); return ctrl; } /** * @description * Retrieves the `FormControl` instance from the provided `FormControlName` directive * * @param dir The `FormControlName` directive instance. */ getControl(dir: FormControlName): FormControl { return <FormControl>this.form.get(dir.path); } /** * @description * Removes the `FormControlName` instance from the internal list of directives * * @param dir The `FormControlName` directive instance. */ removeControl(dir: FormControlName): void { cleanUpControl(dir.control || null, dir, /* validateControlPresenceOnChange */ false); removeListItem(this.directives, dir); } /** * Adds a new `FormGroupName` directive instance to the form. * * @param dir The `FormGroupName` directive instance. */ addFormGroup(dir: FormGroupName): void { this._setUpFormContainer(dir); } /** * Performs the necessary cleanup when a `FormGroupName` directive instance is removed from the * view. * * @param dir The `FormGroupName` directive instance. */ removeFormGroup(dir: FormGroupName): void { this._cleanUpFormContainer(dir); } /** * @description * Retrieves the `FormGroup` for a provided `FormGroupName` directive instance * * @param dir The `FormGroupName` directive instance. */ getFormGroup(dir: FormGroupName): FormGroup { return <FormGroup>this.form.get(dir.path); } /** * Performs the necessary setup when a `FormArrayName` directive instance is added to the view. * * @param dir The `FormArrayName` directive instance. */ addFormArray(dir: FormArrayName): void { this._setUpFormContainer(dir); } /** * Performs the necessary cleanup when a `FormArrayName` directive instance is removed from the * view. * * @param dir The `FormArrayName` directive instance. */ removeFormArray(dir: FormArrayName): void { this._cleanUpFormContainer(dir); } /** * @description * Retrieves the `FormArray` for a provided `FormArrayName` directive instance. * * @param dir The `FormArrayName` directive instance. */ getFormArray(dir: FormArrayName): FormArray { return <FormArray>this.form.get(dir.path); } /** * Sets the new value for the provided `FormControlName` directive. * * @param dir The `FormControlName` directive instance. * @param value The new value for the directive's control. */ updateModel(dir: FormControlName, value: any): void { const ctrl = <FormControl>this.form.get(dir.path); ctrl.setValue(value); } /** * @description * Method called with the \"submit\" event is triggered on the form. * Triggers the `ngSubmit` emitter to emit the \"submit\" event as its payload. * * @param $event The \"submit\" event object */ onSubmit($event: Event): boolean { (this as {submitted: boolean}).submitted = true; syncPendingControls(this.form, this.directives); this.ngSubmit.emit($event); // Forms with `method=\"dialog\"` have some special behavior that won't reload the page and that // shouldn't be prevented. Note that we need to null check the `event` and the `target`, because // some internal apps call this method directly with the wrong arguments. return ($event?.target as HTMLFormElement | null)?.method === 'dialog'; } /** * @description * Method called when the \"reset\" event is triggered on the form. */ onReset(): void { this.resetForm(); } /** * @description * Resets the form to an initial value and resets its submitted status. * * @param value The new value for the form. */ resetForm(value: any = undefined): void { this.form.reset(value); (this as {submitted: boolean}).submitted = false; } /** @internal */ _updateDomValue() { this.directives.forEach(dir => { const oldCtrl = dir.control; const newCtrl = this.form.get(dir.path); if (oldCtrl !== newCtrl) { // Note: the value of the `dir.control` may not be defined, for example when it's a first // `FormControl` that is added to a `FormGroup` instance (via `addControl` call). cleanUpControl(oldCtrl || null, dir); // Check whether new control at the same location inside the corresponding `FormGroup` is an // instance of `FormControl` and perform control setup only if that's the case. // Note: we don't need to clear the list of directives (`this.directives`) here, it would be // taken care of in the `removeControl` method invoked when corresponding `formControlName` // directive instance is being removed (invoked from `FormControlName.ngOnDestroy`). if (isFormControl(newCtrl)) { setUpControl(newCtrl, dir, this.callSetDisabledState); (dir as {control: FormControl}).control = newCtrl; } } }); this.form._updateTreeValidity({emitEvent: false}); } private _setUpFormContainer(dir: FormArrayName|FormGroupName): void { const ctrl: any = this.form.get(dir.path); setUpFormContainer(ctrl, dir); // NOTE: this operation looks unnecessary in case no new validators were added in // `setUpFormContainer` call. Consider updating this code to match the logic in // `_cleanUpFormContainer` function. ctrl.updateValueAndValidity({emitEvent: false}); } private _cleanUpFormContainer(dir: FormArrayName|FormGroupName): void { if (this.form) { const ctrl: any = this.form.get(dir.path); if (ctrl) { const isControlUpdated = cleanUpFormContainer(ctrl, dir); if (isControlUpdated) { // Run validity check only in case a control was updated (i.e. view validators were // removed) as removing view validators might cause validity to change. ctrl.updateValueAndValidity({emitEvent: false}); } } } } private _updateRegistrations() { this.form._registerOnCollectionChange(this._onCollectionChange); if (this._oldForm) { this._oldForm._registerOnCollectionChange(() => {}); } } private _updateValidators() { setUpValidators(this.form, this); if (this._oldForm) { cleanUpValidators(this._oldForm, this); } } private _checkFormPresent() { if (!this.form && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw missingFormException(); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Host, Inject, Input, OnDestroy, OnInit, Optional, Provider, Self, SkipSelf} from '@angular/core'; import {FormArray} from '../../model/form_array'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {AbstractFormGroupDirective} from '../abstract_form_group_directive'; import {ControlContainer} from '../control_container'; import {arrayParentException, groupParentException} from '../reactive_errors'; import {controlPath} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {FormGroupDirective} from './form_group_directive'; const formGroupNameProvider: Provider = { provide: ControlContainer, useExisting: forwardRef(() => FormGroupName) }; /** * @description * * Syncs a nested `FormGroup` or `FormRecord` to a DOM element. * * This directive can only be used with a parent `FormGroupDirective`. * * It accepts the string name of the nested `FormGroup` or `FormRecord` to link, and * looks for a `FormGroup` or `FormRecord` registered with that name in the parent * `FormGroup` instance you passed into `FormGroupDirective`. * * Use nested form groups to validate a sub-group of a * form separately from the rest or to group the values of certain * controls into their own nested object. * * @see [Reactive Forms Guide](guide/reactive-forms) * * @usageNotes * * ### Access the group by name * * The following example uses the `AbstractControl.get` method to access the * associated `FormGroup` * * ```ts * this.form.get('name'); * ``` * * ### Access individual controls in the group * * The following example uses the `AbstractControl.get` method to access * individual controls within the group using dot syntax. * * ```ts * this.form.get('name.first'); * ``` * * ### Register a nested `FormGroup`. * * The following example registers a nested *name* `FormGroup` within an existing `FormGroup`, * and provides methods to retrieve the nested `FormGroup` and individual controls. * * {@example forms/ts/nestedFormGroup/nested_form_group_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formGroupName]', providers: [formGroupNameProvider]}) export class FormGroupName extends AbstractFormGroupDirective implements OnInit, OnDestroy { /** * @description * Tracks the name of the `FormGroup` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form groups to be bound * to indices when iterating over groups in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formGroupName') override name!: string|number|null; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** @internal */ override _checkParentType(): void { if (_hasInvalidParent(this._parent) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw groupParentException(); } } } export const formArrayNameProvider: any = { provide: ControlContainer, useExisting: forwardRef(() => FormArrayName) }; /** * @description * * Syncs a nested `FormArray` to a DOM element. * * This directive is designed to be used with a parent `FormGroupDirective` (selector: * `[formGroup]`). * * It accepts the string name of the nested `FormArray` you want to link, and * will look for a `FormArray` registered with that name in the parent * `FormGroup` instance you passed into `FormGroupDirective`. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `AbstractControl` * * @usageNotes * * ### Example * * {@example forms/ts/nestedFormArray/nested_form_array_example.ts region='Component'} * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formArrayName]', providers: [formArrayNameProvider]}) export class FormArrayName extends ControlContainer implements OnInit, OnDestroy { /** @internal */ _parent: ControlContainer; /** * @description * Tracks the name of the `FormArray` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form arrays to be bound * to indices when iterating over arrays in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formArrayName') override name!: string|number|null; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[]) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); } /** * A lifecycle method called when the directive's inputs are initialized. For internal use only. * @throws If the directive does not have a valid parent. * @nodoc */ ngOnInit(): void { this._checkParentType(); this.formDirective!.addFormArray(this); } /** * A lifecycle method called before the directive's instance is destroyed. For internal use only. * @nodoc */ ngOnDestroy(): void { if (this.formDirective) { this.formDirective.removeFormArray(this); } } /** * @description * The `FormArray` bound to this directive. */ override get control(): FormArray { return this.formDirective!.getFormArray(this); } /** * @description * The top-level directive for this group if present, otherwise null. */ override get formDirective(): FormGroupDirective|null { return this._parent ? <FormGroupDirective>this._parent.formDirective : null; } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent); } private _checkParentType(): void { if (_hasInvalidParent(this._parent) && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw arrayParentException(); } } } function _hasInvalidParent(parent: ControlContainer): boolean { return !(parent instanceof FormGroupName) && !(parent instanceof FormGroupDirective) && !(parent instanceof FormArrayName); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, EventEmitter, forwardRef, Host, Inject, Input, OnChanges, OnDestroy, Optional, Output, Provider, Self, SimpleChanges, SkipSelf} from '@angular/core'; import {FormControl} from '../../model/form_control'; import {NG_ASYNC_VALIDATORS, NG_VALIDATORS} from '../../validators'; import {AbstractFormGroupDirective} from '../abstract_form_group_directive'; import {ControlContainer} from '../control_container'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '../control_value_accessor'; import {NgControl} from '../ng_control'; import {controlParentException, disabledAttrWarning, ngModelGroupException} from '../reactive_errors'; import {_ngModelWarning, controlPath, isPropertyUpdated, selectValueAccessor} from '../shared'; import {AsyncValidator, AsyncValidatorFn, Validator, ValidatorFn} from '../validators'; import {NG_MODEL_WITH_FORM_CONTROL_WARNING} from './form_control_directive'; import {FormGroupDirective} from './form_group_directive'; import {FormArrayName, FormGroupName} from './form_group_name'; const controlNameBinding: Provider = { provide: NgControl, useExisting: forwardRef(() => FormControlName) }; /** * @description * Syncs a `FormControl` in an existing `FormGroup` to a form control * element by name. * * @see [Reactive Forms Guide](guide/reactive-forms) * @see `FormControl` * @see `AbstractControl` * * @usageNotes * * ### Register `FormControl` within a group * * The following example shows how to register multiple form controls within a form group * and set their value. * * {@example forms/ts/simpleFormGroup/simple_form_group_example.ts region='Component'} * * To see `formControlName` examples with different form control types, see: * * * Radio buttons: `RadioControlValueAccessor` * * Selects: `SelectControlValueAccessor` * * ### Use with ngModel is deprecated * * Support for using the `ngModel` input property and `ngModelChange` event with reactive * form directives has been deprecated in Angular v6 and is scheduled for removal in * a future version of Angular. * * For details, see [Deprecated features](guide/deprecations#ngmodel-with-reactive-forms). * * @ngModule ReactiveFormsModule * @publicApi */ @Directive({selector: '[formControlName]', providers: [controlNameBinding]}) export class FormControlName extends NgControl implements OnChanges, OnDestroy { private _added = false; /** * Internal reference to the view model value. * @internal */ viewModel: any; /** * @description * Tracks the `FormControl` instance bound to the directive. */ // TODO(issue/24571): remove '!'. override readonly control!: FormControl; /** * @description * Tracks the name of the `FormControl` bound to the directive. The name corresponds * to a key in the parent `FormGroup` or `FormArray`. * Accepts a name as a string or a number. * The name in the form of a string is useful for individual forms, * while the numerical form allows for form controls to be bound * to indices when iterating over controls in a `FormArray`. */ // TODO(issue/24571): remove '!'. @Input('formControlName') override name!: string|number|null; /** * @description * Triggers a warning in dev mode that this input should not be used with reactive forms. */ @Input('disabled') set isDisabled(isDisabled: boolean) { if (typeof ngDevMode === 'undefined' || ngDevMode) { console.warn(disabledAttrWarning); } } // TODO(kara): remove next 4 properties once deprecation period is over /** @deprecated as of v6 */ @Input('ngModel') model: any; /** @deprecated as of v6 */ @Output('ngModelChange') update = new EventEmitter(); /** * @description * Static property used to track whether any ngModel warnings have been sent across * all instances of FormControlName. Used to support warning config of \"once\". * * @internal */ static _ngModelWarningSentOnce = false; /** * @description * Instance property used to track whether an ngModel warning has been sent out for this * particular FormControlName instance. Used to support warning config of \"always\". * * @internal */ _ngModelWarningSent = false; constructor( @Optional() @Host() @SkipSelf() parent: ControlContainer, @Optional() @Self() @Inject(NG_VALIDATORS) validators: (Validator|ValidatorFn)[], @Optional() @Self() @Inject(NG_ASYNC_VALIDATORS) asyncValidators: (AsyncValidator|AsyncValidatorFn)[], @Optional() @Self() @Inject(NG_VALUE_ACCESSOR) valueAccessors: ControlValueAccessor[], @Optional() @Inject(NG_MODEL_WITH_FORM_CONTROL_WARNING) private _ngModelWarningConfig: string| null) { super(); this._parent = parent; this._setValidators(validators); this._setAsyncValidators(asyncValidators); this.valueAccessor = selectValueAccessor(this, valueAccessors); } /** @nodoc */ ngOnChanges(changes: SimpleChanges) { if (!this._added) this._setUpControl(); if (isPropertyUpdated(changes, this.viewModel)) { if (typeof ngDevMode === 'undefined' || ngDevMode) { _ngModelWarning('formControlName', FormControlName, this, this._ngModelWarningConfig); } this.viewModel = this.model; this.formDirective.updateModel(this, this.model); } } /** @nodoc */ ngOnDestroy(): void { if (this.formDirective) { this.formDirective.removeControl(this); } } /** * @description * Sets the new value for the view model and emits an `ngModelChange` event. * * @param newValue The new value for the view model. */ override viewToModelUpdate(newValue: any): void { this.viewModel = newValue; this.update.emit(newValue); } /** * @description * Returns an array that represents the path from the top-level form to this control. * Each index is the string name of the control on that level. */ override get path(): string[] { return controlPath(this.name == null ? this.name : this.name.toString(), this._parent!); } /** * @description * The top-level directive for this group if present, otherwise null. */ get formDirective(): any { return this._parent ? this._parent.formDirective : null; } private _checkParentType(): void { if (typeof ngDevMode === 'undefined' || ngDevMode) { if (!(this._parent instanceof FormGroupName) && this._parent instanceof AbstractFormGroupDirective) { throw ngModelGroupException(); } else if ( !(this._parent instanceof FormGroupName) && !(this._parent instanceof FormGroupDirective) && !(this._parent instanceof FormArrayName)) { throw controlParentException(); } } } private _setUpControl() { this._checkParentType(); (this as {control: FormControl}).control = this.formDirective.addControl(this); this._added = true; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Host, Input, OnDestroy, Optional, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const SELECT_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectControlValueAccessor), multi: true }; function _buildValueString(id: string|null, value: any): string { if (id == null) return `${value}`; if (value && typeof value === 'object') value = 'Object'; return `${id}: ${value}`.slice(0, 50); } function _extractId(valueString: string): string { return valueString.split(':')[0]; } /** * @description * The `ControlValueAccessor` for writing select control values and listening to select control * changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @usageNotes * * ### Using select controls in a reactive form * * The following examples show how to use a select control in a reactive form. * * {@example forms/ts/reactiveSelectControl/reactive_select_control_example.ts region='Component'} * * ### Using select controls in a template-driven form * * To use a select in a template-driven form, simply add an `ngModel` and a `name` * attribute to the main `<select>` tag. * * {@example forms/ts/selectControl/select_control_example.ts region='Component'} * * ### Customizing option selection * * Angular uses object identity to select option. It's possible for the identities of items * to change while the data does not. This can happen, for example, if the items are produced * from an RPC to the server, and that RPC is re-run. Even if the data hasn't changed, the * second response will produce objects with different identities. * * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. * `compareWith` takes a **function** which has two arguments: `option1` and `option2`. * If `compareWith` is given, Angular selects option by the return value of the function. * * ```ts * const selectedCountriesControl = new FormControl(); * ``` * * ``` * <select [compareWith]=\"compareFn\" [formControl]=\"selectedCountriesControl\"> * <option *ngFor=\"let country of countries\" [ngValue]=\"country\"> * {{country.name}} * </option> * </select> * * compareFn(c1: Country, c2: Country): boolean { * return c1 && c2 ? c1.id === c2.id : c1 === c2; * } * ``` * * **Note:** We listen to the 'change' event because 'input' events aren't fired * for selects in IE, see: * https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event#browser_compatibility * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]', host: {'(change)': 'onChange($event.target.value)', '(blur)': 'onTouched()'}, providers: [SELECT_VALUE_ACCESSOR] }) export class SelectControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** @nodoc */ value: any; /** @internal */ _optionMap: Map<string, any> = new Map<string, any>(); /** @internal */ _idCounter: number = 0; /** * @description * Tracks the option comparison algorithm for tracking identities when * checking for changes. */ @Input() set compareWith(fn: (o1: any, o2: any) => boolean) { if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new RuntimeError( RuntimeErrorCode.COMPAREWITH_NOT_A_FN, `compareWith must be a function, but received ${JSON.stringify(fn)}`); } this._compareWith = fn; } private _compareWith: (o1: any, o2: any) => boolean = Object.is; /** * Sets the \"value\" property on the select element. * @nodoc */ writeValue(value: any): void { this.value = value; const id: string|null = this._getOptionId(value); const valueString = _buildValueString(id, value); this.setProperty('value', valueString); } /** * Registers a function called when the control value changes. * @nodoc */ override registerOnChange(fn: (value: any) => any): void { this.onChange = (valueString: string) => { this.value = this._getOptionValue(valueString); fn(this.value); }; } /** @internal */ _registerOption(): string { return (this._idCounter++).toString(); } /** @internal */ _getOptionId(value: any): string|null { for (const id of Array.from(this._optionMap.keys())) { if (this._compareWith(this._optionMap.get(id), value)) return id; } return null; } /** @internal */ _getOptionValue(valueString: string): any { const id: string = _extractId(valueString); return this._optionMap.has(id) ? this._optionMap.get(id) : valueString; } } /** * @description * Marks `<option>` as dynamic, so Angular can be notified when options change. * * @see `SelectControlValueAccessor` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: 'option'}) export class NgSelectOption implements OnDestroy { /** * @description * ID of the option element */ // TODO(issue/24571): remove '!'. id!: string; constructor( private _element: ElementRef, private _renderer: Renderer2, @Optional() @Host() private _select: SelectControlValueAccessor) { if (this._select) this.id = this._select._registerOption(); } /** * @description * Tracks the value bound to the option element. Unlike the value binding, * ngValue supports binding to objects. */ @Input('ngValue') set ngValue(value: any) { if (this._select == null) return; this._select._optionMap.set(this.id, value); this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } /** * @description * Tracks simple string values bound to the option element. * For objects, use the `ngValue` input binding. */ @Input('value') set value(value: any) { this._setElementValue(value); if (this._select) this._select.writeValue(this._select.value); } /** @internal */ _setElementValue(value: string): void { this._renderer.setProperty(this._element.nativeElement, 'value', value); } /** @nodoc */ ngOnDestroy(): void { if (this._select) { this._select._optionMap.delete(this.id); this._select.writeValue(this._select.value); } } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, ElementRef, forwardRef, Host, Input, OnDestroy, Optional, Provider, Renderer2, ɵRuntimeError as RuntimeError} from '@angular/core'; import {RuntimeErrorCode} from '../errors'; import {BuiltInControlValueAccessor, ControlValueAccessor, NG_VALUE_ACCESSOR} from './control_value_accessor'; const SELECT_MULTIPLE_VALUE_ACCESSOR: Provider = { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => SelectMultipleControlValueAccessor), multi: true }; function _buildValueString(id: string, value: any): string { if (id == null) return `${value}`; if (typeof value === 'string') value = `'${value}'`; if (value && typeof value === 'object') value = 'Object'; return `${id}: ${value}`.slice(0, 50); } function _extractId(valueString: string): string { return valueString.split(':')[0]; } /** Mock interface for HTML Options */ interface HTMLOption { value: string; selected: boolean; } /** Mock interface for HTMLCollection */ abstract class HTMLCollection { // TODO(issue/24571): remove '!'. length!: number; abstract item(_: number): HTMLOption; } /** * @description * The `ControlValueAccessor` for writing multi-select control values and listening to multi-select * control changes. The value accessor is used by the `FormControlDirective`, `FormControlName`, and * `NgModel` directives. * * @see `SelectControlValueAccessor` * * @usageNotes * * ### Using a multi-select control * * The follow example shows you how to use a multi-select control with a reactive form. * * ```ts * const countryControl = new FormControl(); * ``` * * ``` * <select multiple name=\"countries\" [formControl]=\"countryControl\"> * <option *ngFor=\"let country of countries\" [ngValue]=\"country\"> * {{ country.name }} * </option> * </select> * ``` * * ### Customizing option selection * * To customize the default option comparison algorithm, `<select>` supports `compareWith` input. * See the `SelectControlValueAccessor` for usage. * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'select[multiple][formControlName],select[multiple][formControl],select[multiple][ngModel]', host: {'(change)': 'onChange($event.target)', '(blur)': 'onTouched()'}, providers: [SELECT_MULTIPLE_VALUE_ACCESSOR] }) export class SelectMultipleControlValueAccessor extends BuiltInControlValueAccessor implements ControlValueAccessor { /** * The current value. * @nodoc */ value: any; /** @internal */ _optionMap: Map<string, ɵNgSelectMultipleOption> = new Map<string, ɵNgSelectMultipleOption>(); /** @internal */ _idCounter: number = 0; /** * @description * Tracks the option comparison algorithm for tracking identities when * checking for changes. */ @Input() set compareWith(fn: (o1: any, o2: any) => boolean) { if (typeof fn !== 'function' && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new RuntimeError( RuntimeErrorCode.COMPAREWITH_NOT_A_FN, `compareWith must be a function, but received ${JSON.stringify(fn)}`); } this._compareWith = fn; } private _compareWith: (o1: any, o2: any) => boolean = Object.is; /** * Sets the \"value\" property on one or of more of the select's options. * @nodoc */ writeValue(value: any): void { this.value = value; let optionSelectedStateSetter: (opt: ɵNgSelectMultipleOption, o: any) => void; if (Array.isArray(value)) { // convert values to ids const ids = value.map((v) => this._getOptionId(v)); optionSelectedStateSetter = (opt, o) => { opt._setSelected(ids.indexOf(o.toString()) > -1); }; } else { optionSelectedStateSetter = (opt, o) => { opt._setSelected(false); }; } this._optionMap.forEach(optionSelectedStateSetter); } /** * Registers a function called when the control value changes * and writes an array of the selected options. * @nodoc */ override registerOnChange(fn: (value: any) => any): void { this.onChange = (element: HTMLSelectElement) => { const selected: Array<any> = []; const selectedOptions = element.selectedOptions; if (selectedOptions !== undefined) { const options = selectedOptions; for (let i = 0; i < options.length; i++) { const opt = options[i]; const val = this._getOptionValue(opt.value); selected.push(val); } } // Degrade to use `options` when `selectedOptions` property is not available. // Note: the `selectedOptions` is available in all supported browsers, but the Domino lib // doesn't have it currently, see https://github.com/fgnass/domino/issues/177. else { const options = element.options; for (let i = 0; i < options.length; i++) { const opt = options[i]; if (opt.selected) { const val = this._getOptionValue(opt.value); selected.push(val); } } } this.value = selected; fn(selected); }; } /** @internal */ _registerOption(value: ɵNgSelectMultipleOption): string { const id: string = (this._idCounter++).toString(); this._optionMap.set(id, value); return id; } /** @internal */ _getOptionId(value: any): string|null { for (const id of Array.from(this._optionMap.keys())) { if (this._compareWith(this._optionMap.get(id)!._value, value)) return id; } return null; } /** @internal */ _getOptionValue(valueString: string): any { const id: string = _extractId(valueString); return this._optionMap.has(id) ? this._optionMap.get(id)!._value : valueString; } } /** * @description * Marks `<option>` as dynamic, so Angular can be notified when options change. * * @see `SelectMultipleControlValueAccessor` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({selector: 'option'}) export class ɵNgSelectMultipleOption implements OnDestroy { // TODO(issue/24571): remove '!'. id!: string; /** @internal */ _value: any; constructor( private _element: ElementRef, private _renderer: Renderer2, @Optional() @Host() private _select: SelectMultipleControlValueAccessor) { if (this._select) { this.id = this._select._registerOption(this); } } /** * @description * Tracks the value bound to the option element. Unlike the value binding, * ngValue supports binding to objects. */ @Input('ngValue') set ngValue(value: any) { if (this._select == null) return; this._value = value; this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } /** * @description * Tracks simple string values bound to the option element. * For objects, use the `ngValue` input binding. */ @Input('value') set value(value: any) { if (this._select) { this._value = value; this._setElementValue(_buildValueString(this.id, value)); this._select.writeValue(this._select.value); } else { this._setElementValue(value); } } /** @internal */ _setElementValue(value: string): void { this._renderer.setProperty(this._element.nativeElement, 'value', value); } /** @internal */ _setSelected(selected: boolean) { this._renderer.setProperty(this._element.nativeElement, 'selected', selected); } /** @nodoc */ ngOnDestroy(): void { if (this._select) { this._select._optionMap.delete(this.id); this._select.writeValue(this._select.value); } } } export {ɵNgSelectMultipleOption as NgSelectMultipleOption}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Directive, forwardRef, Input, OnChanges, Provider, SimpleChanges, ɵcoerceToBoolean as coerceToBoolean} from '@angular/core'; import {Observable} from 'rxjs'; import {AbstractControl} from '../model/abstract_model'; import {emailValidator, maxLengthValidator, maxValidator, minLengthValidator, minValidator, NG_VALIDATORS, nullValidator, patternValidator, requiredTrueValidator, requiredValidator} from '../validators'; /** * Method that updates string to integer if not already a number * * @param value The value to convert to integer. * @returns value of parameter converted to number or integer. */ function toInteger(value: string|number): number { return typeof value === 'number' ? value : parseInt(value, 10); } /** * Method that ensures that provided value is a float (and converts it to float if needed). * * @param value The value to convert to float. * @returns value of parameter converted to number or float. */ function toFloat(value: string|number): number { return typeof value === 'number' ? value : parseFloat(value); } /** * @description * Defines the map of errors returned from failed validation checks. * * @publicApi */ export type ValidationErrors = { [key: string]: any }; /** * @description * An interface implemented by classes that perform synchronous validation. * * @usageNotes * * ### Provide a custom validator * * The following example implements the `Validator` interface to create a * validator directive with a custom error key. * * ```typescript * @Directive({ * selector: '[customValidator]', * providers: [{provide: NG_VALIDATORS, useExisting: CustomValidatorDirective, multi: true}] * }) * class CustomValidatorDirective implements Validator { * validate(control: AbstractControl): ValidationErrors|null { * return {'custom': true}; * } * } * ``` * * @publicApi */ export interface Validator { /** * @description * Method that performs synchronous validation against the provided control. * * @param control The control to validate against. * * @returns A map of validation errors if validation fails, * otherwise null. */ validate(control: AbstractControl): ValidationErrors|null; /** * @description * Registers a callback function to call when the validator inputs change. * * @param fn The callback function */ registerOnValidatorChange?(fn: () => void): void; } /** * A base class for Validator-based Directives. The class contains common logic shared across such * Directives. * * For internal use only, this class is not intended for use outside of the Forms package. */ @Directive() abstract class AbstractValidatorDirective implements Validator, OnChanges { private _validator: ValidatorFn = nullValidator; private _onChange!: () => void; /** * A flag that tracks whether this validator is enabled. * * Marking it `internal` (vs `protected`), so that this flag can be used in host bindings of * directive classes that extend this base class. * @internal */ _enabled?: boolean; /** * Name of an input that matches directive selector attribute (e.g. `minlength` for * `MinLengthDirective`). An input with a given name might contain configuration information (like * `minlength='10'`) or a flag that indicates whether validator should be enabled (like * `[required]='false'`). * * @internal */ abstract inputName: string; /** * Creates an instance of a validator (specific to a directive that extends this base class). * * @internal */ abstract createValidator(input: unknown): ValidatorFn; /** * Performs the necessary input normalization based on a specific logic of a Directive. * For example, the function might be used to convert string-based representation of the * `minlength` input to an integer value that can later be used in the `Validators.minLength` * validator. * * @internal */ abstract normalizeInput(input: unknown): unknown; /** @nodoc */ ngOnChanges(changes: SimpleChanges): void { if (this.inputName in changes) { const input = this.normalizeInput(changes[this.inputName].currentValue); this._enabled = this.enabled(input); this._validator = this._enabled ? this.createValidator(input) : nullValidator; if (this._onChange) { this._onChange(); } } } /** @nodoc */ validate(control: AbstractControl): ValidationErrors|null { return this._validator(control); } /** @nodoc */ registerOnValidatorChange(fn: () => void): void { this._onChange = fn; } /** * @description * Determines whether this validator should be active or not based on an input. * Base class implementation checks whether an input is defined (if the value is different from * `null` and `undefined`). Validator classes that extend this base class can override this * function with the logic specific to a particular validator directive. */ enabled(input: unknown): boolean { return input != null /* both `null` and `undefined` */; } } /** * @description * Provider which adds `MaxValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MAX_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MaxValidator), multi: true }; /** * A directive which installs the {@link MaxValidator} for any `formControlName`, * `formControl`, or control with `ngModel` that also has a `max` attribute. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a max validator * * The following example shows how to add a max validator to an input attached to an * ngModel binding. * * ```html * <input type=\"number\" ngModel max=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][max][formControlName],input[type=number][max][formControl],input[type=number][max][ngModel]', providers: [MAX_VALIDATOR], host: {'[attr.max]': '_enabled ? max : null'} }) export class MaxValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the max bound to this directive. */ @Input() max!: string|number|null; /** @internal */ override inputName = 'max'; /** @internal */ override normalizeInput = (input: string|number): number => toFloat(input); /** @internal */ override createValidator = (max: number): ValidatorFn => maxValidator(max); } /** * @description * Provider which adds `MinValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MIN_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MinValidator), multi: true }; /** * A directive which installs the {@link MinValidator} for any `formControlName`, * `formControl`, or control with `ngModel` that also has a `min` attribute. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a min validator * * The following example shows how to add a min validator to an input attached to an * ngModel binding. * * ```html * <input type=\"number\" ngModel min=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: 'input[type=number][min][formControlName],input[type=number][min][formControl],input[type=number][min][ngModel]', providers: [MIN_VALIDATOR], host: {'[attr.min]': '_enabled ? min : null'} }) export class MinValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the min bound to this directive. */ @Input() min!: string|number|null; /** @internal */ override inputName = 'min'; /** @internal */ override normalizeInput = (input: string|number): number => toFloat(input); /** @internal */ override createValidator = (min: number): ValidatorFn => minValidator(min); } /** * @description * An interface implemented by classes that perform asynchronous validation. * * @usageNotes * * ### Provide a custom async validator directive * * The following example implements the `AsyncValidator` interface to create an * async validator directive with a custom error key. * * ```typescript * import { of } from 'rxjs'; * * @Directive({ * selector: '[customAsyncValidator]', * providers: [{provide: NG_ASYNC_VALIDATORS, useExisting: CustomAsyncValidatorDirective, multi: * true}] * }) * class CustomAsyncValidatorDirective implements AsyncValidator { * validate(control: AbstractControl): Observable<ValidationErrors|null> { * return of({'custom': true}); * } * } * ``` * * @publicApi */ export interface AsyncValidator extends Validator { /** * @description * Method that performs async validation against the provided control. * * @param control The control to validate against. * * @returns A promise or observable that resolves a map of validation errors * if validation fails, otherwise null. */ validate(control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>; } /** * @description * Provider which adds `RequiredValidator` to the `NG_VALIDATORS` multi-provider list. */ export const REQUIRED_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => RequiredValidator), multi: true }; /** * @description * Provider which adds `CheckboxRequiredValidator` to the `NG_VALIDATORS` multi-provider list. */ export const CHECKBOX_REQUIRED_VALIDATOR: Provider = { provide: NG_VALIDATORS, useExisting: forwardRef(() => CheckboxRequiredValidator), multi: true }; /** * @description * A directive that adds the `required` validator to any controls marked with the * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a required validator using template-driven forms * * ``` * <input name=\"fullName\" ngModel required> * ``` * * @ngModule FormsModule * @ngModule ReactiveFormsModule * @publicApi */ @Directive({ selector: ':not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]', providers: [REQUIRED_VALIDATOR], host: {'[attr.required]': '_enabled ? \"\" : null'} }) export class RequiredValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the required attribute bound to this directive. */ @Input() required!: boolean|string; /** @internal */ override inputName = 'required'; /** @internal */ override normalizeInput = coerceToBoolean; /** @internal */ override createValidator = (input: boolean): ValidatorFn => requiredValidator; /** @nodoc */ override enabled(input: boolean): boolean { return input; } } /** * A Directive that adds the `required` validator to checkbox controls marked with the * `required` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a required checkbox validator using template-driven forms * * The following example shows how to add a checkbox required validator to an input attached to an * ngModel binding. * * ``` * <input type=\"checkbox\" name=\"active\" ngModel required> * ``` * * @publicApi * @ngModule FormsModule * @ngModule ReactiveFormsModule */ @Directive({ selector: 'input[type=checkbox][required][formControlName],input[type=checkbox][required][formControl],input[type=checkbox][required][ngModel]', providers: [CHECKBOX_REQUIRED_VALIDATOR], host: {'[attr.required]': '_enabled ? \"\" : null'} }) export class CheckboxRequiredValidator extends RequiredValidator { /** @internal */ override createValidator = (input: unknown): ValidatorFn => requiredTrueValidator; } /** * @description * Provider which adds `EmailValidator` to the `NG_VALIDATORS` multi-provider list. */ export const EMAIL_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => EmailValidator), multi: true }; /** * A directive that adds the `email` validator to controls marked with the * `email` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * The email validation is based on the WHATWG HTML specification with some enhancements to * incorporate more RFC rules. More information can be found on the [Validators.email * page](api/forms/Validators#email). * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding an email validator * * The following example shows how to add an email validator to an input attached to an ngModel * binding. * * ``` * <input type=\"email\" name=\"email\" ngModel email> * <input type=\"email\" name=\"email\" ngModel email=\"true\"> * <input type=\"email\" name=\"email\" ngModel [email]=\"true\"> * ``` * * @publicApi * @ngModule FormsModule * @ngModule ReactiveFormsModule */ @Directive({ selector: '[email][formControlName],[email][formControl],[email][ngModel]', providers: [EMAIL_VALIDATOR] }) export class EmailValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the email attribute bound to this directive. */ @Input() email!: boolean|string; /** @internal */ override inputName = 'email'; /** @internal */ override normalizeInput = coerceToBoolean; /** @internal */ override createValidator = (input: number): ValidatorFn => emailValidator; /** @nodoc */ override enabled(input: boolean): boolean { return input; } } /** * @description * A function that receives a control and synchronously returns a map of * validation errors if present, otherwise null. * * @publicApi */ export interface ValidatorFn { (control: AbstractControl): ValidationErrors|null; } /** * @description * A function that receives a control and returns a Promise or observable * that emits validation errors if present, otherwise null. * * @publicApi */ export interface AsyncValidatorFn { (control: AbstractControl): Promise<ValidationErrors|null>|Observable<ValidationErrors|null>; } /** * @description * Provider which adds `MinLengthValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MIN_LENGTH_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MinLengthValidator), multi: true }; /** * A directive that adds minimum length validation to controls marked with the * `minlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a minimum length validator * * The following example shows how to add a minimum length validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel minlength=\"4\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[minlength][formControlName],[minlength][formControl],[minlength][ngModel]', providers: [MIN_LENGTH_VALIDATOR], host: {'[attr.minlength]': '_enabled ? minlength : null'} }) export class MinLengthValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the minimum length bound to this directive. */ @Input() minlength!: string|number|null; /** @internal */ override inputName = 'minlength'; /** @internal */ override normalizeInput = (input: string|number): number => toInteger(input); /** @internal */ override createValidator = (minlength: number): ValidatorFn => minLengthValidator(minlength); } /** * @description * Provider which adds `MaxLengthValidator` to the `NG_VALIDATORS` multi-provider list. */ export const MAX_LENGTH_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MaxLengthValidator), multi: true }; /** * A directive that adds max length validation to controls marked with the * `maxlength` attribute. The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a maximum length validator * * The following example shows how to add a maximum length validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel maxlength=\"25\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]', providers: [MAX_LENGTH_VALIDATOR], host: {'[attr.maxlength]': '_enabled ? maxlength : null'} }) export class MaxLengthValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the minimum length bound to this directive. */ @Input() maxlength!: string|number|null; /** @internal */ override inputName = 'maxlength'; /** @internal */ override normalizeInput = (input: string|number): number => toInteger(input); /** @internal */ override createValidator = (maxlength: number): ValidatorFn => maxLengthValidator(maxlength); } /** * @description * Provider which adds `PatternValidator` to the `NG_VALIDATORS` multi-provider list. */ export const PATTERN_VALIDATOR: any = { provide: NG_VALIDATORS, useExisting: forwardRef(() => PatternValidator), multi: true }; /** * @description * A directive that adds regex pattern validation to controls marked with the * `pattern` attribute. The regex must match the entire control value. * The directive is provided with the `NG_VALIDATORS` multi-provider list. * * @see [Form Validation](guide/form-validation) * * @usageNotes * * ### Adding a pattern validator * * The following example shows how to add a pattern validator to an input attached to an * ngModel binding. * * ```html * <input name=\"firstName\" ngModel pattern=\"[a-zA-Z ]*\"> * ``` * * @ngModule ReactiveFormsModule * @ngModule FormsModule * @publicApi */ @Directive({ selector: '[pattern][formControlName],[pattern][formControl],[pattern][ngModel]', providers: [PATTERN_VALIDATOR], host: {'[attr.pattern]': '_enabled ? pattern : null'} }) export class PatternValidator extends AbstractValidatorDirective { /** * @description * Tracks changes to the pattern bound to this directive. */ @Input() pattern!: string|RegExp; // This input is always defined, since the name matches selector. /** @internal */ override inputName = 'pattern'; /** @internal */ override normalizeInput = (input: string|RegExp): string|RegExp => input; /** @internal */ override createValidator = (input: string|RegExp): ValidatorFn => patternValidator(input); } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {NgModule, Type} from '@angular/core'; import {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; import {DefaultValueAccessor} from './directives/default_value_accessor'; import {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; import {NgForm} from './directives/ng_form'; import {NgModel} from './directives/ng_model'; import {NgModelGroup} from './directives/ng_model_group'; import {NgNoValidate} from './directives/ng_no_validate_directive'; import {NumberValueAccessor} from './directives/number_value_accessor'; import {RadioControlRegistryModule, RadioControlValueAccessor} from './directives/radio_control_value_accessor'; import {RangeValueAccessor} from './directives/range_value_accessor'; import {FormControlDirective} from './directives/reactive_directives/form_control_directive'; import {FormControlName} from './directives/reactive_directives/form_control_name'; import {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; import {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; import {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; import {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor'; import {CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, PatternValidator, RequiredValidator} from './directives/validators'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {ControlValueAccessor} from './directives/control_value_accessor'; export {DefaultValueAccessor} from './directives/default_value_accessor'; export {NgControl} from './directives/ng_control'; export {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; export {NgForm} from './directives/ng_form'; export {NgModel} from './directives/ng_model'; export {NgModelGroup} from './directives/ng_model_group'; export {NumberValueAccessor} from './directives/number_value_accessor'; export {RadioControlValueAccessor} from './directives/radio_control_value_accessor'; export {RangeValueAccessor} from './directives/range_value_accessor'; export {FormControlDirective, NG_MODEL_WITH_FORM_CONTROL_WARNING} from './directives/reactive_directives/form_control_directive'; export {FormControlName} from './directives/reactive_directives/form_control_name'; export {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; export {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; export {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; export {NgSelectMultipleOption, SelectMultipleControlValueAccessor} from './directives/select_multiple_control_value_accessor'; export {CALL_SET_DISABLED_STATE} from './directives/shared'; export const SHARED_FORM_DIRECTIVES: Type<any>[] = [ NgNoValidate, NgSelectOption, NgSelectMultipleOption, DefaultValueAccessor, NumberValueAccessor, RangeValueAccessor, CheckboxControlValueAccessor, SelectControlValueAccessor, SelectMultipleControlValueAccessor, RadioControlValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MinLengthValidator, MaxLengthValidator, PatternValidator, CheckboxRequiredValidator, EmailValidator, MinValidator, MaxValidator, ]; export const TEMPLATE_DRIVEN_DIRECTIVES: Type<any>[] = [NgModel, NgModelGroup, NgForm]; export const REACTIVE_DRIVEN_DIRECTIVES: Type<any>[] = [FormControlDirective, FormGroupDirective, FormControlName, FormGroupName, FormArrayName]; /** * Internal module used for sharing directives between FormsModule and ReactiveFormsModule */ @NgModule({ declarations: SHARED_FORM_DIRECTIVES, imports: [RadioControlRegistryModule], exports: SHARED_FORM_DIRECTIVES, }) export class ɵInternalFormsSharedModule { } export {ɵInternalFormsSharedModule as InternalFormsSharedModule}; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {AsyncValidatorFn, ValidatorFn} from '../directives/validators'; import {AbstractControl, AbstractControlOptions, assertAllValuesPresent, assertControlPresent, pickAsyncValidators, pickValidators, ɵRawValue, ɵTypedOrUntyped, ɵValue} from './abstract_model'; /** * FormArrayValue extracts the type of `.value` from a FormArray's element type, and wraps it in an * array. * * Angular uses this type internally to support Typed Forms; do not use it directly. The untyped * case falls back to any[]. */ export type ɵFormArrayValue<T extends AbstractControl<any>> = ɵTypedOrUntyped<T, Array<ɵValue<T>>, any[]>; /** * FormArrayRawValue extracts the type of `.getRawValue()` from a FormArray's element type, and * wraps it in an array. The untyped case falls back to any[]. * * Angular uses this type internally to support Typed Forms; do not use it directly. */ export type ɵFormArrayRawValue<T extends AbstractControl<any>> = ɵTypedOrUntyped<T, Array<ɵRawValue<T>>, any[]>; /** * Tracks the value and validity state of an array of `FormControl`, * `FormGroup` or `FormArray` instances. * * A `FormArray` aggregates the values of each child `FormControl` into an array. * It calculates its status by reducing the status values of its children. For example, if one of * the controls in a `FormArray` is invalid, the entire array becomes invalid. * * `FormArray` accepts one generic argument, which is the type of the controls inside. * If you need a heterogenous array, use {@link UntypedFormArray}. * * `FormArray` is one of the four fundamental building blocks used to define forms in Angular, * along with `FormControl`, `FormGroup`, and `FormRecord`. * * @usageNotes * * ### Create an array of form controls * * ``` * const arr = new FormArray([ * new FormControl('Nancy', Validators.minLength(2)), * new FormControl('Drew'), * ]); * * console.log(arr.value); // ['Nancy', 'Drew'] * console.log(arr.status); // 'VALID' * ``` * * ### Create a form array with array-level validators * * You include array-level validators and async validators. These come in handy * when you want to perform validation that considers the value of more than one child * control. * * The two types of validators are passed in separately as the second and third arg * respectively, or together as part of an options object. * * ``` * const arr = new FormArray([ * new FormControl('Nancy'), * new FormControl('Drew') * ], {validators: myValidator, asyncValidators: myAsyncValidator}); * ``` * * ### Set the updateOn property for all controls in a form array * * The options object is used to set a default value for each child * control's `updateOn` property. If you set `updateOn` to `'blur'` at the * array level, all child controls default to 'blur', unless the child * has explicitly specified a different `updateOn` value. * * ```ts * const arr = new FormArray([ * new FormControl() * ], {updateOn: 'blur'}); * ``` * * ### Adding or removing controls from a form array * * To change the controls in the array, use the `push`, `insert`, `removeAt` or `clear` methods * in `FormArray` itself. These methods ensure the controls are properly tracked in the * form's hierarchy. Do not modify the array of `AbstractControl`s used to instantiate * the `FormArray` directly, as that result in strange and unexpected behavior such * as broken change detection. * * @publicApi */ export class FormArray<TControl extends AbstractControl<any> = any> extends AbstractControl< ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any>, ɵTypedOrUntyped<TControl, ɵFormArrayRawValue<TControl>, any>> { /** * Creates a new `FormArray` instance. * * @param controls An array of child controls. Each child control is given an index * where it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or an `AbstractControlOptions` object that contains validation functions * and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions * */ constructor( controls: Array<TControl>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null) { super(pickValidators(validatorOrOpts), pickAsyncValidators(asyncValidator, validatorOrOpts)); this.controls = controls; this._initObservables(); this._setUpdateStrategy(validatorOrOpts); this._setUpControls(); this.updateValueAndValidity({ onlySelf: true, // If `asyncValidator` is present, it will trigger control status change from `PENDING` to // `VALID` or `INVALID`. // The status should be broadcasted via the `statusChanges` observable, so we set `emitEvent` // to `true` to allow that during the control creation process. emitEvent: !!this.asyncValidator }); } public controls: ɵTypedOrUntyped<TControl, Array<TControl>, Array<AbstractControl<any>>>; /** * Get the `AbstractControl` at the given `index` in the array. * * @param index Index in the array to retrieve the control. If `index` is negative, it will wrap * around from the back, and if index is greatly negative (less than `-length`), the result is * undefined. This behavior is the same as `Array.at(index)`. */ at(index: number): ɵTypedOrUntyped<TControl, TControl, AbstractControl<any>> { return (this.controls as any)[this._adjustIndex(index)]; } /** * Insert a new `AbstractControl` at the end of the array. * * @param control Form control to be inserted * @param options Specifies whether this FormArray instance should emit events after a new * control is added. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * inserted. When false, no events are emitted. */ push(control: TControl, options: {emitEvent?: boolean} = {}): void { this.controls.push(control); this._registerControl(control); this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Insert a new `AbstractControl` at the given `index` in the array. * * @param index Index in the array to insert the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), prepends to the array. * This behavior is the same as `Array.splice(index, 0, control)`. * @param control Form control to be inserted * @param options Specifies whether this FormArray instance should emit events after a new * control is inserted. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * inserted. When false, no events are emitted. */ insert(index: number, control: TControl, options: {emitEvent?: boolean} = {}): void { this.controls.splice(index, 0, control); this._registerControl(control); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Remove the control at the given `index` in the array. * * @param index Index in the array to remove the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), removes the first * element. This behavior is the same as `Array.splice(index, 1)`. * @param options Specifies whether this FormArray instance should emit events after a * control is removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * removed. When false, no events are emitted. */ removeAt(index: number, options: {emitEvent?: boolean} = {}): void { // Adjust the index, then clamp it at no less than 0 to prevent undesired underflows. let adjustedIndex = this._adjustIndex(index); if (adjustedIndex < 0) adjustedIndex = 0; if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {}); this.controls.splice(adjustedIndex, 1); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Replace an existing control. * * @param index Index in the array to replace the control. If `index` is negative, wraps around * from the back. If `index` is greatly negative (less than `-length`), replaces the first * element. This behavior is the same as `Array.splice(index, 1, control)`. * @param control The `AbstractControl` control to replace the existing control * @param options Specifies whether this FormArray instance should emit events after an * existing control is replaced with a new one. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control is * replaced with a new one. When false, no events are emitted. */ setControl(index: number, control: TControl, options: {emitEvent?: boolean} = {}): void { // Adjust the index, then clamp it at no less than 0 to prevent undesired underflows. let adjustedIndex = this._adjustIndex(index); if (adjustedIndex < 0) adjustedIndex = 0; if (this.controls[adjustedIndex]) this.controls[adjustedIndex]._registerOnCollectionChange(() => {}); this.controls.splice(adjustedIndex, 1); if (control) { this.controls.splice(adjustedIndex, 0, control); this._registerControl(control); } this.updateValueAndValidity({emitEvent: options.emitEvent}); this._onCollectionChange(); } /** * Length of the control array. */ get length(): number { return this.controls.length; } /** * Sets the value of the `FormArray`. It accepts an array that matches * the structure of the control. * * This method performs strict checks, and throws an error if you try * to set the value of a control that doesn't exist or if you exclude the * value of a control. * * @usageNotes * ### Set the values for the controls in the form array * * ``` * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.value); // [null, null] * * arr.setValue(['Nancy', 'Drew']); * console.log(arr.value); // ['Nancy', 'Drew'] * ``` * * @param value Array of values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control value is updated. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. */ override setValue(value: ɵFormArrayRawValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { assertAllValuesPresent(this, false, value); value.forEach((newValue: any, index: number) => { assertControlPresent(this, false, index); this.at(index).setValue(newValue, {onlySelf: true, emitEvent: options.emitEvent}); }); this.updateValueAndValidity(options); } /** * Patches the value of the `FormArray`. It accepts an array that matches the * structure of the control, and does its best to match the values to the correct * controls in the group. * * It accepts both super-sets and sub-sets of the array without throwing an error. * * @usageNotes * ### Patch the values for controls in a form array * * ``` * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.value); // [null, null] * * arr.patchValue(['Nancy']); * console.log(arr.value); // ['Nancy', null] * ``` * * @param value Array of latest values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when the control * value is updated. When false, no events are emitted. The configuration options are passed to * the {@link AbstractControl#updateValueAndValidity updateValueAndValidity} method. */ override patchValue(value: ɵFormArrayValue<TControl>, options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { // Even though the `value` argument type doesn't allow `null` and `undefined` values, the // `patchValue` can be called recursively and inner data structures might have these values, // so we just ignore such cases when a field containing FormArray instance receives `null` or // `undefined` as a value. if (value == null /* both `null` and `undefined` */) return; value.forEach((newValue, index) => { if (this.at(index)) { this.at(index).patchValue(newValue, {onlySelf: true, emitEvent: options.emitEvent}); } }); this.updateValueAndValidity(options); } /** * Resets the `FormArray` and all descendants are marked `pristine` and `untouched`, and the * value of all descendants to null or null maps. * * You reset to a specific form state by passing in an array of states * that matches the structure of the control. The state is a standalone value * or a form state object with both a value and a disabled status. * * @usageNotes * ### Reset the values in a form array * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * arr.reset(['name', 'last name']); * * console.log(arr.value); // ['name', 'last name'] * ``` * * ### Reset the values in a form array and the disabled status for the first control * * ``` * arr.reset([ * {value: 'name', disabled: true}, * 'last' * ]); * * console.log(arr.value); // ['last'] * console.log(arr.at(0).status); // 'DISABLED' * ``` * * @param value Array of values for the controls * @param options Configure options that determine how the control propagates changes and * emits events after the value changes * * * `onlySelf`: When true, each change only affects this control, and not its parent. Default * is false. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` * observables emit events with the latest status and value when the control is reset. * When false, no events are emitted. * The configuration options are passed to the {@link AbstractControl#updateValueAndValidity * updateValueAndValidity} method. */ override reset(value: ɵTypedOrUntyped<TControl, ɵFormArrayValue<TControl>, any> = [], options: { onlySelf?: boolean, emitEvent?: boolean } = {}): void { this._forEachChild((control: AbstractControl, index: number) => { control.reset(value[index], {onlySelf: true, emitEvent: options.emitEvent}); }); this._updatePristine(options); this._updateTouched(options); this.updateValueAndValidity(options); } /** * The aggregate value of the array, including any disabled controls. * * Reports all values regardless of disabled status. */ override getRawValue(): ɵFormArrayRawValue<TControl> { return this.controls.map((control: AbstractControl) => control.getRawValue()); } /** * Remove all controls in the `FormArray`. * * @param options Specifies whether this FormArray instance should emit events after all * controls are removed. * * `emitEvent`: When true or not supplied (the default), both the `statusChanges` and * `valueChanges` observables emit events with the latest status and value when all controls * in this FormArray instance are removed. When false, no events are emitted. * * @usageNotes * ### Remove all elements from a FormArray * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * console.log(arr.length); // 2 * * arr.clear(); * console.log(arr.length); // 0 * ``` * * It's a simpler and more efficient alternative to removing all elements one by one: * * ```ts * const arr = new FormArray([ * new FormControl(), * new FormControl() * ]); * * while (arr.length) { * arr.removeAt(0); * } * ``` */ clear(options: {emitEvent?: boolean} = {}): void { if (this.controls.length < 1) return; this._forEachChild((control) => control._registerOnCollectionChange(() => {})); this.controls.splice(0); this.updateValueAndValidity({emitEvent: options.emitEvent}); } /** * Adjusts a negative index by summing it with the length of the array. For very negative * indices, the result may remain negative. * @internal */ private _adjustIndex(index: number): number { return index < 0 ? index + this.length : index; } /** @internal */ override _syncPendingControls(): boolean { let subtreeUpdated = (this.controls as any).reduce((updated: any, child: any) => { return child._syncPendingControls() ? true : updated; }, false); if (subtreeUpdated) this.updateValueAndValidity({onlySelf: true}); return subtreeUpdated; } /** @internal */ override _forEachChild(cb: (c: AbstractControl, index: number) => void): void { this.controls.forEach((control: AbstractControl, index: number) => { cb(control, index); }); } /** @internal */ override _updateValue(): void { (this as {value: any}).value = this.controls.filter((control) => control.enabled || this.disabled) .map((control) => control.value); } /** @internal */ override _anyControls(condition: (c: AbstractControl) => boolean): boolean { return this.controls.some((control) => control.enabled && condition(control)); } /** @internal */ _setUpControls(): void { this._forEachChild((control) => this._registerControl(control)); } /** @internal */ override _allControlsDisabled(): boolean { for (const control of this.controls) { if (control.enabled) return false; } return this.controls.length > 0 || this.disabled; } private _registerControl(control: AbstractControl) { control.setParent(this); control._registerOnCollectionChange(this._onCollectionChange); } /** @internal */ override _find(name: string|number): AbstractControl|null { return this.at(name as number) ?? null; } } interface UntypedFormArrayCtor { new(controls: AbstractControl[], validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormArray; /** * The presence of an explicit `prototype` property provides backwards-compatibility for apps that * manually inspect the prototype chain. */ prototype: FormArray<any>; } /** * UntypedFormArray is a non-strongly-typed version of @see FormArray, which * permits heterogenous controls. */ export type UntypedFormArray = FormArray<any>; export const UntypedFormArray: UntypedFormArrayCtor = FormArray; /** * @description * Asserts that the given control is an instance of `FormArray` * * @publicApi */ export const isFormArray = (control: unknown): control is FormArray => control instanceof FormArray; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {inject, Injectable} from '@angular/core'; import {AsyncValidatorFn, ValidatorFn} from './directives/validators'; import {AbstractControl, AbstractControlOptions, FormHooks} from './model/abstract_model'; import {FormArray, UntypedFormArray} from './model/form_array'; import {FormControl, FormControlOptions, FormControlState, UntypedFormControl} from './model/form_control'; import {FormGroup, FormRecord, UntypedFormGroup} from './model/form_group'; function isAbstractControlOptions(options: AbstractControlOptions|{[key: string]: any}|null| undefined): options is AbstractControlOptions { return !!options && ((options as AbstractControlOptions).asyncValidators !== undefined || (options as AbstractControlOptions).validators !== undefined || (options as AbstractControlOptions).updateOn !== undefined); } /** * The union of all validator types that can be accepted by a ControlConfig. */ type ValidatorConfig = ValidatorFn|AsyncValidatorFn|ValidatorFn[]|AsyncValidatorFn[]; /** * The compiler may not always be able to prove that the elements of the control config are a tuple * (i.e. occur in a fixed order). This slightly looser type is used for inference, to catch cases * where the compiler cannot prove order and position. * * For example, consider the simple case `fb.group({foo: ['bar', Validators.required]})`. The * compiler will infer this as an array, not as a tuple. */ type PermissiveControlConfig<T> = Array<T|FormControlState<T>|ValidatorConfig>; /** * Helper type to allow the compiler to accept [XXXX, { updateOn: string }] as a valid shorthand * argument for .group() */ interface PermissiveAbstractControlOptions extends Omit<AbstractControlOptions, 'updateOn'> { updateOn?: string; } /** * ControlConfig<T> is a tuple containing a value of type T, plus optional validators and async * validators. * * @publicApi */ export type ControlConfig<T> = [T|FormControlState<T>, (ValidatorFn|(ValidatorFn[]))?, (AsyncValidatorFn|AsyncValidatorFn[])?]; // Disable clang-format to produce clearer formatting for this multiline type. // clang-format off /** * FormBuilder accepts values in various container shapes, as well as raw values. * Element returns the appropriate corresponding model class, given the container T. * The flag N, if not never, makes the resulting `FormControl` have N in its type. */ export type ɵElement<T, N extends null> = // The `extends` checks are wrapped in arrays in order to prevent TypeScript from applying type unions // through the distributive conditional type. This is the officially recommended solution: // https://www.typescriptlang.org/docs/handbook/2/conditional-types.html#distributive-conditional-types // // Identify FormControl container types. [T] extends [FormControl<infer U>] ? FormControl<U> : // Or FormControl containers that are optional in their parent group. [T] extends [FormControl<infer U>|undefined] ? FormControl<U> : // FormGroup containers. [T] extends [FormGroup<infer U>] ? FormGroup<U> : // Optional FormGroup containers. [T] extends [FormGroup<infer U>|undefined] ? FormGroup<U> : // FormRecord containers. [T] extends [FormRecord<infer U>] ? FormRecord<U> : // Optional FormRecord containers. [T] extends [FormRecord<infer U>|undefined] ? FormRecord<U> : // FormArray containers. [T] extends [FormArray<infer U>] ? FormArray<U> : // Optional FormArray containers. [T] extends [FormArray<infer U>|undefined] ? FormArray<U> : // Otherwise unknown AbstractControl containers. [T] extends [AbstractControl<infer U>] ? AbstractControl<U> : // Optional AbstractControl containers. [T] extends [AbstractControl<infer U>|undefined] ? AbstractControl<U> : // FormControlState object container, which produces a nullable control. [T] extends [FormControlState<infer U>] ? FormControl<U|N> : // A ControlConfig tuple, which produces a nullable control. [T] extends [PermissiveControlConfig<infer U>] ? FormControl<Exclude<U, ValidatorConfig| PermissiveAbstractControlOptions>|N> : FormControl<T|N>; // clang-format on /** * @description * Creates an `AbstractControl` from a user-specified configuration. * * The `FormBuilder` provides syntactic sugar that shortens creating instances of a * `FormControl`, `FormGroup`, or `FormArray`. It reduces the amount of boilerplate needed to * build complex forms. * * @see [Reactive Forms Guide](guide/reactive-forms) * * @publicApi */ @Injectable({providedIn: 'root'}) export class FormBuilder { private useNonNullable: boolean = false; /** * @description * Returns a FormBuilder in which automatically constructed @see FormControl} elements * have `{nonNullable: true}` and are non-nullable. * * **Constructing non-nullable controls** * * When constructing a control, it will be non-nullable, and will reset to its initial value. * * ```ts * let nnfb = new FormBuilder().nonNullable; * let name = nnfb.control('Alex'); // FormControl<string> * name.reset(); * console.log(name); // 'Alex' * ``` * * **Constructing non-nullable groups or arrays** * * When constructing a group or array, all automatically created inner controls will be * non-nullable, and will reset to their initial values. * * ```ts * let nnfb = new FormBuilder().nonNullable; * let name = nnfb.group({who: 'Alex'}); // FormGroup<{who: FormControl<string>}> * name.reset(); * console.log(name); // {who: 'Alex'} * ``` * **Constructing *nullable* fields on groups or arrays** * * It is still possible to have a nullable field. In particular, any `FormControl` which is * *already* constructed will not be altered. For example: * * ```ts * let nnfb = new FormBuilder().nonNullable; * // FormGroup<{who: FormControl<string|null>}> * let name = nnfb.group({who: new FormControl('Alex')}); * name.reset(); console.log(name); // {who: null} * ``` * * Because the inner control is constructed explicitly by the caller, the builder has * no control over how it is created, and cannot exclude the `null`. */ get nonNullable(): NonNullableFormBuilder { const nnfb = new FormBuilder(); nnfb.useNonNullable = true; return nnfb as NonNullableFormBuilder; } /** * @description * Constructs a new `FormGroup` instance. Accepts a single generic argument, which is an object * containing all the keys and corresponding inner control types. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param options Configuration options object for the `FormGroup`. The object should have the * `AbstractControlOptions` type and might contain the following fields: * * `validators`: A synchronous validator function, or an array of validator functions. * * `asyncValidators`: A single async validator or array of async validator functions. * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur' * | submit'). */ group<T extends {}>( controls: T, options?: AbstractControlOptions|null, ): FormGroup<{[K in keyof T]: ɵElement<T[K], null>}>; /** * @description * Constructs a new `FormGroup` instance. * * @deprecated This API is not typesafe and can result in issues with Closure Compiler renaming. * Use the `FormBuilder#group` overload with `AbstractControlOptions` instead. * Note that `AbstractControlOptions` expects `validators` and `asyncValidators` to be valid * validators. If you have custom validators, make sure their validation function parameter is * `AbstractControl` and not a sub-class, such as `FormGroup`. These functions will be called * with an object of type `AbstractControl` and that cannot be automatically downcast to a * subclass, so TypeScript sees this as an error. For example, change the `(group: FormGroup) => * ValidationErrors|null` signature to be `(group: AbstractControl) => ValidationErrors|null`. * * @param controls A record of child controls. The key for each child is the name * under which the control is registered. * * @param options Configuration options object for the `FormGroup`. The legacy configuration * object consists of: * * `validator`: A synchronous validator function, or an array of validator functions. * * `asyncValidator`: A single async validator or array of async validator functions * Note: the legacy format is deprecated and might be removed in one of the next major versions * of Angular. */ group( controls: {[key: string]: any}, options: {[key: string]: any}, ): FormGroup; group(controls: {[key: string]: any}, options: AbstractControlOptions|{[key: string]: any}|null = null): FormGroup { const reducedControls = this._reduceControls(controls); let newOptions: FormControlOptions = {}; if (isAbstractControlOptions(options)) { // `options` are `AbstractControlOptions` newOptions = options; } else if (options !== null) { // `options` are legacy form group options newOptions.validators = (options as any).validator; newOptions.asyncValidators = (options as any).asyncValidator; } return new FormGroup(reducedControls, newOptions); } /** * @description * Constructs a new `FormRecord` instance. Accepts a single generic argument, which is an object * containing all the keys and corresponding inner control types. * * @param controls A collection of child controls. The key for each child is the name * under which it is registered. * * @param options Configuration options object for the `FormRecord`. The object should have the * `AbstractControlOptions` type and might contain the following fields: * * `validators`: A synchronous validator function, or an array of validator functions. * * `asyncValidators`: A single async validator or array of async validator functions. * * `updateOn`: The event upon which the control should be updated (options: 'change' | 'blur' * | submit'). */ record<T>(controls: {[key: string]: T}, options: AbstractControlOptions|null = null): FormRecord<ɵElement<T, null>> { const reducedControls = this._reduceControls(controls); // Cast to `any` because the inferred types are not as specific as Element. return new FormRecord(reducedControls, options) as any; } /** @deprecated Use `nonNullable` instead. */ control<T>(formState: T|FormControlState<T>, opts: FormControlOptions&{ initialValueIsDefault: true }): FormControl<T>; control<T>(formState: T|FormControlState<T>, opts: FormControlOptions&{nonNullable: true}): FormControl<T>; /** * @deprecated When passing an `options` argument, the `asyncValidator` argument has no effect. */ control<T>( formState: T|FormControlState<T>, opts: FormControlOptions, asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]): FormControl<T|null>; control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T|null>; /** * @description * Constructs a new `FormControl` with the given state, validators and options. Sets * `{nonNullable: true}` in the options to get a non-nullable control. Otherwise, the * control will be nullable. Accepts a single generic argument, which is the type of the * control's value. * * @param formState Initializes the control with an initial state value, or * with an object that contains both a value and a disabled status. * * @param validatorOrOpts A synchronous validator function, or an array of * such functions, or a `FormControlOptions` object that contains * validation functions and a validation trigger. * * @param asyncValidator A single async validator or array of async validator * functions. * * @usageNotes * * ### Initialize a control as disabled * * The following example returns a control with an initial value in a disabled state. * * <code-example path=\"forms/ts/formBuilder/form_builder_example.ts\" region=\"disabled-control\"> * </code-example> */ control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl { let newOptions: FormControlOptions = {}; if (!this.useNonNullable) { return new FormControl(formState, validatorOrOpts, asyncValidator); } if (isAbstractControlOptions(validatorOrOpts)) { // If the second argument is options, then they are copied. newOptions = validatorOrOpts; } else { // If the other arguments are validators, they are copied into an options object. newOptions.validators = validatorOrOpts; newOptions.asyncValidators = asyncValidator; } return new FormControl<T>(formState, {...newOptions, nonNullable: true}); } /** * Constructs a new `FormArray` from the given array of configurations, * validators and options. Accepts a single generic argument, which is the type of each control * inside the array. * * @param controls An array of child controls or control configs. Each child control is given an * index when it is registered. * * @param validatorOrOpts A synchronous validator function, or an array of such functions, or an * `AbstractControlOptions` object that contains * validation functions and a validation trigger. * * @param asyncValidator A single async validator or array of async validator functions. */ array<T>( controls: Array<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormArray<ɵElement<T, null>> { const createdControls = controls.map(c => this._createControl(c)); // Cast to `any` because the inferred types are not as specific as Element. return new FormArray(createdControls, validatorOrOpts, asyncValidator) as any; } /** @internal */ _reduceControls<T>(controls: {[k: string]: T|ControlConfig<T>|FormControlState<T>|AbstractControl<T>}): {[key: string]: AbstractControl} { const createdControls: {[key: string]: AbstractControl} = {}; Object.keys(controls).forEach(controlName => { createdControls[controlName] = this._createControl(controls[controlName]); }); return createdControls; } /** @internal */ _createControl<T>(controls: T|FormControlState<T>|ControlConfig<T>|FormControl<T>| AbstractControl<T>): FormControl<T>|FormControl<T|null>|AbstractControl<T> { if (controls instanceof FormControl) { return controls as FormControl<T>; } else if (controls instanceof AbstractControl) { // A control; just return it return controls; } else if (Array.isArray(controls)) { // ControlConfig Tuple const value: T|FormControlState<T> = controls[0]; const validator: ValidatorFn|ValidatorFn[]|null = controls.length > 1 ? controls[1]! : null; const asyncValidator: AsyncValidatorFn|AsyncValidatorFn[]|null = controls.length > 2 ? controls[2]! : null; return this.control<T>(value, validator, asyncValidator); } else { // T or FormControlState<T> return this.control<T>(controls); } } } /** * @description * `NonNullableFormBuilder` is similar to {@link FormBuilder}, but automatically constructed * {@link FormControl} elements have `{nonNullable: true}` and are non-nullable. * * @publicApi */ @Injectable({ providedIn: 'root', useFactory: () => inject(FormBuilder).nonNullable, }) export abstract class NonNullableFormBuilder { /** * Similar to `FormBuilder#group`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract group<T extends {}>( controls: T, options?: AbstractControlOptions|null, ): FormGroup<{[K in keyof T]: ɵElement<T[K], never>}>; /** * Similar to `FormBuilder#record`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract record<T>( controls: {[key: string]: T}, options?: AbstractControlOptions|null, ): FormRecord<ɵElement<T, never>>; /** * Similar to `FormBuilder#array`, except any implicitly constructed `FormControl` * will be non-nullable (i.e. it will have `nonNullable` set to true). Note * that already-constructed controls will not be altered. */ abstract array<T>( controls: Array<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormArray<ɵElement<T, never>>; /** * Similar to `FormBuilder#control`, except this overridden version of `control` forces * `nonNullable` to be `true`, resulting in the control always being non-nullable. */ abstract control<T>( formState: T|FormControlState<T>, validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): FormControl<T>; } /** * UntypedFormBuilder is the same as @see FormBuilder, but it provides untyped controls. */ @Injectable({providedIn: 'root'}) export class UntypedFormBuilder extends FormBuilder { /** * Like `FormBuilder#group`, except the resulting group is untyped. */ override group( controlsConfig: {[key: string]: any}, options?: AbstractControlOptions|null, ): UntypedFormGroup; /** * @deprecated This API is not typesafe and can result in issues with Closure Compiler renaming. * Use the `FormBuilder#group` overload with `AbstractControlOptions` instead. */ override group( controlsConfig: {[key: string]: any}, options: {[key: string]: any}, ): UntypedFormGroup; override group( controlsConfig: {[key: string]: any}, options: AbstractControlOptions|{[key: string]: any}|null = null): UntypedFormGroup { return super.group(controlsConfig, options); } /** * Like `FormBuilder#control`, except the resulting control is untyped. */ override control( formState: any, validatorOrOpts?: ValidatorFn|ValidatorFn[]|FormControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormControl { return super.control(formState, validatorOrOpts, asyncValidator); } /** * Like `FormBuilder#array`, except the resulting array is untyped. */ override array( controlsConfig: any[], validatorOrOpts?: ValidatorFn|ValidatorFn[]|AbstractControlOptions|null, asyncValidator?: AsyncValidatorFn|AsyncValidatorFn[]|null): UntypedFormArray { return super.array(controlsConfig, validatorOrOpts, asyncValidator); } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * Entry point for all public APIs of the forms package. */ import {Version} from '@angular/core'; /** * @publicApi */ export const VERSION = new Version('15.2.0'); ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {ModuleWithProviders, NgModule} from '@angular/core'; import {InternalFormsSharedModule, NG_MODEL_WITH_FORM_CONTROL_WARNING, REACTIVE_DRIVEN_DIRECTIVES, TEMPLATE_DRIVEN_DIRECTIVES} from './directives'; import {CALL_SET_DISABLED_STATE, setDisabledStateDefault, SetDisabledStateOption} from './directives/shared'; /** * Exports the required providers and directives for template-driven forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `RadioControlRegistry` * * @see [Forms Overview](/guide/forms-overview) * @see [Template-driven Forms Guide](/guide/forms) * * @publicApi */ @NgModule({ declarations: TEMPLATE_DRIVEN_DIRECTIVES, exports: [InternalFormsSharedModule, TEMPLATE_DRIVEN_DIRECTIVES] }) export class FormsModule { /** * @description * Provides options for configuring the forms module. * * @param opts An object of configuration options * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts: { callSetDisabledState?: SetDisabledStateOption, }): ModuleWithProviders<FormsModule> { return { ngModule: FormsModule, providers: [{ provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault }] }; } } /** * Exports the required infrastructure and directives for reactive forms, * making them available for import by NgModules that import this module. * * Providers associated with this module: * * `FormBuilder` * * `RadioControlRegistry` * * @see [Forms Overview](guide/forms-overview) * @see [Reactive Forms Guide](guide/reactive-forms) * * @publicApi */ @NgModule({ declarations: [REACTIVE_DRIVEN_DIRECTIVES], exports: [InternalFormsSharedModule, REACTIVE_DRIVEN_DIRECTIVES] }) export class ReactiveFormsModule { /** * @description * Provides options for configuring the reactive forms module. * * @param opts An object of configuration options * * `warnOnNgModelWithFormControl` Configures when to emit a warning when an `ngModel` * binding is used with reactive form directives. * * `callSetDisabledState` Configures whether to `always` call `setDisabledState`, which is more * correct, or to only call it `whenDisabled`, which is the legacy behavior. */ static withConfig(opts: { /** @deprecated as of v6 */ warnOnNgModelWithFormControl?: 'never'|'once'| 'always', callSetDisabledState?: SetDisabledStateOption, }): ModuleWithProviders<ReactiveFormsModule> { return { ngModule: ReactiveFormsModule, providers: [ { provide: NG_MODEL_WITH_FORM_CONTROL_WARNING, useValue: opts.warnOnNgModelWithFormControl ?? 'always' }, { provide: CALL_SET_DISABLED_STATE, useValue: opts.callSetDisabledState ?? setDisabledStateDefault } ] }; } } ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * This module is used for handling user input, by defining and building a `FormGroup` that * consists of `FormControl` objects, and mapping them onto the DOM. `FormControl` * objects can then be used to read information from the form DOM elements. * * Forms providers are not included in default providers; you must import these providers * explicitly. */ export {ɵInternalFormsSharedModule} from './directives'; export {AbstractControlDirective} from './directives/abstract_control_directive'; export {AbstractFormGroupDirective} from './directives/abstract_form_group_directive'; export {CheckboxControlValueAccessor} from './directives/checkbox_value_accessor'; export {ControlContainer} from './directives/control_container'; export {ControlValueAccessor, NG_VALUE_ACCESSOR} from './directives/control_value_accessor'; export {COMPOSITION_BUFFER_MODE, DefaultValueAccessor} from './directives/default_value_accessor'; export {Form} from './directives/form_interface'; export {NgControl} from './directives/ng_control'; export {NgControlStatus, NgControlStatusGroup} from './directives/ng_control_status'; export {NgForm} from './directives/ng_form'; export {NgModel} from './directives/ng_model'; export {NgModelGroup} from './directives/ng_model_group'; export {ɵNgNoValidate} from './directives/ng_no_validate_directive'; export {NumberValueAccessor} from './directives/number_value_accessor'; export {RadioControlValueAccessor} from './directives/radio_control_value_accessor'; export {RangeValueAccessor} from './directives/range_value_accessor'; export {FormControlDirective} from './directives/reactive_directives/form_control_directive'; export {FormControlName} from './directives/reactive_directives/form_control_name'; export {FormGroupDirective} from './directives/reactive_directives/form_group_directive'; export {FormArrayName, FormGroupName} from './directives/reactive_directives/form_group_name'; export {NgSelectOption, SelectControlValueAccessor} from './directives/select_control_value_accessor'; export {SelectMultipleControlValueAccessor, ɵNgSelectMultipleOption} from './directives/select_multiple_control_value_accessor'; export {SetDisabledStateOption} from './directives/shared'; export {AsyncValidator, AsyncValidatorFn, CheckboxRequiredValidator, EmailValidator, MaxLengthValidator, MaxValidator, MinLengthValidator, MinValidator, PatternValidator, RequiredValidator, ValidationErrors, Validator, ValidatorFn} from './directives/validators'; export {ControlConfig, FormBuilder, NonNullableFormBuilder, UntypedFormBuilder, ɵElement} from './form_builder'; export {AbstractControl, AbstractControlOptions, FormControlStatus, ɵCoerceStrArrToNumArr, ɵGetProperty, ɵNavigate, ɵRawValue, ɵTokenize, ɵTypedOrUntyped, ɵValue, ɵWriteable} from './model/abstract_model'; export {FormArray, isFormArray, UntypedFormArray, ɵFormArrayRawValue, ɵFormArrayValue} from './model/form_array'; export {FormControl, FormControlOptions, FormControlState, isFormControl, UntypedFormControl, ɵFormControlCtor} from './model/form_control'; export {FormGroup, FormRecord, isFormGroup, isFormRecord, UntypedFormGroup, ɵFormGroupRawValue, ɵFormGroupValue, ɵOptionalKeys} from './model/form_group'; export {NG_ASYNC_VALIDATORS, NG_VALIDATORS, Validators} from './validators'; export {VERSION} from './version'; export * from './form_providers'; ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ /** * @module * @description * Entry point for all public APIs of this package. */ export * from './src/forms'; // This file only reexports content of the `src` folder. Keep it that way. ","/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ // This file is not used to build this module. It is only used during editing // by the TypeScript language service and during build for verification. `ngc` // replaces this file with production index.ts when it rewrites private symbol // names. export * from './public_api'; ","/** * Generated bundle index. Do not edit. */ export * from './index'; "],"names":["getDOM","NG_DEV_MODE","isPromise","isObservable","RuntimeError","i1.NgControl","i2.ControlContainer","removeListItem","formDirectiveProvider","resolvedPromise","i1.ControlContainer","formControlBinding","coerceToBoolean","_buildValueString","_extractId","NgNoValidate","NgSelectMultipleOption","InternalFormsSharedModule","i1.NgModel","i2.NgModelGroup","i3.NgForm","i4.FormControlDirective","i5.FormGroupDirective","i6.FormControlName","i7.FormGroupName","i7.FormArrayName"],"mappings":";;;;;;;;;;;;AAqIA;;;;;;AAMG;MAEU,wBAAwB,CAAA;IAcnC,WAAoB,CAAA,SAAoB,EAAU,WAAuB,EAAA;QAArD,IAAS,CAAA,SAAA,GAAT,SAAS,CAAW;QAAU,IAAW,CAAA,WAAA,GAAX,WAAW,CAAY;AAbzE;;;;AAIG;AACH,QAAA,IAAA,CAAA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AA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,qHAFpBA,0BAAyB,EAAAI,oBAAA,EAAAC,kBAAA,EAAAC,eAAA,EAAAC,aAAA,EAAAC,aAAA,CAAA,EAAA,CAAA,CAAA;AAExB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,mBAAmB,YAFpBR,0BAAyB,CAAA,EAAA,CAAA,CAAA;sGAExB,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAJ/B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,0BAA0B,CAAC;AAC1C,oBAAA,OAAO,EAAE,CAACA,0BAAyB,EAAE,0BAA0B,CAAC;AACjE,iBAAA,CAAA;;;AC3DD;;;;;;;;;AASG;;ACTH;;;;AAIG;AAGH;;ACPA;;ACRA;;AAEG;;;;"}
22584
+
22585
+
22586
+
22583
22587
  ======================================================================
22584
22588
 
22585
22589
  To the extent any open source components are licensed under the GPL
@@ -22596,5 +22600,6 @@ General Counsel. VMware shall mail a copy of the Source Files to you on
22596
22600
  a CD or equivalent physical medium. This offer to obtain a copy of the
22597
22601
  Source Files is valid for three years from the date you acquired this
22598
22602
  Software product. Alternatively, the Source Files may accompany the
22599
- VMware product.
22600
- [VCDUISDK1503GAAT083123]
22603
+ VMware service.
22604
+
22605
+ [VCDUISDK1504GARS110123]