Skip to content

Commit 77d6b69

Browse files
committed
fix(material/checkbox): breaking changes for v20
Removes the deprecated symbols for v20 from the checkbox. BREAKING CHANGE: * `MAT_CHECKBOX_REQUIRED_VALIDATOR` has been removed. * `MAT_CHECKBOX_VALUE_ACCESSOR` has been removed. * `MatCheckboxRequiredValidator` has been removed. * `_MatCheckboxRequiredValidatorModule` has been removed.
1 parent c6ad44c commit 77d6b69

File tree

5 files changed

+7
-86
lines changed

5 files changed

+7
-86
lines changed

src/material/checkbox/checkbox-required-validator.ts

-35
This file was deleted.

src/material/checkbox/checkbox.ts

+5-11
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ export enum TransitionCheckState {
5959
Indeterminate,
6060
}
6161

62-
/**
63-
* @deprecated Will stop being exported.
64-
* @breaking-change 19.0.0
65-
*/
66-
export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
67-
provide: NG_VALUE_ACCESSOR,
68-
useExisting: forwardRef(() => MatCheckbox),
69-
multi: true,
70-
};
71-
7262
/** Change event object emitted by checkbox. */
7363
export class MatCheckboxChange {
7464
/** The source checkbox of the event. */
@@ -99,7 +89,11 @@ const defaults = MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY();
9989
'[class]': 'color ? "mat-" + color : "mat-accent"',
10090
},
10191
providers: [
102-
MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR,
92+
{
93+
provide: NG_VALUE_ACCESSOR,
94+
useExisting: forwardRef(() => MatCheckbox),
95+
multi: true,
96+
},
10397
{
10498
provide: NG_VALIDATORS,
10599
useExisting: MatCheckbox,

src/material/checkbox/module.ts

-11
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,6 @@
99
import {NgModule} from '@angular/core';
1010
import {MatCommonModule} from '@angular/material/core';
1111
import {MatCheckbox} from './checkbox';
12-
import {MatCheckboxRequiredValidator} from './checkbox-required-validator';
13-
14-
/**
15-
* @deprecated No longer used, `MatCheckbox` implements required validation directly.
16-
* @breaking-change 19.0.0
17-
*/
18-
@NgModule({
19-
imports: [MatCheckboxRequiredValidator],
20-
exports: [MatCheckboxRequiredValidator],
21-
})
22-
export class _MatCheckboxRequiredValidatorModule {}
2312

2413
@NgModule({
2514
imports: [MatCheckbox, MatCommonModule],

src/material/checkbox/public-api.ts

-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,3 @@
99
export * from './checkbox';
1010
export * from './checkbox-config';
1111
export * from './module';
12-
export * from './checkbox-required-validator';

tools/public_api_guard/material/checkbox.md

+2-28
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,25 @@
66

77
import { AbstractControl } from '@angular/forms';
88
import { AfterViewInit } from '@angular/core';
9-
import { CheckboxRequiredValidator } from '@angular/forms';
109
import { ControlValueAccessor } from '@angular/forms';
1110
import { ElementRef } from '@angular/core';
1211
import { EventEmitter } from '@angular/core';
1312
import { FocusableOption } from '@angular/cdk/a11y';
1413
import * as i0 from '@angular/core';
15-
import * as i3 from '@angular/material/core';
14+
import * as i2 from '@angular/material/core';
1615
import { InjectionToken } from '@angular/core';
1716
import { OnChanges } from '@angular/core';
18-
import { Provider } from '@angular/core';
1917
import { SimpleChanges } from '@angular/core';
2018
import { ThemePalette } from '@angular/material/core';
2119
import { ValidationErrors } from '@angular/forms';
2220
import { Validator } from '@angular/forms';
2321

24-
// @public @deprecated (undocumented)
25-
export const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any;
26-
2722
// @public
2823
export const MAT_CHECKBOX_DEFAULT_OPTIONS: InjectionToken<MatCheckboxDefaultOptions>;
2924

3025
// @public
3126
export function MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY(): MatCheckboxDefaultOptions;
3227

33-
// @public @deprecated (undocumented)
34-
export const MAT_CHECKBOX_REQUIRED_VALIDATOR: Provider;
35-
3628
// @public (undocumented)
3729
export class MatCheckbox implements AfterViewInit, OnChanges, ControlValueAccessor, Validator, FocusableOption {
3830
constructor(...args: unknown[]);
@@ -154,25 +146,7 @@ export class MatCheckboxModule {
154146
// (undocumented)
155147
static ɵinj: i0.ɵɵInjectorDeclaration<MatCheckboxModule>;
156148
// (undocumented)
157-
static ɵmod: i0.ɵɵNgModuleDeclaration<MatCheckboxModule, never, [typeof i2.MatCheckbox, typeof i3.MatCommonModule], [typeof i2.MatCheckbox, typeof i3.MatCommonModule]>;
158-
}
159-
160-
// @public @deprecated
161-
export class MatCheckboxRequiredValidator extends CheckboxRequiredValidator {
162-
// (undocumented)
163-
static ɵdir: i0.ɵɵDirectiveDeclaration<MatCheckboxRequiredValidator, "mat-checkbox[required][formControlName], mat-checkbox[required][formControl], mat-checkbox[required][ngModel]", never, {}, {}, never, never, true, never>;
164-
// (undocumented)
165-
static ɵfac: i0.ɵɵFactoryDeclaration<MatCheckboxRequiredValidator, never>;
166-
}
167-
168-
// @public @deprecated (undocumented)
169-
export class _MatCheckboxRequiredValidatorModule {
170-
// (undocumented)
171-
static ɵfac: i0.ɵɵFactoryDeclaration<_MatCheckboxRequiredValidatorModule, never>;
172-
// (undocumented)
173-
static ɵinj: i0.ɵɵInjectorDeclaration<_MatCheckboxRequiredValidatorModule>;
174-
// (undocumented)
175-
static ɵmod: i0.ɵɵNgModuleDeclaration<_MatCheckboxRequiredValidatorModule, never, [typeof i1.MatCheckboxRequiredValidator], [typeof i1.MatCheckboxRequiredValidator]>;
149+
static ɵmod: i0.ɵɵNgModuleDeclaration<MatCheckboxModule, never, [typeof i1.MatCheckbox, typeof i2.MatCommonModule], [typeof i1.MatCheckbox, typeof i2.MatCommonModule]>;
176150
}
177151

178152
// @public

0 commit comments

Comments
 (0)