Skip to content

Commit

Permalink
fix(material/legacy-checkbox): deprecate all ts symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalerba committed Sep 7, 2022
1 parent a5a12b9 commit ab22cab
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 10 deletions.
4 changes: 4 additions & 0 deletions src/material/legacy-checkbox/checkbox-module.ts
Expand Up @@ -12,6 +12,10 @@ import {MatCommonModule, MatRippleModule} from '@angular/material/core';
import {MatLegacyCheckbox} from './checkbox';
import {_MatCheckboxRequiredValidatorModule} from '@angular/material/checkbox';

/**
* @deprecated Use `MatCheckboxModule` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@NgModule({
imports: [MatRippleModule, MatCommonModule, ObserversModule, _MatCheckboxRequiredValidatorModule],
exports: [MatLegacyCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],
Expand Down
10 changes: 9 additions & 1 deletion src/material/legacy-checkbox/checkbox.ts
Expand Up @@ -29,7 +29,11 @@ import {
MatCheckboxDefaultOptions,
} from '@angular/material/checkbox';

/** Change event object emitted by a checkbox. */
/**
* Change event object emitted by a checkbox.
* @deprecated Use `MatCheckboxChange` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export class MatLegacyCheckboxChange {
/** The source checkbox of the event. */
source: MatLegacyCheckbox;
Expand All @@ -40,6 +44,8 @@ export class MatLegacyCheckboxChange {
* Provider Expression that allows mat-checkbox to register as a ControlValueAccessor.
* This allows it to support [(ngModel)].
* @docs-private
* @deprecated Use `MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
provide: NG_VALUE_ACCESSOR,
Expand All @@ -54,6 +60,8 @@ export const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
* so there is no need to provide them yourself. However, if you want to omit a label and still
* have the checkbox be accessible, you may supply an [aria-label] input.
* See: https://material.io/design/components/selection-controls.html
* @deprecated Use `MatCheckbox` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@Component({
selector: 'mat-checkbox',
Expand Down
39 changes: 37 additions & 2 deletions src/material/legacy-checkbox/public-api.ts
Expand Up @@ -14,16 +14,51 @@ export {
export {MatLegacyCheckboxModule} from './checkbox-module';

export {
/**
* @deprecated Use `MAT_CHECKBOX_REQUIRED_VALIDATOR` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_CHECKBOX_REQUIRED_VALIDATOR as MAT_LEGACY_CHECKBOX_REQUIRED_VALIDATOR,

/**
* @deprecated Use `MatCheckboxClickAction` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MatCheckboxClickAction as MatLegacyCheckboxClickAction,

/**
* @deprecated Use `MatCheckboxRequiredValidator` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MatCheckboxRequiredValidator as MatLegacyCheckboxRequiredValidator,

/**
* @deprecated Use `_MatCheckboxRequiredValidatorModule` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
_MatCheckboxRequiredValidatorModule as _MatLegacyCheckboxRequiredValidatorModule,

/**
* @deprecated
* @breaking-change 9.0.0
* @deprecated Use `TransitionCheckState` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
TransitionCheckState as LegacyTransitionCheckState,

/**
* @deprecated Use `MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS_FACTORY,

/**
* @deprecated Use `MatCheckboxDefaultOptions` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MatCheckboxDefaultOptions as MatLegacyCheckboxDefaultOptions,

/**
* @deprecated Use `MAT_CHECKBOX_DEFAULT_OPTIONS` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
MAT_CHECKBOX_DEFAULT_OPTIONS as MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS,
} from '@angular/material/checkbox';
6 changes: 5 additions & 1 deletion src/material/legacy-checkbox/testing/checkbox-harness.ts
Expand Up @@ -9,7 +9,11 @@
import {HarnessPredicate} from '@angular/cdk/testing';
import {_MatCheckboxHarnessBase, CheckboxHarnessFilters} from '@angular/material/checkbox/testing';

/** Harness for interacting with a standard mat-checkbox in tests. */
/**
* Harness for interacting with a standard mat-checkbox in tests.
* @deprecated Use `MatCheckboxHarness` from `@angular/material/checkbox/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export class MatLegacyCheckboxHarness extends _MatCheckboxHarnessBase {
/** The selector for the host element of a checkbox instance. */
static hostSelector = '.mat-checkbox';
Expand Down
8 changes: 7 additions & 1 deletion src/material/legacy-checkbox/testing/public-api.ts
Expand Up @@ -7,4 +7,10 @@
*/

export {MatLegacyCheckboxHarness} from './checkbox-harness';
export {CheckboxHarnessFilters as LegacyCheckboxHarnessFilters} from '@angular/material/checkbox/testing';
export {
/**
* @deprecated Use `CheckboxHarnessFilters` from `@angular/material/checkbox/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
CheckboxHarnessFilters as LegacyCheckboxHarnessFilters,
} from '@angular/material/checkbox/testing';
2 changes: 1 addition & 1 deletion tools/public_api_guard/material/legacy-checkbox-testing.md
Expand Up @@ -12,7 +12,7 @@ import { TestElement } from '@angular/cdk/testing';

export { LegacyCheckboxHarnessFilters }

// @public
// @public @deprecated
export class MatLegacyCheckboxHarness extends _MatCheckboxHarnessBase {
static hostSelector: string;
// (undocumented)
Expand Down
8 changes: 4 additions & 4 deletions tools/public_api_guard/material/legacy-checkbox.md
Expand Up @@ -27,7 +27,7 @@ import { OnDestroy } from '@angular/core';

export { LegacyTransitionCheckState }

// @public
// @public @deprecated
export const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any;

export { MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS }
Expand All @@ -36,7 +36,7 @@ export { MAT_LEGACY_CHECKBOX_DEFAULT_OPTIONS_FACTORY }

export { MAT_LEGACY_CHECKBOX_REQUIRED_VALIDATOR }

// @public
// @public @deprecated
export class MatLegacyCheckbox extends _MatCheckboxBase<MatLegacyCheckboxChange> implements AfterViewInit, OnDestroy {
constructor(elementRef: ElementRef<HTMLElement>, changeDetectorRef: ChangeDetectorRef, _focusMonitor: FocusMonitor, ngZone: NgZone, tabIndex: string, animationMode?: string, options?: MatLegacyCheckboxDefaultOptions);
// (undocumented)
Expand Down Expand Up @@ -64,7 +64,7 @@ export class MatLegacyCheckbox extends _MatCheckboxBase<MatLegacyCheckboxChange>
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCheckbox, [null, null, null, null, { attribute: "tabindex"; }, { optional: true; }, { optional: true; }]>;
}

// @public
// @public @deprecated
export class MatLegacyCheckboxChange {
checked: boolean;
source: MatLegacyCheckbox;
Expand All @@ -74,7 +74,7 @@ export { MatLegacyCheckboxClickAction }

export { MatLegacyCheckboxDefaultOptions }

// @public (undocumented)
// @public @deprecated (undocumented)
export class MatLegacyCheckboxModule {
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCheckboxModule, never>;
Expand Down

0 comments on commit ab22cab

Please sign in to comment.