With 4.2, we introduced the min and max validator directives. This was actually a breaking change because their selectors could include custom value accessors using the min/max properties for their own purposes. For now, we are rolling back the change by removing the exports. At the least, we should wait to add them until a major version. In the meantime, we will have further discussion about what the best solution is going forward for all validator directives. Closes #17491. ---- PR #17551 tried to roll this back, but did not remove the dead code. This failed internal tests that were checking that all declared directives were used. This PR rolls back the original PR and commit the same as #17551 while also removing the dead code.
82 lines
3.9 KiB
TypeScript
82 lines
3.9 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. 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 {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, MinLengthValidator, 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} 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 const SHARED_FORM_DIRECTIVES: Type<any>[] = [
|
|
NgNoValidate,
|
|
NgSelectOption,
|
|
NgSelectMultipleOption,
|
|
DefaultValueAccessor,
|
|
NumberValueAccessor,
|
|
RangeValueAccessor,
|
|
CheckboxControlValueAccessor,
|
|
SelectControlValueAccessor,
|
|
SelectMultipleControlValueAccessor,
|
|
RadioControlValueAccessor,
|
|
NgControlStatus,
|
|
NgControlStatusGroup,
|
|
RequiredValidator,
|
|
MinLengthValidator,
|
|
MaxLengthValidator,
|
|
PatternValidator,
|
|
CheckboxRequiredValidator,
|
|
EmailValidator,
|
|
];
|
|
|
|
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,
|
|
exports: SHARED_FORM_DIRECTIVES,
|
|
})
|
|
export class InternalFormsSharedModule {
|
|
}
|