Skip to content

Commit 5afe24d

Browse files
committed
fix(material/legacy-dialog): deprecate all ts symbols
1 parent ecdabb8 commit 5afe24d

File tree

13 files changed

+137
-27
lines changed

13 files changed

+137
-27
lines changed

src/material/legacy-dialog/dialog-animations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
/**
1010
* Default parameters for the animation for backwards compatibility.
1111
* @docs-private
12+
* @deprecated Use `defaultParams` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
13+
* @breaking-change 17.0.0
1214
*/
1315
export const defaultParams = {
1416
params: {enterAnimationDuration: '150ms', exitAnimationDuration: '75ms'},

src/material/legacy-dialog/dialog-config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
import {MatDialogConfig as DialogConfigBase, _defaultParams} from '@angular/material/dialog';
1010

11+
/**
12+
* @deprecated Use `MatDialogConfig` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
13+
* @breaking-change 17.0.0
14+
*/
1115
export class MatLegacyDialogConfig<D = any> extends DialogConfigBase<D> {
1216
/** Duration of the enter animation. Has to be a valid CSS value (e.g. 100ms). */
1317
override enterAnimationDuration?: string = _defaultParams.params.enterAnimationDuration;

src/material/legacy-dialog/dialog-container.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ import {_MatDialogContainerBase, matDialogAnimations} from '@angular/material/di
2828
* Internal component that wraps user-provided dialog content.
2929
* Animation is based on https://material.io/guidelines/motion/choreography.html.
3030
* @docs-private
31+
* @deprecated Use `MatDialogContainer` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
32+
* @breaking-change 17.0.0
3133
*/
3234
@Component({
3335
selector: 'mat-dialog-container',

src/material/legacy-dialog/dialog-content-directives.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ let dialogElementUid = 0;
2424

2525
/**
2626
* Button that will close the current dialog.
27+
* @deprecated Use `MatDialogClose` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
28+
* @breaking-change 17.0.0
2729
*/
2830
@Directive({
2931
selector: '[mat-dialog-close], [matDialogClose]',
@@ -93,6 +95,8 @@ export class MatLegacyDialogClose implements OnInit, OnChanges {
9395

9496
/**
9597
* Title of a dialog element. Stays fixed to the top of the dialog when scrolling.
98+
* @deprecated Use `MatDialogTitle` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
99+
* @breaking-change 17.0.0
96100
*/
97101
@Directive({
98102
selector: '[mat-dialog-title], [matDialogTitle]',
@@ -133,6 +137,8 @@ export class MatLegacyDialogTitle implements OnInit {
133137

134138
/**
135139
* Scrollable content container of a dialog.
140+
* @deprecated Use `MatDialogContent` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
141+
* @breaking-change 17.0.0
136142
*/
137143
@Directive({
138144
selector: `[mat-dialog-content], mat-dialog-content, [matDialogContent]`,
@@ -143,6 +149,8 @@ export class MatLegacyDialogContent {}
143149
/**
144150
* Container for the bottom action buttons in a dialog.
145151
* Stays fixed to the bottom when scrolling.
152+
* @deprecated Use `MatDialogActions` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
153+
* @breaking-change 17.0.0
146154
*/
147155
@Directive({
148156
selector: `[mat-dialog-actions], mat-dialog-actions, [matDialogActions]`,

src/material/legacy-dialog/dialog-module.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ import {
2020
MatLegacyDialogTitle,
2121
} from './dialog-content-directives';
2222

23+
/**
24+
* @deprecated Use `MatDialogModule` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
25+
* @breaking-change 17.0.0
26+
*/
2327
@NgModule({
2428
imports: [DialogModule, OverlayModule, PortalModule, MatCommonModule],
2529
exports: [

src/material/legacy-dialog/dialog-ref.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,7 @@ import {MatDialogRef as NewDialogRef} from '@angular/material/dialog';
1010

1111
/**
1212
* Reference to a dialog opened via the MatDialog service.
13+
* @deprecated Use `MatDialogRef` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
14+
* @breaking-change 17.0.0
1315
*/
1416
export class MatLegacyDialogRef<T, R = any> extends NewDialogRef<T, R> {}

src/material/legacy-dialog/dialog.ts

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,47 @@ import {_MatDialogBase} from '@angular/material/dialog';
1515
import {MatLegacyDialogRef} from './dialog-ref';
1616
import {MatLegacyDialogConfig} from './dialog-config';
1717

18-
/** Injection token that can be used to access the data that was passed in to a dialog. */
18+
/**
19+
* Injection token that can be used to access the data that was passed in to a dialog.
20+
* @deprecated Use `MAT_DIALOG_DATA` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
21+
* @breaking-change 17.0.0
22+
*/
1923
export const MAT_LEGACY_DIALOG_DATA = new InjectionToken<any>('MatDialogData');
2024

21-
/** Injection token that can be used to specify default dialog options. */
25+
/**
26+
* Injection token that can be used to specify default dialog options.
27+
* @deprecated Use `MAT_DIALOG_DEFAULT_OPTIONS` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
28+
* @breaking-change 17.0.0
29+
*/
2230
export const MAT_LEGACY_DIALOG_DEFAULT_OPTIONS = new InjectionToken<MatLegacyDialogConfig>(
2331
'mat-dialog-default-options',
2432
);
2533

26-
/** Injection token that determines the scroll handling while the dialog is open. */
34+
/**
35+
* Injection token that determines the scroll handling while the dialog is open.
36+
* @deprecated Use `MAT_DIALOG_SCROLL_STRATEGY` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
37+
* @breaking-change 17.0.0
38+
*/
2739
export const MAT_LEGACY_DIALOG_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrategy>(
2840
'mat-dialog-scroll-strategy',
2941
);
3042

31-
/** @docs-private */
43+
/**
44+
* @docs-private
45+
* @deprecated Use `MAT_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
46+
* @breaking-change 17.0.0
47+
*/
3248
export function MAT_LEGACY_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY(
3349
overlay: Overlay,
3450
): () => ScrollStrategy {
3551
return () => overlay.scrollStrategies.block();
3652
}
3753

38-
/** @docs-private */
54+
/**
55+
* @docs-private
56+
* @deprecated Use `MAT_DIALOG_SCROLL_STRATEGY_PROVIDER` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
57+
* @breaking-change 17.0.0
58+
*/
3959
export const MAT_LEGACY_DIALOG_SCROLL_STRATEGY_PROVIDER = {
4060
provide: MAT_LEGACY_DIALOG_SCROLL_STRATEGY,
4161
deps: [Overlay],
@@ -44,6 +64,8 @@ export const MAT_LEGACY_DIALOG_SCROLL_STRATEGY_PROVIDER = {
4464

4565
/**
4666
* Service to open Material Design modal dialogs.
67+
* @deprecated Use `MatDialog` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
68+
* @breaking-change 17.0.0
4769
*/
4870
@Injectable()
4971
export class MatLegacyDialog extends _MatDialogBase<MatLegacyDialogContainer> {

src/material/legacy-dialog/public-api.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,57 @@ export {
2525
export {MatLegacyDialogRef} from './dialog-ref';
2626
export {MatLegacyDialogConfig} from './dialog-config';
2727
export {
28+
/**
29+
* @deprecated Use `_MatDialogBase` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
30+
* @breaking-change 17.0.0
31+
*/
2832
_MatDialogBase as _MatLegacyDialogBase,
33+
34+
/**
35+
* @deprecated Use `_MatDialogContainerBase` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
36+
* @breaking-change 17.0.0
37+
*/
2938
_MatDialogContainerBase as _MatLegacyDialogContainerBase,
39+
40+
/**
41+
* @deprecated Use `AutoFocusTarget` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
42+
* @breaking-change 17.0.0
43+
*/
3044
AutoFocusTarget as LegacyAutoFocusTarget,
45+
46+
/**
47+
* @deprecated Use `DialogRole` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
48+
* @breaking-change 17.0.0
49+
*/
3150
DialogRole as LegacyDialogRole,
51+
52+
/**
53+
* @deprecated Use `DialogPosition` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
54+
* @breaking-change 17.0.0
55+
*/
3256
DialogPosition as LegacyDialogPosition,
57+
58+
/**
59+
* @deprecated Use `_closeDialogVia` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
60+
* @breaking-change 17.0.0
61+
*/
3362
_closeDialogVia as _closeLegacyDialogVia,
63+
64+
/**
65+
* @deprecated Use `MatDialogState` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
66+
* @breaking-change 17.0.0
67+
*/
3468
MatDialogState as MatLegacyDialogState,
69+
70+
/**
71+
* @deprecated Use `matDialogAnimations` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
72+
* @breaking-change 17.0.0
73+
*/
3574
matDialogAnimations as matLegacyDialogAnimations,
75+
76+
/**
77+
* @deprecated Use `MAT_DIALOG_SCROLL_STRATEGY_FACTORY` from `@angular/material/dialog` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
78+
* @breaking-change 17.0.0
79+
*/
3680
MAT_DIALOG_SCROLL_STRATEGY_FACTORY as MAT_LEGACY_DIALOG_SCROLL_STRATEGY_FACTORY,
3781
} from '@angular/material/dialog';

src/material/legacy-dialog/testing/dialog-harness.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@
99
import {HarnessPredicate} from '@angular/cdk/testing';
1010
import {_MatDialogHarnessBase, DialogHarnessFilters} from '@angular/material/dialog/testing';
1111

12-
/** Selectors for different sections of the mat-dialog that can contain user content. */
12+
/**
13+
* Selectors for different sections of the mat-dialog that can contain user content.
14+
* @deprecated Use `enum` from `@angular/material/dialog/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
15+
* @breaking-change 17.0.0
16+
*/
1317
export const enum MatLegacyDialogSection {
1418
TITLE = '.mat-dialog-title',
1519
CONTENT = '.mat-dialog-content',
1620
ACTIONS = '.mat-dialog-actions',
1721
}
1822

19-
/** Harness for interacting with a standard `MatDialog` in tests. */
23+
/**
24+
* Harness for interacting with a standard `MatDialog` in tests.
25+
* @deprecated Use `MatDialogHarness` from `@angular/material/dialog/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
26+
* @breaking-change 17.0.0
27+
*/
2028
export class MatLegacyDialogHarness extends _MatDialogHarnessBase {
2129
// Developers can provide a custom component or template for the
2230
// dialog. The canonical dialog parent is the "MatDialogContainer".

src/material/legacy-dialog/testing/dialog-opener.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ import {
1717
import {NoopAnimationsModule} from '@angular/platform-browser/animations';
1818
import {_MatTestDialogOpenerBase} from '@angular/material/dialog/testing';
1919

20-
/** Test component that immediately opens a dialog when created. */
20+
/**
21+
* Test component that immediately opens a dialog when created.
22+
* @deprecated Use `MatTestDialogOpener` from `@angular/material/dialog/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
23+
* @breaking-change 17.0.0
24+
*/
2125
@Component({
2226
selector: 'mat-test-dialog-opener',
2327
template: '',
@@ -44,6 +48,10 @@ export class MatTestLegacyDialogOpener<T = unknown, R = unknown> extends _MatTes
4448
}
4549
}
4650

51+
/**
52+
* @deprecated Use `MatTestDialogOpenerModule` from `@angular/material/dialog/testing` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.
53+
* @breaking-change 17.0.0
54+
*/
4755
@NgModule({
4856
declarations: [MatTestLegacyDialogOpener],
4957
imports: [MatLegacyDialogModule, NoopAnimationsModule],

0 commit comments

Comments
 (0)