Skip to content

Commit

Permalink
fix(material/legacy-progress-bar): 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 b6f9d66 commit c3684db
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 18 deletions.
4 changes: 4 additions & 0 deletions src/material/legacy-progress-bar/progress-bar-module.ts
Expand Up @@ -11,6 +11,10 @@ import {CommonModule} from '@angular/common';
import {MatCommonModule} from '@angular/material/core';
import {MatLegacyProgressBar} from './progress-bar';

/**
* @deprecated Use `MatProgressBarModule` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@NgModule({
imports: [CommonModule, MatCommonModule],
exports: [MatLegacyProgressBar, MatCommonModule],
Expand Down
35 changes: 30 additions & 5 deletions src/material/legacy-progress-bar/progress-bar.ts
Expand Up @@ -30,10 +30,13 @@ import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';
import {fromEvent, Observable, Subscription} from 'rxjs';
import {filter} from 'rxjs/operators';

// TODO(josephperrott): Benchpress tests.
// TODO(josephperrott): Add ARIA attributes for progress bar "for".

/** Last animation end data. */
/**
* Last animation end data.
* @deprecated Use `ProgressAnimationEnd` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface LegacyProgressAnimationEnd {
value: number;
}
Expand All @@ -51,6 +54,8 @@ const _MatProgressBarBase = mixinColor(
* Injection token used to provide the current location to `MatProgressBar`.
* Used to handle server-side rendering and to stub out during unit tests.
* @docs-private
* @deprecated Use `MAT_PROGRESS_BAR_LOCATION` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export const MAT_LEGACY_PROGRESS_BAR_LOCATION = new InjectionToken<MatLegacyProgressBarLocation>(
'mat-progress-bar-location',
Expand All @@ -60,12 +65,18 @@ export const MAT_LEGACY_PROGRESS_BAR_LOCATION = new InjectionToken<MatLegacyProg
/**
* Stubbed out location for `MatProgressBar`.
* @docs-private
* @deprecated Use `MatProgressBarLocation` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface MatLegacyProgressBarLocation {
getPathname: () => string;
}

/** @docs-private */
/**
* @docs-private
* @deprecated Use `MAT_PROGRESS_BAR_LOCATION_FACTORY` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export function MAT_LEGACY_PROGRESS_BAR_LOCATION_FACTORY(): MatLegacyProgressBarLocation {
const _document = inject(DOCUMENT);
const _location = _document ? _document.location : null;
Expand All @@ -77,9 +88,17 @@ export function MAT_LEGACY_PROGRESS_BAR_LOCATION_FACTORY(): MatLegacyProgressBar
};
}

/**
* @deprecated Use `ProgressBarMode` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export type LegacyProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';

/** Default `mat-progress-bar` options that can be overridden. */
/**
* Default `mat-progress-bar` options that can be overridden.
* @deprecated Use `MatProgressBarDefaultOptions` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface MatLegacyProgressBarDefaultOptions {
/** Default color of the progress bar. */
color?: ThemePalette;
Expand All @@ -88,7 +107,11 @@ export interface MatLegacyProgressBarDefaultOptions {
mode?: LegacyProgressBarMode;
}

/** Injection token to be used to override the default options for `mat-progress-bar`. */
/**
* Injection token to be used to override the default options for `mat-progress-bar`.
* @deprecated Use `MAT_PROGRESS_BAR_DEFAULT_OPTIONS` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export const MAT_LEGACY_PROGRESS_BAR_DEFAULT_OPTIONS =
new InjectionToken<MatLegacyProgressBarDefaultOptions>('MAT_PROGRESS_BAR_DEFAULT_OPTIONS');

Expand All @@ -97,6 +120,8 @@ let progressbarId = 0;

/**
* `<mat-progress-bar>` component.
* @deprecated Use `MatProgressBar` from `@angular/material/progress-bar` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
@Component({
selector: 'mat-progress-bar',
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 `MatProgressBarHarness` instances. */
/**
* A set of criteria that can be used to filter a list of `MatProgressBarHarness` instances.
* @deprecated Use `ProgressBarHarnessFilters` from `@angular/material/progress-bar/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
* @breaking-change 17.0.0
*/
export interface LegacyProgressBarHarnessFilters extends BaseHarnessFilters {}
Expand Up @@ -10,7 +10,11 @@ import {coerceNumberProperty} from '@angular/cdk/coercion';
import {ComponentHarness, HarnessPredicate} from '@angular/cdk/testing';
import {LegacyProgressBarHarnessFilters} from './progress-bar-harness-filters';

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

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

// @public
// @public @deprecated
export class MatLegacyProgressBarHarness extends ComponentHarness {
getMode(): Promise<string | null>;
getValue(): Promise<number | null>;
Expand Down
18 changes: 9 additions & 9 deletions tools/public_api_guard/material/legacy-progress-bar.md
Expand Up @@ -20,25 +20,25 @@ import { NumberInput } from '@angular/cdk/coercion';
import { OnDestroy } from '@angular/core';
import { ThemePalette } from '@angular/material/core';

// @public
// @public @deprecated
export interface LegacyProgressAnimationEnd {
// (undocumented)
value: number;
}

// @public (undocumented)
// @public @deprecated (undocumented)
export type LegacyProgressBarMode = 'determinate' | 'indeterminate' | 'buffer' | 'query';

// @public
// @public @deprecated
export const MAT_LEGACY_PROGRESS_BAR_DEFAULT_OPTIONS: InjectionToken<MatLegacyProgressBarDefaultOptions>;

// @public
// @public @deprecated
export const MAT_LEGACY_PROGRESS_BAR_LOCATION: InjectionToken<MatLegacyProgressBarLocation>;

// @public
// @public @deprecated
export function MAT_LEGACY_PROGRESS_BAR_LOCATION_FACTORY(): MatLegacyProgressBarLocation;

// @public
// @public @deprecated
export class MatLegacyProgressBar extends _MatProgressBarBase implements CanColor, AfterViewInit, OnDestroy {
constructor(elementRef: ElementRef, _ngZone: NgZone, _animationMode?: string | undefined,
location?: MatLegacyProgressBarLocation, defaults?: MatLegacyProgressBarDefaultOptions,
Expand Down Expand Up @@ -72,19 +72,19 @@ export class MatLegacyProgressBar extends _MatProgressBarBase implements CanColo
static ɵfac: i0.ɵɵFactoryDeclaration<MatLegacyProgressBar, [null, null, { optional: true; }, { optional: true; }, { optional: true; }, null]>;
}

// @public
// @public @deprecated
export interface MatLegacyProgressBarDefaultOptions {
color?: ThemePalette;
mode?: LegacyProgressBarMode;
}

// @public
// @public @deprecated
export interface MatLegacyProgressBarLocation {
// (undocumented)
getPathname: () => string;
}

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

0 comments on commit c3684db

Please sign in to comment.