Skip to content

Commit

Permalink
fix(material/legacy-card): 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 b101898 commit a5a12b9
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 21 deletions.
4 changes: 4 additions & 0 deletions src/material/legacy-card/card-module.ts
Expand Up @@ -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: [
Expand Down
29 changes: 29 additions & 0 deletions src/material/legacy-card/card.ts
Expand Up @@ -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]',
Expand All @@ -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]`,
Expand All @@ -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]`,
Expand All @@ -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',
Expand All @@ -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',
Expand All @@ -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]',
Expand All @@ -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]',
Expand All @@ -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]',
Expand All @@ -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]',
Expand All @@ -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]',
Expand All @@ -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]',
Expand All @@ -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',
Expand All @@ -170,6 +195,8 @@ export class MatLegacyCard {
* Component intended to be used within the `<mat-card>` 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',
Expand All @@ -184,6 +211,8 @@ export class MatLegacyCardHeader {}
* Component intended to be used within the `<mat-card>` 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',
Expand Down
6 changes: 5 additions & 1 deletion src/material/legacy-card/testing/card-harness-filters.ts
Expand Up @@ -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;
Expand Down
12 changes: 10 additions & 2 deletions src/material/legacy-card/testing/card-harness.ts
Expand Up @@ -9,15 +9,23 @@
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',
ACTIONS = '.mat-card-actions',
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<MatLegacyCardSection> {
/** The selector for the host element of a `MatCard` instance. */
static hostSelector = '.mat-card';
Expand Down
6 changes: 3 additions & 3 deletions tools/public_api_guard/material/legacy-card-testing.md
Expand Up @@ -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<MatLegacyCardSection> {
getSubtitleText(): Promise<string>;
getText(): Promise<string>;
Expand All @@ -24,7 +24,7 @@ export class MatLegacyCardHarness extends ContentContainerComponentHarness<MatLe
static with(options?: LegacyCardHarnessFilters): HarnessPredicate<MatLegacyCardHarness>;
}

// @public
// @public @deprecated
export const enum MatLegacyCardSection {
// (undocumented)
ACTIONS = ".mat-card-actions",
Expand Down
30 changes: 15 additions & 15 deletions tools/public_api_guard/material/legacy-card.md
Expand Up @@ -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)
Expand All @@ -18,7 +18,7 @@ export class MatLegacyCard {
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCard, [{ optional: true; }]>;
}

// @public
// @public @deprecated
export class MatLegacyCardActions {
align: 'start' | 'end';
// (undocumented)
Expand All @@ -27,63 +27,63 @@ export class MatLegacyCardActions {
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardActions, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardAvatar {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardAvatar, "[mat-card-avatar], [matCardAvatar]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardAvatar, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardContent {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardContent, "mat-card-content, [mat-card-content], [matCardContent]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardContent, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardFooter {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardFooter, "mat-card-footer", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardFooter, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardHeader {
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatLegacyCardHeader, "mat-card-header", never, {}, {}, never, ["[mat-card-avatar], [matCardAvatar]", "mat-card-title, mat-card-subtitle,\n [mat-card-title], [mat-card-subtitle],\n [matCardTitle], [matCardSubtitle]", "*"], false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardHeader, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardImage {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardImage, "[mat-card-image], [matCardImage]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardImage, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardLgImage {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardLgImage, "[mat-card-lg-image], [matCardImageLarge]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardLgImage, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardMdImage {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardMdImage, "[mat-card-md-image], [matCardImageMedium]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardMdImage, never>;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export class MatLegacyCardModule {
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardModule, never>;
Expand All @@ -93,39 +93,39 @@ export class MatLegacyCardModule {
static ɵmod: i0.ɵɵNgModuleDeclaration<MatLegacyCardModule, [typeof i1.MatLegacyCard, typeof i1.MatLegacyCardHeader, typeof i1.MatLegacyCardTitleGroup, typeof i1.MatLegacyCardContent, typeof i1.MatLegacyCardTitle, typeof i1.MatLegacyCardSubtitle, typeof i1.MatLegacyCardActions, typeof i1.MatLegacyCardFooter, typeof i1.MatLegacyCardSmImage, typeof i1.MatLegacyCardMdImage, typeof i1.MatLegacyCardLgImage, typeof i1.MatLegacyCardImage, typeof i1.MatLegacyCardXlImage, typeof i1.MatLegacyCardAvatar], [typeof i2.MatCommonModule], [typeof i1.MatLegacyCard, typeof i1.MatLegacyCardHeader, typeof i1.MatLegacyCardTitleGroup, typeof i1.MatLegacyCardContent, typeof i1.MatLegacyCardTitle, typeof i1.MatLegacyCardSubtitle, typeof i1.MatLegacyCardActions, typeof i1.MatLegacyCardFooter, typeof i1.MatLegacyCardSmImage, typeof i1.MatLegacyCardMdImage, typeof i1.MatLegacyCardLgImage, typeof i1.MatLegacyCardImage, typeof i1.MatLegacyCardXlImage, typeof i1.MatLegacyCardAvatar, typeof i2.MatCommonModule]>;
}

// @public
// @public @deprecated
export class MatLegacyCardSmImage {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardSmImage, "[mat-card-sm-image], [matCardImageSmall]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardSmImage, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardSubtitle {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardSubtitle, "mat-card-subtitle, [mat-card-subtitle], [matCardSubtitle]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardSubtitle, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardTitle {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardTitle, "mat-card-title, [mat-card-title], [matCardTitle]", never, {}, {}, never, never, false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardTitle, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardTitleGroup {
// (undocumented)
static ɵcmp: i0.ɵɵComponentDeclaration<MatLegacyCardTitleGroup, "mat-card-title-group", never, {}, {}, never, ["mat-card-title, mat-card-subtitle,\n [mat-card-title], [mat-card-subtitle],\n [matCardTitle], [matCardSubtitle]", "img", "*"], false>;
// (undocumented)
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyCardTitleGroup, never>;
}

// @public
// @public @deprecated
export class MatLegacyCardXlImage {
// (undocumented)
static ɵdir: i0.ɵɵDirectiveDeclaration<MatLegacyCardXlImage, "[mat-card-xl-image], [matCardImageXLarge]", never, {}, {}, never, never, false>;
Expand Down

0 comments on commit a5a12b9

Please sign in to comment.