From 209bea5e30128550500883f1d811e954c15c35e8 Mon Sep 17 00:00:00 2001 From: crisbeto Date: Thu, 14 May 2020 22:14:25 +0200 Subject: [PATCH] refactor(tooltip): change deprecated APIs for version 10 Changes an API that was marked for deprecation in v10. BREAKING CHANGES: * The `_hammerLoader` paramter has been removed from the `MatTooltip` constructor. --- .../schematics/ng-update/data/constructor-checks.ts | 4 ++++ src/material/tooltip/tooltip.ts | 8 +------- tools/public_api_guard/material/tooltip.d.ts | 5 ++--- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/material/schematics/ng-update/data/constructor-checks.ts b/src/material/schematics/ng-update/data/constructor-checks.ts index 11e86623c10c..4ab810788df5 100644 --- a/src/material/schematics/ng-update/data/constructor-checks.ts +++ b/src/material/schematics/ng-update/data/constructor-checks.ts @@ -30,6 +30,10 @@ export const constructorChecks: VersionChanges = { { pr: 'https://github.com/angular/components/pull/19324', changes: ['MatAutocompleteTrigger'] + }, + { + pr: 'https://github.com/angular/components/pull/19363', + changes: ['MatTooltip'] } ], [TargetVersion.V9]: [ diff --git a/src/material/tooltip/tooltip.ts b/src/material/tooltip/tooltip.ts index a188325427ff..e438cb2274e4 100644 --- a/src/material/tooltip/tooltip.ts +++ b/src/material/tooltip/tooltip.ts @@ -255,13 +255,7 @@ export class MatTooltip implements OnDestroy, OnInit { @Inject(MAT_TOOLTIP_SCROLL_STRATEGY) scrollStrategy: any, @Optional() private _dir: Directionality, @Optional() @Inject(MAT_TOOLTIP_DEFAULT_OPTIONS) - private _defaultOptions: MatTooltipDefaultOptions, - /** - * @deprecated _hammerLoader parameter to be removed. - * @breaking-change 9.0.0 - */ - // Note that we need to give Angular something to inject here so it doesn't throw. - @Inject(ElementRef) _hammerLoader?: any) { + private _defaultOptions: MatTooltipDefaultOptions) { this._scrollStrategy = scrollStrategy; diff --git a/tools/public_api_guard/material/tooltip.d.ts b/tools/public_api_guard/material/tooltip.d.ts index 5fc58a19d78f..4774c9e16828 100644 --- a/tools/public_api_guard/material/tooltip.d.ts +++ b/tools/public_api_guard/material/tooltip.d.ts @@ -32,8 +32,7 @@ export declare class MatTooltip implements OnDestroy, OnInit { [key: string]: any; }); touchGestures: TooltipTouchGestures; - constructor(_overlay: Overlay, _elementRef: ElementRef, _scrollDispatcher: ScrollDispatcher, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _platform: Platform, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, scrollStrategy: any, _dir: Directionality, _defaultOptions: MatTooltipDefaultOptions, - _hammerLoader?: any); + constructor(_overlay: Overlay, _elementRef: ElementRef, _scrollDispatcher: ScrollDispatcher, _viewContainerRef: ViewContainerRef, _ngZone: NgZone, _platform: Platform, _ariaDescriber: AriaDescriber, _focusMonitor: FocusMonitor, scrollStrategy: any, _dir: Directionality, _defaultOptions: MatTooltipDefaultOptions); _getOrigin(): { main: OriginConnectionPosition; fallback: OriginConnectionPosition; @@ -52,7 +51,7 @@ export declare class MatTooltip implements OnDestroy, OnInit { static ngAcceptInputType_hideDelay: NumberInput; static ngAcceptInputType_showDelay: NumberInput; static ɵdir: i0.ɵɵDirectiveDefWithMeta; - static ɵfac: i0.ɵɵFactoryDef; + static ɵfac: i0.ɵɵFactoryDef; } export declare const matTooltipAnimations: {