Skip to content

Commit

Permalink
Update CDK to new API
Browse files Browse the repository at this point in the history
  • Loading branch information
jelbourn committed Mar 16, 2018
1 parent eba7cd0 commit acd9505
Show file tree
Hide file tree
Showing 20 changed files with 62 additions and 85 deletions.
60 changes: 23 additions & 37 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
"node": ">= 5.4.1"
},
"dependencies": {
"@angular/animations": ">=6.0.0-beta.7 <7.0.0",
"@angular/common": ">=6.0.0-beta.7 <7.0.0",
"@angular/compiler": ">=6.0.0-beta.7 <7.0.0",
"@angular/core": ">=6.0.0-beta.7 <7.0.0",
"@angular/forms": ">=6.0.0-beta.7 <7.0.0",
"@angular/platform-browser": ">=6.0.0-beta.7 <7.0.0",
"@angular/animations": "git@github.com:angular/animations-builds#6.0.0-beta.7+112431d",
"@angular/common": "git@github.com:angular/common-builds#6.0.0-beta.7+112431d",
"@angular/compiler": "git@github.com:angular/compiler-builds#6.0.0-beta.7+112431d",
"@angular/core": "git@github.com:angular/core-builds#6.0.0-beta.7+112431d",
"@angular/forms": "git@github.com:angular/forms-builds#6.0.0-beta.7+112431d",
"@angular/platform-browser": "git@github.com:angular/platform-browser-builds#6.0.0-beta.7+112431d",
"core-js": "^2.4.1",
"rxjs": "^5.5.7",
"systemjs": "0.19.43",
Expand All @@ -42,11 +42,11 @@
"devDependencies": {
"@angular-devkit/core": "^0.4.5",
"@angular-devkit/schematics": "^0.4.5",
"@angular/bazel": ">=6.0.0-beta.7 <7.0.0",
"@angular/compiler-cli": ">=6.0.0-beta.7 <7.0.0",
"@angular/http": ">=6.0.0-beta.7 <7.0.0",
"@angular/platform-browser-dynamic": ">=6.0.0-beta.7 <7.0.0",
"@angular/platform-server": ">=6.0.0-beta.7 <7.0.0",
"@angular/bazel": "git@github.com:angular/bazel-builds#6.0.0-beta.7+112431d",
"@angular/compiler-cli": "git@github.com:angular/compiler-cli-builds#6.0.0-beta.7+112431d",
"@angular/http": "git@github.com:angular/http-builds#6.0.0-beta.7+112431d",
"@angular/platform-browser-dynamic": "git@github.com:angular/platform-browser-dynamic-builds#6.0.0-beta.7+112431d",
"@angular/platform-server": "git@github.com:angular/platform-server-builds#6.0.0-beta.7+112431d",
"@angular/router": ">=6.0.0-beta.7 <7.0.0",
"@angular/upgrade": "^5.0.1",
"@bazel/ibazel": "0.3.1",
Expand Down Expand Up @@ -126,7 +126,7 @@
"tsconfig-paths": "^2.3.0",
"tslint": "^5.9.1",
"tsutils": "^2.6.0",
"typescript": "~2.6.0",
"typescript": "~2.7.0",
"uglify-js": "^2.8.14",
"web-animations-js": "^2.2.5"
}
Expand Down
3 changes: 1 addition & 2 deletions src/cdk/a11y/aria-describer/aria-describer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {DOCUMENT} from '@angular/common';
import {
APP_ROOT_SCOPE,
Inject,
Injectable,
InjectionToken,
Expand Down Expand Up @@ -54,7 +53,7 @@ let messagesContainer: HTMLElement | null = null;
* content.
* @docs-private
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class AriaDescriber {
private _document: Document;

Expand Down
3 changes: 1 addition & 2 deletions src/cdk/a11y/focus-monitor/focus-monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {Platform, supportsPassiveEventListeners} from '@angular/cdk/platform';
import {
APP_ROOT_SCOPE,
Directive,
ElementRef,
EventEmitter,
Expand Down Expand Up @@ -41,7 +40,7 @@ type MonitoredElementInfo = {


/** Monitors mouse and keyboard events to determine the cause of focus events. */
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class FocusMonitor implements OnDestroy {
/** The focus origin that the next focus event is a result of. */
private _origin: FocusOrigin = null;
Expand Down
3 changes: 1 addition & 2 deletions src/cdk/a11y/focus-trap/focus-trap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {DOCUMENT} from '@angular/common';
import {
AfterContentInit,
APP_ROOT_SCOPE,
Directive,
ElementRef,
Inject,
Expand Down Expand Up @@ -279,7 +278,7 @@ export class FocusTrap {


/** Factory that allows easy instantiation of focus traps. */
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class FocusTrapFactory {
private _document: Document;

Expand Down
4 changes: 2 additions & 2 deletions src/cdk/a11y/interactivity-checker/interactivity-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {Platform} from '@angular/cdk/platform';
import {APP_ROOT_SCOPE, Injectable} from '@angular/core';
import {Injectable} from '@angular/core';


// The InteractivityChecker leans heavily on the ally.js accessibility utilities.
Expand All @@ -18,7 +18,7 @@ import {APP_ROOT_SCOPE, Injectable} from '@angular/core';
* Utility for checking the interactivity of an element, such as whether is is focusable or
* tabbable.
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class InteractivityChecker {

constructor(private _platform: Platform) {}
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/a11y/live-announcer/live-announcer-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* found in the LICENSE file at https://angular.io/license
*/

import {APP_ROOT_SCOPE, InjectionToken} from '@angular/core';
import {InjectionToken} from '@angular/core';

// The token for the live announcer element is defined in a separate file from LiveAnnouncer
// as a workaround for https://github.com/angular/angular/issues/22559

export const LIVE_ANNOUNCER_ELEMENT_TOKEN =
new InjectionToken<HTMLElement | null>('liveAnnouncerElement', {
scope: APP_ROOT_SCOPE,
providedIn: 'root',
factory: () => null,
});
3 changes: 1 addition & 2 deletions src/cdk/a11y/live-announcer/live-announcer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {DOCUMENT} from '@angular/common';
import {
APP_ROOT_SCOPE,
Inject,
Injectable,
OnDestroy,
Expand All @@ -22,7 +21,7 @@ import {LIVE_ANNOUNCER_ELEMENT_TOKEN} from './live-announcer-token';
/** Possible politeness levels. */
export type AriaLivePoliteness = 'off' | 'polite' | 'assertive';

@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class LiveAnnouncer implements OnDestroy {
private readonly _liveElement: Element;

Expand Down
4 changes: 2 additions & 2 deletions src/cdk/bidi/dir-document-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {DOCUMENT} from '@angular/common';
import {APP_ROOT_SCOPE, inject, InjectionToken} from '@angular/core';
import {inject, InjectionToken} from '@angular/core';


/**
Expand All @@ -26,6 +26,6 @@ import {APP_ROOT_SCOPE, inject, InjectionToken} from '@angular/core';
* @docs-private
*/
export const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {
scope: APP_ROOT_SCOPE,
providedIn: 'root',
factory: () => inject(DOCUMENT),
});
4 changes: 2 additions & 2 deletions src/cdk/bidi/directionality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {APP_ROOT_SCOPE, EventEmitter, Inject, Injectable, Optional} from '@angular/core';
import {EventEmitter, Inject, Injectable, Optional} from '@angular/core';
import {DIR_DOCUMENT} from './dir-document-token';


Expand All @@ -17,7 +17,7 @@ export type Direction = 'ltr' | 'rtl';
* The directionality (LTR / RTL) context for the application (or a subtree of it).
* Exposes the current direction and a stream of direction changes.
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class Directionality {
/** The current 'ltr' or 'rtl' value. */
readonly value: Direction = 'ltr';
Expand Down
4 changes: 2 additions & 2 deletions src/cdk/collections/unique-selection-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {APP_ROOT_SCOPE, Injectable, OnDestroy} from '@angular/core';
import {Injectable, OnDestroy} from '@angular/core';


// Users of the Dispatcher never need to see this type, but TypeScript requires it to be exported.
Expand All @@ -21,7 +21,7 @@ export type UniqueSelectionDispatcherListener = (id: string, name: string) => vo
* This service does not *store* any IDs and names because they may change at any time, so it is
* less error-prone if they are simply passed through when the events occur.
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class UniqueSelectionDispatcher implements OnDestroy {
private _listeners: UniqueSelectionDispatcherListener[] = [];

Expand Down
3 changes: 1 addition & 2 deletions src/cdk/observers/observe-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import {coerceBooleanProperty} from '@angular/cdk/coercion';
import {
AfterContentInit,
APP_ROOT_SCOPE,
Directive,
ElementRef,
EventEmitter,
Expand All @@ -30,7 +29,7 @@ import {Subject} from 'rxjs/Subject';
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
* @docs-private
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class MutationObserverFactory {
create(callback: MutationCallback): MutationObserver | null {
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);
Expand Down
3 changes: 1 addition & 2 deletions src/cdk/overlay/keyboard/overlay-keyboard-dispatcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {DOCUMENT} from '@angular/common';
import {
APP_ROOT_SCOPE,
Inject,
Injectable,
InjectionToken,
Expand All @@ -24,7 +23,7 @@ import {OverlayRef} from '../overlay-ref';
* if any. It maintains a list of attached overlays to determine best suited overlay based
* on event target and order of overlay opens.
*/
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class OverlayKeyboardDispatcher implements OnDestroy {

/** Currently attached overlays in the order they were attached. */
Expand Down
3 changes: 1 addition & 2 deletions src/cdk/overlay/overlay-container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import {DOCUMENT} from '@angular/common';
import {
APP_ROOT_SCOPE,
Inject,
Injectable,
InjectionToken,
Expand All @@ -19,7 +18,7 @@ import {


/** Container inside which all overlays will render. */
@Injectable({scope: APP_ROOT_SCOPE})
@Injectable({providedIn: 'root'})
export class OverlayContainer implements OnDestroy {
protected _containerElement: HTMLElement;

Expand Down

0 comments on commit acd9505

Please sign in to comment.