Skip to content

Commit bc10a87

Browse files
committed
fix(material/tooltip): remove deprecated factory functions
Removes factory functions that we had marked as deprecated for v21. These functions aren't necessary since we switched to standalone. BREAKING CHANGE: * `MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY` has been removed. * `MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY` has been removed. * `MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER` has been removed.
1 parent a5a7c12 commit bc10a87

File tree

3 files changed

+6
-54
lines changed

3 files changed

+6
-54
lines changed

goldens/material/tooltip/index.api.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,9 @@ export function getMatTooltipInvalidPositionError(position: string): Error;
2929
// @public
3030
export const MAT_TOOLTIP_DEFAULT_OPTIONS: InjectionToken<MatTooltipDefaultOptions>;
3131

32-
// @public @deprecated
33-
export function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY(): MatTooltipDefaultOptions;
34-
3532
// @public
3633
export const MAT_TOOLTIP_SCROLL_STRATEGY: InjectionToken<() => ScrollStrategy>;
3734

38-
// @public @deprecated
39-
export function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(_overlay: unknown): () => ScrollStrategy;
40-
41-
// @public @deprecated
42-
export const MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER: {
43-
provide: InjectionToken<() => ScrollStrategy>;
44-
deps: any[];
45-
useFactory: typeof MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY;
46-
};
47-
4835
// @public
4936
export class MatTooltip implements OnDestroy, AfterViewInit {
5037
constructor(...args: unknown[]);

src/material/tooltip/tooltip-module.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@ import {A11yModule} from '@angular/cdk/a11y';
1111
import {OverlayModule} from '@angular/cdk/overlay';
1212
import {CdkScrollableModule} from '@angular/cdk/scrolling';
1313
import {MatCommonModule} from '../core';
14-
import {
15-
MatTooltip,
16-
TooltipComponent,
17-
MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER,
18-
} from './tooltip';
14+
import {MatTooltip, TooltipComponent} from './tooltip';
1915

2016
@NgModule({
2117
imports: [A11yModule, OverlayModule, MatCommonModule, MatTooltip, TooltipComponent],
2218
exports: [MatTooltip, TooltipComponent, MatCommonModule, CdkScrollableModule],
23-
providers: [MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER],
2419
})
2520
export class MatTooltipModule {}

src/material/tooltip/tooltip.ts

Lines changed: 5 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -90,46 +90,16 @@ export const MAT_TOOLTIP_SCROLL_STRATEGY = new InjectionToken<() => ScrollStrate
9090
},
9191
);
9292

93-
/**
94-
* @docs-private
95-
* @deprecated No longer used, will be removed.
96-
* @breaking-change 21.0.0
97-
*/
98-
export function MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY(_overlay: unknown): () => ScrollStrategy {
99-
const injector = inject(Injector);
100-
return () => createRepositionScrollStrategy(injector, {scrollThrottle: SCROLL_THROTTLE_MS});
101-
}
102-
103-
/**
104-
* @docs-private
105-
* @deprecated No longer used, will be removed.
106-
* @breaking-change 21.0.0
107-
*/
108-
export const MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY_PROVIDER = {
109-
provide: MAT_TOOLTIP_SCROLL_STRATEGY,
110-
deps: [] as any[],
111-
useFactory: MAT_TOOLTIP_SCROLL_STRATEGY_FACTORY,
112-
};
113-
114-
/**
115-
* @docs-private
116-
* @deprecated No longer used, will be removed.
117-
* @breaking-change 21.0.0
118-
*/
119-
export function MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY(): MatTooltipDefaultOptions {
120-
return {
121-
showDelay: 0,
122-
hideDelay: 0,
123-
touchendHideDelay: 1500,
124-
};
125-
}
126-
12793
/** Injection token to be used to override the default options for `matTooltip`. */
12894
export const MAT_TOOLTIP_DEFAULT_OPTIONS = new InjectionToken<MatTooltipDefaultOptions>(
12995
'mat-tooltip-default-options',
13096
{
13197
providedIn: 'root',
132-
factory: MAT_TOOLTIP_DEFAULT_OPTIONS_FACTORY,
98+
factory: () => ({
99+
showDelay: 0,
100+
hideDelay: 0,
101+
touchendHideDelay: 1500,
102+
}),
133103
},
134104
);
135105

0 commit comments

Comments
 (0)