Skip to content

Commit

Permalink
fix(material/legacy-progress-spinner): 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 c3684db commit 36a54d3
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 14 deletions.
Expand Up @@ -10,6 +10,10 @@ import {CommonModule} from '@angular/common';
import {MatCommonModule} from '@angular/material/core';
import {MatLegacyProgressSpinner} from './progress-spinner';

/**
* @deprecated Use `MatProgressSpinnerModule` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@NgModule({
imports: [MatCommonModule, CommonModule],
exports: [MatLegacyProgressSpinner, MatCommonModule],
Expand Down
26 changes: 22 additions & 4 deletions src/material/legacy-progress-spinner/progress-spinner.ts
Expand Up @@ -28,7 +28,11 @@ import {CanColor, mixinColor, ThemePalette} from '@angular/material/core';
import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
import {Subscription} from 'rxjs';

/** Possible mode for a progress spinner. */
/**
* Possible mode for a progress spinner.
* @deprecated Use `ProgressSpinnerMode` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export type LegacyProgressSpinnerMode = 'determinate' | 'indeterminate';

/**
Expand All @@ -52,7 +56,11 @@ const _MatProgressSpinnerBase = mixinColor(
'primary',
);

/** Default `mat-progress-spinner` options that can be overridden. */
/**
* Default `mat-progress-spinner` options that can be overridden.
* @deprecated Use `MatProgressSpinnerDefaultOptions` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface MatLegacyProgressSpinnerDefaultOptions {
/** Default color of the spinner. */
color?: ThemePalette;
Expand All @@ -67,7 +75,11 @@ export interface MatLegacyProgressSpinnerDefaultOptions {
_forceAnimations?: boolean;
}

/** Injection token to be used to override the default options for `mat-progress-spinner`. */
/**
* Injection token to be used to override the default options for `mat-progress-spinner`.
* @deprecated Use `MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export const MAT_LEGACY_PROGRESS_SPINNER_DEFAULT_OPTIONS =
new InjectionToken<MatLegacyProgressSpinnerDefaultOptions>(
'mat-progress-spinner-default-options',
Expand All @@ -77,7 +89,11 @@ export const MAT_LEGACY_PROGRESS_SPINNER_DEFAULT_OPTIONS =
},
);

/** @docs-private */
/**
* @docs-private
* @deprecated Use `MAT_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export function MAT_LEGACY_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatLegacyProgressSpinnerDefaultOptions {
return {diameter: BASE_SIZE};
}
Expand Down Expand Up @@ -112,6 +128,8 @@ const INDETERMINATE_ANIMATION_TEMPLATE = `

/**
* `<mat-progress-spinner>` component.
* @deprecated Use `MatProgressSpinner` from `@angular/material/progress-spinner` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@Component({
selector: 'mat-progress-spinner, mat-spinner',
Expand Down
Expand Up @@ -8,5 +8,9 @@

import {BaseHarnessFilters} from '@angular/cdk/testing';

/** A set of criteria that can be used to filter a list of `MatProgressSpinnerHarness` instances. */
/**
* A set of criteria that can be used to filter a list of `MatProgressSpinnerHarness` instances.
* @deprecated Use `ProgressSpinnerHarnessFilters` from `@angular/material/progress-spinner/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface LegacyProgressSpinnerHarnessFilters extends BaseHarnessFilters {}
Expand Up @@ -11,7 +11,11 @@ import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {LegacyProgressSpinnerMode} from '@angular/material/legacy-progress-spinner';
import {LegacyProgressSpinnerHarnessFilters} from './progress-spinner-harness-filters';

/** Harness for interacting with a standard mat-progress-spinner in tests. */
/**
* Harness for interacting with a standard mat-progress-spinner in tests.
* @deprecated Use `MatProgressSpinnerHarness` from `@angular/material/progress-spinner/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export class MatLegacyProgressSpinnerHarness extends ComponentHarness {
/** The selector for the host element of a Progress Spinner instance. */
static hostSelector = '.mat-progress-spinner';
Expand Down
Expand Up @@ -9,11 +9,11 @@ import { ComponentHarness } from '@angular/cdk/testing';
import { HarnessPredicate } from '@angular/cdk/testing';
import { LegacyProgressSpinnerMode } from '@angular/material/legacy-progress-spinner';

// @public
// @public @deprecated
export interface LegacyProgressSpinnerHarnessFilters extends BaseHarnessFilters {
}

// @public
// @public @deprecated
export class MatLegacyProgressSpinnerHarness extends ComponentHarness {
getMode(): Promise<LegacyProgressSpinnerMode>;
getValue(): Promise<number | null>;
Expand Down
12 changes: 6 additions & 6 deletions tools/public_api_guard/material/legacy-progress-spinner.md
Expand Up @@ -21,16 +21,16 @@ import { Platform } from '@angular/cdk/platform';
import { ThemePalette } from '@angular/material/core';
import { ViewportRuler } from '@angular/cdk/scrolling';

// @public
// @public @deprecated
export type LegacyProgressSpinnerMode = 'determinate' | 'indeterminate';

// @public
// @public @deprecated
export const MAT_LEGACY_PROGRESS_SPINNER_DEFAULT_OPTIONS: InjectionToken<MatLegacyProgressSpinnerDefaultOptions>;

// @public
// @public @deprecated
export function MAT_LEGACY_PROGRESS_SPINNER_DEFAULT_OPTIONS_FACTORY(): MatLegacyProgressSpinnerDefaultOptions;

// @public
// @public @deprecated
export class MatLegacyProgressSpinner extends _MatProgressSpinnerBase implements OnInit, OnDestroy, CanColor {
constructor(elementRef: ElementRef<HTMLElement>, _platform: Platform, _document: any, animationMode: string, defaults?: MatLegacyProgressSpinnerDefaultOptions,
changeDetectorRef?: ChangeDetectorRef, viewportRuler?: ViewportRuler, ngZone?: NgZone);
Expand Down Expand Up @@ -59,15 +59,15 @@ export class MatLegacyProgressSpinner extends _MatProgressSpinnerBase implements
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyProgressSpinner, [null, null, { optional: true; }, { optional: true; }, null, null, null, null]>;
}

// @public
// @public @deprecated
export interface MatLegacyProgressSpinnerDefaultOptions {
color?: ThemePalette;
diameter?: number;
_forceAnimations?: boolean;
strokeWidth?: number;
}

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

0 comments on commit 36a54d3

Please sign in to comment.