Skip to content

Commit 0363236

Browse files
authored
refactor(bottom-sheet): remove deprecated APIs for v11 (#20546)
Removes the APIs that were marked as deprecated for v11. BREAKING CHANGES: * `_location` parameter has been removed from the `MatBottomSheet` constructor. * `_location` parameter has been removed from the `MatBottomSheetRef` constructor.
1 parent 2c83b40 commit 0363236

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/material/bottom-sheet/bottom-sheet-ref.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Location} from '@angular/common';
109
import {ESCAPE, hasModifierKey} from '@angular/cdk/keycodes';
1110
import {OverlayRef} from '@angular/cdk/overlay';
1211
import {merge, Observable, Subject} from 'rxjs';
@@ -44,9 +43,7 @@ export class MatBottomSheetRef<T = any, R = any> {
4443

4544
constructor(
4645
containerInstance: MatBottomSheetContainer,
47-
private _overlayRef: OverlayRef,
48-
// @breaking-change 8.0.0 `_location` parameter to be removed.
49-
_location?: Location) {
46+
private _overlayRef: OverlayRef) {
5047
this.containerInstance = containerInstance;
5148
this.disableClose = containerInstance.bottomSheetConfig.disableClose;
5249

src/material/bottom-sheet/bottom-sheet.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
OnDestroy,
2222
StaticProvider,
2323
} from '@angular/core';
24-
import {Location} from '@angular/common';
2524
import {of as observableOf} from 'rxjs';
2625
import {MAT_BOTTOM_SHEET_DATA, MatBottomSheetConfig} from './bottom-sheet-config';
2726
import {MatBottomSheetContainer} from './bottom-sheet-container';
@@ -58,7 +57,6 @@ export class MatBottomSheet implements OnDestroy {
5857
private _overlay: Overlay,
5958
private _injector: Injector,
6059
@Optional() @SkipSelf() private _parentBottomSheet: MatBottomSheet,
61-
@Optional() private _location?: Location,
6260
@Optional() @Inject(MAT_BOTTOM_SHEET_DEFAULT_OPTIONS)
6361
private _defaultOptions?: MatBottomSheetConfig) {}
6462

@@ -74,7 +72,7 @@ export class MatBottomSheet implements OnDestroy {
7472
_applyConfigDefaults(this._defaultOptions || new MatBottomSheetConfig(), config);
7573
const overlayRef = this._createOverlay(_config);
7674
const container = this._attachContainer(overlayRef, _config);
77-
const ref = new MatBottomSheetRef<T, R>(container, overlayRef, this._location);
75+
const ref = new MatBottomSheetRef<T, R>(container, overlayRef);
7876

7977
if (componentOrTemplateRef instanceof TemplateRef) {
8078
container.attachTemplatePortal(new TemplatePortal<T>(componentOrTemplateRef, null!, {

src/material/schematics/ng-update/data/constructor-checks.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ export const constructorChecks: VersionChanges<ConstructorChecksUpgradeData> = {
2222
{
2323
pr: 'https://github.com/angular/components/pull/20449',
2424
changes: ['MatDatepickerContent']
25+
},
26+
{
27+
pr: 'https://github.com/angular/components/pull/20545',
28+
changes: ['MatBottomSheet', 'MatBottomSheetRef']
2529
}
2630
],
2731
[TargetVersion.V10]: [

tools/public_api_guard/material/bottom-sheet.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ export declare const MAT_BOTTOM_SHEET_DEFAULT_OPTIONS: InjectionToken<MatBottomS
55
export declare class MatBottomSheet implements OnDestroy {
66
get _openedBottomSheetRef(): MatBottomSheetRef<any> | null;
77
set _openedBottomSheetRef(value: MatBottomSheetRef<any> | null);
8-
constructor(_overlay: Overlay, _injector: Injector, _parentBottomSheet: MatBottomSheet, _location?: Location | undefined, _defaultOptions?: MatBottomSheetConfig<any> | undefined);
8+
constructor(_overlay: Overlay, _injector: Injector, _parentBottomSheet: MatBottomSheet, _defaultOptions?: MatBottomSheetConfig<any> | undefined);
99
dismiss<R = any>(result?: R): void;
1010
ngOnDestroy(): void;
1111
open<T, D = any, R = any>(component: ComponentType<T>, config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;
1212
open<T, D = any, R = any>(template: TemplateRef<T>, config?: MatBottomSheetConfig<D>): MatBottomSheetRef<T, R>;
13-
static ɵfac: i0.ɵɵFactoryDef<MatBottomSheet, [null, null, { optional: true; skipSelf: true; }, { optional: true; }, { optional: true; }]>;
13+
static ɵfac: i0.ɵɵFactoryDef<MatBottomSheet, [null, null, { optional: true; skipSelf: true; }, { optional: true; }]>;
1414
static ɵprov: i0.ɵɵInjectableDef<MatBottomSheet>;
1515
}
1616

@@ -61,7 +61,7 @@ export declare class MatBottomSheetRef<T = any, R = any> {
6161
containerInstance: MatBottomSheetContainer;
6262
disableClose: boolean | undefined;
6363
instance: T;
64-
constructor(containerInstance: MatBottomSheetContainer, _overlayRef: OverlayRef, _location?: Location);
64+
constructor(containerInstance: MatBottomSheetContainer, _overlayRef: OverlayRef);
6565
afterDismissed(): Observable<R | undefined>;
6666
afterOpened(): Observable<void>;
6767
backdropClick(): Observable<MouseEvent>;

0 commit comments

Comments
 (0)