Skip to content

Commit 7a42c35

Browse files
crisbetojelbourn
authored andcommitted
refactor(a11y): remove 6.0.0 deletion targets (#10325)
Removes the deletion targets for 6.0.0 from the `cdk/a11y` entry point. BREAKING CHANGES: * The `renderer` parameter in `FocusMonitor.monitor` has been removed. * `cdk-focus-trap` which was deprecated in 5.0.0 has been removed. Use `cdkTrapFocus` instead.
1 parent 0af5bca commit 7a42c35

File tree

4 files changed

+4
-69
lines changed

4 files changed

+4
-69
lines changed

src/cdk/a11y/a11y-module.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,14 @@ import {CommonModule} from '@angular/common';
1111
import {NgModule} from '@angular/core';
1212
import {ARIA_DESCRIBER_PROVIDER, AriaDescriber} from './aria-describer/aria-describer';
1313
import {CdkMonitorFocus, FOCUS_MONITOR_PROVIDER} from './focus-monitor/focus-monitor';
14-
import {
15-
CdkTrapFocus,
16-
FocusTrapDeprecatedDirective,
17-
FocusTrapFactory,
18-
} from './focus-trap/focus-trap';
14+
import {CdkTrapFocus, FocusTrapFactory} from './focus-trap/focus-trap';
1915
import {InteractivityChecker} from './interactivity-checker/interactivity-checker';
2016
import {LIVE_ANNOUNCER_PROVIDER} from './live-announcer/live-announcer';
2117

2218
@NgModule({
2319
imports: [CommonModule, PlatformModule],
24-
declarations: [CdkTrapFocus, FocusTrapDeprecatedDirective, CdkMonitorFocus],
25-
exports: [CdkTrapFocus, FocusTrapDeprecatedDirective, CdkMonitorFocus],
20+
declarations: [CdkTrapFocus, CdkMonitorFocus],
21+
exports: [CdkTrapFocus, CdkMonitorFocus],
2622
providers: [
2723
InteractivityChecker,
2824
FocusTrapFactory,

src/cdk/a11y/focus-monitor/focus-monitor.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import {
1515
OnDestroy,
1616
Optional,
1717
Output,
18-
Renderer2,
1918
SkipSelf,
2019
} from '@angular/core';
2120
import {Observable} from 'rxjs/Observable';
@@ -74,31 +73,14 @@ export class FocusMonitor implements OnDestroy {
7473

7574
constructor(private _ngZone: NgZone, private _platform: Platform) {}
7675

77-
/**
78-
* @docs-private
79-
* @deprecated renderer param no longer needed.
80-
* @deletion-target 6.0.0
81-
*/
82-
monitor(element: HTMLElement, renderer: Renderer2, checkChildren: boolean):
83-
Observable<FocusOrigin>;
8476
/**
8577
* Monitors focus on an element and applies appropriate CSS classes.
8678
* @param element The element to monitor
8779
* @param checkChildren Whether to count the element as focused when its children are focused.
8880
* @returns An observable that emits when the focus state of the element changes.
8981
* When the element is blurred, null will be emitted.
9082
*/
91-
monitor(element: HTMLElement, checkChildren?: boolean): Observable<FocusOrigin>;
92-
monitor(
93-
element: HTMLElement,
94-
renderer?: Renderer2 | boolean,
95-
checkChildren?: boolean): Observable<FocusOrigin> {
96-
// TODO(mmalerba): clean up after deprecated signature is removed.
97-
if (!(renderer instanceof Renderer2)) {
98-
checkChildren = renderer;
99-
}
100-
checkChildren = !!checkChildren;
101-
83+
monitor(element: HTMLElement, checkChildren: boolean = false): Observable<FocusOrigin> {
10284
// Do nothing if we're not on the browser platform.
10385
if (!this._platform.isBrowser) {
10486
return observableOf(null);

src/cdk/a11y/focus-trap/focus-trap.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -303,40 +303,6 @@ export class FocusTrapFactory {
303303
}
304304
}
305305

306-
307-
/**
308-
* Directive for trapping focus within a region.
309-
* @docs-private
310-
* @deprecated
311-
* @deletion-target 6.0.0
312-
*/
313-
@Directive({
314-
selector: 'cdk-focus-trap',
315-
})
316-
export class FocusTrapDeprecatedDirective implements OnDestroy, AfterContentInit {
317-
focusTrap: FocusTrap;
318-
319-
/** Whether the focus trap is active. */
320-
@Input()
321-
get disabled(): boolean { return !this.focusTrap.enabled; }
322-
set disabled(val: boolean) {
323-
this.focusTrap.enabled = !coerceBooleanProperty(val);
324-
}
325-
326-
constructor(private _elementRef: ElementRef, private _focusTrapFactory: FocusTrapFactory) {
327-
this.focusTrap = this._focusTrapFactory.create(this._elementRef.nativeElement, true);
328-
}
329-
330-
ngOnDestroy() {
331-
this.focusTrap.destroy();
332-
}
333-
334-
ngAfterContentInit() {
335-
this.focusTrap.attachAnchors();
336-
}
337-
}
338-
339-
340306
/** Directive for trapping focus within a region. */
341307
@Directive({
342308
selector: '[cdkTrapFocus]',

src/cdk/a11y/public-api.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@
55
* Use of this source code is governed by an MIT-style license that can be
66
* found in the LICENSE file at https://angular.io/license
77
*/
8-
import {CdkTrapFocus} from './focus-trap/focus-trap';
9-
10-
118
export * from './aria-describer/aria-describer';
129
export * from './key-manager/activedescendant-key-manager';
1310
export * from './key-manager/focus-key-manager';
@@ -18,9 +15,3 @@ export * from './live-announcer/live-announcer';
1815
export * from './focus-monitor/focus-monitor';
1916
export * from './fake-mousedown';
2017
export * from './a11y-module';
21-
22-
/**
23-
* @deprecated Renamed to CdkTrapFocus.
24-
* @deletion-target 6.0.0
25-
*/
26-
export {CdkTrapFocus as FocusTrapDirective};

0 commit comments

Comments
 (0)