Skip to content

Commit 2edb141

Browse files
committed
fix: remove cdk re-exports from @angular/material
BREAKING CHANGE: `@angular/material` no longer re-exports symbols from `@angular/cdk`.
1 parent 5ec538e commit 2edb141

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+135
-478
lines changed
File renamed without changes.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import {ComponentFixture, TestBed, async} from '@angular/core/testing';
1+
import {Platform} from '@angular/cdk/platform';
22
import {Component, ViewChild} from '@angular/core';
3-
import {FocusTrapFactory, FocusTrapDirective, FocusTrap} from './focus-trap';
3+
import {async, ComponentFixture, TestBed} from '@angular/core/testing';
4+
import {FocusTrap, FocusTrapDirective, FocusTrapFactory} from './focus-trap';
45
import {InteractivityChecker} from './interactivity-checker';
5-
import {Platform} from '../platform/platform';
66

77

88
describe('FocusTrap', () => {

src/cdk/a11y/interactivity-checker.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
import {Platform} from '@angular/cdk/platform';
12
import {InteractivityChecker} from './interactivity-checker';
2-
import {Platform} from '../platform/platform';
3+
34

45
describe('InteractivityChecker', () => {
56
let testContainerElement: HTMLElement;

src/cdk/a11y/list-key-manager.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import {DOWN_ARROW, TAB, UP_ARROW} from '@angular/cdk/keycodes';
2+
import {first} from '@angular/cdk/rxjs';
13
import {QueryList} from '@angular/core';
24
import {fakeAsync, tick} from '@angular/core/testing';
5+
import {createKeyboardEvent} from '../testing/event-objects';
6+
import {ActiveDescendantKeyManager} from './activedescendant-key-manager';
37
import {FocusKeyManager} from './focus-key-manager';
4-
import {DOWN_ARROW, UP_ARROW, TAB} from '../keycodes/keycodes';
58
import {ListKeyManager} from './list-key-manager';
6-
import {ActiveDescendantKeyManager} from './activedescendant-key-manager';
7-
import {createKeyboardEvent} from '../testing/event-objects';
8-
import {first} from '../rxjs/index';
99

1010

1111
class FakeFocusable {

src/cdk/portal/public_api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@
99
export * from './portal';
1010
export * from './dom-portal-host';
1111
export * from './portal-directives';
12+
export * from './portal-injector';

src/demo-app/snack-bar/snack-bar-demo.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1+
import {Dir} from '@angular/cdk/bidi';
12
import {Component, ViewEncapsulation} from '@angular/core';
23
import {
34
MdSnackBar,
45
MdSnackBarConfig,
56
MdSnackBarHorizontalPosition,
67
MdSnackBarVerticalPosition,
7-
Dir,
88
} from '@angular/material';
99

10+
1011
@Component({
1112
moduleId: module.id,
1213
selector: 'snack-bar-demo',
@@ -24,7 +25,8 @@ export class SnackBarDemo {
2425
horizontalPosition: MdSnackBarHorizontalPosition = 'center';
2526
verticalPosition: MdSnackBarVerticalPosition = 'bottom';
2627

27-
constructor(public snackBar: MdSnackBar, private dir: Dir) { }
28+
constructor(public snackBar: MdSnackBar, private dir: Dir) {
29+
}
2830

2931
open() {
3032
let config = new MdSnackBarConfig();

src/lib/button-toggle/button-toggle.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import '../core/a11y/a11y';
21
@import '../core/style/elevation';
32
@import '../core/style/vendor-prefixes';
43
@import '../core/style/layout-common';

src/lib/button/button.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// TODO(jelbourn): Measure perf benefits for translate3d and will-change.
22
// TODO(jelbourn): Figure out if anchor hover underline actually happens in any browser.
33
@import 'button-base';
4-
@import '../core/a11y/a11y';
4+
@import '../../cdk/a11y/a11y';
55
@import '../core/style/layout-common';
66

77
.mat-button, .mat-icon-button {

src/lib/card/card.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@import '../core/style/variables';
22
@import '../core/style/elevation';
3-
@import '../core/a11y/a11y';
3+
@import '../../cdk/a11y/a11y';
44

55

66
$mat-card-default-padding: 24px !default;

src/lib/chips/chip-input.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {Directive, Output, EventEmitter, ElementRef, Input} from '@angular/core';
109
import {coerceBooleanProperty} from '@angular/cdk/coercion';
11-
import {ENTER} from '@angular/material/core';
10+
import {ENTER} from '@angular/cdk/keycodes';
11+
import {Directive, ElementRef, EventEmitter, Input, Output} from '@angular/core';
1212
import {MdChipList} from './chip-list';
1313

14+
1415
export interface MdChipInputEvent {
1516
input: HTMLInputElement;
1617
value: string;

src/lib/chips/chip-list.ts

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

9+
import {FocusKeyManager} from '@angular/cdk/a11y';
10+
import {Directionality} from '@angular/cdk/bidi';
11+
import {coerceBooleanProperty} from '@angular/cdk/coercion';
12+
import {BACKSPACE, DELETE, LEFT_ARROW, RIGHT_ARROW, UP_ARROW} from '@angular/cdk/keycodes';
913
import {
1014
AfterContentInit,
1115
ChangeDetectionStrategy,
1216
Component,
1317
ContentChildren,
18+
ElementRef,
1419
Input,
15-
QueryList,
16-
ViewEncapsulation,
1720
OnDestroy,
1821
Optional,
19-
ElementRef,
22+
QueryList,
2023
Renderer2,
24+
ViewEncapsulation,
2125
} from '@angular/core';
22-
23-
import {MdChip} from './chip';
24-
import {FocusKeyManager} from '@angular/cdk/a11y';
25-
import {BACKSPACE, DELETE, LEFT_ARROW, RIGHT_ARROW, UP_ARROW} from '@angular/material/core';
26-
import {Directionality} from '@angular/cdk/bidi';
2726
import {Subscription} from 'rxjs/Subscription';
28-
import {coerceBooleanProperty} from '@angular/cdk/coercion';
27+
import {MdChip} from './chip';
28+
2929

3030
/**
3131
* A material design chips component (named ChipList for it's similarity to the List component).

src/lib/chips/chip.ts

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
import {FocusableOption} from '@angular/cdk/a11y';
1010
import {coerceBooleanProperty} from '@angular/cdk/coercion';
11+
import {BACKSPACE, DELETE, SPACE} from '@angular/cdk/keycodes';
1112
import {
1213
ContentChild,
1314
Directive,
@@ -19,26 +20,21 @@ import {
1920
Output,
2021
Renderer2,
2122
} from '@angular/core';
22-
import {
23-
BACKSPACE,
24-
CanColor,
25-
CanDisable,
26-
DELETE,
27-
mixinColor,
28-
mixinDisabled,
29-
SPACE,
30-
} from '@angular/material/core';
23+
import {CanColor, CanDisable, mixinColor, mixinDisabled} from '@angular/material/core';
3124
import {Subject} from 'rxjs/Subject';
3225

26+
3327
export interface MdChipEvent {
3428
chip: MdChip;
3529
}
3630

3731
// Boilerplate for applying mixins to MdChip.
3832
/** @docs-private */
3933
export class MdChipBase {
40-
constructor(public _renderer: Renderer2, public _elementRef: ElementRef) {}
34+
constructor(public _renderer: Renderer2, public _elementRef: ElementRef) {
35+
}
4136
}
37+
4238
export const _MdChipMixinBase = mixinColor(mixinDisabled(MdChipBase), 'primary');
4339

4440

@@ -48,9 +44,10 @@ export const _MdChipMixinBase = mixinColor(mixinDisabled(MdChipBase), 'primary')
4844
*/
4945
@Directive({
5046
selector: `md-basic-chip, [md-basic-chip], mat-basic-chip, [mat-basic-chip]`,
51-
host: {'class': 'mat-basic-chip'}
47+
host: {'class': 'mat-basic-chip'},
5248
})
53-
export class MdBasicChip { }
49+
export class MdBasicChip {
50+
}
5451

5552
/**
5653
* Material design styled Chip component. Used inside the MdChipList component.
@@ -72,44 +69,53 @@ export class MdBasicChip { }
7269
'(keydown)': '_handleKeydown($event)',
7370
'(focus)': '_hasFocus = true',
7471
'(blur)': '_hasFocus = false',
75-
}
72+
},
7673
})
7774
export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestroy, CanColor,
78-
CanDisable {
75+
CanDisable {
7976

8077
@ContentChild(forwardRef(() => MdChipRemove)) _chipRemove: MdChipRemove;
8178

8279
/** Whether the chip is selected. */
83-
@Input() get selected(): boolean { return this._selected; }
80+
@Input()
81+
get selected(): boolean {
82+
return this._selected;
83+
}
84+
8485
set selected(value: boolean) {
8586
this._selected = coerceBooleanProperty(value);
8687
(this.selected ? this.select : this.deselect).emit({chip: this});
8788
}
89+
8890
protected _selected: boolean = false;
8991

9092
/**
9193
* Whether or not the chips are selectable. When a chip is not selectable,
9294
* changes to it's selected state are always ignored.
9395
*/
94-
@Input() get selectable(): boolean {
96+
@Input()
97+
get selectable(): boolean {
9598
return this._selectable;
9699
}
97100

98101
set selectable(value: boolean) {
99102
this._selectable = coerceBooleanProperty(value);
100103
}
104+
101105
protected _selectable: boolean = true;
102106

103107
/**
104108
* Determines whether or not the chip displays the remove styling and emits (remove) events.
105109
*/
106-
@Input() get removable(): boolean {
110+
@Input()
111+
get removable(): boolean {
107112
return this._removable;
108113
}
109114

110115
set removable(value: boolean) {
111116
this._removable = coerceBooleanProperty(value);
112117
}
118+
113119
protected _removable: boolean = true;
114120

115121
/** Whether the chip has focus. */
@@ -224,11 +230,12 @@ export class MdChip extends _MdChipMixinBase implements FocusableOption, OnDestr
224230
selector: '[mdChipRemove], [matChipRemove]',
225231
host: {
226232
'class': 'mat-chip-remove',
227-
'(click)': '_handleClick($event)'
228-
}
233+
'(click)': '_handleClick($event)',
234+
},
229235
})
230236
export class MdChipRemove {
231-
constructor(protected _parentChip: MdChip) {}
237+
constructor(protected _parentChip: MdChip) {
238+
}
232239

233240
/** Calls the parent chip's public `remove()` method if applicable. */
234241
_handleClick() {

src/lib/chips/chips.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import '../core/a11y/a11y';
1+
@import '../../cdk/a11y/a11y';
22
@import '../core/style/elevation';
33

44
$mat-chip-vertical-padding: 7px;

src/lib/core/_core.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// We can use relative imports for imports from the cdk because we bundle everything
22
// up into a single flat scss file for material.
33
@import '../../cdk/overlay/overlay';
4+
@import '../../cdk/a11y/a11y';
45

56
// Core styles that can be used to apply material design treatments to any element.
6-
@import 'a11y/a11y';
77
@import 'style/elevation';
88
@import 'ripple/ripple';
99
@import 'option/option';

src/lib/core/a11y/README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/lib/core/a11y/activedescendant-key-manager.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/fake-mousedown.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/focus-key-manager.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/focus-trap.ts

Lines changed: 0 additions & 19 deletions
This file was deleted.

src/lib/core/a11y/index.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/interactivity-checker.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/list-key-manager.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.

src/lib/core/a11y/live-announcer.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/lib/core/bidi/dir.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)