@angular/cdk 9.1.2 → 9.2.1

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.
Files changed (199) hide show
  1. package/a11y/focus-monitor/focus-monitor.d.ts +42 -2
  2. package/a11y/index.metadata.json +1 -1
  3. package/bundles/cdk-a11y.umd.js +107 -75
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +7 -7
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-clipboard.umd.js +1 -1
  8. package/bundles/cdk-clipboard.umd.js.map +1 -1
  9. package/bundles/cdk-clipboard.umd.min.js +1 -1
  10. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  11. package/bundles/cdk-coercion.umd.js +0 -1
  12. package/bundles/cdk-coercion.umd.js.map +1 -1
  13. package/bundles/cdk-coercion.umd.min.js.map +1 -1
  14. package/bundles/cdk-drag-drop.umd.js +121 -95
  15. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  16. package/bundles/cdk-drag-drop.umd.min.js +15 -8
  17. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  18. package/bundles/cdk-overlay.umd.js +2 -1
  19. package/bundles/cdk-overlay.umd.js.map +1 -1
  20. package/bundles/cdk-overlay.umd.min.js +4 -4
  21. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  22. package/bundles/cdk-platform.umd.js +11 -0
  23. package/bundles/cdk-platform.umd.js.map +1 -1
  24. package/bundles/cdk-platform.umd.min.js +6 -6
  25. package/bundles/cdk-platform.umd.min.js.map +1 -1
  26. package/bundles/cdk-scrolling.umd.js +41 -10
  27. package/bundles/cdk-scrolling.umd.js.map +1 -1
  28. package/bundles/cdk-scrolling.umd.min.js +8 -8
  29. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  30. package/bundles/cdk-table.umd.js +58 -27
  31. package/bundles/cdk-table.umd.js.map +1 -1
  32. package/bundles/cdk-table.umd.min.js +12 -5
  33. package/bundles/cdk-table.umd.min.js.map +1 -1
  34. package/bundles/cdk-testing-protractor.umd.js +15 -9
  35. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  36. package/bundles/cdk-testing-protractor.umd.min.js +2 -2
  37. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  38. package/bundles/cdk-testing-testbed.umd.js +15 -9
  39. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  40. package/bundles/cdk-testing-testbed.umd.min.js +8 -8
  41. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  42. package/bundles/cdk-text-field.umd.js +21 -6
  43. package/bundles/cdk-text-field.umd.js.map +1 -1
  44. package/bundles/cdk-text-field.umd.min.js +3 -3
  45. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  46. package/bundles/cdk-tree.umd.js +8 -4
  47. package/bundles/cdk-tree.umd.js.map +1 -1
  48. package/bundles/cdk-tree.umd.min.js +1 -1
  49. package/bundles/cdk-tree.umd.min.js.map +1 -1
  50. package/bundles/cdk.umd.js +1 -1
  51. package/bundles/cdk.umd.js.map +1 -1
  52. package/bundles/cdk.umd.min.js +1 -1
  53. package/bundles/cdk.umd.min.js.map +1 -1
  54. package/coercion/array.d.ts +1 -0
  55. package/drag-drop/client-rect.d.ts +31 -0
  56. package/drag-drop/directives/config.d.ts +1 -0
  57. package/drag-drop/directives/drop-list.d.ts +4 -3
  58. package/drag-drop/drag-ref.d.ts +4 -0
  59. package/drag-drop/index.metadata.json +1 -1
  60. package/esm2015/a11y/focus-monitor/focus-monitor.js +163 -76
  61. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  62. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  63. package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +8 -4
  64. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  65. package/esm2015/a11y/public-api.js +2 -2
  66. package/esm2015/bidi/directionality.js +1 -1
  67. package/esm2015/clipboard/pending-copy.js +3 -3
  68. package/esm2015/coercion/array.js +1 -2
  69. package/esm2015/drag-drop/client-rect.js +75 -0
  70. package/esm2015/drag-drop/directives/config.js +3 -1
  71. package/esm2015/drag-drop/directives/drag.js +3 -2
  72. package/esm2015/drag-drop/directives/drop-list.js +24 -18
  73. package/esm2015/drag-drop/drag-drop.js +1 -1
  74. package/esm2015/drag-drop/drag-ref.js +61 -25
  75. package/esm2015/drag-drop/drop-list-ref.js +15 -82
  76. package/esm2015/layout/breakpoints-observer.js +1 -1
  77. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -2
  78. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  79. package/esm2015/platform/features/shadow-dom.js +16 -1
  80. package/esm2015/platform/public-api.js +2 -2
  81. package/esm2015/scrolling/scroll-dispatcher.js +38 -5
  82. package/esm2015/scrolling/viewport-ruler.js +44 -5
  83. package/esm2015/table/cell.js +18 -8
  84. package/esm2015/table/public-api.js +3 -2
  85. package/esm2015/table/row.js +24 -8
  86. package/esm2015/table/table.js +26 -12
  87. package/esm2015/table/text-column.js +3 -26
  88. package/esm2015/table/tokens.js +44 -0
  89. package/esm2015/testing/protractor/protractor-harness-environment.js +13 -8
  90. package/esm2015/testing/testbed/testbed-harness-environment.js +16 -10
  91. package/esm2015/text-field/autosize.js +38 -4
  92. package/esm2015/tree/padding.js +9 -10
  93. package/esm2015/version.js +1 -1
  94. package/esm5/a11y/focus-monitor/focus-monitor.js +87 -56
  95. package/esm5/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  96. package/esm5/a11y/focus-trap/focus-trap.js +1 -1
  97. package/esm5/a11y/high-contrast-mode/high-contrast-mode-detector.js +7 -4
  98. package/esm5/a11y/live-announcer/live-announcer.js +1 -1
  99. package/esm5/bidi/directionality.js +1 -1
  100. package/esm5/clipboard/pending-copy.js +2 -2
  101. package/esm5/coercion/array.js +1 -2
  102. package/esm5/drag-drop/client-rect.js +60 -0
  103. package/esm5/drag-drop/directives/config.js +1 -1
  104. package/esm5/drag-drop/directives/drag.js +3 -2
  105. package/esm5/drag-drop/directives/drop-list.js +13 -10
  106. package/esm5/drag-drop/drag-drop.js +1 -1
  107. package/esm5/drag-drop/drag-ref.js +39 -21
  108. package/esm5/drag-drop/drop-list-ref.js +13 -67
  109. package/esm5/layout/breakpoints-observer.js +1 -1
  110. package/esm5/overlay/position/flexible-connected-position-strategy.js +3 -2
  111. package/esm5/overlay/position/overlay-position-builder.js +1 -1
  112. package/esm5/platform/features/shadow-dom.js +11 -1
  113. package/esm5/scrolling/scroll-dispatcher.js +21 -5
  114. package/esm5/scrolling/viewport-ruler.js +24 -5
  115. package/esm5/table/cell.js +13 -8
  116. package/esm5/table/public-api.js +2 -1
  117. package/esm5/table/row.js +21 -11
  118. package/esm5/table/table.js +16 -11
  119. package/esm5/table/text-column.js +3 -4
  120. package/esm5/table/tokens.js +16 -0
  121. package/esm5/testing/protractor/protractor-harness-environment.js +17 -11
  122. package/esm5/testing/testbed/testbed-harness-environment.js +17 -11
  123. package/esm5/text-field/autosize.js +20 -4
  124. package/esm5/tree/padding.js +9 -5
  125. package/esm5/version.js +1 -1
  126. package/fesm2015/a11y.js +190 -103
  127. package/fesm2015/a11y.js.map +1 -1
  128. package/fesm2015/cdk.js +1 -1
  129. package/fesm2015/cdk.js.map +1 -1
  130. package/fesm2015/clipboard.js +2 -2
  131. package/fesm2015/clipboard.js.map +1 -1
  132. package/fesm2015/coercion.js +0 -1
  133. package/fesm2015/coercion.js.map +1 -1
  134. package/fesm2015/drag-drop.js +174 -123
  135. package/fesm2015/drag-drop.js.map +1 -1
  136. package/fesm2015/overlay.js +2 -1
  137. package/fesm2015/overlay.js.map +1 -1
  138. package/fesm2015/platform.js +16 -1
  139. package/fesm2015/platform.js.map +1 -1
  140. package/fesm2015/scrolling.js +76 -7
  141. package/fesm2015/scrolling.js.map +1 -1
  142. package/fesm2015/table.js +98 -49
  143. package/fesm2015/table.js.map +1 -1
  144. package/fesm2015/testing/protractor.js +13 -8
  145. package/fesm2015/testing/protractor.js.map +1 -1
  146. package/fesm2015/testing/testbed.js +15 -9
  147. package/fesm2015/testing/testbed.js.map +1 -1
  148. package/fesm2015/text-field.js +37 -3
  149. package/fesm2015/text-field.js.map +1 -1
  150. package/fesm2015/tree.js +8 -9
  151. package/fesm2015/tree.js.map +1 -1
  152. package/fesm5/a11y.js +107 -76
  153. package/fesm5/a11y.js.map +1 -1
  154. package/fesm5/cdk.js +1 -1
  155. package/fesm5/cdk.js.map +1 -1
  156. package/fesm5/clipboard.js +1 -1
  157. package/fesm5/clipboard.js.map +1 -1
  158. package/fesm5/coercion.js +0 -1
  159. package/fesm5/coercion.js.map +1 -1
  160. package/fesm5/drag-drop.js +122 -96
  161. package/fesm5/drag-drop.js.map +1 -1
  162. package/fesm5/overlay.js +2 -1
  163. package/fesm5/overlay.js.map +1 -1
  164. package/fesm5/platform.js +11 -1
  165. package/fesm5/platform.js.map +1 -1
  166. package/fesm5/scrolling.js +39 -7
  167. package/fesm5/scrolling.js.map +1 -1
  168. package/fesm5/table.js +59 -29
  169. package/fesm5/table.js.map +1 -1
  170. package/fesm5/testing/protractor.js +17 -11
  171. package/fesm5/testing/protractor.js.map +1 -1
  172. package/fesm5/testing/testbed.js +16 -10
  173. package/fesm5/testing/testbed.js.map +1 -1
  174. package/fesm5/text-field.js +19 -3
  175. package/fesm5/text-field.js.map +1 -1
  176. package/fesm5/tree.js +8 -4
  177. package/fesm5/tree.js.map +1 -1
  178. package/package.json +1 -1
  179. package/platform/features/shadow-dom.d.ts +2 -0
  180. package/platform/index.metadata.json +1 -1
  181. package/schematics/ng-add/index.js +1 -1
  182. package/schematics/ng-update/upgrade-rules/class-names-rule.js +3 -1
  183. package/schematics/utils/ast/ng-module-imports.js +3 -2
  184. package/scrolling/index.metadata.json +1 -1
  185. package/scrolling/scroll-dispatcher.d.ts +9 -1
  186. package/scrolling/viewport-ruler.d.ts +9 -1
  187. package/table/cell.d.ts +2 -0
  188. package/table/index.metadata.json +1 -1
  189. package/table/public-api.d.ts +1 -0
  190. package/table/row.d.ts +6 -3
  191. package/table/table.d.ts +2 -0
  192. package/table/text-column.d.ts +2 -13
  193. package/table/tokens.d.ts +25 -0
  194. package/testing/protractor/protractor-harness-environment.d.ts +10 -3
  195. package/testing/testbed/testbed-harness-environment.d.ts +12 -4
  196. package/text-field/autosize.d.ts +9 -1
  197. package/text-field/index.metadata.json +1 -1
  198. package/tree/index.metadata.json +1 -1
  199. package/tree/padding.d.ts +6 -2
package/fesm5/platform.js CHANGED
@@ -264,6 +264,16 @@ function _supportsShadowDom() {
264
264
  }
265
265
  return shadowDomIsSupported;
266
266
  }
267
+ /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */
268
+ function _getShadowRoot(element) {
269
+ if (_supportsShadowDom()) {
270
+ var rootNode = element.getRootNode ? element.getRootNode() : null;
271
+ if (rootNode instanceof ShadowRoot) {
272
+ return rootNode;
273
+ }
274
+ }
275
+ return null;
276
+ }
267
277
 
268
278
  /**
269
279
  * @license
@@ -277,5 +287,5 @@ function _supportsShadowDom() {
277
287
  * Generated bundle index. Do not edit.
278
288
  */
279
289
 
280
- export { Platform, PlatformModule, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
290
+ export { Platform, PlatformModule, _getShadowRoot, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
281
291
  //# sourceMappingURL=platform.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform.js","sources":["../../../../../../src/cdk/platform/platform.ts","../../../../../../src/cdk/platform/platform-module.ts","../../../../../../src/cdk/platform/features/input-types.ts","../../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../../src/cdk/platform/features/scrolling.ts","../../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../../src/cdk/platform/public-api.ts","../../../../../../src/cdk/platform/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC 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\nimport {Inject, Injectable, Optional, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\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 /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\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 /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\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 /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n /**\n * @breaking-change 8.0.0 remove optional decorator\n */\n constructor(@Optional() @Inject(PLATFORM_ID) private _platformId?: Object) {}\n}\n\n","/**\n * @license\n * Copyright Google LLC 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\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\n","/**\n * @license\n * Copyright Google LLC 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/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\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/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\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\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\n}\n","/**\n * @license\n * Copyright Google LLC 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/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n","/**\n * @license\n * Copyright Google LLC 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/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n return !!(typeof document == 'object' && 'scrollBehavior' in document.documentElement!.style);\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.height = '1px';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\n}\n","/**\n * @license\n * Copyright Google LLC 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\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n","/**\n * @license\n * Copyright Google LLC 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\nexport * from './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;AAQA,AAGA;;AAEA,IAAI,kBAA2B,CAAC;;;;;;AAOhC,IAAI;IACF,kBAAkB,IAAI,OAAO,IAAI,KAAK,WAAW,IAAK,IAAY,CAAC,eAAe,CAAC,CAAC;CACrF;AAAC,WAAM;IACN,kBAAkB,GAAG,KAAK,CAAC;CAC5B;;;;;AAMD;;;;IAkDE,kBAAqD,WAAoB;QAApB,gBAAW,GAAX,WAAW,CAAS;;;;;QA5CzE,cAAS,GAAY,IAAI,CAAC,WAAW;Y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CAAC,KAAK,CAAC,CAAC;QAC9C,IAAM,YAAY,GAAG,OAAO,CAAC,KAAK,CAAC;QACnC,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;QAC3B,YAAY,CAAC,MAAM,GAAG,KAAK,CAAC;QAE5B,eAAe,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QACrC,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;QAE3C,iBAAiB,kBAA4B;;;;QAK7C,IAAI,eAAe,CAAC,UAAU,KAAK,CAAC,EAAE;;;;;YAKpC,eAAe,CAAC,UAAU,GAAG,CAAC,CAAC;YAC/B,iBAAiB;gBACb,eAAe,CAAC,UAAU,KAAK,CAAC,sCAA0D;SAC/F;QAED,eAAe,CAAC,UAAW,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;KAC1D;IACD,OAAO,iBAAiB,CAAC;CAC1B;;ACnFD;;;;;;;AAQA,IAAI,oBAA6B,CAAC;;AAGlC,SAAgB,kBAAkB;IAChC,IAAI,oBAAoB,IAAI,IAAI,EAAE;QAChC,IAAM,IAAI,GAAG,OAAO,QAAQ,KAAK,WAAW,GAAG,QAAQ,CAAC,IAAI,GAAG,IAAI,CAAC;QACpE,oBAAoB,GAAG,CAAC,EAAE,IAAI,KAAM,IAAY,CAAC,gBAAgB,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;KAC1F;IAED,OAAO,oBAAoB,CAAC;CAC7B;;AClBD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
1
+ {"version":3,"file":"platform.js","sources":["../../../../../../src/cdk/platform/platform.ts","../../../../../../src/cdk/platform/platform-module.ts","../../../../../../src/cdk/platform/features/input-types.ts","../../../../../../src/cdk/platform/features/passive-listeners.ts","../../../../../../src/cdk/platform/features/scrolling.ts","../../../../../../src/cdk/platform/features/shadow-dom.ts","../../../../../../src/cdk/platform/public-api.ts","../../../../../../src/cdk/platform/index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC 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\nimport {Inject, Injectable, Optional, PLATFORM_ID} from '@angular/core';\nimport {isPlatformBrowser} from '@angular/common';\n\n// Whether the current platform supports the V8 Break Iterator. The V8 check\n// is necessary to detect all Blink based browsers.\nlet hasV8BreakIterator: boolean;\n\n// We need a try/catch around the reference to `Intl`, because accessing it in some cases can\n// cause IE to throw. These cases are tied to particular versions of Windows and can happen if\n// the consumer is providing a polyfilled `Map`. See:\n// https://github.com/Microsoft/ChakraCore/issues/3189\n// https://github.com/angular/components/issues/15687\ntry {\n hasV8BreakIterator = (typeof Intl !== 'undefined' && (Intl as any).v8BreakIterator);\n} catch {\n hasV8BreakIterator = false;\n}\n\n/**\n * Service to detect the current platform by comparing the userAgent strings and\n * checking browser-specific global properties.\n */\n@Injectable({providedIn: 'root'})\nexport class Platform {\n // We want to use the Angular platform check because if the Document is shimmed\n // without the navigator, the following checks will fail. This is preferred because\n // sometimes the Document may be shimmed without the user's knowledge or intention\n /** Whether the Angular application is being rendered in the browser. */\n isBrowser: boolean = this._platformId ?\n isPlatformBrowser(this._platformId) : typeof document === 'object' && !!document;\n\n /** Whether the current browser is Microsoft Edge. */\n EDGE: boolean = this.isBrowser && /(edge)/i.test(navigator.userAgent);\n\n /** Whether the current rendering engine is Microsoft Trident. */\n TRIDENT: boolean = this.isBrowser && /(msie|trident)/i.test(navigator.userAgent);\n\n // EdgeHTML and Trident mock Blink specific things and need to be excluded from this check.\n /** Whether the current rendering engine is Blink. */\n BLINK: boolean = this.isBrowser && (!!((window as any).chrome || hasV8BreakIterator) &&\n typeof CSS !== 'undefined' && !this.EDGE && !this.TRIDENT);\n\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 /** Whether the current rendering engine is WebKit. */\n WEBKIT: boolean = this.isBrowser &&\n /AppleWebKit/i.test(navigator.userAgent) && !this.BLINK && !this.EDGE && !this.TRIDENT;\n\n /** Whether the current platform is Apple iOS. */\n IOS: boolean = this.isBrowser && /iPad|iPhone|iPod/.test(navigator.userAgent) &&\n !('MSStream' in window);\n\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 /** Whether the current browser is Firefox. */\n FIREFOX: boolean = this.isBrowser && /(firefox|minefield)/i.test(navigator.userAgent);\n\n /** Whether the current platform is Android. */\n // Trident on mobile adds the android platform to the userAgent to trick detections.\n ANDROID: boolean = this.isBrowser && /android/i.test(navigator.userAgent) && !this.TRIDENT;\n\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 /** Whether the current browser is Safari. */\n SAFARI: boolean = this.isBrowser && /safari/i.test(navigator.userAgent) && this.WEBKIT;\n\n /**\n * @breaking-change 8.0.0 remove optional decorator\n */\n constructor(@Optional() @Inject(PLATFORM_ID) private _platformId?: Object) {}\n}\n\n","/**\n * @license\n * Copyright Google LLC 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\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class PlatformModule {}\n","/**\n * @license\n * Copyright Google LLC 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/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\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/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\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\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }));\n\n return supportedInputTypes;\n}\n","/**\n * @license\n * Copyright Google LLC 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/** Cached result of whether the user's browser supports passive event listeners. */\nlet supportsPassiveEvents: boolean;\n\n/**\n * Checks whether the user's browser supports passive event listeners.\n * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md\n */\nexport function supportsPassiveEventListeners(): boolean {\n if (supportsPassiveEvents == null && typeof window !== 'undefined') {\n try {\n window.addEventListener('test', null!, Object.defineProperty({}, 'passive', {\n get: () => supportsPassiveEvents = true\n }));\n } finally {\n supportsPassiveEvents = supportsPassiveEvents || false;\n }\n }\n\n return supportsPassiveEvents;\n}\n\n/**\n * Normalizes an `AddEventListener` object to something that can be passed\n * to `addEventListener` on any browser, no matter whether it supports the\n * `options` parameter.\n * @param options Object to be normalized.\n */\nexport function normalizePassiveListenerOptions(options: AddEventListenerOptions):\n AddEventListenerOptions | boolean {\n return supportsPassiveEventListeners() ? options : !!options.capture;\n}\n","/**\n * @license\n * Copyright Google LLC 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/** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */\nexport const enum RtlScrollAxisType {\n /**\n * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled\n * all the way right.\n */\n NORMAL,\n /**\n * scrollLeft is -(scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n NEGATED,\n /**\n * scrollLeft is (scrollWidth - clientWidth) when scrolled all the way left and 0 when scrolled\n * all the way right.\n */\n INVERTED\n}\n\n/** Cached result of the way the browser handles the horizontal scroll axis in RTL mode. */\nlet rtlScrollAxisType: RtlScrollAxisType|undefined;\n\n/** Check whether the browser supports scroll behaviors. */\nexport function supportsScrollBehavior(): boolean {\n return !!(typeof document == 'object' && 'scrollBehavior' in document.documentElement!.style);\n}\n\n/**\n * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,\n * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.\n */\nexport function getRtlScrollAxisType(): RtlScrollAxisType {\n // We can't check unless we're on the browser. Just assume 'normal' if we're not.\n if (typeof document !== 'object' || !document) {\n return RtlScrollAxisType.NORMAL;\n }\n\n if (rtlScrollAxisType == null) {\n // Create a 1px wide scrolling container and a 2px wide content element.\n const scrollContainer = document.createElement('div');\n const containerStyle = scrollContainer.style;\n scrollContainer.dir = 'rtl';\n containerStyle.height = '1px';\n containerStyle.width = '1px';\n containerStyle.overflow = 'auto';\n containerStyle.visibility = 'hidden';\n containerStyle.pointerEvents = 'none';\n containerStyle.position = 'absolute';\n\n const content = document.createElement('div');\n const contentStyle = content.style;\n contentStyle.width = '2px';\n contentStyle.height = '1px';\n\n scrollContainer.appendChild(content);\n document.body.appendChild(scrollContainer);\n\n rtlScrollAxisType = RtlScrollAxisType.NORMAL;\n\n // The viewport starts scrolled all the way to the right in RTL mode. If we are in a NORMAL\n // browser this would mean that the scrollLeft should be 1. If it's zero instead we know we're\n // dealing with one of the other two types of browsers.\n if (scrollContainer.scrollLeft === 0) {\n // In a NEGATED browser the scrollLeft is always somewhere in [-maxScrollAmount, 0]. For an\n // INVERTED browser it is always somewhere in [0, maxScrollAmount]. We can determine which by\n // setting to the scrollLeft to 1. This is past the max for a NEGATED browser, so it will\n // return 0 when we read it again.\n scrollContainer.scrollLeft = 1;\n rtlScrollAxisType =\n scrollContainer.scrollLeft === 0 ? RtlScrollAxisType.NEGATED : RtlScrollAxisType.INVERTED;\n }\n\n scrollContainer.parentNode!.removeChild(scrollContainer);\n }\n return rtlScrollAxisType;\n}\n","/**\n * @license\n * Copyright Google LLC 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\nlet shadowDomIsSupported: boolean;\n\n/** Checks whether the user's browser support Shadow DOM. */\nexport function _supportsShadowDom(): boolean {\n if (shadowDomIsSupported == null) {\n const head = typeof document !== 'undefined' ? document.head : null;\n shadowDomIsSupported = !!(head && ((head as any).createShadowRoot || head.attachShadow));\n }\n\n return shadowDomIsSupported;\n}\n\n/** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */\nexport function _getShadowRoot(element: HTMLElement): Node | null {\n if (_supportsShadowDom()) {\n const rootNode = element.getRootNode ? element.getRootNode() : null;\n\n if (rootNode instanceof ShadowRoot) {\n return rootNode;\n }\n }\n\n return null;\n}\n","/**\n * @license\n * Copyright Google LLC 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\nexport * from './platform';\nexport * from './platform-module';\nexport * from './features/input-types';\nexport * from './features/passive-listeners';\nexport * from './features/scrolling';\nexport * from './features/shadow-dom';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;AAAA;;;;;;;AAQA,AAGA;;AAEA,IAAI,kBAA2B,CAAC;;;;;;AAOhC,IAAI;IACF,kBAAkB,IAAI,OAAO,IAAI,KAAK,WAAW,IAAK,IAAY,CAAC,eAAe,CAAC,CAAC;CAC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EpE,IAAI,QAAQ,YAAY,UAAU,EAAE;YAClC,OAAO,QAAQ,CAAC;SACjB;KACF;IAED,OAAO,IAAI,CAAC;CACb;;AC/BD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
@@ -1,8 +1,9 @@
1
1
  import { coerceNumberProperty } from '@angular/cdk/coercion';
2
- import { InjectionToken, Directive, forwardRef, Input, Injectable, NgZone, ɵɵdefineInjectable, ɵɵinject, ElementRef, Optional, Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, Inject, Output, ViewChild, ViewContainerRef, TemplateRef, IterableDiffers, SkipSelf, NgModule } from '@angular/core';
2
+ import { InjectionToken, Directive, forwardRef, Input, Injectable, NgZone, Optional, Inject, ɵɵdefineInjectable, ɵɵinject, ElementRef, Component, ViewEncapsulation, ChangeDetectionStrategy, ChangeDetectorRef, Output, ViewChild, ViewContainerRef, TemplateRef, IterableDiffers, SkipSelf, NgModule } from '@angular/core';
3
3
  import { Subject, of, Observable, fromEvent, merge, animationFrameScheduler, asapScheduler, Subscription, isObservable } from 'rxjs';
4
4
  import { distinctUntilChanged, auditTime, filter, takeUntil, startWith, pairwise, switchMap, shareReplay } from 'rxjs/operators';
5
5
  import { Platform, getRtlScrollAxisType, supportsScrollBehavior, PlatformModule } from '@angular/cdk/platform';
6
+ import { DOCUMENT } from '@angular/common';
6
7
  import { Directionality, BidiModule } from '@angular/cdk/bidi';
7
8
  import { __extends, __values, __read } from 'tslib';
8
9
  import { isDataSource, ArrayDataSource } from '@angular/cdk/collections';
@@ -213,7 +214,9 @@ var DEFAULT_SCROLL_TIME = 20;
213
214
  * Scrollable references emit a scrolled event.
214
215
  */
215
216
  var ScrollDispatcher = /** @class */ (function () {
216
- function ScrollDispatcher(_ngZone, _platform) {
217
+ function ScrollDispatcher(_ngZone, _platform,
218
+ /** @breaking-change 11.0.0 make document required */
219
+ document) {
217
220
  this._ngZone = _ngZone;
218
221
  this._platform = _platform;
219
222
  /** Subject for notifying that a registered scrollable reference element has been scrolled. */
@@ -227,6 +230,7 @@ var ScrollDispatcher = /** @class */ (function () {
227
230
  * scroll event subscriptions.
228
231
  */
229
232
  this.scrollContainers = new Map();
233
+ this._document = document;
230
234
  }
231
235
  /**
232
236
  * Registers a scrollable instance with the service and listens for its scrolled events. When the
@@ -315,6 +319,15 @@ var ScrollDispatcher = /** @class */ (function () {
315
319
  });
316
320
  return scrollingContainers;
317
321
  };
322
+ /** Access injected document if available or fallback to global document reference */
323
+ ScrollDispatcher.prototype._getDocument = function () {
324
+ return this._document || document;
325
+ };
326
+ /** Use defaultView of injected document if available or fallback to global window reference */
327
+ ScrollDispatcher.prototype._getWindow = function () {
328
+ var doc = this._getDocument();
329
+ return doc.defaultView || window;
330
+ };
318
331
  /** Returns true if the element is contained within the provided Scrollable. */
319
332
  ScrollDispatcher.prototype._scrollableContainsElement = function (scrollable, elementRef) {
320
333
  var element = elementRef.nativeElement;
@@ -332,6 +345,7 @@ var ScrollDispatcher = /** @class */ (function () {
332
345
  ScrollDispatcher.prototype._addGlobalListener = function () {
333
346
  var _this = this;
334
347
  this._globalSubscription = this._ngZone.runOutsideAngular(function () {
348
+ var window = _this._getWindow();
335
349
  return fromEvent(window.document, 'scroll').subscribe(function () { return _this._scrolled.next(); });
336
350
  });
337
351
  };
@@ -348,9 +362,10 @@ var ScrollDispatcher = /** @class */ (function () {
348
362
  /** @nocollapse */
349
363
  ScrollDispatcher.ctorParameters = function () { return [
350
364
  { type: NgZone },
351
- { type: Platform }
365
+ { type: Platform },
366
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] }
352
367
  ]; };
353
- ScrollDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function ScrollDispatcher_Factory() { return new ScrollDispatcher(ɵɵinject(NgZone), ɵɵinject(Platform)); }, token: ScrollDispatcher, providedIn: "root" });
368
+ ScrollDispatcher.ɵprov = ɵɵdefineInjectable({ factory: function ScrollDispatcher_Factory() { return new ScrollDispatcher(ɵɵinject(NgZone), ɵɵinject(Platform), ɵɵinject(DOCUMENT, 8)); }, token: ScrollDispatcher, providedIn: "root" });
354
369
  return ScrollDispatcher;
355
370
  }());
356
371
 
@@ -542,10 +557,14 @@ var DEFAULT_RESIZE_TIME = 20;
542
557
  * @docs-private
543
558
  */
544
559
  var ViewportRuler = /** @class */ (function () {
545
- function ViewportRuler(_platform, ngZone) {
560
+ function ViewportRuler(_platform, ngZone,
561
+ /** @breaking-change 11.0.0 make document required */
562
+ document) {
546
563
  var _this = this;
547
564
  this._platform = _platform;
565
+ this._document = document;
548
566
  ngZone.runOutsideAngular(function () {
567
+ var window = _this._getWindow();
549
568
  _this._change = _platform.isBrowser ?
550
569
  merge(fromEvent(window, 'resize'), fromEvent(window, 'orientationchange')) :
551
570
  of();
@@ -604,6 +623,8 @@ var ViewportRuler = /** @class */ (function () {
604
623
  // `scrollTop` and `scrollLeft` is inconsistent. However, using the bounding rect of
605
624
  // `document.documentElement` works consistently, where the `top` and `left` values will
606
625
  // equal negative the scroll position.
626
+ var document = this._getDocument();
627
+ var window = this._getWindow();
607
628
  var documentElement = document.documentElement;
608
629
  var documentRect = documentElement.getBoundingClientRect();
609
630
  var top = -documentRect.top || document.body.scrollTop || window.scrollY ||
@@ -620,8 +641,18 @@ var ViewportRuler = /** @class */ (function () {
620
641
  if (throttleTime === void 0) { throttleTime = DEFAULT_RESIZE_TIME; }
621
642
  return throttleTime > 0 ? this._change.pipe(auditTime(throttleTime)) : this._change;
622
643
  };
644
+ /** Access injected document if available or fallback to global document reference */
645
+ ViewportRuler.prototype._getDocument = function () {
646
+ return this._document || document;
647
+ };
648
+ /** Use defaultView of injected document if available or fallback to global window reference */
649
+ ViewportRuler.prototype._getWindow = function () {
650
+ var doc = this._getDocument();
651
+ return doc.defaultView || window;
652
+ };
623
653
  /** Updates the cached viewport size. */
624
654
  ViewportRuler.prototype._updateViewportSize = function () {
655
+ var window = this._getWindow();
625
656
  this._viewportSize = this._platform.isBrowser ?
626
657
  { width: window.innerWidth, height: window.innerHeight } :
627
658
  { width: 0, height: 0 };
@@ -632,9 +663,10 @@ var ViewportRuler = /** @class */ (function () {
632
663
  /** @nocollapse */
633
664
  ViewportRuler.ctorParameters = function () { return [
634
665
  { type: Platform },
635
- { type: NgZone }
666
+ { type: NgZone },
667
+ { type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [DOCUMENT,] }] }
636
668
  ]; };
637
- ViewportRuler.ɵprov = ɵɵdefineInjectable({ factory: function ViewportRuler_Factory() { return new ViewportRuler(ɵɵinject(Platform), ɵɵinject(NgZone)); }, token: ViewportRuler, providedIn: "root" });
669
+ ViewportRuler.ɵprov = ɵɵdefineInjectable({ factory: function ViewportRuler_Factory() { return new ViewportRuler(ɵɵinject(Platform), ɵɵinject(NgZone), ɵɵinject(DOCUMENT, 8)); }, token: ViewportRuler, providedIn: "root" });
638
670
  return ViewportRuler;
639
671
  }());
640
672