File tree 3 files changed +3
-57
lines changed 3 files changed +3
-57
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import {
20
20
ChangeDetectionStrategy ,
21
21
} from '@angular/core' ;
22
22
import { MdOption } from '../core' ;
23
- import { ActiveDescendantKeyManager } from '../core /a11y/activedescendant-key-manager ' ;
23
+ import { ActiveDescendantKeyManager } from '@angular/cdk /a11y' ;
24
24
25
25
/**
26
26
* Autocomplete IDs need to be unique across components, so this counter exists outside of
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { ListKeyManager , ListKeyManagerOption } from './list-key-manager' ;
10
-
11
- /**
12
- * This is the interface for highlightable items (used by the ActiveDescendantKeyManager).
13
- * Each item must know how to style itself as active or inactive and whether or not it is
14
- * currently disabled.
15
- */
16
- export interface Highlightable extends ListKeyManagerOption {
17
- setActiveStyles ( ) : void ;
18
- setInactiveStyles ( ) : void ;
19
- }
20
-
21
- export class ActiveDescendantKeyManager < T > extends ListKeyManager < Highlightable & T > {
22
-
23
- /**
24
- * This method sets the active item to the item at the specified index.
25
- * It also adds active styles to the newly active item and removes active
26
- * styles from the previously active item.
27
- */
28
- setActiveItem ( index : number ) : void {
29
- Promise . resolve ( ) . then ( ( ) => {
30
- if ( this . activeItem ) {
31
- this . activeItem . setInactiveStyles ( ) ;
32
- }
33
- super . setActiveItem ( index ) ;
34
- if ( this . activeItem ) {
35
- this . activeItem . setActiveStyles ( ) ;
36
- }
37
- } ) ;
38
- }
39
-
40
- }
9
+ export { ActiveDescendantKeyManager , Highlightable } from '@angular/cdk/a11y' ;
Original file line number Diff line number Diff line change 6
6
* found in the LICENSE file at https://angular.io/license
7
7
*/
8
8
9
- import { ListKeyManager , ListKeyManagerOption } from './list-key-manager' ;
10
-
11
- /**
12
- * This is the interface for focusable items (used by the FocusKeyManager).
13
- * Each item must know how to focus itself, whether or not it is currently disabled
14
- * and be able to supply it's label.
15
- */
16
- export interface FocusableOption extends ListKeyManagerOption {
17
- focus ( ) : void ;
18
- }
19
-
20
- export class FocusKeyManager < T > extends ListKeyManager < FocusableOption & T > {
21
- /**
22
- * This method sets the active item to the item at the specified index.
23
- * It also adds focuses the newly active item.
24
- */
25
- setActiveItem ( index : number ) : void {
26
- super . setActiveItem ( index ) ;
27
-
28
- if ( this . activeItem ) {
29
- this . activeItem . focus ( ) ;
30
- }
31
- }
32
- }
9
+ export { FocusKeyManager , FocusableOption } from '@angular/cdk/a11y' ;
You can’t perform that action at this time.
0 commit comments