From d0568f9044e5b312abe70523a1d57c0f260a2179 Mon Sep 17 00:00:00 2001 From: Adam Plumer Date: Sat, 21 Oct 2017 20:46:02 -0400 Subject: [PATCH] fix(universal): remove browser check from style-utils - Remove default value of fxLayout to avoid confusion in Universal - Removed browser checks from style-utils since getDOM will always return an implementation with the methods implemented - Added note about getComputedStyle PR pending - Updated RxJS to 5.5.0 and added necessary fixes - Added better null and type checking throughout - Updated LICENSE --- LICENSE | 2 +- build-config.js | 2 +- package.json | 67 ++++++++++--------- src/lib/api/core/base-adapter.spec.ts | 2 +- src/lib/api/core/base-adapter.ts | 2 +- src/lib/api/core/base.ts | 8 ++- src/lib/api/core/renderer-adapter.ts | 2 +- .../api/core/responsive-activation.spec.ts | 2 +- src/lib/api/core/responsive-activation.ts | 19 +++--- src/lib/api/ext/class.spec.ts | 2 +- src/lib/api/ext/class.ts | 2 +- src/lib/api/ext/hide.spec.ts | 2 +- src/lib/api/ext/img-src.spec.ts | 2 +- src/lib/api/ext/img-src.ts | 2 +- src/lib/api/ext/show-hide.ts | 2 +- src/lib/api/ext/show.spec.ts | 2 +- src/lib/api/ext/style.spec.ts | 2 +- src/lib/api/ext/style.ts | 2 +- src/lib/api/flexbox/flex-align.ts | 2 +- src/lib/api/flexbox/flex-fill.ts | 2 +- src/lib/api/flexbox/flex-offset.spec.ts | 2 +- src/lib/api/flexbox/flex-offset.ts | 2 +- src/lib/api/flexbox/flex-order.ts | 2 +- src/lib/api/flexbox/flex.spec.ts | 2 +- src/lib/api/flexbox/flex.ts | 4 +- src/lib/api/flexbox/layout-align.spec.ts | 2 +- src/lib/api/flexbox/layout-align.ts | 2 +- src/lib/api/flexbox/layout-gap.spec.ts | 2 +- src/lib/api/flexbox/layout-gap.ts | 2 +- src/lib/api/flexbox/layout-wrap.ts | 2 +- src/lib/api/flexbox/layout.spec.ts | 2 +- src/lib/api/flexbox/layout.ts | 15 ++--- src/lib/api/index.ts | 2 +- src/lib/index.ts | 2 +- src/lib/media-query/_module.ts | 2 +- .../breakpoints/break-point-registry.spec.ts | 2 +- .../breakpoints/break-point-registry.ts | 14 ++-- .../media-query/breakpoints/break-point.ts | 2 +- .../breakpoints/break-points-provider.ts | 2 +- .../breakpoints/break-points-token.ts | 2 +- .../breakpoints/data/break-points.spec.ts | 2 +- .../breakpoints/data/break-points.ts | 2 +- .../data/orientation-break-points.spec.ts | 2 +- .../data/orientation-break-points.ts | 2 +- src/lib/media-query/index.ts | 2 +- src/lib/media-query/match-media.spec.ts | 2 +- src/lib/media-query/match-media.ts | 26 +++---- src/lib/media-query/media-change.ts | 2 +- src/lib/media-query/media-monitor-provider.ts | 2 +- src/lib/media-query/media-monitor.spec.ts | 2 +- src/lib/media-query/media-monitor.ts | 17 +++-- .../media-query/mock/mock-match-media.spec.ts | 2 +- src/lib/media-query/mock/mock-match-media.ts | 2 +- .../media-query/observable-media-provider.ts | 2 +- src/lib/media-query/observable-media.spec.ts | 20 +++--- src/lib/media-query/observable-media.ts | 20 ++---- src/lib/module.ts | 2 +- src/lib/public-api.ts | 2 +- src/lib/utils/add-alias.ts | 4 +- src/lib/utils/auto-prefixer.spec.ts | 2 +- src/lib/utils/auto-prefixer.ts | 2 +- src/lib/utils/basis-validator.spec.ts | 2 +- src/lib/utils/basis-validator.ts | 2 +- src/lib/utils/breakpoint-tools.spec.ts | 2 +- src/lib/utils/breakpoint-tools.ts | 4 +- src/lib/utils/index.ts | 2 +- src/lib/utils/layout-validator.ts | 4 +- src/lib/utils/object-extend.spec.ts | 2 +- src/lib/utils/object-extend.ts | 2 +- src/lib/utils/style-transforms.spec.ts | 2 +- src/lib/utils/style-transforms.ts | 2 +- src/lib/utils/style-utils.spec.ts | 2 +- src/lib/utils/style-utils.ts | 19 ++---- src/lib/utils/testing/custom-matchers.ts | 2 +- src/lib/utils/testing/dom-tools.ts | 2 +- src/lib/utils/testing/helpers.ts | 2 +- src/lib/version.ts | 2 +- test/karma-test-shim.js | 3 +- tools/package-tools/build-package.ts | 2 +- tools/package-tools/rollup-globals.ts | 17 +---- 80 files changed, 182 insertions(+), 207 deletions(-) diff --git a/LICENSE b/LICENSE index 47bfda24a..113bbc0ba 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License -Copyright (c) 2017 Google, Inc. +Copyright (c) 2017 Google LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/build-config.js b/build-config.js index 26b3f8199..34f91137f 100644 --- a/build-config.js +++ b/build-config.js @@ -10,7 +10,7 @@ const buildVersion = require('./package.json').version; /** License that will be placed inside of all created bundles. */ const buildLicense = `/** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/package.json b/package.json index b3e40e8af..38a540c83 100644 --- a/package.json +++ b/package.json @@ -26,58 +26,59 @@ "node": ">= 5.4.1 <= 8" }, "dependencies": { - "@angular/common": "~4.4.4", - "@angular/compiler": "~4.4.4", - "@angular/core": "~4.4.4", - "@angular/platform-browser": "~4.4.4", - "core-js": "^2.4.1", - "rxjs": "^5.4.2", + + "@angular/common": "^4.4.6", + "@angular/compiler": "^4.4.6", + "@angular/core": "^4.4.6", + "@angular/platform-browser": "^4.4.6", + "core-js": "^2.5.1", + "rxjs": "^5.5.0", "systemjs": "0.19.43", "tsickle": "^0.23.5", - "tslib": "^1.7.1", - "zone.js": "^0.8.12" + "tslib": "^1.8.0", + "zone.js": "^0.8.18" }, "devDependencies": { - "@angular/animations": "~4.4.4", + "@angular/animations": "^4.4.6", "@angular/cdk": "^2.0.0-beta.12", - "@angular/compiler-cli": "~4.4.4", - "@angular/forms": "~4.4.4", - "@angular/http": "~4.4.4", + "@angular/compiler-cli": "^4.4.6", + "@angular/forms": "^4.4.6", + "@angular/http": "^4.4.6", "@angular/material": "^2.0.0-beta.12", - "@angular/platform-browser-dynamic": "~4.4.4", - "@angular/platform-server": "~4.4.4", - "@angular/router": "~4.4.4", - "@angular/tsc-wrapped": "~4.4.4", - "@google-cloud/storage": "^1.1.1", + "@angular/platform-browser-dynamic": "^4.4.6", + "@angular/platform-server": "^4.4.6", + "@angular/router": "^4.4.6", + "@angular/tsc-wrapped": "^4.4.6", + "@google-cloud/storage": "^1.4.0", "@types/chalk": "^0.4.31", "@types/fs-extra": "^3.0.1", - "@types/glob": "^5.0.30", + "@types/glob": "^5.0.33", "@types/gulp": "3.8.32", "@types/hammerjs": "^2.0.34", "@types/jasmine": "2.5.45", "@types/merge2": "^0.3.30", "@types/minimist": "^1.2.0", - "@types/node": "^7.0.21", + "@types/node": "^7.0.46", "@types/run-sequence": "^0.0.29", "@types/rx": "2.5.33", - "axe-core": "^2.3.1", - "axe-webdriverjs": "^1.1.1", + "axe-core": "^2.4.2", + "axe-webdriverjs": "^1.1.5", "chalk": "^1.1.3", "cli-color": "^1.2.0", "dgeni": "^0.4.7", "dgeni-packages": "^0.19.1", - "firebase": "^4.0.0", - "firebase-admin": "^5.0.0", - "firebase-tools": "^3.11.0", + "firebase": "^4.6.0", + "firebase-admin": "^5.4.2", + "firebase-tools": "^3.13.1", "fs-extra": "^3.0.1", "glob": "^7.1.2", "google-closure-compiler": "20170409.0.0", "gulp": "^3.9.1", "gulp-clean": "^0.3.2", - "gulp-clean-css": "^3.3.1", + "gulp-clean-css": "^3.9.0", "gulp-cli": "^1.3.0", "gulp-connect": "^5.0.0", - "gulp-conventional-changelog": "^1.1.3", + "gulp-conventional-changelog": "^1.1.6", "gulp-dom": "^0.9.17", "gulp-flatten": "^0.3.1", "gulp-highlight-files": "^0.0.5", @@ -106,21 +107,21 @@ "minimatch": "^3.0.4", "minimist": "^1.2.0", "prompt-sync": "^4.1.5", - "protractor": "^5.1.2", - "request": "^2.81.0", + "protractor": "^5.2.0", + "request": "^2.83.0", "resolve-bin": "^0.4.0", "rollup": "^0.41.6", - "rollup-plugin-alias": "^1.3.1", + "rollup-plugin-alias": "^1.4.0", "rollup-plugin-node-resolve": "^3.0.0", "run-sequence": "^1.2.2", "scss-bundle": "^2.0.1-beta.7", - "selenium-webdriver": "^3.4.0", + "selenium-webdriver": "^3.6.0", "sorcery": "^0.10.0", "stylelint": "^7.12.0", "ts-node": "^3.0.4", - "tsconfig-paths": "^2.2.0", - "tslint": "^5.7.0", - "tsutils": "^2.6.0", + "tsconfig-paths": "^2.3.0", + "tslint": "^5.8.0", + "tsutils": "^2.12.1", "typescript": "~2.4.2", "uglify-js": "^2.8.14" } diff --git a/src/lib/api/core/base-adapter.spec.ts b/src/lib/api/core/base-adapter.spec.ts index 6790472ce..f07d400bd 100644 --- a/src/lib/api/core/base-adapter.spec.ts +++ b/src/lib/api/core/base-adapter.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/core/base-adapter.ts b/src/lib/api/core/base-adapter.ts index abc8d73b4..38f498d7e 100644 --- a/src/lib/api/core/base-adapter.ts +++ b/src/lib/api/core/base-adapter.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/core/base.ts b/src/lib/api/core/base.ts index abc826a1e..ef5e899ae 100644 --- a/src/lib/api/core/base.ts +++ b/src/lib/api/core/base.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -192,7 +192,9 @@ export abstract class BaseFxDirective implements OnDestroy, OnChanges { this._inputMap[prop] = source[prop]; } } else { - this._inputMap[key] = source; + if (!!key) { + this._inputMap[key] = source; + } } } @@ -220,7 +222,7 @@ export abstract class BaseFxDirective implements OnDestroy, OnChanges { */ protected get childrenNodes() { const obj = this.nativeElement.children; - const buffer = []; + const buffer: any[] = []; // iterate backwards ensuring that length is an UInt32 for (let i = obj.length; i--; ) { diff --git a/src/lib/api/core/renderer-adapter.ts b/src/lib/api/core/renderer-adapter.ts index f74177b73..8cc05efe2 100644 --- a/src/lib/api/core/renderer-adapter.ts +++ b/src/lib/api/core/renderer-adapter.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/core/responsive-activation.spec.ts b/src/lib/api/core/responsive-activation.spec.ts index 5f344d4ed..d5e7c7fce 100644 --- a/src/lib/api/core/responsive-activation.spec.ts +++ b/src/lib/api/core/responsive-activation.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/core/responsive-activation.ts b/src/lib/api/core/responsive-activation.ts index c8988b0f5..f22275658 100644 --- a/src/lib/api/core/responsive-activation.ts +++ b/src/lib/api/core/responsive-activation.ts @@ -1,12 +1,12 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Subscription} from 'rxjs/Subscription'; -import {map} from 'rxjs/operator/map'; +import {map} from 'rxjs/operators'; import {MediaChange, MediaQuerySubscriber} from '../../media-query/media-change'; import {BreakPoint} from '../../media-query/breakpoints/break-point'; @@ -117,7 +117,7 @@ export class ResponsiveActivation { * Cache 1..n subscriptions for internal auto-unsubscribes when the the directive destructs */ private _configureChangeObservers(): SubscriptionList { - let subscriptions = []; + let subscriptions: Subscription[] = []; this._registryMap.forEach((bp: BreakPointX) => { if (this._keyInUse(bp.key)) { @@ -130,10 +130,10 @@ export class ResponsiveActivation { }; subscriptions.push( - map.call(this.mediaMonitor.observe(bp.alias), buildChanges) - .subscribe(change => { - this._onMonitorEvents(change); - }) + this.mediaMonitor.observe(bp.alias).pipe(map(buildChanges)) + .subscribe(change => { + this._onMonitorEvents(change); + }) ); } }); @@ -188,7 +188,7 @@ export class ResponsiveActivation { const currentKey = this._options.baseKey + current.suffix; // e.g. suffix == 'GtSm', let newKey = this._activatedInputKey; // e.g. newKey == hideGtSm - newKey = current.matches ? currentKey : ((newKey == currentKey) ? null : newKey); + newKey = current.matches ? currentKey : ((newKey == currentKey) ? '' : newKey); this._activatedInputKey = this._validateInputKey(newKey); return this.activatedInput; @@ -201,11 +201,10 @@ export class ResponsiveActivation { * NOTE: scans in the order defined by activeOverLaps (largest viewport ranges -> smallest ranges) */ private _validateInputKey(inputKey) { - let items: BreakPoint[] = this.mediaMonitor.activeOverlaps; let isMissingKey = (key) => !this._keyInUse(key); if (isMissingKey(inputKey)) { - items.some(bp => { + this.mediaMonitor.activeOverlaps.some(bp => { let key = this._options.baseKey + bp.suffix; if (!isMissingKey(key)) { inputKey = key; diff --git a/src/lib/api/ext/class.spec.ts b/src/lib/api/ext/class.spec.ts index 776d17d3c..c1268e74d 100644 --- a/src/lib/api/ext/class.spec.ts +++ b/src/lib/api/ext/class.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/class.ts b/src/lib/api/ext/class.ts index 006b7d5a9..ae1cac2ca 100644 --- a/src/lib/api/ext/class.ts +++ b/src/lib/api/ext/class.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/hide.spec.ts b/src/lib/api/ext/hide.spec.ts index 15d747678..44ad28ef1 100644 --- a/src/lib/api/ext/hide.spec.ts +++ b/src/lib/api/ext/hide.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/img-src.spec.ts b/src/lib/api/ext/img-src.spec.ts index 35b5dcba5..9541cf8ff 100644 --- a/src/lib/api/ext/img-src.spec.ts +++ b/src/lib/api/ext/img-src.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/img-src.ts b/src/lib/api/ext/img-src.ts index 0a2640c42..c9cfb8f3c 100644 --- a/src/lib/api/ext/img-src.ts +++ b/src/lib/api/ext/img-src.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/show-hide.ts b/src/lib/api/ext/show-hide.ts index 4363e27df..1ed4cfb8e 100644 --- a/src/lib/api/ext/show-hide.ts +++ b/src/lib/api/ext/show-hide.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/show.spec.ts b/src/lib/api/ext/show.spec.ts index 74e5b4e30..01162d8bc 100644 --- a/src/lib/api/ext/show.spec.ts +++ b/src/lib/api/ext/show.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/style.spec.ts b/src/lib/api/ext/style.spec.ts index 37f99c18e..421a4f017 100644 --- a/src/lib/api/ext/style.spec.ts +++ b/src/lib/api/ext/style.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/ext/style.ts b/src/lib/api/ext/style.ts index 0f3a3868f..ee48a5ec0 100644 --- a/src/lib/api/ext/style.ts +++ b/src/lib/api/ext/style.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex-align.ts b/src/lib/api/flexbox/flex-align.ts index c7a4bfe5e..701256ba9 100644 --- a/src/lib/api/flexbox/flex-align.ts +++ b/src/lib/api/flexbox/flex-align.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex-fill.ts b/src/lib/api/flexbox/flex-fill.ts index 1fc4ef26c..5d1f955e8 100644 --- a/src/lib/api/flexbox/flex-fill.ts +++ b/src/lib/api/flexbox/flex-fill.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex-offset.spec.ts b/src/lib/api/flexbox/flex-offset.spec.ts index f457319d4..9d4aec903 100644 --- a/src/lib/api/flexbox/flex-offset.spec.ts +++ b/src/lib/api/flexbox/flex-offset.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex-offset.ts b/src/lib/api/flexbox/flex-offset.ts index 6cf54629e..b90917aa6 100644 --- a/src/lib/api/flexbox/flex-offset.ts +++ b/src/lib/api/flexbox/flex-offset.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex-order.ts b/src/lib/api/flexbox/flex-order.ts index 3a24dbcb4..e3e49654a 100644 --- a/src/lib/api/flexbox/flex-order.ts +++ b/src/lib/api/flexbox/flex-order.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex.spec.ts b/src/lib/api/flexbox/flex.spec.ts index f9eaef7a3..6affec24d 100644 --- a/src/lib/api/flexbox/flex.spec.ts +++ b/src/lib/api/flexbox/flex.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/flex.ts b/src/lib/api/flexbox/flex.ts index 3a2485eee..410df3844 100644 --- a/src/lib/api/flexbox/flex.ts +++ b/src/lib/api/flexbox/flex.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -50,7 +50,7 @@ export type FlexBasisAlias = 'grow' | 'initial' | 'auto' | 'none' | 'nogrow' | ' export class FlexDirective extends BaseFxDirective implements OnInit, OnChanges, OnDestroy { /** The flex-direction of this element's flex container. Defaults to 'row'. */ - protected _layout = 'row'; + protected _layout: string; /** * Subscription to the parent flex container's layout changes. diff --git a/src/lib/api/flexbox/layout-align.spec.ts b/src/lib/api/flexbox/layout-align.spec.ts index eab1d6361..97924a338 100644 --- a/src/lib/api/flexbox/layout-align.spec.ts +++ b/src/lib/api/flexbox/layout-align.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout-align.ts b/src/lib/api/flexbox/layout-align.ts index 7aeb94fdb..c46e8fb15 100644 --- a/src/lib/api/flexbox/layout-align.ts +++ b/src/lib/api/flexbox/layout-align.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout-gap.spec.ts b/src/lib/api/flexbox/layout-gap.spec.ts index 20eb0c47f..8bde452c0 100644 --- a/src/lib/api/flexbox/layout-gap.spec.ts +++ b/src/lib/api/flexbox/layout-gap.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout-gap.ts b/src/lib/api/flexbox/layout-gap.ts index 6acec5a57..a50901ba6 100644 --- a/src/lib/api/flexbox/layout-gap.ts +++ b/src/lib/api/flexbox/layout-gap.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout-wrap.ts b/src/lib/api/flexbox/layout-wrap.ts index 9b39f4fac..ed4cfa489 100644 --- a/src/lib/api/flexbox/layout-wrap.ts +++ b/src/lib/api/flexbox/layout-wrap.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout.spec.ts b/src/lib/api/flexbox/layout.spec.ts index 72fa875e8..76092a55b 100644 --- a/src/lib/api/flexbox/layout.spec.ts +++ b/src/lib/api/flexbox/layout.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/api/flexbox/layout.ts b/src/lib/api/flexbox/layout.ts index fabed74f8..c3aa688b2 100644 --- a/src/lib/api/flexbox/layout.ts +++ b/src/lib/api/flexbox/layout.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -15,13 +15,13 @@ import { Renderer2, SimpleChanges, } from '@angular/core'; -import {BehaviorSubject} from 'rxjs/BehaviorSubject'; import {Observable} from 'rxjs/Observable'; import {BaseFxDirective} from '../core/base'; import {MediaChange} from '../../media-query/media-change'; import {MediaMonitor} from '../../media-query/media-monitor'; import {buildLayoutCSS} from '../../utils/layout-validator'; +import {ReplaySubject} from 'rxjs/ReplaySubject'; /** * 'layout' flexbox styling directive * Defines the positioning flow direction for the child elements: row or column @@ -41,7 +41,7 @@ export class LayoutDirective extends BaseFxDirective implements OnInit, OnChange * Create Observable for nested/child 'flex' directives. This allows * child flex directives to subscribe/listen for flexbox direction changes. */ - protected _announcer: BehaviorSubject; + protected _announcer: ReplaySubject; /** * Publish observer to enabled nested, dependent directives to listen @@ -73,7 +73,7 @@ export class LayoutDirective extends BaseFxDirective implements OnInit, OnChange */ constructor(monitor: MediaMonitor, elRef: ElementRef, renderer: Renderer2) { super(monitor, elRef, renderer); - this._announcer = new BehaviorSubject('row'); + this._announcer = new ReplaySubject(1); this.layout$ = this._announcer.asObservable(); } @@ -119,15 +119,10 @@ export class LayoutDirective extends BaseFxDirective implements OnInit, OnChange } // Update styles and announce to subscribers the *new* direction - let css = buildLayoutCSS(value); + let css = buildLayoutCSS(!!value ? value : ''); this._applyStyleToElement(css); this._announcer.next(css['flex-direction']); } - - - - - } diff --git a/src/lib/api/index.ts b/src/lib/api/index.ts index 3621aa9a6..8ca4c9427 100644 --- a/src/lib/api/index.ts +++ b/src/lib/api/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/index.ts b/src/lib/index.ts index d6e71197a..676ca90f1 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/_module.ts b/src/lib/media-query/_module.ts index 2dd786b52..9fa89703f 100644 --- a/src/lib/media-query/_module.ts +++ b/src/lib/media-query/_module.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/break-point-registry.spec.ts b/src/lib/media-query/breakpoints/break-point-registry.spec.ts index 826396860..f8e7b49a6 100644 --- a/src/lib/media-query/breakpoints/break-point-registry.spec.ts +++ b/src/lib/media-query/breakpoints/break-point-registry.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/break-point-registry.ts b/src/lib/media-query/breakpoints/break-point-registry.ts index a18de243d..5c69354e3 100644 --- a/src/lib/media-query/breakpoints/break-point-registry.ts +++ b/src/lib/media-query/breakpoints/break-point-registry.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -19,7 +19,7 @@ import {BREAKPOINTS} from './break-points-token'; @Injectable() export class BreakPointRegistry { - constructor(@Inject(BREAKPOINTS) private _registry: BreakPoint[ ]) { + constructor(@Inject(BREAKPOINTS) private _registry: BreakPoint[]) { } /** @@ -46,12 +46,12 @@ export class BreakPointRegistry { /** * Search breakpoints by alias (e.g. gt-xs) */ - findByAlias(alias: string): BreakPoint { - return this._registry.find(bp => bp.alias == alias); + findByAlias(alias: string): BreakPoint | null { + return this._registry.find(bp => bp.alias == alias) || null; } - findByQuery(query: string): BreakPoint { - return this._registry.find(bp => bp.mediaQuery == query); + findByQuery(query: string): BreakPoint | null { + return this._registry.find(bp => bp.mediaQuery == query) || null; } /** @@ -75,6 +75,6 @@ export class BreakPointRegistry { * for property layoutGtSM. */ get suffixes(): string[] { - return this._registry.map(it => it.suffix); + return this._registry.map(it => !!it.suffix ? it.suffix : ''); } } diff --git a/src/lib/media-query/breakpoints/break-point.ts b/src/lib/media-query/breakpoints/break-point.ts index 75fd39680..3e4cc9bb1 100644 --- a/src/lib/media-query/breakpoints/break-point.ts +++ b/src/lib/media-query/breakpoints/break-point.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/break-points-provider.ts b/src/lib/media-query/breakpoints/break-points-provider.ts index 2ecf2cd43..5ef45cb18 100644 --- a/src/lib/media-query/breakpoints/break-points-provider.ts +++ b/src/lib/media-query/breakpoints/break-points-provider.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/break-points-token.ts b/src/lib/media-query/breakpoints/break-points-token.ts index cbc07fb12..1ab698f00 100644 --- a/src/lib/media-query/breakpoints/break-points-token.ts +++ b/src/lib/media-query/breakpoints/break-points-token.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/data/break-points.spec.ts b/src/lib/media-query/breakpoints/data/break-points.spec.ts index 897b23fd3..c63b97d81 100644 --- a/src/lib/media-query/breakpoints/data/break-points.spec.ts +++ b/src/lib/media-query/breakpoints/data/break-points.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/data/break-points.ts b/src/lib/media-query/breakpoints/data/break-points.ts index 7240d9f10..773eeafcc 100644 --- a/src/lib/media-query/breakpoints/data/break-points.ts +++ b/src/lib/media-query/breakpoints/data/break-points.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/data/orientation-break-points.spec.ts b/src/lib/media-query/breakpoints/data/orientation-break-points.spec.ts index d0a239c86..f075ca8ce 100644 --- a/src/lib/media-query/breakpoints/data/orientation-break-points.spec.ts +++ b/src/lib/media-query/breakpoints/data/orientation-break-points.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/breakpoints/data/orientation-break-points.ts b/src/lib/media-query/breakpoints/data/orientation-break-points.ts index 9d993395b..21894aa00 100644 --- a/src/lib/media-query/breakpoints/data/orientation-break-points.ts +++ b/src/lib/media-query/breakpoints/data/orientation-break-points.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/index.ts b/src/lib/media-query/index.ts index 31de85b0a..5e59da0ad 100644 --- a/src/lib/media-query/index.ts +++ b/src/lib/media-query/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/match-media.spec.ts b/src/lib/media-query/match-media.spec.ts index a82dfae0a..f1f62bc5b 100644 --- a/src/lib/media-query/match-media.spec.ts +++ b/src/lib/media-query/match-media.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/match-media.ts b/src/lib/media-query/match-media.ts index 45857192c..d694d3c3e 100644 --- a/src/lib/media-query/match-media.ts +++ b/src/lib/media-query/match-media.ts @@ -1,15 +1,16 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {Inject, Injectable, NgZone} from '@angular/core'; -import {ɵgetDOM as getDom, DOCUMENT} from '@angular/platform-browser'; +import {ɵgetDOM as getDom} from '@angular/platform-browser'; +import {DOCUMENT} from '@angular/common'; import {BehaviorSubject} from 'rxjs/BehaviorSubject'; import {Observable} from 'rxjs/Observable'; -import {filter} from 'rxjs/operator/filter'; +import {filter} from 'rxjs/operators'; import {MediaChange} from './media-change'; @@ -57,11 +58,8 @@ export class MatchMedia { * For the specified mediaQuery? */ isActive(mediaQuery: string): boolean { - if (this._registry.has(mediaQuery)) { - let mql = this._registry.get(mediaQuery); - return mql.matches; - } - return false; + let mql = this._registry.get(mediaQuery); + return !!mql ? mql.matches : false; } /** @@ -73,11 +71,15 @@ export class MatchMedia { * be announced. */ observe(mediaQuery?: string): Observable { - this.registerQuery(mediaQuery); + if (mediaQuery) { + this.registerQuery(mediaQuery); + } - return filter.call(this._observable$, (change: MediaChange) => { - return mediaQuery ? (change.mediaQuery === mediaQuery) : true; - }); + return this._observable$.pipe( + filter((change: MediaChange) => { + return mediaQuery ? (change.mediaQuery === mediaQuery) : true; + }) + ); } /** diff --git a/src/lib/media-query/media-change.ts b/src/lib/media-query/media-change.ts index cfb29279a..5b9825e58 100644 --- a/src/lib/media-query/media-change.ts +++ b/src/lib/media-query/media-change.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/media-monitor-provider.ts b/src/lib/media-query/media-monitor-provider.ts index 703f5efff..30f239f25 100644 --- a/src/lib/media-query/media-monitor-provider.ts +++ b/src/lib/media-query/media-monitor-provider.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/media-monitor.spec.ts b/src/lib/media-query/media-monitor.spec.ts index bc420f292..4967696f4 100644 --- a/src/lib/media-query/media-monitor.spec.ts +++ b/src/lib/media-query/media-monitor.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/media-monitor.ts b/src/lib/media-query/media-monitor.ts index d5e91ab14..03d0a1469 100644 --- a/src/lib/media-query/media-monitor.ts +++ b/src/lib/media-query/media-monitor.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -15,8 +15,7 @@ import {MediaChange} from './media-change'; import {mergeAlias} from '../utils/add-alias'; import {Observable} from 'rxjs/Observable'; -import {filter} from 'rxjs/operator/filter'; -import {map} from 'rxjs/operator/map'; +import {filter, map} from 'rxjs/operators'; /** * MediaMonitor uses the MatchMedia service to observe mediaQuery changes (both activations and @@ -51,8 +50,8 @@ export class MediaMonitor { }); } - get active(): BreakPoint { - let found = null, items = this.breakpoints.reverse(); + get active(): BreakPoint | null { + let found: BreakPoint | null = null, items = this.breakpoints.reverse(); items.forEach(bp => { if (bp.alias !== '') { if (!found && this._matchMedia.isActive(bp.mediaQuery)) { @@ -79,12 +78,16 @@ export class MediaMonitor { * otherwise return all events for BOTH activated + deactivated changes. */ observe(alias?: string): Observable { - let bp = this._breakpoints.findByAlias(alias) || this._breakpoints.findByQuery(alias); + let bp = this._breakpoints.findByAlias(alias || '') || + this._breakpoints.findByQuery(alias || ''); let hasAlias = (change: MediaChange) => (bp ? change.mqAlias !== '' : true); // Note: the raw MediaChange events [from MatchMedia] do not contain important alias information let media$ = this._matchMedia.observe(bp ? bp.mediaQuery : alias); - return filter.call(map.call(media$, change => mergeAlias(change, bp)), hasAlias); + return media$.pipe( + map(change => mergeAlias(change, bp)), + filter(hasAlias) + ); } /** diff --git a/src/lib/media-query/mock/mock-match-media.spec.ts b/src/lib/media-query/mock/mock-match-media.spec.ts index 286dcbed1..42a951731 100644 --- a/src/lib/media-query/mock/mock-match-media.spec.ts +++ b/src/lib/media-query/mock/mock-match-media.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/mock/mock-match-media.ts b/src/lib/media-query/mock/mock-match-media.ts index 788fc52ae..4a439e637 100644 --- a/src/lib/media-query/mock/mock-match-media.ts +++ b/src/lib/media-query/mock/mock-match-media.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/observable-media-provider.ts b/src/lib/media-query/observable-media-provider.ts index fa312ec6b..7d2329f72 100644 --- a/src/lib/media-query/observable-media-provider.ts +++ b/src/lib/media-query/observable-media-provider.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/media-query/observable-media.spec.ts b/src/lib/media-query/observable-media.spec.ts index d20d65840..297784fb2 100644 --- a/src/lib/media-query/observable-media.spec.ts +++ b/src/lib/media-query/observable-media.spec.ts @@ -1,14 +1,13 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {TestBed, inject, async} from '@angular/core/testing'; -import {filter} from 'rxjs/operator/filter'; -import {map} from 'rxjs/operator/map'; +import {filter, map} from 'rxjs/operators'; import {BreakPoint} from './breakpoints/break-point'; import {BREAKPOINTS} from './breakpoints/break-points-token'; @@ -68,15 +67,12 @@ describe('observable-media', () => { [ObservableMedia, MatchMedia], (mediaService, matchMedia) => { let count = 0, - subscription = map.call( - filter.call( - mediaService.asObservable(), - change => change.mqAlias == 'md' - ), - change => change.mqAlias - ).subscribe(_ => { - count += 1; - }); + subscription = mediaService.asObservable().pipe( + filter((change: MediaChange) => change.mqAlias == 'md'), + map((change: MediaChange) => change.mqAlias) + ).subscribe(_ => { + count += 1; + }); // Activate mediaQuery associated with 'md' alias diff --git a/src/lib/media-query/observable-media.ts b/src/lib/media-query/observable-media.ts index 65e1b03de..5c7164453 100644 --- a/src/lib/media-query/observable-media.ts +++ b/src/lib/media-query/observable-media.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -10,8 +10,7 @@ import {Injectable} from '@angular/core'; import {Subscription} from 'rxjs/Subscription'; import {Observable, Subscribable} from 'rxjs/Observable'; -import {map} from 'rxjs/operator/map'; -import {filter} from 'rxjs/operator/filter'; +import {map, filter} from 'rxjs/operators'; import {BreakPointRegistry} from './breakpoints/break-point-registry'; @@ -153,15 +152,10 @@ export class MediaService implements ObservableMedia { * Inject associated (if any) alias information into the MediaChange event * Exclude mediaQuery activations for overlapping mQs. List bounded mQ ranges only */ - return map.call( - filter.call( - filter.call( - media$, - activationsOnly - ), - excludeOverlaps - ), - addAliasInformation + return media$.pipe( + filter(activationsOnly), + filter(excludeOverlaps), + map(addAliasInformation) ); } @@ -183,7 +177,7 @@ export class MediaService implements ObservableMedia { * Find associated breakpoint (if any) */ private _toMediaQuery(query) { - let bp: BreakPoint = this._findByAlias(query) || this._findByQuery(query); + let bp: BreakPoint | null = this._findByAlias(query) || this._findByQuery(query); return bp ? bp.mediaQuery : query; } diff --git a/src/lib/module.ts b/src/lib/module.ts index 22bedd7b0..8bfd13fd8 100644 --- a/src/lib/module.ts +++ b/src/lib/module.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/public-api.ts b/src/lib/public-api.ts index cf2714a7b..318326cf7 100644 --- a/src/lib/public-api.ts +++ b/src/lib/public-api.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/add-alias.ts b/src/lib/utils/add-alias.ts index 6e69f0c72..6b0b62412 100644 --- a/src/lib/utils/add-alias.ts +++ b/src/lib/utils/add-alias.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -13,7 +13,7 @@ import {extendObject} from './object-extend'; * For the specified MediaChange, make sure it contains the breakpoint alias * and suffix (if available). */ -export function mergeAlias(dest: MediaChange, source: BreakPoint) { +export function mergeAlias(dest: MediaChange, source: BreakPoint | null) { return extendObject(dest, source ? { mqAlias: source.alias, suffix: source.suffix diff --git a/src/lib/utils/auto-prefixer.spec.ts b/src/lib/utils/auto-prefixer.spec.ts index 120476319..af1bfd209 100644 --- a/src/lib/utils/auto-prefixer.spec.ts +++ b/src/lib/utils/auto-prefixer.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/auto-prefixer.ts b/src/lib/utils/auto-prefixer.ts index 7762cd549..2037a8166 100644 --- a/src/lib/utils/auto-prefixer.ts +++ b/src/lib/utils/auto-prefixer.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/basis-validator.spec.ts b/src/lib/utils/basis-validator.spec.ts index e51c06fee..6e214b594 100644 --- a/src/lib/utils/basis-validator.spec.ts +++ b/src/lib/utils/basis-validator.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/basis-validator.ts b/src/lib/utils/basis-validator.ts index bbb694621..6b37d39ea 100644 --- a/src/lib/utils/basis-validator.ts +++ b/src/lib/utils/basis-validator.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/breakpoint-tools.spec.ts b/src/lib/utils/breakpoint-tools.spec.ts index 145e64543..348fd251e 100644 --- a/src/lib/utils/breakpoint-tools.spec.ts +++ b/src/lib/utils/breakpoint-tools.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/breakpoint-tools.ts b/src/lib/utils/breakpoint-tools.ts index b32dddff2..542b878b8 100644 --- a/src/lib/utils/breakpoint-tools.ts +++ b/src/lib/utils/breakpoint-tools.ts @@ -1,12 +1,12 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ - import {BreakPoint} from '../media-query/breakpoints/break-point'; +import {BreakPoint} from '../media-query/breakpoints/break-point'; import {extendObject} from './object-extend'; const ALIAS_DELIMITERS = /(\.|-|_)/g; diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index 003f87346..14ca23dec 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/layout-validator.ts b/src/lib/utils/layout-validator.ts index d57db0d39..ed6708ab9 100644 --- a/src/lib/utils/layout-validator.ts +++ b/src/lib/utils/layout-validator.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -13,7 +13,7 @@ export const LAYOUT_VALUES = ['row', 'column', 'row-reverse', 'column-reverse']; */ export function buildLayoutCSS(value: string) { let [direction, wrap] = validateValue(value); - return buildCSS(direction, wrap); + return buildCSS(direction, wrap); } /** diff --git a/src/lib/utils/object-extend.spec.ts b/src/lib/utils/object-extend.spec.ts index 44b89bc21..0f3cf4a14 100644 --- a/src/lib/utils/object-extend.spec.ts +++ b/src/lib/utils/object-extend.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/object-extend.ts b/src/lib/utils/object-extend.ts index 263031462..550510319 100644 --- a/src/lib/utils/object-extend.ts +++ b/src/lib/utils/object-extend.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/style-transforms.spec.ts b/src/lib/utils/style-transforms.spec.ts index a2d0e5d4b..a48147aed 100644 --- a/src/lib/utils/style-transforms.spec.ts +++ b/src/lib/utils/style-transforms.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/style-transforms.ts b/src/lib/utils/style-transforms.ts index 683d3be81..72bf735e6 100644 --- a/src/lib/utils/style-transforms.ts +++ b/src/lib/utils/style-transforms.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/style-utils.spec.ts b/src/lib/utils/style-utils.spec.ts index ac10c683b..354d42519 100644 --- a/src/lib/utils/style-utils.spec.ts +++ b/src/lib/utils/style-utils.spec.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/style-utils.ts b/src/lib/utils/style-utils.ts index 16d26bb62..bd46e900d 100644 --- a/src/lib/utils/style-utils.ts +++ b/src/lib/utils/style-utils.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license @@ -13,14 +13,7 @@ import {applyCssPrefixes} from './auto-prefixer'; * Definition of a css style. Either a property name (e.g. "flex-basis") or an object * map of property name and value (e.g. {display: 'none', flex-order: 5}). */ -export type StyleDefinition = string | { [property: string]: string | number }; - -/** - * Is this a SSR process ? - */ -export function isBrowser(): boolean { - return getDom().supportsDOMEvents(); -} +export type StyleDefinition = string | { [property: string]: string | number | null }; /** @@ -71,13 +64,13 @@ export function applyMultiValueStyleToElement(styles: {}, element: any, renderer * Find the DOM element's raw attribute value (if any) */ export function lookupAttributeValue(element: HTMLElement, attribute: string): string { - return isBrowser() ? getDom().getAttribute(element, attribute) : ''; + return getDom().getAttribute(element, attribute) || ''; } /** * Find the DOM element's inline style value (if any) */ export function lookupInlineStyle(element: HTMLElement, styleName: string): string { - return isBrowser() ? getDom().getStyle(element, styleName) : ''; + return getDom().getStyle(element, styleName); } /** @@ -85,14 +78,14 @@ export function lookupInlineStyle(element: HTMLElement, styleName: string): stri */ export function lookupStyle(element: HTMLElement, styleName: string, inlineOnly = false): string { let value = ''; - if (element && isBrowser()) { + if (element) { try { let immediateValue = value = lookupInlineStyle(element, styleName); if ( !inlineOnly ) { value = immediateValue || getDom().getComputedStyle(element).getPropertyValue(styleName); } } catch (e) { - // TODO: platform-server throws an exception for getComputedStyle + // TODO: platform-server throws an exception for getComputedStyle, will be fixed by PR 18362 } } diff --git a/src/lib/utils/testing/custom-matchers.ts b/src/lib/utils/testing/custom-matchers.ts index a928ce633..365cee038 100644 --- a/src/lib/utils/testing/custom-matchers.ts +++ b/src/lib/utils/testing/custom-matchers.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/testing/dom-tools.ts b/src/lib/utils/testing/dom-tools.ts index 1584f9802..1deb1f30a 100644 --- a/src/lib/utils/testing/dom-tools.ts +++ b/src/lib/utils/testing/dom-tools.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/utils/testing/helpers.ts b/src/lib/utils/testing/helpers.ts index 09fa5d39b..e7597ce37 100644 --- a/src/lib/utils/testing/helpers.ts +++ b/src/lib/utils/testing/helpers.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/src/lib/version.ts b/src/lib/version.ts index 4def72836..eb695afc3 100644 --- a/src/lib/version.ts +++ b/src/lib/version.ts @@ -1,6 +1,6 @@ /** * @license - * Copyright Google Inc. All Rights Reserved. + * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license diff --git a/test/karma-test-shim.js b/test/karma-test-shim.js index 4068bfb85..cb3c23423 100644 --- a/test/karma-test-shim.js +++ b/test/karma-test-shim.js @@ -44,7 +44,7 @@ System.config({ 'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', '@angular/platform-browser-dynamic/testing': 'node:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic-testing.umd.js', - + '@angular/material': 'node:@angular/material/bundles/material.umd.js', '@angular/cdk': 'node:@angular/cdk/bundles/cdk.umd.js', '@angular/cdk/a11y': 'node:@angular/cdk/bundles/cdk-a11y.umd.js', @@ -67,6 +67,7 @@ System.config({ packages: { // Thirdparty barrels. 'rxjs': {main: 'index'}, + 'rxjs/operators': {main: 'index'}, // Set the default extension for the root package, because otherwise the demo-app can't // be built within the production mode. Due to missing file extensions. diff --git a/tools/package-tools/build-package.ts b/tools/package-tools/build-package.ts index 6c357ad8e..c1f9144b8 100644 --- a/tools/package-tools/build-package.ts +++ b/tools/package-tools/build-package.ts @@ -58,7 +58,7 @@ export class BuildPackage { } private _secondaryEntryPoints: string[]; - constructor(public readonly name: string, public readonly dependencies: BuildPackage[] = []) { + constructor(readonly name: string, readonly dependencies: BuildPackage[] = []) { this.sourceDir = join(packagesDir, name); this.outputDir = join(outputDir, 'packages', name); this.esm5OutputDir = join(outputDir, 'packages', name, 'esm5'); diff --git a/tools/package-tools/rollup-globals.ts b/tools/package-tools/rollup-globals.ts index 4399babb2..2075cf521 100644 --- a/tools/package-tools/rollup-globals.ts +++ b/tools/package-tools/rollup-globals.ts @@ -51,6 +51,7 @@ export const rollupGlobals = { 'rxjs/Observer': 'Rx', 'rxjs/Subscriber': 'Rx', 'rxjs/Scheduler': 'Rx', + 'rxjs/ReplaySubject': 'Rx', 'rxjs/observable/combineLatest': 'Rx.Observable', 'rxjs/observable/forkJoin': 'Rx.Observable', 'rxjs/observable/fromEvent': 'Rx.Observable', @@ -58,20 +59,8 @@ export const rollupGlobals = { 'rxjs/observable/of': 'Rx.Observable', 'rxjs/observable/throw': 'Rx.Observable', 'rxjs/observable/defer': 'Rx.Observable', - 'rxjs/operator/auditTime': 'Rx.Observable.prototype', - 'rxjs/operator/catch': 'Rx.Observable.prototype', - 'rxjs/operator/debounceTime': 'Rx.Observable.prototype', - 'rxjs/operator/do': 'Rx.Observable.prototype', - 'rxjs/operator/filter': 'Rx.Observable.prototype', - 'rxjs/operator/finally': 'Rx.Observable.prototype', - 'rxjs/operator/first': 'Rx.Observable.prototype', - 'rxjs/operator/let': 'Rx.Observable.prototype', - 'rxjs/operator/map': 'Rx.Observable.prototype', - 'rxjs/operator/share': 'Rx.Observable.prototype', - 'rxjs/operator/startWith': 'Rx.Observable.prototype', - 'rxjs/operator/switchMap': 'Rx.Observable.prototype', - 'rxjs/operator/takeUntil': 'Rx.Observable.prototype', - 'rxjs/operator/toPromise': 'Rx.Observable.prototype', + 'rxjs/operators': 'Rx.Observable', + 'rxjs/operators/index': 'Rx.Observable', 'rxjs/add/observable/merge': 'Rx.Observable', 'rxjs/add/observable/fromEvent': 'Rx.Observable',