From a5a12b9f8822ea8f52aa5198a6bd627bd0cb6a31 Mon Sep 17 00:00:00 2001 From: Miles Malerba Date: Sat, 3 Sep 2022 20:25:55 +0000 Subject: [PATCH] fix(material/legacy-card): deprecate all ts symbols --- src/material/legacy-card/card-module.ts | 4 +++ src/material/legacy-card/card.ts | 29 ++++++++++++++++++ .../testing/card-harness-filters.ts | 6 +++- .../legacy-card/testing/card-harness.ts | 12 ++++++-- .../material/legacy-card-testing.md | 6 ++-- .../public_api_guard/material/legacy-card.md | 30 +++++++++---------- 6 files changed, 66 insertions(+), 21 deletions(-) diff --git a/src/material/legacy-card/card-module.ts b/src/material/legacy-card/card-module.ts index 593c1249e63c..bb2b6cfe3ac3 100644 --- a/src/material/legacy-card/card-module.ts +++ b/src/material/legacy-card/card-module.ts @@ -25,6 +25,10 @@ import { MatLegacyCardXlImage, } from './card'; +/** + * @deprecated Use `MatCardModule` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ @NgModule({ imports: [MatCommonModule], exports: [ diff --git a/src/material/legacy-card/card.ts b/src/material/legacy-card/card.ts index 8994b1f42b0e..be417adc150c 100644 --- a/src/material/legacy-card/card.ts +++ b/src/material/legacy-card/card.ts @@ -20,6 +20,8 @@ import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations'; /** * Content of a card, needed as it's used as a selector in the API. * @docs-private + * @deprecated Use `MatCardContent` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: 'mat-card-content, [mat-card-content], [matCardContent]', @@ -30,6 +32,8 @@ export class MatLegacyCardContent {} /** * Title of a card, needed as it's used as a selector in the API. * @docs-private + * @deprecated Use `MatCardTitle` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: `mat-card-title, [mat-card-title], [matCardTitle]`, @@ -42,6 +46,8 @@ export class MatLegacyCardTitle {} /** * Sub-title of a card, needed as it's used as a selector in the API. * @docs-private + * @deprecated Use `MatCardSubtitle` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: `mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]`, @@ -54,6 +60,8 @@ export class MatLegacyCardSubtitle {} /** * Action section of a card, needed as it's used as a selector in the API. * @docs-private + * @deprecated Use `MatCardActions` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: 'mat-card-actions', @@ -71,6 +79,8 @@ export class MatLegacyCardActions { /** * Footer of a card, needed as it's used as a selector in the API. * @docs-private + * @deprecated Use `MatCardFooter` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: 'mat-card-footer', @@ -81,6 +91,8 @@ export class MatLegacyCardFooter {} /** * Image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardImage` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-image], [matCardImage]', @@ -91,6 +103,8 @@ export class MatLegacyCardImage {} /** * Image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardSmImage` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-sm-image], [matCardImageSmall]', @@ -101,6 +115,8 @@ export class MatLegacyCardSmImage {} /** * Image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardMdImage` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-md-image], [matCardImageMedium]', @@ -111,6 +127,8 @@ export class MatLegacyCardMdImage {} /** * Image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardLgImage` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-lg-image], [matCardImageLarge]', @@ -121,6 +139,8 @@ export class MatLegacyCardLgImage {} /** * Large image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardXlImage` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-xl-image], [matCardImageXLarge]', @@ -131,6 +151,8 @@ export class MatLegacyCardXlImage {} /** * Avatar image used in a card, needed to add the mat- CSS styling. * @docs-private + * @deprecated Use `MatCardAvatar` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Directive({ selector: '[mat-card-avatar], [matCardAvatar]', @@ -148,6 +170,9 @@ export class MatLegacyCardAvatar {} * - mat-card-content * - mat-card-actions * - mat-card-footer + * + * @deprecated Use `MatCard` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Component({ selector: 'mat-card', @@ -170,6 +195,8 @@ export class MatLegacyCard { * Component intended to be used within the `` component. It adds styles for a * preset header section (i.e. a title, subtitle, and avatar layout). * @docs-private + * @deprecated Use `MatCardHeader` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Component({ selector: 'mat-card-header', @@ -184,6 +211,8 @@ export class MatLegacyCardHeader {} * Component intended to be used within the `` component. It adds styles for a preset * layout that groups an image with a title section. * @docs-private + * @deprecated Use `MatCardTitleGroup` from `@angular/material/card` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 */ @Component({ selector: 'mat-card-title-group', diff --git a/src/material/legacy-card/testing/card-harness-filters.ts b/src/material/legacy-card/testing/card-harness-filters.ts index bf3ef830e0f0..ac8313cfd4c7 100644 --- a/src/material/legacy-card/testing/card-harness-filters.ts +++ b/src/material/legacy-card/testing/card-harness-filters.ts @@ -8,7 +8,11 @@ import {BaseHarnessFilters} from '@angular/cdk/testing'; -/** A set of criteria that can be used to filter a list of `MatCardHarness` instances. */ +/** + * A set of criteria that can be used to filter a list of `MatCardHarness` instances. + * @deprecated Use `CardHarnessFilters` from `@angular/material/card/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ export interface LegacyCardHarnessFilters extends BaseHarnessFilters { /** Only find instances whose text matches the given value. */ text?: string | RegExp; diff --git a/src/material/legacy-card/testing/card-harness.ts b/src/material/legacy-card/testing/card-harness.ts index 402b4ff142e0..448f97932b6b 100644 --- a/src/material/legacy-card/testing/card-harness.ts +++ b/src/material/legacy-card/testing/card-harness.ts @@ -9,7 +9,11 @@ import {HarnessPredicate, ContentContainerComponentHarness} from '@angular/cdk/testing'; import {LegacyCardHarnessFilters} from './card-harness-filters'; -/** Selectors for different sections of the mat-card that can container user content. */ +/** + * Selectors for different sections of the mat-card that can container user content. + * @deprecated Use `MatCardSection` from `@angular/material/card/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ export const enum MatLegacyCardSection { HEADER = '.mat-card-header', CONTENT = '.mat-card-content', @@ -17,7 +21,11 @@ export const enum MatLegacyCardSection { FOOTER = '.mat-card-footer', } -/** Harness for interacting with a standard mat-card in tests. */ +/** + * Harness for interacting with a standard mat-card in tests. + * @deprecated Use `MatCardHarness` from `@angular/material/card/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. + * @breaking-change 17.0.0 + */ export class MatLegacyCardHarness extends ContentContainerComponentHarness { /** The selector for the host element of a `MatCard` instance. */ static hostSelector = '.mat-card'; diff --git a/tools/public_api_guard/material/legacy-card-testing.md b/tools/public_api_guard/material/legacy-card-testing.md index a25e790ef2cc..9f392ef78a0a 100644 --- a/tools/public_api_guard/material/legacy-card-testing.md +++ b/tools/public_api_guard/material/legacy-card-testing.md @@ -8,14 +8,14 @@ import { BaseHarnessFilters } from '@angular/cdk/testing'; import { ContentContainerComponentHarness } from '@angular/cdk/testing'; import { HarnessPredicate } from '@angular/cdk/testing'; -// @public +// @public @deprecated export interface LegacyCardHarnessFilters extends BaseHarnessFilters { subtitle?: string | RegExp; text?: string | RegExp; title?: string | RegExp; } -// @public +// @public @deprecated export class MatLegacyCardHarness extends ContentContainerComponentHarness { getSubtitleText(): Promise; getText(): Promise; @@ -24,7 +24,7 @@ export class MatLegacyCardHarness extends ContentContainerComponentHarness; } -// @public +// @public @deprecated export const enum MatLegacyCardSection { // (undocumented) ACTIONS = ".mat-card-actions", diff --git a/tools/public_api_guard/material/legacy-card.md b/tools/public_api_guard/material/legacy-card.md index d806becee535..bfe67ff775a9 100644 --- a/tools/public_api_guard/material/legacy-card.md +++ b/tools/public_api_guard/material/legacy-card.md @@ -7,7 +7,7 @@ import * as i0 from '@angular/core'; import * as i2 from '@angular/material/core'; -// @public +// @public @deprecated export class MatLegacyCard { constructor(_animationMode?: string | undefined); // (undocumented) @@ -18,7 +18,7 @@ export class MatLegacyCard { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardActions { align: 'start' | 'end'; // (undocumented) @@ -27,7 +27,7 @@ export class MatLegacyCardActions { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardAvatar { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -35,7 +35,7 @@ export class MatLegacyCardAvatar { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardContent { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -43,7 +43,7 @@ export class MatLegacyCardContent { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardFooter { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -51,7 +51,7 @@ export class MatLegacyCardFooter { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardHeader { // (undocumented) static ɵcmp: i0.ɵɵComponentDeclaration; @@ -59,7 +59,7 @@ export class MatLegacyCardHeader { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardImage { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -67,7 +67,7 @@ export class MatLegacyCardImage { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardLgImage { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -75,7 +75,7 @@ export class MatLegacyCardLgImage { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardMdImage { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -83,7 +83,7 @@ export class MatLegacyCardMdImage { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public (undocumented) +// @public @deprecated (undocumented) export class MatLegacyCardModule { // (undocumented) static ɵfac: i0.ɵɵFactoryDeclaration; @@ -93,7 +93,7 @@ export class MatLegacyCardModule { static ɵmod: i0.ɵɵNgModuleDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardSmImage { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -101,7 +101,7 @@ export class MatLegacyCardSmImage { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardSubtitle { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -109,7 +109,7 @@ export class MatLegacyCardSubtitle { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardTitle { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration; @@ -117,7 +117,7 @@ export class MatLegacyCardTitle { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardTitleGroup { // (undocumented) static ɵcmp: i0.ɵɵComponentDeclaration; @@ -125,7 +125,7 @@ export class MatLegacyCardTitleGroup { static ɵfac: i0.ɵɵFactoryDeclaration; } -// @public +// @public @deprecated export class MatLegacyCardXlImage { // (undocumented) static ɵdir: i0.ɵɵDirectiveDeclaration;