@angular/cdk 2.0.0-beta.11 → 2.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_a11y.scss +23 -0
- package/_overlay.scss +93 -0
- package/a11y/index.metadata.json +2 -1
- package/a11y/typings/a11y-module.d.ts +2 -0
- package/a11y/typings/focus-monitor.d.ts +1 -1
- package/a11y/typings/index.d.ts +1 -1
- package/a11y/typings/index.metadata.json +1 -1
- package/a11y/typings/{public_api.d.ts → public-api.d.ts} +8 -2
- package/a11y-prebuilt.css +1 -0
- package/a11y.metadata.json +2 -1
- package/bidi/index.metadata.json +2 -1
- package/bidi/typings/bidi-module.d.ts +2 -0
- package/bidi/typings/index.d.ts +1 -1
- package/bidi/typings/index.metadata.json +1 -1
- package/bidi/typings/public-api.d.ts +10 -0
- package/bidi.metadata.json +2 -1
- package/bundles/cdk-a11y.umd.js +1368 -1357
- package/bundles/cdk-a11y.umd.js.map +1 -1
- package/bundles/cdk-a11y.umd.min.js +2 -2
- package/bundles/cdk-a11y.umd.min.js.map +1 -1
- package/bundles/cdk-bidi.umd.js +42 -40
- package/bundles/cdk-bidi.umd.js.map +1 -1
- package/bundles/cdk-bidi.umd.min.js +2 -2
- package/bundles/cdk-bidi.umd.min.js.map +1 -1
- package/bundles/cdk-coercion.umd.js +12 -0
- package/bundles/cdk-coercion.umd.js.map +1 -1
- package/bundles/cdk-coercion.umd.min.js +2 -2
- package/bundles/cdk-coercion.umd.min.js.map +1 -1
- package/bundles/cdk-collections.umd.js +113 -11
- package/bundles/cdk-collections.umd.js.map +1 -1
- package/bundles/cdk-collections.umd.min.js +2 -2
- package/bundles/cdk-collections.umd.min.js.map +1 -1
- package/bundles/cdk-keycodes.umd.js.map +1 -1
- package/bundles/cdk-keycodes.umd.min.js +1 -1
- package/bundles/cdk-keycodes.umd.min.js.map +1 -1
- package/bundles/cdk-layout.umd.js +235 -0
- package/bundles/cdk-layout.umd.js.map +1 -0
- package/bundles/cdk-layout.umd.min.js +9 -0
- package/bundles/cdk-layout.umd.min.js.map +1 -0
- package/bundles/cdk-observers.umd.js +41 -40
- package/bundles/cdk-observers.umd.js.map +1 -1
- package/bundles/cdk-observers.umd.min.js +2 -2
- package/bundles/cdk-observers.umd.min.js.map +1 -1
- package/bundles/cdk-overlay.umd.js +306 -265
- package/bundles/cdk-overlay.umd.js.map +1 -1
- package/bundles/cdk-overlay.umd.min.js +2 -2
- package/bundles/cdk-overlay.umd.min.js.map +1 -1
- package/bundles/cdk-platform.umd.js +19 -17
- package/bundles/cdk-platform.umd.js.map +1 -1
- package/bundles/cdk-platform.umd.min.js +2 -2
- package/bundles/cdk-platform.umd.min.js.map +1 -1
- package/bundles/cdk-portal.umd.js +71 -37
- package/bundles/cdk-portal.umd.js.map +1 -1
- package/bundles/cdk-portal.umd.min.js +2 -2
- package/bundles/cdk-portal.umd.min.js.map +1 -1
- package/bundles/cdk-rxjs.umd.js +13 -4
- package/bundles/cdk-rxjs.umd.js.map +1 -1
- package/bundles/cdk-rxjs.umd.min.js +2 -2
- package/bundles/cdk-rxjs.umd.min.js.map +1 -1
- package/bundles/cdk-scrolling.umd.js +89 -54
- package/bundles/cdk-scrolling.umd.js.map +1 -1
- package/bundles/cdk-scrolling.umd.min.js +2 -2
- package/bundles/cdk-scrolling.umd.min.js.map +1 -1
- package/bundles/cdk-stepper.umd.js +115 -90
- package/bundles/cdk-stepper.umd.js.map +1 -1
- package/bundles/cdk-stepper.umd.min.js +2 -2
- package/bundles/cdk-stepper.umd.min.js.map +1 -1
- package/bundles/cdk-table.umd.js +261 -218
- package/bundles/cdk-table.umd.js.map +1 -1
- package/bundles/cdk-table.umd.min.js +2 -2
- package/bundles/cdk-table.umd.min.js.map +1 -1
- package/bundles/cdk.umd.js +1 -1
- package/bundles/cdk.umd.js.map +1 -1
- package/bundles/cdk.umd.min.js +2 -2
- package/bundles/cdk.umd.min.js.map +1 -1
- package/cdk.metadata.json +2 -1
- package/coercion/index.metadata.json +2 -1
- package/coercion/typings/array.d.ts +9 -0
- package/coercion/typings/index.d.ts +1 -1
- package/coercion/typings/index.metadata.json +1 -1
- package/{typings/coercion/public_api.d.ts → coercion/typings/public-api.d.ts} +1 -0
- package/coercion.metadata.json +2 -1
- package/collections/index.metadata.json +2 -1
- package/collections/typings/index.d.ts +2 -1
- package/collections/typings/index.metadata.json +1 -1
- package/{typings/collections/public_api.d.ts → collections/typings/public-api.d.ts} +1 -0
- package/collections/typings/selection.d.ts +13 -3
- package/collections/typings/unique-selection-dispatcher.d.ts +40 -0
- package/collections.metadata.json +2 -1
- package/esm2015/a11y.js +1252 -1250
- package/esm2015/a11y.js.map +1 -1
- package/esm2015/bidi.js +1 -1
- package/esm2015/bidi.js.map +1 -1
- package/esm2015/cdk.js +1 -1
- package/esm2015/cdk.js.map +1 -1
- package/esm2015/coercion.js +11 -1
- package/esm2015/coercion.js.map +1 -1
- package/esm2015/collections.js +93 -8
- package/esm2015/collections.js.map +1 -1
- package/esm2015/keycodes.js.map +1 -1
- package/esm2015/layout.js +226 -0
- package/esm2015/layout.js.map +1 -0
- package/esm2015/observers.js +8 -7
- package/esm2015/observers.js.map +1 -1
- package/esm2015/overlay.js +157 -136
- package/esm2015/overlay.js.map +1 -1
- package/esm2015/platform.js +1 -1
- package/esm2015/platform.js.map +1 -1
- package/esm2015/portal.js +30 -1
- package/esm2015/portal.js.map +1 -1
- package/esm2015/rxjs.js +5 -1
- package/esm2015/rxjs.js.map +1 -1
- package/esm2015/scrolling.js +39 -8
- package/esm2015/scrolling.js.map +1 -1
- package/esm2015/stepper.js +27 -5
- package/esm2015/stepper.js.map +1 -1
- package/esm2015/table.js +68 -29
- package/esm2015/table.js.map +1 -1
- package/esm5/a11y.es5.js +1372 -1357
- package/esm5/a11y.es5.js.map +1 -1
- package/esm5/bidi.es5.js +45 -40
- package/esm5/bidi.es5.js.map +1 -1
- package/esm5/cdk.es5.js +4 -1
- package/esm5/cdk.es5.js.map +1 -1
- package/esm5/coercion.es5.js +14 -1
- package/esm5/coercion.es5.js.map +1 -1
- package/esm5/collections.es5.js +110 -8
- package/esm5/collections.es5.js.map +1 -1
- package/esm5/keycodes.es5.js +2 -0
- package/esm5/keycodes.es5.js.map +1 -1
- package/esm5/layout.es5.js +234 -0
- package/esm5/layout.es5.js.map +1 -0
- package/esm5/observers.es5.js +44 -40
- package/esm5/observers.es5.js.map +1 -1
- package/esm5/overlay.es5.js +304 -259
- package/esm5/overlay.es5.js.map +1 -1
- package/esm5/platform.es5.js +22 -17
- package/esm5/platform.es5.js.map +1 -1
- package/esm5/portal.es5.js +81 -44
- package/esm5/portal.es5.js.map +1 -1
- package/esm5/rxjs.es5.js +12 -1
- package/esm5/rxjs.es5.js.map +1 -1
- package/esm5/scrolling.es5.js +89 -51
- package/esm5/scrolling.es5.js.map +1 -1
- package/esm5/stepper.es5.js +119 -91
- package/esm5/stepper.es5.js.map +1 -1
- package/esm5/table.es5.js +265 -218
- package/esm5/table.es5.js.map +1 -1
- package/keycodes/index.metadata.json +2 -1
- package/keycodes/typings/index.d.ts +1 -1
- package/keycodes/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/keycodes.metadata.json +2 -1
- package/layout/index.d.ts +8 -0
- package/layout/index.metadata.json +12 -0
- package/layout/package.json +7 -0
- package/layout/typings/breakpoints-observer.d.ts +37 -0
- package/layout/typings/breakpoints.d.ts +18 -0
- package/layout/typings/index.d.ts +4 -0
- package/layout/typings/index.metadata.json +1 -0
- package/layout/typings/media-matcher.d.ts +15 -0
- package/layout/typings/public-api.d.ts +5 -0
- package/layout.d.ts +8 -0
- package/layout.metadata.json +12 -0
- package/observers/index.metadata.json +2 -1
- package/observers/typings/index.d.ts +1 -1
- package/observers/typings/index.metadata.json +1 -1
- package/observers/typings/observe-content.d.ts +3 -3
- package/observers/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/observers.metadata.json +2 -1
- package/overlay/index.metadata.json +2 -1
- package/overlay/typings/index.d.ts +2 -2
- package/overlay/typings/index.metadata.json +1 -1
- package/overlay/typings/overlay-config.d.ts +1 -1
- package/overlay/typings/overlay-directives.d.ts +3 -3
- package/overlay/typings/overlay-module.d.ts +11 -0
- package/overlay/typings/overlay-ref.d.ts +6 -6
- package/overlay/typings/overlay.d.ts +2 -2
- package/overlay/typings/position/connected-position-strategy.d.ts +5 -0
- package/overlay/typings/position/position-strategy.d.ts +2 -0
- package/overlay/typings/{public_api.d.ts → public-api.d.ts} +1 -4
- package/overlay/typings/scroll/scroll-strategy.d.ts +1 -1
- package/overlay-prebuilt.css +1 -0
- package/overlay.metadata.json +2 -1
- package/package.json +3 -3
- package/platform/index.metadata.json +2 -1
- package/platform/typings/index.d.ts +1 -1
- package/platform/typings/index.metadata.json +1 -1
- package/platform/typings/platform-module.d.ts +2 -0
- package/platform/typings/public-api.d.ts +10 -0
- package/platform.metadata.json +2 -1
- package/portal/index.metadata.json +2 -1
- package/portal/typings/index.d.ts +1 -1
- package/portal/typings/index.metadata.json +1 -1
- package/portal/typings/{public_api.d.ts → public-api.d.ts} +1 -0
- package/portal.metadata.json +2 -1
- package/rxjs/index.metadata.json +2 -1
- package/rxjs/typings/index.d.ts +1 -1
- package/rxjs/typings/index.metadata.json +1 -1
- package/rxjs/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/rxjs/typings/rx-operators.d.ts +7 -0
- package/rxjs.metadata.json +2 -1
- package/scrolling/index.metadata.json +2 -1
- package/scrolling/typings/index.d.ts +1 -1
- package/scrolling/typings/index.metadata.json +1 -1
- package/scrolling/typings/public-api.d.ts +11 -0
- package/scrolling/typings/scrolling-module.d.ts +2 -0
- package/scrolling/typings/viewport-ruler.d.ts +20 -6
- package/scrolling.metadata.json +2 -1
- package/stepper/index.metadata.json +2 -1
- package/stepper/typings/index.d.ts +1 -1
- package/stepper/typings/index.metadata.json +1 -1
- package/stepper/typings/public-api.d.ts +11 -0
- package/stepper/typings/stepper-module.d.ts +2 -0
- package/stepper/typings/stepper.d.ts +8 -4
- package/stepper.metadata.json +2 -1
- package/table/index.metadata.json +2 -1
- package/table/typings/index.d.ts +1 -1
- package/table/typings/index.metadata.json +1 -1
- package/table/typings/public-api.d.ts +13 -0
- package/table/typings/row.d.ts +11 -3
- package/table/typings/table-errors.d.ts +10 -0
- package/table/typings/table-module.d.ts +2 -0
- package/table/typings/table.d.ts +17 -8
- package/table.metadata.json +2 -1
- package/typings/a11y/a11y-module.d.ts +2 -0
- package/typings/a11y/focus-monitor.d.ts +1 -1
- package/typings/a11y/index.d.ts +1 -1
- package/typings/a11y/index.metadata.json +1 -1
- package/typings/a11y/{public_api.d.ts → public-api.d.ts} +8 -2
- package/typings/bidi/bidi-module.d.ts +2 -0
- package/typings/bidi/index.d.ts +1 -1
- package/typings/bidi/index.metadata.json +1 -1
- package/typings/bidi/public-api.d.ts +10 -0
- package/typings/coercion/array.d.ts +9 -0
- package/typings/coercion/index.d.ts +1 -1
- package/typings/coercion/index.metadata.json +1 -1
- package/{coercion/typings/public_api.d.ts → typings/coercion/public-api.d.ts} +1 -0
- package/typings/collections/index.d.ts +2 -1
- package/typings/collections/index.metadata.json +1 -1
- package/{collections/typings/public_api.d.ts → typings/collections/public-api.d.ts} +1 -0
- package/typings/collections/selection.d.ts +13 -3
- package/typings/collections/unique-selection-dispatcher.d.ts +40 -0
- package/typings/index.d.ts +1 -1
- package/typings/index.metadata.json +1 -1
- package/typings/keycodes/index.d.ts +1 -1
- package/typings/keycodes/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/layout/breakpoints-observer.d.ts +37 -0
- package/typings/layout/breakpoints.d.ts +18 -0
- package/typings/layout/index.d.ts +4 -0
- package/typings/layout/index.metadata.json +1 -0
- package/typings/layout/media-matcher.d.ts +15 -0
- package/typings/layout/public-api.d.ts +5 -0
- package/typings/observers/index.d.ts +1 -1
- package/typings/observers/index.metadata.json +1 -1
- package/typings/observers/observe-content.d.ts +3 -3
- package/typings/observers/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/overlay/index.d.ts +2 -2
- package/typings/overlay/index.metadata.json +1 -1
- package/typings/overlay/overlay-config.d.ts +1 -1
- package/typings/overlay/overlay-directives.d.ts +3 -3
- package/typings/overlay/overlay-module.d.ts +11 -0
- package/typings/overlay/overlay-ref.d.ts +6 -6
- package/typings/overlay/overlay.d.ts +2 -2
- package/typings/overlay/position/connected-position-strategy.d.ts +5 -0
- package/typings/overlay/position/position-strategy.d.ts +2 -0
- package/typings/overlay/{public_api.d.ts → public-api.d.ts} +1 -4
- package/typings/overlay/scroll/scroll-strategy.d.ts +1 -1
- package/typings/platform/index.d.ts +1 -1
- package/typings/platform/index.metadata.json +1 -1
- package/typings/platform/platform-module.d.ts +2 -0
- package/typings/platform/public-api.d.ts +10 -0
- package/typings/portal/index.d.ts +1 -1
- package/typings/portal/index.metadata.json +1 -1
- package/typings/portal/{public_api.d.ts → public-api.d.ts} +1 -0
- package/typings/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/rxjs/index.d.ts +1 -1
- package/typings/rxjs/index.metadata.json +1 -1
- package/typings/rxjs/{public_api.d.ts → public-api.d.ts} +0 -0
- package/typings/rxjs/rx-operators.d.ts +7 -0
- package/typings/scrolling/index.d.ts +1 -1
- package/typings/scrolling/index.metadata.json +1 -1
- package/typings/scrolling/public-api.d.ts +11 -0
- package/typings/scrolling/scrolling-module.d.ts +2 -0
- package/typings/scrolling/viewport-ruler.d.ts +20 -6
- package/typings/stepper/index.d.ts +1 -1
- package/typings/stepper/index.metadata.json +1 -1
- package/typings/stepper/public-api.d.ts +11 -0
- package/typings/stepper/stepper-module.d.ts +2 -0
- package/typings/stepper/stepper.d.ts +8 -4
- package/typings/table/index.d.ts +1 -1
- package/typings/table/index.metadata.json +1 -1
- package/typings/table/public-api.d.ts +13 -0
- package/typings/table/row.d.ts +11 -3
- package/typings/table/table-errors.d.ts +10 -0
- package/typings/table/table-module.d.ts +2 -0
- package/typings/table/table.d.ts +17 -8
- package/bidi/typings/public_api.d.ts +0 -4
- package/platform/typings/public_api.d.ts +0 -4
- package/scrolling/typings/public_api.d.ts +0 -5
- package/stepper/typings/public_api.d.ts +0 -5
- package/table/typings/public_api.d.ts +0 -7
- package/typings/bidi/public_api.d.ts +0 -4
- package/typings/platform/public_api.d.ts +0 -4
- package/typings/scrolling/public_api.d.ts +0 -5
- package/typings/stepper/public_api.d.ts +0 -5
- package/typings/table/public_api.d.ts +0 -7
package/esm2015/platform.js
CHANGED
|
@@ -129,5 +129,5 @@ PlatformModule.ctorParameters = () => [];
|
|
|
129
129
|
* Generated bundle index. Do not edit.
|
|
130
130
|
*/
|
|
131
131
|
|
|
132
|
-
export {
|
|
132
|
+
export { Platform, getSupportedInputTypes, PlatformModule };
|
|
133
133
|
//# sourceMappingURL=platform.js.map
|
package/esm2015/platform.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sources":["
|
|
1
|
+
{"version":3,"file":"platform.js","sources":["../../packages/cdk/platform/platform.js","../../packages/cdk/platform/features.js","../../packages/cdk/platform/platform-module.js","../../packages/cdk/platform/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable } from '@angular/core';\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nconst /** @type {?} */ hasV8BreakIterator = (typeof (Intl) !== 'undefined' && ((Intl)).v8BreakIterator);\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n * \\@docs-private\n */\nexport class Platform {\n constructor() {\n this.isBrowser = typeof document === 'object' && !!document;\n /**\n * Layout Engines\n */\n this.EDGE = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n this.TRIDENT = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n this.BLINK = this.isBrowser &&\n (!!(((window)).chrome || hasV8BreakIterator) && !!CSS && !this.EDGE && !this.TRIDENT);\n // Webkit is part of the userAgent in EdgeHTML, Blink and Trident. Therefore we need to\n // ensure that Webkit runs standalone and is not used as another engine's base.\n this.WEBKIT = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n /**\n * Browsers and Platform Types\n */\n this.IOS = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;\n // It's difficult to detect the plain Gecko engine, because most of the browsers identify\n // them self as Gecko-like browsers and modify the userAgent's according to that.\n // Since we only cover one explicit Firefox case, we can simply check for Firefox\n // instead of having an unstable check for Gecko.\n this.FIREFOX = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n this.ANDROID = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n // Safari browsers will include the Safari keyword in their userAgent. Some browsers may fake\n // this and just place the Safari keyword in the userAgent. To be more safe about Safari every\n // Safari browser should also use Webkit as its layout engine.\n this.SAFARI = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n }\n}\nPlatform.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nPlatform.ctorParameters = () => [];\nfunction Platform_tsickle_Closure_declarations() {\n /** @type {?} */\n Platform.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Platform.ctorParameters;\n /** @type {?} */\n Platform.prototype.isBrowser;\n /**\n * Layout Engines\n * @type {?}\n */\n Platform.prototype.EDGE;\n /** @type {?} */\n Platform.prototype.TRIDENT;\n /** @type {?} */\n Platform.prototype.BLINK;\n /** @type {?} */\n Platform.prototype.WEBKIT;\n /**\n * Browsers and Platform Types\n * @type {?}\n */\n Platform.prototype.IOS;\n /** @type {?} */\n Platform.prototype.FIREFOX;\n /** @type {?} */\n Platform.prototype.ANDROID;\n /** @type {?} */\n Platform.prototype.SAFARI;\n}\n//# sourceMappingURL=platform.js.map","/**\n * Cached result Set of input types support by the current browser.\n */\nlet supportedInputTypes;\n/**\n * Types of <input> that *might* be supported.\n */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n/**\n * @return {?} The input types supported by this browser.\n */\nexport function getSupportedInputTypes() {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n let /** @type {?} */ featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n return supportedInputTypes;\n}\n//# sourceMappingURL=features.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule } from '@angular/core';\nimport { Platform } from './platform';\nexport class PlatformModule {\n}\nPlatformModule.decorators = [\n { type: NgModule, args: [{\n providers: [Platform]\n },] },\n];\n/**\n * @nocollapse\n */\nPlatformModule.ctorParameters = () => [];\nfunction PlatformModule_tsickle_Closure_declarations() {\n /** @type {?} */\n PlatformModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n PlatformModule.ctorParameters;\n}\n//# sourceMappingURL=platform-module.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { Platform, getSupportedInputTypes,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AO,gBAAgB,CAAC,IAAI,KAAK,KAAK,CAAC;KAC1C,CAAC,CAAC,CAAC;IACJ,OAAO,mBAAmB,CAAC;CAC9B,AACD;;AChDO,MAAM,cAAc,CAAC;CAC3B;AACD,cAAc,CAAC,UAAU,GAAG;IACxB,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;gBACb,SAAS,EAAE,CAAC,QAAQ,CAAC;aACxB,EAAE,EAAE;CAChB,CAAC;;;;AAIF,cAAc,CAAC,cAAc,GAAG,MAAM,EAAE,CAAC,AACzC,AAQC,AACD;;AC7BA;;GAEG,AACH,AAAgF,AAChF;;"}
|
package/esm2015/portal.js
CHANGED
|
@@ -482,6 +482,7 @@ class PortalHostDirective extends BasePortalHost {
|
|
|
482
482
|
PortalHostDirective.decorators = [
|
|
483
483
|
{ type: Directive, args: [{
|
|
484
484
|
selector: '[cdkPortalHost], [portalHost]',
|
|
485
|
+
exportAs: 'cdkPortalHost',
|
|
485
486
|
inputs: ['portal: cdkPortalHost']
|
|
486
487
|
},] },
|
|
487
488
|
];
|
|
@@ -508,9 +509,37 @@ PortalModule.decorators = [
|
|
|
508
509
|
*/
|
|
509
510
|
PortalModule.ctorParameters = () => [];
|
|
510
511
|
|
|
512
|
+
/**
|
|
513
|
+
* Custom injector to be used when providing custom
|
|
514
|
+
* injection tokens to components inside a portal.
|
|
515
|
+
* \@docs-private
|
|
516
|
+
*/
|
|
517
|
+
class PortalInjector {
|
|
518
|
+
/**
|
|
519
|
+
* @param {?} _parentInjector
|
|
520
|
+
* @param {?} _customTokens
|
|
521
|
+
*/
|
|
522
|
+
constructor(_parentInjector, _customTokens) {
|
|
523
|
+
this._parentInjector = _parentInjector;
|
|
524
|
+
this._customTokens = _customTokens;
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* @param {?} token
|
|
528
|
+
* @param {?=} notFoundValue
|
|
529
|
+
* @return {?}
|
|
530
|
+
*/
|
|
531
|
+
get(token, notFoundValue) {
|
|
532
|
+
const /** @type {?} */ value = this._customTokens.get(token);
|
|
533
|
+
if (typeof value !== 'undefined') {
|
|
534
|
+
return value;
|
|
535
|
+
}
|
|
536
|
+
return this._parentInjector.get(token, notFoundValue);
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
|
|
511
540
|
/**
|
|
512
541
|
* Generated bundle index. Do not edit.
|
|
513
542
|
*/
|
|
514
543
|
|
|
515
|
-
export { Portal, ComponentPortal, TemplatePortal, BasePortalHost, DomPortalHost, TemplatePortalDirective, PortalHostDirective, PortalModule };
|
|
544
|
+
export { Portal, ComponentPortal, TemplatePortal, BasePortalHost, DomPortalHost, TemplatePortalDirective, PortalHostDirective, PortalModule, PortalInjector };
|
|
516
545
|
//# sourceMappingURL=portal.js.map
|
package/esm2015/portal.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"portal.js","sources":["../../../src/cdk/portal/index.ts","../../../src/cdk/portal/portal-directives.ts","../../../src/cdk/portal/dom-portal-host.ts","../../../src/cdk/portal/portal.ts","../../../src/cdk/portal/portal-errors.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {ComponentType,Portal,ComponentPortal,TemplatePortal,PortalHost,BasePortalHost,DomPortalHost,TemplatePortalDirective,PortalHostDirective,PortalModule} from './public_api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {\n NgModule,\n ComponentRef,\n Directive,\n EmbeddedViewRef,\n TemplateRef,\n ComponentFactoryResolver,\n ViewContainerRef,\n OnDestroy,\n Input,\n} from '@angular/core';\nimport {Portal, TemplatePortal, ComponentPortal, BasePortalHost} from './portal';\n/**\n * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,\n * the directive instance itself can be attached to a host, enabling declarative use of portals.\n * \n * Usage:\n * <ng-template portal #greeting>\n * <p> Hello {{name}} </p>\n * </ng-template>\n */\nexport class TemplatePortalDirective extends TemplatePortal<any> {\n/**\n * @param {?} templateRef\n * @param {?} viewContainerRef\n */\nconstructor(templateRef: TemplateRef<any>, viewContainerRef: ViewContainerRef) {\n super(templateRef, viewContainerRef);\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{\n selector: '[cdk-portal], [cdkPortal], [portal]',\n exportAs: 'cdkPortal',\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: TemplateRef, },\n{type: ViewContainerRef, },\n];\n}\n\nfunction TemplatePortalDirective_tsickle_Closure_declarations() {\n/** @type {?} */\nTemplatePortalDirective.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nTemplatePortalDirective.ctorParameters;\n}\n\n/**\n * Directive version of a PortalHost. Because the directive *is* a PortalHost, portals can be\n * directly attached to it, enabling declarative use.\n * \n * Usage:\n * <ng-template [cdkPortalHost]=\"greeting\"></ng-template>\n */\nexport class PortalHostDirective extends BasePortalHost implements OnDestroy {\n/**\n * The attached portal.\n */\nprivate _portal: Portal<any> | null = null;\n/**\n * @param {?} _componentFactoryResolver\n * @param {?} _viewContainerRef\n */\nconstructor(\nprivate _componentFactoryResolver: ComponentFactoryResolver,\nprivate _viewContainerRef: ViewContainerRef) {\n super();\n }\n/**\n * @deprecated\n * @return {?}\n */\nget _deprecatedPortal() { return this.portal; }\n/**\n * @param {?} v\n * @return {?}\n */\nset _deprecatedPortal(v) { this.portal = v; }\n/**\n * Portal associated with the Portal host.\n * @return {?}\n */\nget portal(): Portal<any> | null {\n return this._portal;\n }\n/**\n * @param {?} portal\n * @return {?}\n */\nset portal(portal: Portal<any> | null) {\n if (this.hasAttached()) {\n super.detach();\n }\n\n if (portal) {\n super.attach(portal);\n }\n\n this._portal = portal;\n }\n/**\n * @return {?}\n */\nngOnDestroy() {\n super.dispose();\n this._portal = null;\n }\n/**\n * Attach the given ComponentPortal to this PortalHost using the ComponentFactoryResolver.\n * \n * @template T\n * @param {?} portal Portal to be attached to the portal host.\n * @return {?}\n */\nattachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n portal.setAttachedHost(this);\n\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalHost.\n let /** @type {?} */ viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n\n let /** @type {?} */ componentFactory =\n this._componentFactoryResolver.resolveComponentFactory(portal.component);\n let /** @type {?} */ ref = viewContainerRef.createComponent(\n componentFactory, viewContainerRef.length,\n portal.injector || viewContainerRef.parentInjector);\n\n super.setDisposeFn(() => ref.destroy());\n this._portal = portal;\n\n return ref;\n }\n/**\n * Attach the given TemplatePortal to this PortlHost as an embedded View.\n * @template C\n * @param {?} portal Portal to be attached.\n * @return {?}\n */\nattachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n portal.setAttachedHost(this);\n const /** @type {?} */ viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n\n this._portal = portal;\n\n return viewRef;\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{\n selector: '[cdkPortalHost], [portalHost]',\n inputs: ['portal: cdkPortalHost']\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ComponentFactoryResolver, },\n{type: ViewContainerRef, },\n];\nstatic propDecorators: {[key: string]: DecoratorInvocation[]} = {\n'_deprecatedPortal': [{ type: Input, args: ['portalHost', ] },],\n};\n}\n\nfunction PortalHostDirective_tsickle_Closure_declarations() {\n/** @type {?} */\nPortalHostDirective.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nPortalHostDirective.ctorParameters;\n/** @type {?} */\nPortalHostDirective.propDecorators;\n/**\n * The attached portal.\n * @type {?}\n */\nPortalHostDirective.prototype._portal;\n/** @type {?} */\nPortalHostDirective.prototype._componentFactoryResolver;\n/** @type {?} */\nPortalHostDirective.prototype._viewContainerRef;\n}\n\nexport class PortalModule {static decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n exports: [TemplatePortalDirective, PortalHostDirective],\n declarations: [TemplatePortalDirective, PortalHostDirective],\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction PortalModule_tsickle_Closure_declarations() {\n/** @type {?} */\nPortalModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nPortalModule.ctorParameters;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {\n ComponentFactoryResolver,\n ComponentRef,\n EmbeddedViewRef,\n ApplicationRef,\n Injector,\n} from '@angular/core';\nimport {BasePortalHost, ComponentPortal, TemplatePortal} from './portal';\n/**\n * A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular\n * application context.\n * \n * This is the only part of the portal core that directly touches the DOM.\n */\nexport class DomPortalHost extends BasePortalHost {\n/**\n * @param {?} _hostDomElement\n * @param {?} _componentFactoryResolver\n * @param {?} _appRef\n * @param {?} _defaultInjector\n */\nconstructor(\nprivate _hostDomElement: Element,\nprivate _componentFactoryResolver: ComponentFactoryResolver,\nprivate _appRef: ApplicationRef,\nprivate _defaultInjector: Injector) {\n super();\n }\n/**\n * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.\n * @template T\n * @param {?} portal Portal to be attached\n * @return {?}\n */\nattachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T> {\n let /** @type {?} */ componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);\n let /** @type {?} */ componentRef: ComponentRef<T>;\n\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(\n componentFactory,\n portal.viewContainerRef.length,\n portal.injector || portal.viewContainerRef.parentInjector);\n\n this.setDisposeFn(() => componentRef.destroy());\n } else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this._hostDomElement.appendChild(this._getComponentRootNode(componentRef));\n\n return componentRef;\n }\n/**\n * Attaches a template portal to the DOM as an embedded view.\n * @template C\n * @param {?} portal Portal to be attached.\n * @return {?}\n */\nattachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C> {\n let /** @type {?} */ viewContainer = portal.viewContainerRef;\n let /** @type {?} */ viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n viewRef.detectChanges();\n\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalHost the view can be added everywhere in the DOM (e.g Overlay Container)\n // To move the view to the specified host element. We just re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this._hostDomElement.appendChild(rootNode));\n\n this.setDisposeFn((() => {\n let /** @type {?} */ index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }\n/**\n * Clears out a portal from the DOM.\n * @return {?}\n */\ndispose(): void {\n super.dispose();\n if (this._hostDomElement.parentNode != null) {\n this._hostDomElement.parentNode.removeChild(this._hostDomElement);\n }\n }\n/**\n * Gets the root HTMLElement for an instantiated component.\n * @param {?} componentRef\n * @return {?}\n */\nprivate _getComponentRootNode(componentRef: ComponentRef<any>): HTMLElement {\n return /** @type {?} */(( ( /** @type {?} */((componentRef.hostView as EmbeddedViewRef<any>))).rootNodes[0] as HTMLElement));\n }\n}\n\nfunction DomPortalHost_tsickle_Closure_declarations() {\n/** @type {?} */\nDomPortalHost.prototype._hostDomElement;\n/** @type {?} */\nDomPortalHost.prototype._componentFactoryResolver;\n/** @type {?} */\nDomPortalHost.prototype._appRef;\n/** @type {?} */\nDomPortalHost.prototype._defaultInjector;\n}\n\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {\n TemplateRef,\n ViewContainerRef,\n ElementRef,\n ComponentRef,\n EmbeddedViewRef,\n Injector\n} from '@angular/core';\nimport {\n throwNullPortalHostError,\n throwPortalAlreadyAttachedError,\n throwNoPortalAttachedError,\n throwNullPortalError,\n throwPortalHostAlreadyDisposedError,\n throwUnknownPortalTypeError\n} from './portal-errors';\n\n\nexport interface ComponentType<T> {\n new (...args: any[]): T;\n}\n/**\n * A `Portal` is something that you want to render somewhere else.\n * It can be attach to / detached from a `PortalHost`.\n * @abstract\n */\nexport abstract class Portal<T> {\nprivate _attachedHost: PortalHost | null;\n/**\n * Attach this portal to a host.\n * @param {?} host\n * @return {?}\n */\nattach(host: PortalHost): T {\n if (host == null) {\n throwNullPortalHostError();\n }\n\n if (host.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n\n this._attachedHost = host;\n return /** @type {?} */(( <T> host.attach(this)));\n }\n/**\n * Detach this portal from its host\n * @return {?}\n */\ndetach(): void {\n let /** @type {?} */ host = this._attachedHost;\n\n if (host == null) {\n throwNoPortalAttachedError();\n } else {\n this._attachedHost = null;\n host.detach();\n }\n }\n/**\n * Whether this portal is attached to a host.\n * @return {?}\n */\nget isAttached(): boolean {\n return this._attachedHost != null;\n }\n/**\n * Sets the PortalHost reference without performing `attach()`. This is used directly by\n * the PortalHost when it is performing an `attach()` or `detach()`.\n * @param {?} host\n * @return {?}\n */\nsetAttachedHost(host: PortalHost | null) {\n this._attachedHost = host;\n }\n}\n\nfunction Portal_tsickle_Closure_declarations() {\n/** @type {?} */\nPortal.prototype._attachedHost;\n}\n\n/**\n * A `ComponentPortal` is a portal that instantiates some Component upon attachment.\n */\nexport class ComponentPortal<T> extends Portal<ComponentRef<T>> {\n/**\n * The type of the component that will be instantiated for attachment.\n */\ncomponent: ComponentType<T>;\n/**\n * [Optional] Where the attached component should live in Angular's *logical* component tree.\n * This is different from where the component *renders*, which is determined by the PortalHost.\n * The origin is necessary when the host is outside of the Angular application context.\n */\nviewContainerRef?: ViewContainerRef | null;\n/**\n * [Optional] Injector used for the instantiation of the component.\n */\ninjector?: Injector | null;\n/**\n * @param {?} component\n * @param {?=} viewContainerRef\n * @param {?=} injector\n */\nconstructor(\n component: ComponentType<T>,\n viewContainerRef?: ViewContainerRef | null,\n injector?: Injector | null) {\n super();\n this.component = component;\n this.viewContainerRef = viewContainerRef;\n this.injector = injector;\n }\n}\n\nfunction ComponentPortal_tsickle_Closure_declarations() {\n/**\n * The type of the component that will be instantiated for attachment.\n * @type {?}\n */\nComponentPortal.prototype.component;\n/**\n * [Optional] Where the attached component should live in Angular's *logical* component tree.\n * This is different from where the component *renders*, which is determined by the PortalHost.\n * The origin is necessary when the host is outside of the Angular application context.\n * @type {?}\n */\nComponentPortal.prototype.viewContainerRef;\n/**\n * [Optional] Injector used for the instantiation of the component.\n * @type {?}\n */\nComponentPortal.prototype.injector;\n}\n\n/**\n * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).\n */\nexport class TemplatePortal<C> extends Portal<C> {\n/**\n * The embedded template that will be used to instantiate an embedded View in the host.\n */\ntemplateRef: TemplateRef<C>;\n/**\n * Reference to the ViewContainer into which the template will be stamped out.\n */\nviewContainerRef: ViewContainerRef;\n\n context: C | undefined;\n/**\n * @param {?} template\n * @param {?} viewContainerRef\n * @param {?=} context\n */\nconstructor(template: TemplateRef<any>, viewContainerRef: ViewContainerRef, context?: C) {\n super();\n this.templateRef = template;\n this.viewContainerRef = viewContainerRef;\n if (context) {\n this.context = context;\n }\n }\n/**\n * @return {?}\n */\nget origin(): ElementRef {\n return this.templateRef.elementRef;\n }\n/**\n * Attach the the portal to the provided `PortalHost`.\n * When a context is provided it will override the `context` property of the `TemplatePortal`\n * instance.\n * @param {?} host\n * @param {?=} context\n * @return {?}\n */\nattach(host: PortalHost, context: C | undefined = this.context): C {\n this.context = context;\n return super.attach(host);\n }\n/**\n * @return {?}\n */\ndetach(): void {\n this.context = undefined;\n return super.detach();\n }\n}\n\nfunction TemplatePortal_tsickle_Closure_declarations() {\n/**\n * The embedded template that will be used to instantiate an embedded View in the host.\n * @type {?}\n */\nTemplatePortal.prototype.templateRef;\n/**\n * Reference to the ViewContainer into which the template will be stamped out.\n * @type {?}\n */\nTemplatePortal.prototype.viewContainerRef;\n/** @type {?} */\nTemplatePortal.prototype.context;\n}\n\n\n\n/**\n * A `PortalHost` is an space that can contain a single `Portal`.\n */\nexport interface PortalHost {\n attach(portal: Portal<any>): any;\n\n detach(): any;\n\n dispose(): void;\n\n hasAttached(): boolean;\n}\n/**\n * Partial implementation of PortalHost that only deals with attaching either a\n * ComponentPortal or a TemplatePortal.\n * @abstract\n */\nexport abstract class BasePortalHost implements PortalHost {\n/**\n * The portal currently attached to the host.\n */\nprivate _attachedPortal: Portal<any> | null;\n/**\n * A function that will permanently dispose this host.\n */\nprivate _disposeFn: (() => void) | null;\n/**\n * Whether this host has already been permanently disposed.\n */\nprivate _isDisposed: boolean = false;\n/**\n * Whether this host has an attached portal.\n * @return {?}\n */\nhasAttached(): boolean {\n return !!this._attachedPortal;\n }\n/**\n * @param {?} portal\n * @return {?}\n */\nattach(portal: Portal<any>): any {\n if (!portal) {\n throwNullPortalError();\n }\n\n if (this.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n\n if (this._isDisposed) {\n throwPortalHostAlreadyDisposedError();\n }\n\n if (portal instanceof ComponentPortal) {\n this._attachedPortal = portal;\n return this.attachComponentPortal(portal);\n } else if (portal instanceof TemplatePortal) {\n this._attachedPortal = portal;\n return this.attachTemplatePortal(portal);\n }\n\n throwUnknownPortalTypeError();\n }\n/**\n * @abstract\n * @template T\n * @param {?} portal\n * @return {?}\n */\nattachComponentPortal<T>(portal: ComponentPortal<T>) {}\n/**\n * @abstract\n * @template C\n * @param {?} portal\n * @return {?}\n */\nattachTemplatePortal<C>(portal: TemplatePortal<C>) {}\n/**\n * @return {?}\n */\ndetach(): void {\n if (this._attachedPortal) {\n this._attachedPortal.setAttachedHost(null);\n this._attachedPortal = null;\n }\n\n this._invokeDisposeFn();\n }\n/**\n * @return {?}\n */\ndispose() {\n if (this.hasAttached()) {\n this.detach();\n }\n\n this._invokeDisposeFn();\n this._isDisposed = true;\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nsetDisposeFn(fn: () => void) {\n this._disposeFn = fn;\n }\n/**\n * @return {?}\n */\nprivate _invokeDisposeFn() {\n if (this._disposeFn) {\n this._disposeFn();\n this._disposeFn = null;\n }\n }\n}\n\nfunction BasePortalHost_tsickle_Closure_declarations() {\n/**\n * The portal currently attached to the host.\n * @type {?}\n */\nBasePortalHost.prototype._attachedPortal;\n/**\n * A function that will permanently dispose this host.\n * @type {?}\n */\nBasePortalHost.prototype._disposeFn;\n/**\n * Whether this host has already been permanently disposed.\n * @type {?}\n */\nBasePortalHost.prototype._isDisposed;\n}\n\n","\n/**\n * Throws an exception when attempting to attach a null portal to a host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwNullPortalError() {\n throw Error('Must provide a portal to attach');\n}\n/**\n * Throws an exception when attempting to attach a portal to a host that is already attached.\n * \\@docs-private\n * @return {?}\n */\nexport function throwPortalAlreadyAttachedError() {\n throw Error('Host already has a portal attached');\n}\n/**\n * Throws an exception when attempting to attach a portal to an already-disposed host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwPortalHostAlreadyDisposedError() {\n throw Error('This PortalHost has already been disposed');\n}\n/**\n * Throws an exception when attempting to attach an unknown portal type.\n * \\@docs-private\n * @return {?}\n */\nexport function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalHost accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}\n/**\n * Throws an exception when attempting to attach a portal to a null host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwNullPortalHostError() {\n throw Error('Attempting to attach a portal to a null PortalHost');\n}\n/**\n * Throws an exception when attempting to detach a portal that is not attached.\n * \\@docs-privatew\n * @return {?}\n */\nexport function throwNoPortalAttachedError() {\n throw Error('Attempting to detach a portal that is not attached to a host');\n}\n"],"names":[],"mappings":";;;;;;;;;AICA;;;;;AAKA,AAAA,SAAA,oBAAA,GAAA;IACE,MAMM,KAAA,CAAM,iCAAC,CAAiC,CAAC;CALhD;;;;;;AAMD,AAAA,SAAA,+BAAA,GAAA;IACE,MAMM,KAAA,CAAM,oCAAC,CAAoC,CAAC;CALnD;;;;;;AAMD,AAAA,SAAA,mCAAA,GAAA;IACE,MAMM,KAAA,CAAM,2CAAC,CAA2C,CAAC;CAL1D;;;;;;AAMD,AAAA,SAAA,2BAAA,GAAA;IACE,MAMM,KAAA,CAAM,6EAAC;QALG,wCAAwC,CAMC,CAAC;CAL3D;;;;;;AAMD,AAAA,SAAA,wBAAA,GAAA;IACE,MAMM,KAAA,CAAM,oDAAC,CAAoD,CAAC;CALnE;;;;;;AAMD,AAAA,SAAA,0BAAA,GAAA;IACE,MAMM,KAAA,CAAM,8DAAC,CAA8D,CAAC;CAL7E;;ADnBD;;;;;AAKA,AAAA,MAAA,MAAA,CAAA;;;;;;IAOA,MAJG,CAAA,IAAA,EAIH;QACI,IAAI,IAJC,IAAO,IAAA,EAAM;YAKhB,wBAAwB,EAJC,CAAE;SAK5B;QAED,IAAI,IAJC,CAAI,WAAC,EAAW,EAAG;YAKtB,+BAA+B,EAJC,CAAE;SAKnC;QAED,IAAI,CAJC,aAAC,GAAe,IAAA,CAAK;QAK1B,QAJW,IAAA,CAAK,MAAC,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/portal-errors.js","../../packages/cdk/portal/portal.js","../../packages/cdk/portal/dom-portal-host.js","../../packages/cdk/portal/portal-directives.js","../../packages/cdk/portal/portal-injector.js","../../packages/cdk/portal/index.js"],"sourcesContent":["/**\n * Throws an exception when attempting to attach a null portal to a host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwNullPortalError() {\n throw Error('Must provide a portal to attach');\n}\n/**\n * Throws an exception when attempting to attach a portal to a host that is already attached.\n * \\@docs-private\n * @return {?}\n */\nexport function throwPortalAlreadyAttachedError() {\n throw Error('Host already has a portal attached');\n}\n/**\n * Throws an exception when attempting to attach a portal to an already-disposed host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwPortalHostAlreadyDisposedError() {\n throw Error('This PortalHost has already been disposed');\n}\n/**\n * Throws an exception when attempting to attach an unknown portal type.\n * \\@docs-private\n * @return {?}\n */\nexport function throwUnknownPortalTypeError() {\n throw Error('Attempting to attach an unknown Portal type. BasePortalHost accepts either ' +\n 'a ComponentPortal or a TemplatePortal.');\n}\n/**\n * Throws an exception when attempting to attach a portal to a null host.\n * \\@docs-private\n * @return {?}\n */\nexport function throwNullPortalHostError() {\n throw Error('Attempting to attach a portal to a null PortalHost');\n}\n/**\n * Throws an exception when attempting to detach a portal that is not attached.\n * \\@docs-privatew\n * @return {?}\n */\nexport function throwNoPortalAttachedError() {\n throw Error('Attempting to detach a portal that is not attached to a host');\n}\n//# sourceMappingURL=portal-errors.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { throwNullPortalHostError, throwPortalAlreadyAttachedError, throwNoPortalAttachedError, throwNullPortalError, throwPortalHostAlreadyDisposedError, throwUnknownPortalTypeError } from './portal-errors';\n/**\n * A `Portal` is something that you want to render somewhere else.\n * It can be attach to / detached from a `PortalHost`.\n * @abstract\n */\nexport class Portal {\n /**\n * Attach this portal to a host.\n * @param {?} host\n * @return {?}\n */\n attach(host) {\n if (host == null) {\n throwNullPortalHostError();\n }\n if (host.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n this._attachedHost = host;\n return (host.attach(this));\n }\n /**\n * Detach this portal from its host\n * @return {?}\n */\n detach() {\n let /** @type {?} */ host = this._attachedHost;\n if (host == null) {\n throwNoPortalAttachedError();\n }\n else {\n this._attachedHost = null;\n host.detach();\n }\n }\n /**\n * Whether this portal is attached to a host.\n * @return {?}\n */\n get isAttached() {\n return this._attachedHost != null;\n }\n /**\n * Sets the PortalHost reference without performing `attach()`. This is used directly by\n * the PortalHost when it is performing an `attach()` or `detach()`.\n * @param {?} host\n * @return {?}\n */\n setAttachedHost(host) {\n this._attachedHost = host;\n }\n}\nfunction Portal_tsickle_Closure_declarations() {\n /** @type {?} */\n Portal.prototype._attachedHost;\n}\n/**\n * A `ComponentPortal` is a portal that instantiates some Component upon attachment.\n */\nexport class ComponentPortal extends Portal {\n /**\n * @param {?} component\n * @param {?=} viewContainerRef\n * @param {?=} injector\n */\n constructor(component, viewContainerRef, injector) {\n super();\n this.component = component;\n this.viewContainerRef = viewContainerRef;\n this.injector = injector;\n }\n}\nfunction ComponentPortal_tsickle_Closure_declarations() {\n /**\n * The type of the component that will be instantiated for attachment.\n * @type {?}\n */\n ComponentPortal.prototype.component;\n /**\n * [Optional] Where the attached component should live in Angular's *logical* component tree.\n * This is different from where the component *renders*, which is determined by the PortalHost.\n * The origin is necessary when the host is outside of the Angular application context.\n * @type {?}\n */\n ComponentPortal.prototype.viewContainerRef;\n /**\n * [Optional] Injector used for the instantiation of the component.\n * @type {?}\n */\n ComponentPortal.prototype.injector;\n}\n/**\n * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).\n */\nexport class TemplatePortal extends Portal {\n /**\n * @param {?} template\n * @param {?} viewContainerRef\n * @param {?=} context\n */\n constructor(template, viewContainerRef, context) {\n super();\n this.templateRef = template;\n this.viewContainerRef = viewContainerRef;\n if (context) {\n this.context = context;\n }\n }\n /**\n * @return {?}\n */\n get origin() {\n return this.templateRef.elementRef;\n }\n /**\n * Attach the the portal to the provided `PortalHost`.\n * When a context is provided it will override the `context` property of the `TemplatePortal`\n * instance.\n * @param {?} host\n * @param {?=} context\n * @return {?}\n */\n attach(host, context = this.context) {\n this.context = context;\n return super.attach(host);\n }\n /**\n * @return {?}\n */\n detach() {\n this.context = undefined;\n return super.detach();\n }\n}\nfunction TemplatePortal_tsickle_Closure_declarations() {\n /**\n * The embedded template that will be used to instantiate an embedded View in the host.\n * @type {?}\n */\n TemplatePortal.prototype.templateRef;\n /**\n * Reference to the ViewContainer into which the template will be stamped out.\n * @type {?}\n */\n TemplatePortal.prototype.viewContainerRef;\n /** @type {?} */\n TemplatePortal.prototype.context;\n}\n/**\n * Partial implementation of PortalHost that only deals with attaching either a\n * ComponentPortal or a TemplatePortal.\n * @abstract\n */\nexport class BasePortalHost {\n constructor() {\n /**\n * Whether this host has already been permanently disposed.\n */\n this._isDisposed = false;\n }\n /**\n * Whether this host has an attached portal.\n * @return {?}\n */\n hasAttached() {\n return !!this._attachedPortal;\n }\n /**\n * @param {?} portal\n * @return {?}\n */\n attach(portal) {\n if (!portal) {\n throwNullPortalError();\n }\n if (this.hasAttached()) {\n throwPortalAlreadyAttachedError();\n }\n if (this._isDisposed) {\n throwPortalHostAlreadyDisposedError();\n }\n if (portal instanceof ComponentPortal) {\n this._attachedPortal = portal;\n return this.attachComponentPortal(portal);\n }\n else if (portal instanceof TemplatePortal) {\n this._attachedPortal = portal;\n return this.attachTemplatePortal(portal);\n }\n throwUnknownPortalTypeError();\n }\n /**\n * @abstract\n * @template T\n * @param {?} portal\n * @return {?}\n */\n attachComponentPortal(portal) { }\n /**\n * @abstract\n * @template C\n * @param {?} portal\n * @return {?}\n */\n attachTemplatePortal(portal) { }\n /**\n * @return {?}\n */\n detach() {\n if (this._attachedPortal) {\n this._attachedPortal.setAttachedHost(null);\n this._attachedPortal = null;\n }\n this._invokeDisposeFn();\n }\n /**\n * @return {?}\n */\n dispose() {\n if (this.hasAttached()) {\n this.detach();\n }\n this._invokeDisposeFn();\n this._isDisposed = true;\n }\n /**\n * @param {?} fn\n * @return {?}\n */\n setDisposeFn(fn) {\n this._disposeFn = fn;\n }\n /**\n * @return {?}\n */\n _invokeDisposeFn() {\n if (this._disposeFn) {\n this._disposeFn();\n this._disposeFn = null;\n }\n }\n}\nfunction BasePortalHost_tsickle_Closure_declarations() {\n /**\n * The portal currently attached to the host.\n * @type {?}\n */\n BasePortalHost.prototype._attachedPortal;\n /**\n * A function that will permanently dispose this host.\n * @type {?}\n */\n BasePortalHost.prototype._disposeFn;\n /**\n * Whether this host has already been permanently disposed.\n * @type {?}\n */\n BasePortalHost.prototype._isDisposed;\n}\n//# sourceMappingURL=portal.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { BasePortalHost } from './portal';\n/**\n * A PortalHost for attaching portals to an arbitrary DOM element outside of the Angular\n * application context.\n *\n * This is the only part of the portal core that directly touches the DOM.\n */\nexport class DomPortalHost extends BasePortalHost {\n /**\n * @param {?} _hostDomElement\n * @param {?} _componentFactoryResolver\n * @param {?} _appRef\n * @param {?} _defaultInjector\n */\n constructor(_hostDomElement, _componentFactoryResolver, _appRef, _defaultInjector) {\n super();\n this._hostDomElement = _hostDomElement;\n this._componentFactoryResolver = _componentFactoryResolver;\n this._appRef = _appRef;\n this._defaultInjector = _defaultInjector;\n }\n /**\n * Attach the given ComponentPortal to DOM element using the ComponentFactoryResolver.\n * @template T\n * @param {?} portal Portal to be attached\n * @return {?}\n */\n attachComponentPortal(portal) {\n let /** @type {?} */ componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);\n let /** @type {?} */ componentRef;\n // If the portal specifies a ViewContainerRef, we will use that as the attachment point\n // for the component (in terms of Angular's component tree, not rendering).\n // When the ViewContainerRef is missing, we use the factory to create the component directly\n // and then manually attach the view to the application.\n if (portal.viewContainerRef) {\n componentRef = portal.viewContainerRef.createComponent(componentFactory, portal.viewContainerRef.length, portal.injector || portal.viewContainerRef.parentInjector);\n this.setDisposeFn(() => componentRef.destroy());\n }\n else {\n componentRef = componentFactory.create(portal.injector || this._defaultInjector);\n this._appRef.attachView(componentRef.hostView);\n this.setDisposeFn(() => {\n this._appRef.detachView(componentRef.hostView);\n componentRef.destroy();\n });\n }\n // At this point the component has been instantiated, so we move it to the location in the DOM\n // where we want it to be rendered.\n this._hostDomElement.appendChild(this._getComponentRootNode(componentRef));\n return componentRef;\n }\n /**\n * Attaches a template portal to the DOM as an embedded view.\n * @template C\n * @param {?} portal Portal to be attached.\n * @return {?}\n */\n attachTemplatePortal(portal) {\n let /** @type {?} */ viewContainer = portal.viewContainerRef;\n let /** @type {?} */ viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context);\n viewRef.detectChanges();\n // The method `createEmbeddedView` will add the view as a child of the viewContainer.\n // But for the DomPortalHost the view can be added everywhere in the DOM (e.g Overlay Container)\n // To move the view to the specified host element. We just re-append the existing root nodes.\n viewRef.rootNodes.forEach(rootNode => this._hostDomElement.appendChild(rootNode));\n this.setDisposeFn((() => {\n let /** @type {?} */ index = viewContainer.indexOf(viewRef);\n if (index !== -1) {\n viewContainer.remove(index);\n }\n }));\n // TODO(jelbourn): Return locals from view.\n return viewRef;\n }\n /**\n * Clears out a portal from the DOM.\n * @return {?}\n */\n dispose() {\n super.dispose();\n if (this._hostDomElement.parentNode != null) {\n this._hostDomElement.parentNode.removeChild(this._hostDomElement);\n }\n }\n /**\n * Gets the root HTMLElement for an instantiated component.\n * @param {?} componentRef\n * @return {?}\n */\n _getComponentRootNode(componentRef) {\n return (((componentRef.hostView)).rootNodes[0]);\n }\n}\nfunction DomPortalHost_tsickle_Closure_declarations() {\n /** @type {?} */\n DomPortalHost.prototype._hostDomElement;\n /** @type {?} */\n DomPortalHost.prototype._componentFactoryResolver;\n /** @type {?} */\n DomPortalHost.prototype._appRef;\n /** @type {?} */\n DomPortalHost.prototype._defaultInjector;\n}\n//# sourceMappingURL=dom-portal-host.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule, Directive, TemplateRef, ComponentFactoryResolver, ViewContainerRef, Input, } from '@angular/core';\nimport { TemplatePortal, BasePortalHost } from './portal';\n/**\n * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,\n * the directive instance itself can be attached to a host, enabling declarative use of portals.\n *\n * Usage:\n * <ng-template portal #greeting>\n * <p> Hello {{name}} </p>\n * </ng-template>\n */\nexport class TemplatePortalDirective extends TemplatePortal {\n /**\n * @param {?} templateRef\n * @param {?} viewContainerRef\n */\n constructor(templateRef, viewContainerRef) {\n super(templateRef, viewContainerRef);\n }\n}\nTemplatePortalDirective.decorators = [\n { type: Directive, args: [{\n selector: '[cdk-portal], [cdkPortal], [portal]',\n exportAs: 'cdkPortal',\n },] },\n];\n/**\n * @nocollapse\n */\nTemplatePortalDirective.ctorParameters = () => [\n { type: TemplateRef, },\n { type: ViewContainerRef, },\n];\nfunction TemplatePortalDirective_tsickle_Closure_declarations() {\n /** @type {?} */\n TemplatePortalDirective.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n TemplatePortalDirective.ctorParameters;\n}\n/**\n * Directive version of a PortalHost. Because the directive *is* a PortalHost, portals can be\n * directly attached to it, enabling declarative use.\n *\n * Usage:\n * <ng-template [cdkPortalHost]=\"greeting\"></ng-template>\n */\nexport class PortalHostDirective extends BasePortalHost {\n /**\n * @param {?} _componentFactoryResolver\n * @param {?} _viewContainerRef\n */\n constructor(_componentFactoryResolver, _viewContainerRef) {\n super();\n this._componentFactoryResolver = _componentFactoryResolver;\n this._viewContainerRef = _viewContainerRef;\n /**\n * The attached portal.\n */\n this._portal = null;\n }\n /**\n * @deprecated\n * @return {?}\n */\n get _deprecatedPortal() { return this.portal; }\n /**\n * @param {?} v\n * @return {?}\n */\n set _deprecatedPortal(v) { this.portal = v; }\n /**\n * Portal associated with the Portal host.\n * @return {?}\n */\n get portal() {\n return this._portal;\n }\n /**\n * @param {?} portal\n * @return {?}\n */\n set portal(portal) {\n if (this.hasAttached()) {\n super.detach();\n }\n if (portal) {\n super.attach(portal);\n }\n this._portal = portal;\n }\n /**\n * @return {?}\n */\n ngOnDestroy() {\n super.dispose();\n this._portal = null;\n }\n /**\n * Attach the given ComponentPortal to this PortalHost using the ComponentFactoryResolver.\n *\n * @template T\n * @param {?} portal Portal to be attached to the portal host.\n * @return {?}\n */\n attachComponentPortal(portal) {\n portal.setAttachedHost(this);\n // If the portal specifies an origin, use that as the logical location of the component\n // in the application tree. Otherwise use the location of this PortalHost.\n let /** @type {?} */ viewContainerRef = portal.viewContainerRef != null ?\n portal.viewContainerRef :\n this._viewContainerRef;\n let /** @type {?} */ componentFactory = this._componentFactoryResolver.resolveComponentFactory(portal.component);\n let /** @type {?} */ ref = viewContainerRef.createComponent(componentFactory, viewContainerRef.length, portal.injector || viewContainerRef.parentInjector);\n super.setDisposeFn(() => ref.destroy());\n this._portal = portal;\n return ref;\n }\n /**\n * Attach the given TemplatePortal to this PortlHost as an embedded View.\n * @template C\n * @param {?} portal Portal to be attached.\n * @return {?}\n */\n attachTemplatePortal(portal) {\n portal.setAttachedHost(this);\n const /** @type {?} */ viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context);\n super.setDisposeFn(() => this._viewContainerRef.clear());\n this._portal = portal;\n return viewRef;\n }\n}\nPortalHostDirective.decorators = [\n { type: Directive, args: [{\n selector: '[cdkPortalHost], [portalHost]',\n exportAs: 'cdkPortalHost',\n inputs: ['portal: cdkPortalHost']\n },] },\n];\n/**\n * @nocollapse\n */\nPortalHostDirective.ctorParameters = () => [\n { type: ComponentFactoryResolver, },\n { type: ViewContainerRef, },\n];\nPortalHostDirective.propDecorators = {\n '_deprecatedPortal': [{ type: Input, args: ['portalHost',] },],\n};\nfunction PortalHostDirective_tsickle_Closure_declarations() {\n /** @type {?} */\n PortalHostDirective.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n PortalHostDirective.ctorParameters;\n /** @type {?} */\n PortalHostDirective.propDecorators;\n /**\n * The attached portal.\n * @type {?}\n */\n PortalHostDirective.prototype._portal;\n /** @type {?} */\n PortalHostDirective.prototype._componentFactoryResolver;\n /** @type {?} */\n PortalHostDirective.prototype._viewContainerRef;\n}\nexport class PortalModule {\n}\nPortalModule.decorators = [\n { type: NgModule, args: [{\n exports: [TemplatePortalDirective, PortalHostDirective],\n declarations: [TemplatePortalDirective, PortalHostDirective],\n },] },\n];\n/**\n * @nocollapse\n */\nPortalModule.ctorParameters = () => [];\nfunction PortalModule_tsickle_Closure_declarations() {\n /** @type {?} */\n PortalModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n PortalModule.ctorParameters;\n}\n//# sourceMappingURL=portal-directives.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Custom injector to be used when providing custom\n * injection tokens to components inside a portal.\n * \\@docs-private\n */\nexport class PortalInjector {\n /**\n * @param {?} _parentInjector\n * @param {?} _customTokens\n */\n constructor(_parentInjector, _customTokens) {\n this._parentInjector = _parentInjector;\n this._customTokens = _customTokens;\n }\n /**\n * @param {?} token\n * @param {?=} notFoundValue\n * @return {?}\n */\n get(token, notFoundValue) {\n const /** @type {?} */ value = this._customTokens.get(token);\n if (typeof value !== 'undefined') {\n return value;\n }\n return this._parentInjector.get(token, notFoundValue);\n }\n}\nfunction PortalInjector_tsickle_Closure_declarations() {\n /** @type {?} */\n PortalInjector.prototype._parentInjector;\n /** @type {?} */\n PortalInjector.prototype._customTokens;\n}\n//# sourceMappingURL=portal-injector.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { Portal, ComponentPortal, TemplatePortal, BasePortalHost, DomPortalHost, TemplatePortalDirective, PortalHostDirective, Port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ith';
|
|
|
17
17
|
import { debounceTime } from 'rxjs/operator/debounceTime';
|
|
18
18
|
import { auditTime } from 'rxjs/operator/auditTime';
|
|
19
19
|
import { takeUntil } from 'rxjs/operator/takeUntil';
|
|
20
|
+
import { delay } from 'rxjs/operator/delay';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Utility class used to chain RxJS operators.
|
|
@@ -92,6 +93,8 @@ class AuditTimeBrand {
|
|
|
92
93
|
}
|
|
93
94
|
class TakeUntilBrand {
|
|
94
95
|
}
|
|
96
|
+
class DelayBrand {
|
|
97
|
+
}
|
|
95
98
|
// We add `Function` to the type intersection to make this nomically different from
|
|
96
99
|
// `finallyOperatorType` while still being structurally the same. Without this, TypeScript tries to
|
|
97
100
|
// reduce `typeof _finallyOperator & FinallyBrand` to `finallyOperatorType<T>` and then fails
|
|
@@ -108,10 +111,11 @@ const startWith$1 = (startWith);
|
|
|
108
111
|
const debounceTime$1 = (debounceTime);
|
|
109
112
|
const auditTime$1 = (auditTime);
|
|
110
113
|
const takeUntil$1 = (takeUntil);
|
|
114
|
+
const delay$1 = (delay);
|
|
111
115
|
|
|
112
116
|
/**
|
|
113
117
|
* Generated bundle index. Do not edit.
|
|
114
118
|
*/
|
|
115
119
|
|
|
116
|
-
export { RxChain, FinallyBrand, CatchBrand, DoBrand, MapBrand, FilterBrand, ShareBrand, FirstBrand, SwitchMapBrand, StartWithBrand, DebounceTimeBrand, AuditTimeBrand, TakeUntilBrand, finallyOperator, catchOperator, doOperator, map$1 as map, filter$1 as filter, share$1 as share, first$1 as first, switchMap$1 as switchMap, startWith$1 as startWith, debounceTime$1 as debounceTime, auditTime$1 as auditTime, takeUntil$1 as takeUntil };
|
|
120
|
+
export { RxChain, FinallyBrand, CatchBrand, DoBrand, MapBrand, FilterBrand, ShareBrand, FirstBrand, SwitchMapBrand, StartWithBrand, DebounceTimeBrand, AuditTimeBrand, TakeUntilBrand, DelayBrand, finallyOperator, catchOperator, doOperator, map$1 as map, filter$1 as filter, share$1 as share, first$1 as first, switchMap$1 as switchMap, startWith$1 as startWith, debounceTime$1 as debounceTime, auditTime$1 as auditTime, takeUntil$1 as takeUntil, delay$1 as delay };
|
|
117
121
|
//# sourceMappingURL=rxjs.js.map
|
package/esm2015/rxjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rxjs.js","sources":["../../../src/cdk/rxjs/index.ts","../../../src/cdk/rxjs/rx-operators.ts","../../../src/cdk/rxjs/rx-chain.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {RxChain,StrictRxChain,FinallyBrand,CatchBrand,DoBrand,MapBrand,FilterBrand,ShareBrand,FirstBrand,SwitchMapBrand,StartWithBrand,DebounceTimeBrand,AuditTimeBrand,TakeUntilBrand,finallyOperatorType,catchOperatorType,doOperatorType,mapOperatorType,filterOperatorType,shareOperatorType,firstOperatorType,switchMapOperatorType,startWithOperatorType,debounceTimeOperatorType,auditTimeOperatorType,takeUntilOperatorType,finallyOperator,catchOperator,doOperator,map,filter,share,first,switchMap,startWith,debounceTime,auditTime,takeUntil} from './public_api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Observable, ObservableInput} from 'rxjs/Observable';\nimport {PartialObserver} from 'rxjs/Observer';\nimport {Subscription} from 'rxjs/Subscription';\nimport {IScheduler} from 'rxjs/Scheduler';\nimport {_finally as _finallyOperator} from 'rxjs/operator/finally';\nimport {_catch as _catchOperator} from 'rxjs/operator/catch';\nimport {_do as _doOperator} from 'rxjs/operator/do';\nimport {map as mapOperator} from 'rxjs/operator/map';\nimport {filter as filterOperator} from 'rxjs/operator/filter';\nimport {share as shareOperator} from 'rxjs/operator/share';\nimport {first as firstOperator} from 'rxjs/operator/first';\nimport {switchMap as switchMapOperator} from 'rxjs/operator/switchMap';\nimport {startWith as startWithOperator} from 'rxjs/operator/startWith';\nimport {debounceTime as debounceTimeOperator} from 'rxjs/operator/debounceTime';\nimport {auditTime as auditTimeOperator} from 'rxjs/operator/auditTime';\nimport {takeUntil as takeUntilOperator} from 'rxjs/operator/takeUntil';\n\n/**\n * Represents a strongly-typed chain of RxJS operators.\n *\n * We achieve strict type enforcement on the chained operators by creating types that\n * *unambiguously* match specific rxjs operators. These unambiguous types are created by\n * intersecting a \"brand\" to the `typeof` the existing operator. The brand (a class with a private\n * member) effectively forces nominal typing for the operators. This allows typescript to understand\n * that, for example, `filter` is *`filter`* and not, say, a map of T => boolean.\n *\n * The downside to this approach is that operators must be imported in their type-coerced form\n * rather than from the normal rxjs location.\n */\nexport interface StrictRxChain<T> {\n call<R>(operator: mapOperatorType<T, R>,\n project: (value: T, index: number) => R, thisArg?: any): StrictRxChain<R>;\n\n call<R>(operator: switchMapOperatorType<T, R>,\n project: (value: T, index: number) => ObservableInput<R>): StrictRxChain<R>;\n\n call<R>(operator: catchOperatorType<T, R>,\n selector: (err: any, caught: Observable<T>) => ObservableInput<R>): StrictRxChain<T | R>;\n\n call(operator: filterOperatorType<T>,\n predicate: (value: T, index: number) => boolean, thisArg?: any): StrictRxChain<T>;\n\n call(operator: shareOperatorType<T>): StrictRxChain<T>;\n\n call(operator: finallyOperatorType<T>, action: () => void): StrictRxChain<T>;\n\n call(operator: doOperatorType<T>, next: (x: T) => void, error?:\n (e: any) => void, complete?: () => void): StrictRxChain<T>;\n\n call(operator: doOperatorType<T>, observer: PartialObserver<T>): StrictRxChain<T>;\n\n call(operator: firstOperatorType<T>, thisArg?: any, defaultValue?: any): StrictRxChain<T>;\n\n call(operator: firstOperatorType<T>, predicate: (value: T) => boolean): StrictRxChain<T>;\n\n call(operator: startWithOperatorType<T>, ...args: any[]): StrictRxChain<T>;\n\n call(operator: debounceTimeOperatorType<T>, dueTime: number,\n scheduler?: IScheduler): StrictRxChain<T>;\n\n call(operator: auditTimeOperatorType<T>, duration: number,\n scheduler?: IScheduler): StrictRxChain<T>;\n\n call(operator: takeUntilOperatorType<T>, notifier: Observable<any>): StrictRxChain<T>;\n\n subscribe(fn: (t: T) => void): Subscription;\n\n result(): Observable<T>;\n}\nexport class FinallyBrand {\nprivate _; }\n\nfunction FinallyBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nFinallyBrand.prototype._;\n}\n\nexport class CatchBrand {\nprivate _; }\n\nfunction CatchBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nCatchBrand.prototype._;\n}\n\nexport class DoBrand {\nprivate _; }\n\nfunction DoBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nDoBrand.prototype._;\n}\n\nexport class MapBrand {\nprivate _; }\n\nfunction MapBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nMapBrand.prototype._;\n}\n\nexport class FilterBrand {\nprivate _; }\n\nfunction FilterBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nFilterBrand.prototype._;\n}\n\nexport class ShareBrand {\nprivate _; }\n\nfunction ShareBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nShareBrand.prototype._;\n}\n\nexport class FirstBrand {\nprivate _; }\n\nfunction FirstBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nFirstBrand.prototype._;\n}\n\nexport class SwitchMapBrand {\nprivate _; }\n\nfunction SwitchMapBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nSwitchMapBrand.prototype._;\n}\n\nexport class StartWithBrand {\nprivate _; }\n\nfunction StartWithBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nStartWithBrand.prototype._;\n}\n\nexport class DebounceTimeBrand {\nprivate _; }\n\nfunction DebounceTimeBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nDebounceTimeBrand.prototype._;\n}\n\nexport class AuditTimeBrand {\nprivate _; }\n\nfunction AuditTimeBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nAuditTimeBrand.prototype._;\n}\n\nexport class TakeUntilBrand {\nprivate _; }\n\nfunction TakeUntilBrand_tsickle_Closure_declarations() {\n/** @type {?} */\nTakeUntilBrand.prototype._;\n}\n\n/* tslint:enable:no-unused-variable */\n\n\nexport type finallyOperatorType<T> = typeof _finallyOperator & FinallyBrand;\nexport type catchOperatorType<T, R> = typeof _catchOperator & CatchBrand;\nexport type doOperatorType<T> = typeof _doOperator & DoBrand;\nexport type mapOperatorType<T, R> = typeof mapOperator & MapBrand;\nexport type filterOperatorType<T> = typeof filterOperator & FilterBrand;\nexport type shareOperatorType<T> = typeof shareOperator & ShareBrand;\nexport type firstOperatorType<T> = typeof firstOperator & FirstBrand;\nexport type switchMapOperatorType<T, R> = typeof switchMapOperator & SwitchMapBrand;\nexport type startWithOperatorType<T> = typeof startWithOperator & StartWithBrand;\nexport type debounceTimeOperatorType<T> = typeof debounceTimeOperator & DebounceTimeBrand;\nexport type auditTimeOperatorType<T> = typeof auditTimeOperator & AuditTimeBrand;\nexport type takeUntilOperatorType<T> = typeof takeUntilOperator & TakeUntilBrand;\n\n// We add `Function` to the type intersection to make this nomically different from\n// `finallyOperatorType` while still being structurally the same. Without this, TypeScript tries to\n// reduce `typeof _finallyOperator & FinallyBrand` to `finallyOperatorType<T>` and then fails\n// because `T` isn't known.\nexport const /** @type {?} */ finallyOperator = /** @type {?} */((\n _finallyOperator as typeof _finallyOperator & FinallyBrand & Function));\nexport const /** @type {?} */ catchOperator = /** @type {?} */(( _catchOperator as typeof _catchOperator & CatchBrand & Function));\nexport const /** @type {?} */ doOperator = /** @type {?} */(( _doOperator as typeof _doOperator & DoBrand & Function));\nexport const /** @type {?} */ map = /** @type {?} */(( mapOperator as typeof mapOperator & MapBrand & Function));\nexport const /** @type {?} */ filter = /** @type {?} */(( filterOperator as typeof filterOperator & FilterBrand & Function));\nexport const /** @type {?} */ share = /** @type {?} */(( shareOperator as typeof shareOperator & ShareBrand & Function));\nexport const /** @type {?} */ first = /** @type {?} */(( firstOperator as typeof firstOperator & FirstBrand & Function));\nexport const /** @type {?} */ switchMap = /** @type {?} */(( switchMapOperator as typeof switchMapOperator & SwitchMapBrand & Function));\nexport const /** @type {?} */ startWith = /** @type {?} */(( startWithOperator as typeof startWithOperator & StartWithBrand & Function));\nexport const /** @type {?} */ debounceTime = /** @type {?} */((\n debounceTimeOperator as typeof debounceTimeOperator & DebounceTimeBrand & Function));\nexport const /** @type {?} */ auditTime = /** @type {?} */(( auditTimeOperator as typeof auditTimeOperator & AuditTimeBrand & Function));\nexport const /** @type {?} */ takeUntil = /** @type {?} */(( takeUntilOperator as typeof takeUntilOperator & TakeUntilBrand & Function));\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Observable} from 'rxjs/Observable';\nimport {Subscription} from 'rxjs/Subscription';\nimport {StrictRxChain} from './rx-operators';\n/**\n * Utility class used to chain RxJS operators.\n * \n * This class is the concrete implementation, but the type used by the user when chaining\n * is StrictRxChain. The strict chain enforces types on the operators to the same level as\n * the prototype-added equivalents.\n */\nexport class RxChain<T> {\n/**\n * @param {?} _context\n */\nprivate constructor(private _context: Observable<T>) { }\n/**\n * Starts a new chain and specifies the initial `this` value.\n * @template O\n * @param {?} context Initial `this` value for the chain.\n * @return {?}\n */\nstatic from<O>(context: Observable<O>): StrictRxChain<O> {\n return new RxChain(context);\n }\n/**\n * Invokes an RxJS operator as a part of the chain.\n * @param {?} operator Operator to be invoked.\n * @param {...?} args Arguments to be passed to the operator.\n * @return {?}\n */\ncall(operator: Function, ...args: any[]): RxChain<any> {\n this._context = operator.call(this._context, ...args);\n return this;\n }\n/**\n * Subscribes to the result of the chain.\n * @param {?} fn Callback to be invoked when the result emits a value.\n * @return {?}\n */\nsubscribe(fn: (t: T) => void): Subscription {\n return this._context.subscribe(fn);\n }\n/**\n * Returns the result of the chain.\n * @return {?}\n */\nresult(): Observable<T> {\n return this._context;\n }\n}\n\nfunction RxChain_tsickle_Closure_declarations() {\n/** @type {?} */\nRxChain.prototype._context;\n}\n\n"],"names":["takeUntil","takeUntilOperator","auditTime","auditTimeOperator","debounceTime","debounceTimeOperator","startWith","startWithOperator","switchMap","switchMapOperator","first","firstOperator","share","shareOperator","filter","filterOperator","map","mapOperator","_doOperator","_catchOperator","_finallyOperator"],"mappings":";;;;;;;;;;;;;;;;;;;;AEYA;;;;;;;AAOA,AAAA,MAAA,OAAA,CAAA;;;;IAIA,WAAA,CAH8B,QAAuB,EAGrD;QAH8B,IAA9B,CAAA,QAA8B,GAAA,QAAA,CAAuB;KAAC;;;;;;;IAUtD,OAJG,IAAA,CAAA,OAAA,EAIH;QACI,OAJO,IAAI,OAAA,CAAQ,OAAC,CAAO,CAAC;KAK7B;;;;;;;IAOH,IAJG,CAAA,QAAA,EAAA,GAAA,IAAA,EAIH;QACI,IAAI,CAJC,QAAC,GAAU,QAAA,CAAS,IAAC,CAAI,IAAC,CAAI,QAAC,EAAS,GAAA,IAAI,CAAI,CAAC;QAKtD,OAJO,IAAA,CAAK;KAKb;;;;;;IAMH,SAJG,CAAA,EAAA,EAIH;QACI,OAJO,IAAA,CAAK,QAAC,CAAQ,SAAC,CAAS,EAAC,CAAE,CAAC;KAKpC;;;;;IAKH,MAJG,GAIH;QACI,OAJO,IAAA,CAAK,QAAC,CAAQ;KAKtB;CACF,AAED,AAGC;;ADeD,MAAA,YAAA,CAAA;CACuC;AAEvC,AAKA,AAAA,MAAA,UAAA,CAAA;CANqC;AASrC,AAKA,AAAA,MAAA,OAAA,CAAA;CAbkC;AAgBlC,AAKA,AAAA,MAAA,QAAA,CAAA;CApBmC;AAuBnC,AAKA,AAAA,MAAA,WAAA,CAAA;CA3BsC;AA8BtC,AAKA,AAAA,MAAA,UAAA,CAAA;CAlCqC;AAqCrC,AAKA,AAAA,MAAA,UAAA,CAAA;CAzCqC;AA4CrC,AAKA,AAAA,MAAA,cAAA,CAAA;CAhDyC;AAmDzC,AAKA,AAAA,MAAA,cAAA,CAAA;CAvDyC;AA0DzC,AAKA,AAAA,MAAA,iBAAA,CAAA;CA9D4C;AAiE5C,AAKA,AAAA,MAAA,cAAA,CAAA;CArEyC;AAwEzC,AAKA,AAAA,MAAA,cAAA,CAAA;CA5EyC;AA+EzC,AAqBA;;;;AAIA,AAnFO,MAAM,eAAA,IAoFToB,QAnF6D,CAAA,CAAS;AAoF1E,AAnFO,MAAM,aAAA,IAAgBD,MAAuD,CAAA,CAAS;AAoF7F,AAnFO,MAAM,UAAA,IAAaD,GAA8C,CAAA,CAAS;AAoFjF,AAnFO,MAAMF,KAAA,IAAMC,GAA+C,CAAA,CAAS;AAoF3E,AAnFO,MAAMH,QAAA,IAASC,MAAwD,CAAA,CAAS;AAoFvF,AAnFO,MAAMH,OAAA,IAAQC,KAAqD,CAAA,CAAS;AAoFnF,AAnFO,MAAMH,OAAA,IAAQC,KAAqD,CAAA,CAAS;AAoFnF,AAnFO,MAAMH,WAAA,IAAYC,SAAiE,CAAA,CAAS;AAoFnG,AAnFO,MAAMH,WAAA,IAAYC,SAAiE,CAAA,CAAS;AAoFnG,AAnFO,MAAMH,cAAA,IAoFTC,YAnF0E,CAAA,CAAS;AAoFvF,AAnFO,MAAMH,WAAA,IAAYC,SAAiE,CAAA,CAAS;AAoFnG,AAnFO,MAAMH,WAAA,IAAYC,SAAiE,CAAA,CAAS;;AD5HnG;;GAEG,AAEH,AAA8iB;;"}
|
|
1
|
+
{"version":3,"file":"rxjs.js","sources":["../../packages/cdk/rxjs/rx-chain.js","../../packages/cdk/rxjs/rx-operators.js","../../packages/cdk/rxjs/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n/**\n * Utility class used to chain RxJS operators.\n *\n * This class is the concrete implementation, but the type used by the user when chaining\n * is StrictRxChain. The strict chain enforces types on the operators to the same level as\n * the prototype-added equivalents.\n */\nexport class RxChain {\n /**\n * @param {?} _context\n */\n constructor(_context) {\n this._context = _context;\n }\n /**\n * Starts a new chain and specifies the initial `this` value.\n * @template O\n * @param {?} context Initial `this` value for the chain.\n * @return {?}\n */\n static from(context) {\n return new RxChain(context);\n }\n /**\n * Invokes an RxJS operator as a part of the chain.\n * @param {?} operator Operator to be invoked.\n * @param {...?} args Arguments to be passed to the operator.\n * @return {?}\n */\n call(operator, ...args) {\n this._context = operator.call(this._context, ...args);\n return this;\n }\n /**\n * Subscribes to the result of the chain.\n * @param {?} fn Callback to be invoked when the result emits a value.\n * @return {?}\n */\n subscribe(fn) {\n return this._context.subscribe(fn);\n }\n /**\n * Returns the result of the chain.\n * @return {?}\n */\n result() {\n return this._context;\n }\n}\nfunction RxChain_tsickle_Closure_declarations() {\n /** @type {?} */\n RxChain.prototype._context;\n}\n//# sourceMappingURL=rx-chain.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { _finally as _finallyOperator } from 'rxjs/operator/finally';\nimport { _catch as _catchOperator } from 'rxjs/operator/catch';\nimport { _do as _doOperator } from 'rxjs/operator/do';\nimport { map as mapOperator } from 'rxjs/operator/map';\nimport { filter as filterOperator } from 'rxjs/operator/filter';\nimport { share as shareOperator } from 'rxjs/operator/share';\nimport { first as firstOperator } from 'rxjs/operator/first';\nimport { switchMap as switchMapOperator } from 'rxjs/operator/switchMap';\nimport { startWith as startWithOperator } from 'rxjs/operator/startWith';\nimport { debounceTime as debounceTimeOperator } from 'rxjs/operator/debounceTime';\nimport { auditTime as auditTimeOperator } from 'rxjs/operator/auditTime';\nimport { takeUntil as takeUntilOperator } from 'rxjs/operator/takeUntil';\nimport { delay as delayOperator } from 'rxjs/operator/delay';\nexport class FinallyBrand {\n}\nfunction FinallyBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n FinallyBrand.prototype._;\n}\nexport class CatchBrand {\n}\nfunction CatchBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n CatchBrand.prototype._;\n}\nexport class DoBrand {\n}\nfunction DoBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n DoBrand.prototype._;\n}\nexport class MapBrand {\n}\nfunction MapBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n MapBrand.prototype._;\n}\nexport class FilterBrand {\n}\nfunction FilterBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n FilterBrand.prototype._;\n}\nexport class ShareBrand {\n}\nfunction ShareBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n ShareBrand.prototype._;\n}\nexport class FirstBrand {\n}\nfunction FirstBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n FirstBrand.prototype._;\n}\nexport class SwitchMapBrand {\n}\nfunction SwitchMapBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n SwitchMapBrand.prototype._;\n}\nexport class StartWithBrand {\n}\nfunction StartWithBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n StartWithBrand.prototype._;\n}\nexport class DebounceTimeBrand {\n}\nfunction DebounceTimeBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n DebounceTimeBrand.prototype._;\n}\nexport class AuditTimeBrand {\n}\nfunction AuditTimeBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n AuditTimeBrand.prototype._;\n}\nexport class TakeUntilBrand {\n}\nfunction TakeUntilBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n TakeUntilBrand.prototype._;\n}\nexport class DelayBrand {\n}\nfunction DelayBrand_tsickle_Closure_declarations() {\n /** @type {?} */\n DelayBrand.prototype._;\n}\n// We add `Function` to the type intersection to make this nomically different from\n// `finallyOperatorType` while still being structurally the same. Without this, TypeScript tries to\n// reduce `typeof _finallyOperator & FinallyBrand` to `finallyOperatorType<T>` and then fails\n// because `T` isn't known.\nexport const /** @type {?} */ finallyOperator = (_finallyOperator);\nexport const /** @type {?} */ catchOperator = (_catchOperator);\nexport const /** @type {?} */ doOperator = (_doOperator);\nexport const /** @type {?} */ map = (mapOperator);\nexport const /** @type {?} */ filter = (filterOperator);\nexport const /** @type {?} */ share = (shareOperator);\nexport const /** @type {?} */ first = (firstOperator);\nexport const /** @type {?} */ switchMap = (switchMapOperator);\nexport const /** @type {?} */ startWith = (startWithOperator);\nexport const /** @type {?} */ debounceTime = (debounceTimeOperator);\nexport const /** @type {?} */ auditTime = (auditTimeOperator);\nexport const /** @type {?} */ takeUntil = (takeUntilOperator);\nexport const /** @type {?} */ delay = (delayOperator);\n//# sourceMappingURL=rx-operators.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { RxChain, FinallyBrand, CatchBrand, DoBrand, MapBrand, FilterBrand, ShareBrand, FirstBrand, SwitchMapBrand, StartWithBrand, DebounceTimeBrand, AuditTimeBrand, TakeUntilBrand, DelayBrand, finallyOperator, catchOperator, doOperator, map, filter, share, first, switchMap, startWith, debounceTime, auditTime, takeUntil, delay } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":["_finallyOperator","_catchOperator","_doOperator","map","mapOperator","filter","filterOperator","share","shareOperator","first","firstOperator","switchMap","switchMapOperator","startWith","startWithOperator","debounceTime","debounceTimeOperator","auditTime","auditTimeOperator","takeUntil","takeUntilOperator","delay","delayOperator"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA;;;;;;;AAOA,AAAO,MAAM,OAAO,CAAC;;;;IAIjB,WAAW,CAAC,QAAQ,EAAE;QAClB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;KAC5B;;;;;;;IAOD,OAAO,IAAI,CAAC,OAAO,EAAE;QACjB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;KAC/B;;;;;;;IAOD,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,EAAE;QACpB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,CAAC;QACtD,OAAO,IAAI,CAAC;KACf;;;;;;IAMD,SAAS,CAAC,EAAE,EAAE;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,C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,MAAuBC,WAAS,IAAIC,SAAiB,CAAC,CAAC;AAC9D,AAAO,MAAuBC,OAAK,IAAIC,KAAa,CAAC,CAAC,AACtD;;ACnHA;;GAEG,AACH,AAAgW,AAChW;;"}
|
package/esm2015/scrolling.js
CHANGED
|
@@ -10,8 +10,9 @@ import { Platform, PlatformModule } from '@angular/cdk/platform';
|
|
|
10
10
|
import { Subject } from 'rxjs/Subject';
|
|
11
11
|
import { Subscription } from 'rxjs/Subscription';
|
|
12
12
|
import { fromEvent } from 'rxjs/observable/fromEvent';
|
|
13
|
-
import { merge } from 'rxjs/observable/merge';
|
|
14
13
|
import { auditTime } from 'rxjs/operator/auditTime';
|
|
14
|
+
import { merge } from 'rxjs/observable/merge';
|
|
15
|
+
import { of } from 'rxjs/observable/of';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* Time in ms to throttle the scrolling events by default.
|
|
@@ -90,7 +91,7 @@ class ScrollDispatcher {
|
|
|
90
91
|
this._scrolledCount++;
|
|
91
92
|
if (!this._globalSubscription) {
|
|
92
93
|
this._globalSubscription = this._ngZone.runOutsideAngular(() => {
|
|
93
|
-
return
|
|
94
|
+
return fromEvent(window.document, 'scroll').subscribe(() => this._notify());
|
|
94
95
|
});
|
|
95
96
|
}
|
|
96
97
|
// Note that we need to do the subscribing from here, in order to be able to remove
|
|
@@ -244,17 +245,35 @@ Scrollable.ctorParameters = () => [
|
|
|
244
245
|
{ type: Renderer2, },
|
|
245
246
|
];
|
|
246
247
|
|
|
248
|
+
/**
|
|
249
|
+
* Time in ms to throttle the resize events by default.
|
|
250
|
+
*/
|
|
251
|
+
const DEFAULT_RESIZE_TIME = 20;
|
|
247
252
|
/**
|
|
248
253
|
* Simple utility for getting the bounds of the browser viewport.
|
|
249
254
|
* \@docs-private
|
|
250
255
|
*/
|
|
251
256
|
class ViewportRuler {
|
|
252
257
|
/**
|
|
258
|
+
* @param {?} platform
|
|
259
|
+
* @param {?} ngZone
|
|
253
260
|
* @param {?} scrollDispatcher
|
|
254
261
|
*/
|
|
255
|
-
constructor(scrollDispatcher) {
|
|
262
|
+
constructor(platform, ngZone, scrollDispatcher) {
|
|
263
|
+
this._change = platform.isBrowser ? ngZone.runOutsideAngular(() => {
|
|
264
|
+
return merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange'));
|
|
265
|
+
}) : of();
|
|
256
266
|
// Subscribe to scroll and resize events and update the document rectangle on changes.
|
|
257
|
-
|
|
267
|
+
this._invalidateCacheSubscriptions = [
|
|
268
|
+
scrollDispatcher.scrolled(0, () => this._cacheViewportGeometry()),
|
|
269
|
+
this.change().subscribe(() => this._cacheViewportGeometry())
|
|
270
|
+
];
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* @return {?}
|
|
274
|
+
*/
|
|
275
|
+
ngOnDestroy() {
|
|
276
|
+
this._invalidateCacheSubscriptions.forEach(subscription => subscription.unsubscribe());
|
|
258
277
|
}
|
|
259
278
|
/**
|
|
260
279
|
* Gets a ClientRect for the viewport's bounds.
|
|
@@ -311,6 +330,14 @@ class ViewportRuler {
|
|
|
311
330
|
document.documentElement.scrollLeft || 0;
|
|
312
331
|
return { top, left };
|
|
313
332
|
}
|
|
333
|
+
/**
|
|
334
|
+
* Returns a stream that emits whenever the size of the viewport changes.
|
|
335
|
+
* @param {?=} throttleTime
|
|
336
|
+
* @return {?}
|
|
337
|
+
*/
|
|
338
|
+
change(throttleTime = DEFAULT_RESIZE_TIME) {
|
|
339
|
+
return throttleTime > 0 ? auditTime.call(this._change, throttleTime) : this._change;
|
|
340
|
+
}
|
|
314
341
|
/**
|
|
315
342
|
* Caches the latest client rectangle of the document element.
|
|
316
343
|
* @return {?}
|
|
@@ -326,16 +353,20 @@ ViewportRuler.decorators = [
|
|
|
326
353
|
* @nocollapse
|
|
327
354
|
*/
|
|
328
355
|
ViewportRuler.ctorParameters = () => [
|
|
356
|
+
{ type: Platform, },
|
|
357
|
+
{ type: NgZone, },
|
|
329
358
|
{ type: ScrollDispatcher, },
|
|
330
359
|
];
|
|
331
360
|
/**
|
|
332
361
|
* \@docs-private
|
|
333
362
|
* @param {?} parentRuler
|
|
363
|
+
* @param {?} platform
|
|
364
|
+
* @param {?} ngZone
|
|
334
365
|
* @param {?} scrollDispatcher
|
|
335
366
|
* @return {?}
|
|
336
367
|
*/
|
|
337
|
-
function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, scrollDispatcher) {
|
|
338
|
-
return parentRuler || new ViewportRuler(scrollDispatcher);
|
|
368
|
+
function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform, ngZone, scrollDispatcher) {
|
|
369
|
+
return parentRuler || new ViewportRuler(platform, ngZone, scrollDispatcher);
|
|
339
370
|
}
|
|
340
371
|
/**
|
|
341
372
|
* \@docs-private
|
|
@@ -343,7 +374,7 @@ function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, scrollDispatcher) {
|
|
|
343
374
|
const VIEWPORT_RULER_PROVIDER = {
|
|
344
375
|
// If there is already a ViewportRuler available, use that. Otherwise, provide a new one.
|
|
345
376
|
provide: ViewportRuler,
|
|
346
|
-
deps: [[new Optional(), new SkipSelf(), ViewportRuler], ScrollDispatcher],
|
|
377
|
+
deps: [[new Optional(), new SkipSelf(), ViewportRuler], Platform, NgZone, ScrollDispatcher],
|
|
347
378
|
useFactory: VIEWPORT_RULER_PROVIDER_FACTORY
|
|
348
379
|
};
|
|
349
380
|
|
|
@@ -366,5 +397,5 @@ ScrollDispatchModule.ctorParameters = () => [];
|
|
|
366
397
|
* Generated bundle index. Do not edit.
|
|
367
398
|
*/
|
|
368
399
|
|
|
369
|
-
export {
|
|
400
|
+
export { DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, Scrollable, DEFAULT_RESIZE_TIME, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER, ScrollDispatchModule };
|
|
370
401
|
//# sourceMappingURL=scrolling.js.map
|
package/esm2015/scrolling.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrolling.js","sources":["../../../src/cdk/scrolling/index.ts","../../../src/cdk/scrolling/public_api.ts","../../../src/cdk/scrolling/viewport-ruler.ts","../../../src/cdk/scrolling/scrollable.ts","../../../src/cdk/scrolling/scroll-dispatcher.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport {ScrollDispatchModule,DEFAULT_SCROLL_TIME,ScrollDispatcher,SCROLL_DISPATCHER_PROVIDER_FACTORY,SCROLL_DISPATCHER_PROVIDER,Scrollable,ViewportRuler,VIEWPORT_RULER_PROVIDER_FACTORY,VIEWPORT_RULER_PROVIDER} from './public_api';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {NgModule} from '@angular/core';\nimport {SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';\nimport {Scrollable} from './scrollable';\nimport {PlatformModule} from '@angular/cdk/platform';\nexport class ScrollDispatchModule {static decorators: DecoratorInvocation[] = [\n{ type: NgModule, args: [{\n imports: [PlatformModule],\n exports: [Scrollable],\n declarations: [Scrollable],\n providers: [SCROLL_DISPATCHER_PROVIDER],\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n];\n}\n\nfunction ScrollDispatchModule_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollDispatchModule.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollDispatchModule.ctorParameters;\n}\n\n\nexport {DEFAULT_SCROLL_TIME,ScrollDispatcher,SCROLL_DISPATCHER_PROVIDER_FACTORY,SCROLL_DISPATCHER_PROVIDER} from './scroll-dispatcher';\nexport {Scrollable} from './scrollable';\nexport {ViewportRuler,VIEWPORT_RULER_PROVIDER_FACTORY,VIEWPORT_RULER_PROVIDER} from './viewport-ruler';\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Injectable, Optional, SkipSelf} from '@angular/core';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * \\@docs-private\n */\nexport class ViewportRuler {\n/**\n * Cached document client rectangle.\n */\nprivate _documentRect?: ClientRect;\n/**\n * @param {?} scrollDispatcher\n */\nconstructor(scrollDispatcher: ScrollDispatcher) {\n // Subscribe to scroll and resize events and update the document rectangle on changes.\n scrollDispatcher.scrolled(0, () => this._cacheViewportGeometry());\n }\n/**\n * Gets a ClientRect for the viewport's bounds.\n * @param {?=} documentRect\n * @return {?}\n */\ngetViewportRect(documentRect = this._documentRect): ClientRect {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const /** @type {?} */ scrollPosition = this.getViewportScrollPosition(documentRect);\n const /** @type {?} */ height = window.innerHeight;\n const /** @type {?} */ width = window.innerWidth;\n\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n/**\n * Gets the (top, left) scroll position of the viewport.\n * @param {?=} documentRect\n * @return {?}\n */\ngetViewportScrollPosition(documentRect = this._documentRect) {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const /** @type {?} */ top = - /** @type {?} */((documentRect)).top || document.body.scrollTop || window.scrollY ||\n document.documentElement.scrollTop || 0;\n\n const /** @type {?} */ left = - /** @type {?} */((documentRect)).left || document.body.scrollLeft || window.scrollX ||\n document.documentElement.scrollLeft || 0;\n\n return {top, left};\n }\n/**\n * Caches the latest client rectangle of the document element.\n * @return {?}\n */\n_cacheViewportGeometry() {\n this._documentRect = document.documentElement.getBoundingClientRect();\n }\n\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ScrollDispatcher, },\n];\n}\n\nfunction ViewportRuler_tsickle_Closure_declarations() {\n/** @type {?} */\nViewportRuler.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nViewportRuler.ctorParameters;\n/**\n * Cached document client rectangle.\n * @type {?}\n */\nViewportRuler.prototype._documentRect;\n}\n\n/**\n * \\@docs-private\n * @param {?} parentRuler\n * @param {?} scrollDispatcher\n * @return {?}\n */\nexport function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler: ViewportRuler,\n scrollDispatcher: ScrollDispatcher) {\n return parentRuler || new ViewportRuler(scrollDispatcher);\n}\n/**\n * \\@docs-private\n */\nexport const VIEWPORT_RULER_PROVIDER = {\n // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.\n provide: ViewportRuler,\n deps: [[new Optional(), new SkipSelf(), ViewportRuler], ScrollDispatcher],\n useFactory: VIEWPORT_RULER_PROVIDER_FACTORY\n};\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {Directive, ElementRef, OnInit, OnDestroy, NgZone, Renderer2} from '@angular/core';\nimport {Observable} from 'rxjs/Observable';\nimport {Subject} from 'rxjs/Subject';\nimport {ScrollDispatcher} from './scroll-dispatcher';\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nexport class Scrollable implements OnInit, OnDestroy {\nprivate _elementScrolled: Subject<Event> = new Subject();\nprivate _scrollListener: Function | null;\n/**\n * @param {?} _elementRef\n * @param {?} _scroll\n * @param {?} _ngZone\n * @param {?} _renderer\n */\nconstructor(private _elementRef: ElementRef,\nprivate _scroll: ScrollDispatcher,\nprivate _ngZone: NgZone,\nprivate _renderer: Renderer2) {}\n/**\n * @return {?}\n */\nngOnInit() {\n this._scrollListener = this._ngZone.runOutsideAngular(() => {\n return this._renderer.listen(this.getElementRef().nativeElement, 'scroll', (event: Event) => {\n this._elementScrolled.next(event);\n });\n });\n\n this._scroll.register(this);\n }\n/**\n * @return {?}\n */\nngOnDestroy() {\n this._scroll.deregister(this);\n\n if (this._scrollListener) {\n this._scrollListener();\n this._scrollListener = null;\n }\n }\n/**\n * Returns observable that emits when a scroll event is fired on the host element.\n * @return {?}\n */\nelementScrolled(): Observable<any> {\n return this._elementScrolled.asObservable();\n }\n/**\n * @return {?}\n */\ngetElementRef(): ElementRef {\n return this._elementRef;\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Directive, args: [{\n selector: '[cdk-scrollable], [cdkScrollable]'\n}, ] },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: ElementRef, },\n{type: ScrollDispatcher, },\n{type: NgZone, },\n{type: Renderer2, },\n];\n}\n\nfunction Scrollable_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollable.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollable.ctorParameters;\n/** @type {?} */\nScrollable.prototype._elementScrolled;\n/** @type {?} */\nScrollable.prototype._scrollListener;\n/** @type {?} */\nScrollable.prototype._elementRef;\n/** @type {?} */\nScrollable.prototype._scroll;\n/** @type {?} */\nScrollable.prototype._ngZone;\n/** @type {?} */\nScrollable.prototype._renderer;\n}\n\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {ElementRef, Injectable, NgZone, Optional, SkipSelf} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\nimport {Subject} from 'rxjs/Subject';\nimport {Subscription} from 'rxjs/Subscription';\nimport {fromEvent} from 'rxjs/observable/fromEvent';\nimport {merge} from 'rxjs/observable/merge';\nimport {auditTime} from 'rxjs/operator/auditTime';\nimport {Scrollable} from './scrollable';\n/**\n * Time in ms to throttle the scrolling events by default.\n */\nexport const DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nexport class ScrollDispatcher {\n/**\n * @param {?} _ngZone\n * @param {?} _platform\n */\nconstructor(private _ngZone: NgZone,\nprivate _platform: Platform) { }\n/**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n */\n_scrolled: Subject<void> = new Subject<void>();\n/**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n */\n_globalSubscription: Subscription | null = null;\n/**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n */\nprivate _scrolledCount = 0;\n/**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\nscrollableReferences: Map<Scrollable, Subscription> = new Map();\n/**\n * Registers a Scrollable with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event in its scrolled observable.\n * @param {?} scrollable Scrollable instance to be registered.\n * @return {?}\n */\nregister(scrollable: Scrollable): void {\n const /** @type {?} */ scrollSubscription = scrollable.elementScrolled().subscribe(() => this._notify());\n\n this.scrollableReferences.set(scrollable, scrollSubscription);\n }\n/**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param {?} scrollable Scrollable instance to be deregistered.\n * @return {?}\n */\nderegister(scrollable: Scrollable): void {\n const /** @type {?} */ scrollableReference = this.scrollableReferences.get(scrollable);\n\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollableReferences.delete(scrollable);\n }\n }\n/**\n * Subscribes to an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n * @param {?=} auditTimeInMs\n * @param {?=} callback\n * @return {?}\n */\nscrolled(auditTimeInMs: number = DEFAULT_SCROLL_TIME, callback: () => any): Subscription {\n // Scroll events can only happen on the browser, so do nothing if we're not on the browser.\n if (!this._platform.isBrowser) {\n return Subscription.EMPTY;\n }\n\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n let /** @type {?} */ observable = auditTimeInMs > 0 ?\n auditTime.call(this._scrolled.asObservable(), auditTimeInMs) :\n this._scrolled.asObservable();\n\n this._scrolledCount++;\n\n if (!this._globalSubscription) {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n return merge(\n fromEvent(window.document, 'scroll'),\n fromEvent(window, 'resize')\n ).subscribe(() => this._notify());\n });\n }\n\n // Note that we need to do the subscribing from here, in order to be able to remove\n // the global event listeners once there are no more subscriptions.\n let /** @type {?} */ subscription = observable.subscribe(callback);\n\n subscription.add(() => {\n this._scrolledCount--;\n\n if (this._globalSubscription && !this.scrollableReferences.size && !this._scrolledCount) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n });\n\n return subscription;\n }\n/**\n * Returns all registered Scrollables that contain the provided element.\n * @param {?} elementRef\n * @return {?}\n */\ngetScrollContainers(elementRef: ElementRef): Scrollable[] {\n const /** @type {?} */ scrollingContainers: Scrollable[] = [];\n\n this.scrollableReferences.forEach((_subscription: Subscription, scrollable: Scrollable) => {\n if (this.scrollableContainsElement(scrollable, elementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n\n return scrollingContainers;\n }\n/**\n * Returns true if the element is contained within the provided Scrollable.\n * @param {?} scrollable\n * @param {?} elementRef\n * @return {?}\n */\nscrollableContainsElement(scrollable: Scrollable, elementRef: ElementRef): boolean {\n let /** @type {?} */ element = elementRef.nativeElement;\n let /** @type {?} */ scrollableElement = scrollable.getElementRef().nativeElement;\n\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) { return true; }\n } while (element = element.parentElement);\n\n return false;\n }\n/**\n * Sends a notification that a scroll event has been fired.\n * @return {?}\n */\n_notify() {\n this._scrolled.next();\n }\nstatic decorators: DecoratorInvocation[] = [\n{ type: Injectable },\n];\n/**\n * @nocollapse\n */\nstatic ctorParameters: () => ({type: any, decorators?: DecoratorInvocation[]}|null)[] = () => [\n{type: NgZone, },\n{type: Platform, },\n];\n}\n\nfunction ScrollDispatcher_tsickle_Closure_declarations() {\n/** @type {?} */\nScrollDispatcher.decorators;\n/**\n * @nocollapse\n * @type {?}\n */\nScrollDispatcher.ctorParameters;\n/**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n * @type {?}\n */\nScrollDispatcher.prototype._scrolled;\n/**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n * @type {?}\n */\nScrollDispatcher.prototype._globalSubscription;\n/**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n * @type {?}\n */\nScrollDispatcher.prototype._scrolledCount;\n/**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n * @type {?}\n */\nScrollDispatcher.prototype.scrollableReferences;\n/** @type {?} */\nScrollDispatcher.prototype._ngZone;\n/** @type {?} */\nScrollDispatcher.prototype._platform;\n}\n\n/**\n * \\@docs-private\n * @param {?} parentDispatcher\n * @param {?} ngZone\n * @param {?} platform\n * @return {?}\n */\nexport function SCROLL_DISPATCHER_PROVIDER_FACTORY(\n parentDispatcher: ScrollDispatcher, ngZone: NgZone, platform: Platform) {\n return parentDispatcher || new ScrollDispatcher(ngZone, platform);\n}\n/**\n * \\@docs-private\n */\nexport const SCROLL_DISPATCHER_PROVIDER = {\n // If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.\n provide: ScrollDispatcher,\n deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],\n useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY\n};\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AIiBA;;;AAGA,AADC,MAAA,mBAAA,GAAA,EAAA,CAAA;;;;;AAMD,AAAA,MAAA,gBAAA,CAAA;;;;;IAKA,WAAA,CAHsB,OAAS,EAAgB,SAAW,EAG1D;QAHsB,IAAtB,CAAA,OAAsB,GAAA,OAAA,CAAS;QAAgB,IAA/C,CAAA,SAA+C,GAAA,SAAA,CAAW;;;;QAQ1D,IAAA,CAAA,SALG,GAAA,IAAA,OAAA,EAAA,CAAA;;;;QASH,IAAA,CAAA,mBANG,GAAA,IAAA,CAAA;;;;QAGA,IAAH,CAAA,cAAG,GAAA,CAAA,CAAA;;;;;QAYH,IAAA,CAAA,oBANG,GAAA,IAAA,GAAA,EAAA,CAAA;KAfgE;;;;;;;IA4BnE,QANG,CAAA,UAAA,EAMH;QACI,uBANM,kBAAA,GAAqB,UAAA,CAAW,eAAC,EAAe,CAAE,SAAC,CAAS,MAAM,IAAA,CAAK,OAAC,EAAO,CAAE,CAAC;QAQxF,IAAI,CANC,oBAAC,C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E,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACzE,UAAU,EAAE,+BAA+B;CAC5C,CAAC;;AD9HF,MAAA,oBAAA,CAAA;;AAC0C,oBAA1C,CAAA,UAA0C,GAAoC;IAA9E,EACE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,CAAA;gBAAtB,OAAO,EACE,CAAA,cAAE,CAAc;gBAAzB,OAAO,EACE,CAAA,UAAE,CAAU;gBAArB,YAAY,EACE,CAAA,UAAE,CAAU;gBAA1B,SAAS,EACE,CAAA,0BAAE,CAA0B;aAAxC,EACC,EAAG;CAAJ,CACC;;;;AAED,oBAAD,CAAA,cAAC,GAAA,MAAA,EAEA,CANoC,AASrC,AAWA,AACA,AACA,AAAuG;;ADzCvG;;GAEG,AAEH,AAAsO;;"}
|
|
1
|
+
{"version":3,"file":"scrolling.js","sources":["../../packages/cdk/scrolling/scroll-dispatcher.js","../../packages/cdk/scrolling/scrollable.js","../../packages/cdk/scrolling/viewport-ruler.js","../../packages/cdk/scrolling/scrolling-module.js","../../packages/cdk/scrolling/index.js"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, NgZone, Optional, SkipSelf } from '@angular/core';\nimport { Platform } from '@angular/cdk/platform';\nimport { Subject } from 'rxjs/Subject';\nimport { Subscription } from 'rxjs/Subscription';\nimport { fromEvent } from 'rxjs/observable/fromEvent';\nimport { auditTime } from 'rxjs/operator/auditTime';\n/**\n * Time in ms to throttle the scrolling events by default.\n */\nexport const DEFAULT_SCROLL_TIME = 20;\n/**\n * Service contained all registered Scrollable references and emits an event when any one of the\n * Scrollable references emit a scrolled event.\n */\nexport class ScrollDispatcher {\n /**\n * @param {?} _ngZone\n * @param {?} _platform\n */\n constructor(_ngZone, _platform) {\n this._ngZone = _ngZone;\n this._platform = _platform;\n /**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n */\n this._scrolled = new Subject();\n /**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n */\n this._globalSubscription = null;\n /**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n */\n this._scrolledCount = 0;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n */\n this.scrollableReferences = new Map();\n }\n /**\n * Registers a Scrollable with the service and listens for its scrolled events. When the\n * scrollable is scrolled, the service emits the event in its scrolled observable.\n * @param {?} scrollable Scrollable instance to be registered.\n * @return {?}\n */\n register(scrollable) {\n const /** @type {?} */ scrollSubscription = scrollable.elementScrolled().subscribe(() => this._notify());\n this.scrollableReferences.set(scrollable, scrollSubscription);\n }\n /**\n * Deregisters a Scrollable reference and unsubscribes from its scroll event observable.\n * @param {?} scrollable Scrollable instance to be deregistered.\n * @return {?}\n */\n deregister(scrollable) {\n const /** @type {?} */ scrollableReference = this.scrollableReferences.get(scrollable);\n if (scrollableReference) {\n scrollableReference.unsubscribe();\n this.scrollableReferences.delete(scrollable);\n }\n }\n /**\n * Subscribes to an observable that emits an event whenever any of the registered Scrollable\n * references (or window, document, or body) fire a scrolled event. Can provide a time in ms\n * to override the default \"throttle\" time.\n * @param {?=} auditTimeInMs\n * @param {?=} callback\n * @return {?}\n */\n scrolled(auditTimeInMs = DEFAULT_SCROLL_TIME, callback) {\n // Scroll events can only happen on the browser, so do nothing if we're not on the browser.\n if (!this._platform.isBrowser) {\n return Subscription.EMPTY;\n }\n // In the case of a 0ms delay, use an observable without auditTime\n // since it does add a perceptible delay in processing overhead.\n let /** @type {?} */ observable = auditTimeInMs > 0 ?\n auditTime.call(this._scrolled.asObservable(), auditTimeInMs) :\n this._scrolled.asObservable();\n this._scrolledCount++;\n if (!this._globalSubscription) {\n this._globalSubscription = this._ngZone.runOutsideAngular(() => {\n return fromEvent(window.document, 'scroll').subscribe(() => this._notify());\n });\n }\n // Note that we need to do the subscribing from here, in order to be able to remove\n // the global event listeners once there are no more subscriptions.\n let /** @type {?} */ subscription = observable.subscribe(callback);\n subscription.add(() => {\n this._scrolledCount--;\n if (this._globalSubscription && !this.scrollableReferences.size && !this._scrolledCount) {\n this._globalSubscription.unsubscribe();\n this._globalSubscription = null;\n }\n });\n return subscription;\n }\n /**\n * Returns all registered Scrollables that contain the provided element.\n * @param {?} elementRef\n * @return {?}\n */\n getScrollContainers(elementRef) {\n const /** @type {?} */ scrollingContainers = [];\n this.scrollableReferences.forEach((_subscription, scrollable) => {\n if (this.scrollableContainsElement(scrollable, elementRef)) {\n scrollingContainers.push(scrollable);\n }\n });\n return scrollingContainers;\n }\n /**\n * Returns true if the element is contained within the provided Scrollable.\n * @param {?} scrollable\n * @param {?} elementRef\n * @return {?}\n */\n scrollableContainsElement(scrollable, elementRef) {\n let /** @type {?} */ element = elementRef.nativeElement;\n let /** @type {?} */ scrollableElement = scrollable.getElementRef().nativeElement;\n // Traverse through the element parents until we reach null, checking if any of the elements\n // are the scrollable's element.\n do {\n if (element == scrollableElement) {\n return true;\n }\n } while (element = element.parentElement);\n return false;\n }\n /**\n * Sends a notification that a scroll event has been fired.\n * @return {?}\n */\n _notify() {\n this._scrolled.next();\n }\n}\nScrollDispatcher.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nScrollDispatcher.ctorParameters = () => [\n { type: NgZone, },\n { type: Platform, },\n];\nfunction ScrollDispatcher_tsickle_Closure_declarations() {\n /** @type {?} */\n ScrollDispatcher.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ScrollDispatcher.ctorParameters;\n /**\n * Subject for notifying that a registered scrollable reference element has been scrolled.\n * @type {?}\n */\n ScrollDispatcher.prototype._scrolled;\n /**\n * Keeps track of the global `scroll` and `resize` subscriptions.\n * @type {?}\n */\n ScrollDispatcher.prototype._globalSubscription;\n /**\n * Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards.\n * @type {?}\n */\n ScrollDispatcher.prototype._scrolledCount;\n /**\n * Map of all the scrollable references that are registered with the service and their\n * scroll event subscriptions.\n * @type {?}\n */\n ScrollDispatcher.prototype.scrollableReferences;\n /** @type {?} */\n ScrollDispatcher.prototype._ngZone;\n /** @type {?} */\n ScrollDispatcher.prototype._platform;\n}\n/**\n * \\@docs-private\n * @param {?} parentDispatcher\n * @param {?} ngZone\n * @param {?} platform\n * @return {?}\n */\nexport function SCROLL_DISPATCHER_PROVIDER_FACTORY(parentDispatcher, ngZone, platform) {\n return parentDispatcher || new ScrollDispatcher(ngZone, platform);\n}\n/**\n * \\@docs-private\n */\nexport const SCROLL_DISPATCHER_PROVIDER = {\n // If there is already a ScrollDispatcher available, use that. Otherwise, provide a new one.\n provide: ScrollDispatcher,\n deps: [[new Optional(), new SkipSelf(), ScrollDispatcher], NgZone, Platform],\n useFactory: SCROLL_DISPATCHER_PROVIDER_FACTORY\n};\n//# sourceMappingURL=scroll-dispatcher.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Directive, ElementRef, NgZone, Renderer2 } from '@angular/core';\nimport { Subject } from 'rxjs/Subject';\nimport { ScrollDispatcher } from './scroll-dispatcher';\n/**\n * Sends an event when the directive's element is scrolled. Registers itself with the\n * ScrollDispatcher service to include itself as part of its collection of scrolling events that it\n * can be listened to through the service.\n */\nexport class Scrollable {\n /**\n * @param {?} _elementRef\n * @param {?} _scroll\n * @param {?} _ngZone\n * @param {?} _renderer\n */\n constructor(_elementRef, _scroll, _ngZone, _renderer) {\n this._elementRef = _elementRef;\n this._scroll = _scroll;\n this._ngZone = _ngZone;\n this._renderer = _renderer;\n this._elementScrolled = new Subject();\n }\n /**\n * @return {?}\n */\n ngOnInit() {\n this._scrollListener = this._ngZone.runOutsideAngular(() => {\n return this._renderer.listen(this.getElementRef().nativeElement, 'scroll', (event) => {\n this._elementScrolled.next(event);\n });\n });\n this._scroll.register(this);\n }\n /**\n * @return {?}\n */\n ngOnDestroy() {\n this._scroll.deregister(this);\n if (this._scrollListener) {\n this._scrollListener();\n this._scrollListener = null;\n }\n }\n /**\n * Returns observable that emits when a scroll event is fired on the host element.\n * @return {?}\n */\n elementScrolled() {\n return this._elementScrolled.asObservable();\n }\n /**\n * @return {?}\n */\n getElementRef() {\n return this._elementRef;\n }\n}\nScrollable.decorators = [\n { type: Directive, args: [{\n selector: '[cdk-scrollable], [cdkScrollable]'\n },] },\n];\n/**\n * @nocollapse\n */\nScrollable.ctorParameters = () => [\n { type: ElementRef, },\n { type: ScrollDispatcher, },\n { type: NgZone, },\n { type: Renderer2, },\n];\nfunction Scrollable_tsickle_Closure_declarations() {\n /** @type {?} */\n Scrollable.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n Scrollable.ctorParameters;\n /** @type {?} */\n Scrollable.prototype._elementScrolled;\n /** @type {?} */\n Scrollable.prototype._scrollListener;\n /** @type {?} */\n Scrollable.prototype._elementRef;\n /** @type {?} */\n Scrollable.prototype._scroll;\n /** @type {?} */\n Scrollable.prototype._ngZone;\n /** @type {?} */\n Scrollable.prototype._renderer;\n}\n//# sourceMappingURL=scrollable.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { Injectable, Optional, SkipSelf, NgZone } from '@angular/core';\nimport { Platform } from '@angular/cdk/platform';\nimport { ScrollDispatcher } from './scroll-dispatcher';\nimport { fromEvent } from 'rxjs/observable/fromEvent';\nimport { merge } from 'rxjs/observable/merge';\nimport { auditTime } from 'rxjs/operator/auditTime';\nimport { of as observableOf } from 'rxjs/observable/of';\n/**\n * Time in ms to throttle the resize events by default.\n */\nexport const DEFAULT_RESIZE_TIME = 20;\n/**\n * Simple utility for getting the bounds of the browser viewport.\n * \\@docs-private\n */\nexport class ViewportRuler {\n /**\n * @param {?} platform\n * @param {?} ngZone\n * @param {?} scrollDispatcher\n */\n constructor(platform, ngZone, scrollDispatcher) {\n this._change = platform.isBrowser ? ngZone.runOutsideAngular(() => {\n return merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange'));\n }) : observableOf();\n // Subscribe to scroll and resize events and update the document rectangle on changes.\n this._invalidateCacheSubscriptions = [\n scrollDispatcher.scrolled(0, () => this._cacheViewportGeometry()),\n this.change().subscribe(() => this._cacheViewportGeometry())\n ];\n }\n /**\n * @return {?}\n */\n ngOnDestroy() {\n this._invalidateCacheSubscriptions.forEach(subscription => subscription.unsubscribe());\n }\n /**\n * Gets a ClientRect for the viewport's bounds.\n * @param {?=} documentRect\n * @return {?}\n */\n getViewportRect(documentRect = this._documentRect) {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n // Use the document element's bounding rect rather than the window scroll properties\n // (e.g. pageYOffset, scrollY) due to in issue in Chrome and IE where window scroll\n // properties and client coordinates (boundingClientRect, clientX/Y, etc.) are in different\n // conceptual viewports. Under most circumstances these viewports are equivalent, but they\n // can disagree when the page is pinch-zoomed (on devices that support touch).\n // See https://bugs.chromium.org/p/chromium/issues/detail?id=489206#c4\n // We use the documentElement instead of the body because, by default (without a css reset)\n // browsers typically give the document body an 8px margin, which is not included in\n // getBoundingClientRect().\n const /** @type {?} */ scrollPosition = this.getViewportScrollPosition(documentRect);\n const /** @type {?} */ height = window.innerHeight;\n const /** @type {?} */ width = window.innerWidth;\n return {\n top: scrollPosition.top,\n left: scrollPosition.left,\n bottom: scrollPosition.top + height,\n right: scrollPosition.left + width,\n height,\n width,\n };\n }\n /**\n * Gets the (top, left) scroll position of the viewport.\n * @param {?=} documentRect\n * @return {?}\n */\n getViewportScrollPosition(documentRect = this._documentRect) {\n // Cache the document bounding rect so that we don't recompute it for multiple calls.\n if (!documentRect) {\n this._cacheViewportGeometry();\n documentRect = this._documentRect;\n }\n // The top-left-corner of the viewport is determined by the scroll position of the document\n // body, normally just (scrollLeft, scrollTop). However, Chrome and Firefox disagree about\n // whether `document.body` or `document.documentElement` is the scrolled element, so reading\n // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of\n // `document.documentElement` works consistently, where the `top` and `left` values will\n // equal negative the scroll position.\n const /** @type {?} */ top = -((documentRect)).top || document.body.scrollTop || window.scrollY ||\n document.documentElement.scrollTop || 0;\n const /** @type {?} */ left = -((documentRect)).left || document.body.scrollLeft || window.scrollX ||\n document.documentElement.scrollLeft || 0;\n return { top, left };\n }\n /**\n * Returns a stream that emits whenever the size of the viewport changes.\n * @param {?=} throttleTime\n * @return {?}\n */\n change(throttleTime = DEFAULT_RESIZE_TIME) {\n return throttleTime > 0 ? auditTime.call(this._change, throttleTime) : this._change;\n }\n /**\n * Caches the latest client rectangle of the document element.\n * @return {?}\n */\n _cacheViewportGeometry() {\n this._documentRect = document.documentElement.getBoundingClientRect();\n }\n}\nViewportRuler.decorators = [\n { type: Injectable },\n];\n/**\n * @nocollapse\n */\nViewportRuler.ctorParameters = () => [\n { type: Platform, },\n { type: NgZone, },\n { type: ScrollDispatcher, },\n];\nfunction ViewportRuler_tsickle_Closure_declarations() {\n /** @type {?} */\n ViewportRuler.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ViewportRuler.ctorParameters;\n /**\n * Cached document client rectangle.\n * @type {?}\n */\n ViewportRuler.prototype._documentRect;\n /**\n * Stream of viewport change events.\n * @type {?}\n */\n ViewportRuler.prototype._change;\n /**\n * Subscriptions to streams that invalidate the cached viewport dimensions.\n * @type {?}\n */\n ViewportRuler.prototype._invalidateCacheSubscriptions;\n}\n/**\n * \\@docs-private\n * @param {?} parentRuler\n * @param {?} platform\n * @param {?} ngZone\n * @param {?} scrollDispatcher\n * @return {?}\n */\nexport function VIEWPORT_RULER_PROVIDER_FACTORY(parentRuler, platform, ngZone, scrollDispatcher) {\n return parentRuler || new ViewportRuler(platform, ngZone, scrollDispatcher);\n}\n/**\n * \\@docs-private\n */\nexport const VIEWPORT_RULER_PROVIDER = {\n // If there is already a ViewportRuler available, use that. Otherwise, provide a new one.\n provide: ViewportRuler,\n deps: [[new Optional(), new SkipSelf(), ViewportRuler], Platform, NgZone, ScrollDispatcher],\n useFactory: VIEWPORT_RULER_PROVIDER_FACTORY\n};\n//# sourceMappingURL=viewport-ruler.js.map","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { NgModule } from '@angular/core';\nimport { SCROLL_DISPATCHER_PROVIDER } from './scroll-dispatcher';\nimport { Scrollable } from './scrollable';\nimport { PlatformModule } from '@angular/cdk/platform';\nexport class ScrollDispatchModule {\n}\nScrollDispatchModule.decorators = [\n { type: NgModule, args: [{\n imports: [PlatformModule],\n exports: [Scrollable],\n declarations: [Scrollable],\n providers: [SCROLL_DISPATCHER_PROVIDER],\n },] },\n];\n/**\n * @nocollapse\n */\nScrollDispatchModule.ctorParameters = () => [];\nfunction ScrollDispatchModule_tsickle_Closure_declarations() {\n /** @type {?} */\n ScrollDispatchModule.decorators;\n /**\n * @nocollapse\n * @type {?}\n */\n ScrollDispatchModule.ctorParameters;\n}\n//# sourceMappingURL=scrolling-module.js.map","/**\n * Generated bundle index. Do not edit.\n */\nexport { DEFAULT_SCROLL_TIME, ScrollDispatcher, SCROLL_DISPATCHER_PROVIDER_FACTORY, SCROLL_DISPATCHER_PROVIDER, Scrollable, DEFAULT_RESIZE_TIME, ViewportRuler, VIEWPORT_RULER_PROVIDER_FACTORY, VIEWPORT_RULER_PROVIDER, ScrollDispatchModule } from './public-api';\n//# sourceMappingURL=index.js.map"],"names":["observableOf"],"mappings":";;;;;;;;;;;;;;;;AAaA;;;AAGA,AAAO,MAAM,mBAAmB,GAAG,EAAE,CAAC;;;;;AAKtC,AAAO,MAAM,gBAAgB,CAAC;;;;;IAK1B,WAAW,CAAC,OAAO,EAAE,SAAS,EAAE;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;;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