@angular/cdk 10.1.1 → 10.2.0

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 (223) hide show
  1. package/a11y/index.metadata.json +1 -1
  2. package/a11y/key-manager/list-key-manager.d.ts +4 -3
  3. package/bundles/cdk-a11y.umd.js +440 -384
  4. package/bundles/cdk-a11y.umd.js.map +1 -1
  5. package/bundles/cdk-a11y.umd.min.js +34 -10
  6. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  7. package/bundles/cdk-accordion.umd.js +40 -40
  8. package/bundles/cdk-accordion.umd.js.map +1 -1
  9. package/bundles/cdk-accordion.umd.min.js +10 -2
  10. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  11. package/bundles/cdk-bidi.umd.js +25 -25
  12. package/bundles/cdk-bidi.umd.js.map +1 -1
  13. package/bundles/cdk-bidi.umd.min.js +5 -4
  14. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  15. package/bundles/cdk-clipboard.umd.js +37 -36
  16. package/bundles/cdk-clipboard.umd.js.map +1 -1
  17. package/bundles/cdk-clipboard.umd.min.js +10 -2
  18. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  19. package/bundles/cdk-coercion.umd.js.map +1 -1
  20. package/bundles/cdk-collections.umd.js +498 -238
  21. package/bundles/cdk-collections.umd.js.map +1 -1
  22. package/bundles/cdk-collections.umd.min.js +6 -4
  23. package/bundles/cdk-collections.umd.min.js.map +1 -1
  24. package/bundles/cdk-drag-drop.umd.js +508 -448
  25. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  26. package/bundles/cdk-drag-drop.umd.min.js +64 -8
  27. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  28. package/bundles/cdk-keycodes.umd.js.map +1 -1
  29. package/bundles/cdk-layout.umd.js +30 -26
  30. package/bundles/cdk-layout.umd.js.map +1 -1
  31. package/bundles/cdk-layout.umd.min.js +7 -6
  32. package/bundles/cdk-layout.umd.min.js.map +1 -1
  33. package/bundles/cdk-observers.umd.js +34 -34
  34. package/bundles/cdk-observers.umd.js.map +1 -1
  35. package/bundles/cdk-observers.umd.min.js +2 -2
  36. package/bundles/cdk-observers.umd.min.js.map +1 -1
  37. package/bundles/cdk-overlay.umd.js +492 -435
  38. package/bundles/cdk-overlay.umd.js.map +1 -1
  39. package/bundles/cdk-overlay.umd.min.js +51 -11
  40. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  41. package/bundles/cdk-platform.umd.js +38 -11
  42. package/bundles/cdk-platform.umd.js.map +1 -1
  43. package/bundles/cdk-platform.umd.min.js +5 -12
  44. package/bundles/cdk-platform.umd.min.js.map +1 -1
  45. package/bundles/cdk-portal.umd.js +385 -322
  46. package/bundles/cdk-portal.umd.js.map +1 -1
  47. package/bundles/cdk-portal.umd.min.js +3 -12
  48. package/bundles/cdk-portal.umd.min.js.map +1 -1
  49. package/bundles/cdk-scrolling.umd.js +503 -490
  50. package/bundles/cdk-scrolling.umd.js.map +1 -1
  51. package/bundles/cdk-scrolling.umd.min.js +20 -34
  52. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  53. package/bundles/cdk-stepper.umd.js +135 -136
  54. package/bundles/cdk-stepper.umd.js.map +1 -1
  55. package/bundles/cdk-stepper.umd.min.js +11 -2
  56. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  57. package/bundles/cdk-table.umd.js +923 -653
  58. package/bundles/cdk-table.umd.js.map +1 -1
  59. package/bundles/cdk-table.umd.min.js +7 -22
  60. package/bundles/cdk-table.umd.min.js.map +1 -1
  61. package/bundles/cdk-testing-protractor.umd.js +310 -245
  62. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  63. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  64. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  65. package/bundles/cdk-testing-testbed.umd.js +341 -292
  66. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  67. package/bundles/cdk-testing-testbed.umd.min.js +6 -29
  68. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  69. package/bundles/cdk-testing.umd.js +342 -270
  70. package/bundles/cdk-testing.umd.js.map +1 -1
  71. package/bundles/cdk-testing.umd.min.js +3 -17
  72. package/bundles/cdk-testing.umd.min.js.map +1 -1
  73. package/bundles/cdk-text-field.umd.js +53 -53
  74. package/bundles/cdk-text-field.umd.js.map +1 -1
  75. package/bundles/cdk-text-field.umd.min.js +10 -2
  76. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  77. package/bundles/cdk-tree.umd.js +481 -417
  78. package/bundles/cdk-tree.umd.js.map +1 -1
  79. package/bundles/cdk-tree.umd.min.js +28 -3
  80. package/bundles/cdk-tree.umd.min.js.map +1 -1
  81. package/bundles/cdk.umd.js +1 -1
  82. package/bundles/cdk.umd.js.map +1 -1
  83. package/bundles/cdk.umd.min.js +1 -1
  84. package/bundles/cdk.umd.min.js.map +1 -1
  85. package/collections/dispose-view-repeater-strategy.d.ts +22 -0
  86. package/collections/index.metadata.json +1 -1
  87. package/collections/public-api.d.ts +3 -0
  88. package/collections/recycle-view-repeater-strategy.d.ts +56 -0
  89. package/collections/view-repeater.d.ts +94 -0
  90. package/drag-drop/index.d.ts +1 -2
  91. package/drag-drop/index.metadata.json +1 -1
  92. package/drag-drop/public-api.d.ts +2 -1
  93. package/esm2015/a11y/aria-describer/aria-describer.js +3 -3
  94. package/esm2015/a11y/focus-monitor/focus-monitor.js +3 -3
  95. package/esm2015/a11y/focus-trap/focus-trap.js +5 -4
  96. package/esm2015/a11y/key-manager/list-key-manager.js +8 -6
  97. package/esm2015/clipboard/pending-copy.js +7 -6
  98. package/esm2015/collections/collection-viewer.js +1 -0
  99. package/esm2015/collections/dispose-view-repeater-strategy.js +48 -0
  100. package/esm2015/collections/public-api.js +4 -1
  101. package/esm2015/collections/recycle-view-repeater-strategy.js +128 -0
  102. package/esm2015/collections/selection-model.js +2 -2
  103. package/esm2015/collections/tree-adapter.js +1 -0
  104. package/esm2015/collections/view-repeater.js +16 -0
  105. package/esm2015/drag-drop/clone-node.js +9 -1
  106. package/esm2015/drag-drop/directives/drag-handle.js +1 -3
  107. package/esm2015/drag-drop/directives/drag.js +7 -5
  108. package/esm2015/drag-drop/directives/drop-list.js +3 -3
  109. package/esm2015/drag-drop/drag-events.js +1 -0
  110. package/esm2015/drag-drop/drag-ref.js +2 -2
  111. package/esm2015/drag-drop/index.js +1 -3
  112. package/esm2015/drag-drop/public-api.js +3 -2
  113. package/esm2015/layout/breakpoints-observer.js +9 -9
  114. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +11 -9
  115. package/esm2015/overlay/overlay-config.js +1 -5
  116. package/esm2015/overlay/overlay-directives.js +18 -2
  117. package/esm2015/overlay/overlay-ref.js +6 -8
  118. package/esm2015/overlay/overlay-reference.js +1 -0
  119. package/esm2015/overlay/overlay.js +4 -4
  120. package/esm2015/overlay/position/connected-position-strategy.js +2 -9
  121. package/esm2015/overlay/position/flexible-connected-position-strategy.js +19 -16
  122. package/esm2015/overlay/position/position-strategy.js +1 -0
  123. package/esm2015/overlay/scroll/close-scroll-strategy.js +2 -2
  124. package/esm2015/overlay/scroll/reposition-scroll-strategy.js +2 -2
  125. package/esm2015/platform/features/scrolling.js +29 -2
  126. package/esm2015/portal/dom-portal-outlet.js +7 -4
  127. package/esm2015/portal/portal-directives.js +3 -3
  128. package/esm2015/portal/portal-injector.js +3 -1
  129. package/esm2015/portal/portal.js +25 -19
  130. package/esm2015/scrolling/fixed-size-virtual-scroll.js +2 -2
  131. package/esm2015/scrolling/scrolling-module.js +4 -1
  132. package/esm2015/scrolling/virtual-for-of.js +67 -92
  133. package/esm2015/scrolling/virtual-scroll-repeater.js +1 -0
  134. package/esm2015/scrolling/virtual-scroll-viewport.js +5 -5
  135. package/esm2015/stepper/stepper.js +19 -17
  136. package/esm2015/table/cell.js +34 -14
  137. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  138. package/esm2015/table/public-api.js +2 -1
  139. package/esm2015/table/sticky-styler.js +79 -45
  140. package/esm2015/table/table-module.js +4 -2
  141. package/esm2015/table/table.js +70 -44
  142. package/esm2015/table/text-column.js +9 -5
  143. package/esm2015/testing/element-dimensions.js +1 -0
  144. package/esm2015/testing/protractor/protractor-element.js +6 -3
  145. package/esm2015/testing/public-api.js +2 -1
  146. package/esm2015/testing/test-element.js +1 -1
  147. package/esm2015/testing/testbed/task-state-zone-interceptor.js +2 -2
  148. package/esm2015/testing/testbed/unit-test-element.js +26 -21
  149. package/esm2015/testing/text-filtering.js +23 -0
  150. package/esm2015/text-field/autofill.js +3 -3
  151. package/esm2015/tree/control/tree-control.js +1 -0
  152. package/esm2015/tree/nested-node.js +2 -2
  153. package/esm2015/tree/padding.js +34 -20
  154. package/esm2015/tree/tree.js +14 -27
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +15 -12
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/cdk.js +1 -1
  159. package/fesm2015/cdk.js.map +1 -1
  160. package/fesm2015/clipboard.js +6 -5
  161. package/fesm2015/clipboard.js.map +1 -1
  162. package/fesm2015/collections.js +194 -3
  163. package/fesm2015/collections.js.map +1 -1
  164. package/fesm2015/drag-drop.js +32 -23
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/layout.js +8 -8
  167. package/fesm2015/layout.js.map +1 -1
  168. package/fesm2015/overlay.js +55 -48
  169. package/fesm2015/overlay.js.map +1 -1
  170. package/fesm2015/platform.js +28 -1
  171. package/fesm2015/platform.js.map +1 -1
  172. package/fesm2015/portal.js +34 -23
  173. package/fesm2015/portal.js.map +1 -1
  174. package/fesm2015/scrolling.js +72 -95
  175. package/fesm2015/scrolling.js.map +1 -1
  176. package/fesm2015/stepper.js +19 -17
  177. package/fesm2015/stepper.js.map +1 -1
  178. package/fesm2015/table.js +274 -105
  179. package/fesm2015/table.js.map +1 -1
  180. package/fesm2015/testing/protractor.js +5 -2
  181. package/fesm2015/testing/protractor.js.map +1 -1
  182. package/fesm2015/testing/testbed.js +26 -21
  183. package/fesm2015/testing/testbed.js.map +1 -1
  184. package/fesm2015/testing.js +24 -1
  185. package/fesm2015/testing.js.map +1 -1
  186. package/fesm2015/text-field.js +2 -2
  187. package/fesm2015/text-field.js.map +1 -1
  188. package/fesm2015/tree.js +46 -45
  189. package/fesm2015/tree.js.map +1 -1
  190. package/layout/breakpoints-observer.d.ts +3 -3
  191. package/overlay/index.metadata.json +1 -1
  192. package/overlay/overlay-config.d.ts +0 -4
  193. package/overlay/overlay-directives.d.ts +1 -0
  194. package/overlay/position/connected-position-strategy.d.ts +1 -3
  195. package/package.json +1 -1
  196. package/platform/index.metadata.json +1 -1
  197. package/portal/index.metadata.json +1 -1
  198. package/portal/portal-injector.d.ts +2 -0
  199. package/schematics/index.js +1 -1
  200. package/schematics/ng-add/index.js +1 -1
  201. package/schematics/ng-update/data/index.js +1 -1
  202. package/schematics/ng-update/public-api.js +1 -1
  203. package/schematics/update-tool/public-api.js +1 -1
  204. package/schematics/utils/index.js +1 -1
  205. package/scrolling/index.metadata.json +1 -1
  206. package/scrolling/scrolling-module.d.ts +3 -0
  207. package/scrolling/virtual-for-of.d.ts +11 -19
  208. package/stepper/index.metadata.json +1 -1
  209. package/stepper/stepper.d.ts +7 -10
  210. package/table/cell.d.ts +21 -1
  211. package/table/coalesced-style-scheduler.d.ts +41 -0
  212. package/table/index.metadata.json +1 -1
  213. package/table/public-api.d.ts +1 -0
  214. package/table/sticky-styler.d.ts +7 -1
  215. package/table/table.d.ts +14 -8
  216. package/testing/protractor/protractor-element.d.ts +2 -2
  217. package/testing/public-api.d.ts +1 -0
  218. package/testing/test-element.d.ts +9 -2
  219. package/testing/testbed/unit-test-element.d.ts +9 -2
  220. package/testing/text-filtering.d.ts +13 -0
  221. package/tree/index.metadata.json +1 -1
  222. package/tree/padding.d.ts +14 -0
  223. package/tree/tree.d.ts +2 -4
@@ -1,8 +1,8 @@
1
1
  import { NgModule, ɵɵdefineInjectable, ɵɵinject, Injectable, NgZone } from '@angular/core';
2
- import { Platform } from '@angular/cdk/platform';
2
+ import { coerceArray } from '@angular/cdk/coercion';
3
3
  import { Subject, combineLatest, concat, Observable } from 'rxjs';
4
4
  import { take, skip, debounceTime, map, startWith, takeUntil } from 'rxjs/operators';
5
- import { coerceArray } from '@angular/cdk/coercion';
5
+ import { Platform } from '@angular/cdk/platform';
6
6
 
7
7
  /**
8
8
  * @license
@@ -137,14 +137,14 @@ class BreakpointObserver {
137
137
  let stateObservable = combineLatest(observables);
138
138
  // Emit the first state immediately, and then debounce the subsequent emissions.
139
139
  stateObservable = concat(stateObservable.pipe(take(1)), stateObservable.pipe(skip(1), debounceTime(0)));
140
- return stateObservable.pipe(map((breakpointStates) => {
140
+ return stateObservable.pipe(map(breakpointStates => {
141
141
  const response = {
142
142
  matches: false,
143
143
  breakpoints: {},
144
144
  };
145
- breakpointStates.forEach((state) => {
146
- response.matches = response.matches || state.matches;
147
- response.breakpoints[state.query] = state.matches;
145
+ breakpointStates.forEach(({ matches, query }) => {
146
+ response.matches = response.matches || matches;
147
+ response.breakpoints[query] = matches;
148
148
  });
149
149
  return response;
150
150
  }));
@@ -168,7 +168,7 @@ class BreakpointObserver {
168
168
  return () => {
169
169
  mql.removeListener(handler);
170
170
  };
171
- }).pipe(startWith(mql), map((nextMql) => ({ query, matches: nextMql.matches })), takeUntil(this._destroySubject));
171
+ }).pipe(startWith(mql), map(({ matches }) => ({ query, matches })), takeUntil(this._destroySubject));
172
172
  // Add the MediaQueryList to the set of queries.
173
173
  const output = { observable: queryObservable, mql };
174
174
  this._queries.set(query, output);
@@ -188,7 +188,7 @@ BreakpointObserver.ctorParameters = () => [
188
188
  * separated.
189
189
  */
190
190
  function splitQueries(queries) {
191
- return queries.map((query) => query.split(','))
191
+ return queries.map(query => query.split(','))
192
192
  .reduce((a1, a2) => a1.concat(a2))
193
193
  .map(query => query.trim());
194
194
  }
@@ -1 +1 @@
1
- {"version":3,"file":"layout.js","sources":["../../../../../../src/cdk/layout/layout-module.ts","../../../../../../src/cdk/layout/media-matcher.ts","../../../../../../src/cdk/layout/breakpoints-observer.ts","../../../../../../src/cdk/layout/breakpoints.ts","../../../../../../src/cdk/layout/public-api.ts","../../../../../../src/cdk/layout/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 */\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class LayoutModule {}\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 */\nimport {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private _platform: Platform) {\n this._matchMedia = this._platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\n } as any;\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 {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {MediaMatcher} from './media-matcher';\nimport {combineLatest, concat, Observable, Subject, Observer} from 'rxjs';\nimport {debounceTime, map, skip, startWith, take, takeUntil} from 'rxjs/operators';\nimport {coerceArray} from '@angular/cdk/coercion';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject = new Subject<void>();\n\n constructor(private _mediaMatcher: MediaMatcher, private _zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n let stateObservable = combineLatest(observables);\n // Emit the first state immediately, and then debounce the subsequent emissions.\n stateObservable = concat(\n stateObservable.pipe(take(1)),\n stateObservable.pipe(skip(1), debounceTime(0)));\n return stateObservable.pipe(map((breakpointStates: InternalBreakpointState[]) => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach((state: InternalBreakpointState) => {\n response.matches = response.matches || state.matches;\n response.breakpoints[state.query] = state.matches;\n });\n return response;\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql: MediaQueryList = this._mediaMatcher.matchMedia(query);\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = new Observable<MediaQueryList>((observer: Observer<MediaQueryList>) => {\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n const handler = (e: any) => this._zone.run(() => observer.next(e));\n mql.addListener(handler);\n\n return () => {\n mql.removeListener(handler);\n };\n }).pipe(\n startWith(mql),\n map((nextMql: MediaQueryList) => ({query, matches: nextMql.matches})),\n takeUntil(this._destroySubject)\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: string[]): string[] {\n return queries.map((query: string) => query.split(','))\n .reduce((a1: string[], a2: string[]) => a1.concat(a2))\n .map(query => query.trim());\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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599.99px)',\n Small: '(min-width: 600px) and (max-width: 959.99px)',\n Medium: '(min-width: 960px) and (max-width: 1279.99px)',\n Large: '(min-width: 1280px) and (max-width: 1919.99px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599.99px) and (orientation: portrait), ' +\n '(max-width: 959.99px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599.99px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959.99px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {LayoutModule} from './layout-module';\nexport {BreakpointObserver, BreakpointState} from './breakpoints-observer';\nexport {Breakpoints} from './breakpoints';\nexport {MediaMatcher} from './media-matcher';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAOA,MAIa,YAAY;;;YADxB,QAAQ,SAAC,EAAE;;;ACVZ;;;;;;;AAOA,AAGA;AACA,MAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU,CAAC;;AAG1E,IAAI,mBAAiD,CAAC;;AAItD,MAAa,YAAY;IAIvB,YAAoB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU;;;YAG9D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KAClB;;;;;;;IAQD,UAAU,CAAC,KAAa;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YACzB,oBAAoB,CAAC,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAChC;;;;YAxBF,UAAU,SAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;YATxB,QAAQ;;;;;;AAwChB,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,kCAAkC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACjD,OAAO;KACR;IAED,IAAI;QACF,IAAI,CAAC,mBAAmB,EAAE;YACxB,mBAAmB,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACtD,mBAAmB,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACrD,QAAQ,CAAC,IAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;SACjD;QAED,IAAI,mBAAmB,CAAC,KAAK,EAAE;YAC5B,mBAAmB,CAAC,KAAuB;iBACvC,UAA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;CACjE;;AC9BD;;;;;;GAMG;;ACNH;;GAEG;;;;"}
1
+ {"version":3,"file":"layout.js","sources":["../../../../../../src/cdk/layout/layout-module.ts","../../../../../../src/cdk/layout/media-matcher.ts","../../../../../../src/cdk/layout/breakpoints-observer.ts","../../../../../../src/cdk/layout/breakpoints.ts","../../../../../../src/cdk/layout/public-api.ts","../../../../../../src/cdk/layout/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 */\nimport {NgModule} from '@angular/core';\n\n\n@NgModule({})\nexport class LayoutModule {}\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 */\nimport {Injectable} from '@angular/core';\nimport {Platform} from '@angular/cdk/platform';\n\n/** Global registry for all dynamically-created, injected media queries. */\nconst mediaQueriesForWebkitCompatibility: Set<string> = new Set<string>();\n\n/** Style tag that holds all of the dynamically-created media queries. */\nlet mediaQueryStyleNode: HTMLStyleElement | undefined;\n\n/** A utility for calling matchMedia queries. */\n@Injectable({providedIn: 'root'})\nexport class MediaMatcher {\n /** The internal matchMedia method to return back a MediaQueryList like object. */\n private _matchMedia: (query: string) => MediaQueryList;\n\n constructor(private _platform: Platform) {\n this._matchMedia = this._platform.isBrowser && window.matchMedia ?\n // matchMedia is bound to the window scope intentionally as it is an illegal invocation to\n // call it from a different scope.\n window.matchMedia.bind(window) :\n noopMatchMedia;\n }\n\n /**\n * Evaluates the given media query and returns the native MediaQueryList from which results\n * can be retrieved.\n * Confirms the layout engine will trigger for the selector query provided and returns the\n * MediaQueryList for the query provided.\n */\n matchMedia(query: string): MediaQueryList {\n if (this._platform.WEBKIT) {\n createEmptyStyleRule(query);\n }\n return this._matchMedia(query);\n }\n}\n\n/**\n * For Webkit engines that only trigger the MediaQueryListListener when\n * there is at least one CSS selector for the respective media query.\n */\nfunction createEmptyStyleRule(query: string) {\n if (mediaQueriesForWebkitCompatibility.has(query)) {\n return;\n }\n\n try {\n if (!mediaQueryStyleNode) {\n mediaQueryStyleNode = document.createElement('style');\n mediaQueryStyleNode.setAttribute('type', 'text/css');\n document.head!.appendChild(mediaQueryStyleNode);\n }\n\n if (mediaQueryStyleNode.sheet) {\n (mediaQueryStyleNode.sheet as CSSStyleSheet)\n .insertRule(`@media ${query} {.fx-query-test{ }}`, 0);\n mediaQueriesForWebkitCompatibility.add(query);\n }\n } catch (e) {\n console.error(e);\n }\n}\n\n/** No-op matchMedia replacement for non-browser platforms. */\nfunction noopMatchMedia(query: string): MediaQueryList {\n // Use `as any` here to avoid adding additional necessary properties for\n // the noop matcher.\n return {\n matches: query === 'all' || query === '',\n media: query,\n addListener: () => {},\n removeListener: () => {}\n } as any;\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 {coerceArray} from '@angular/cdk/coercion';\nimport {Injectable, NgZone, OnDestroy} from '@angular/core';\nimport {combineLatest, concat, Observable, Observer, Subject} from 'rxjs';\nimport {debounceTime, map, skip, startWith, take, takeUntil} from 'rxjs/operators';\nimport {MediaMatcher} from './media-matcher';\n\n\n/** The current state of a layout breakpoint. */\nexport interface BreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /**\n * A key boolean pair for each query provided to the observe method,\n * with its current matched state.\n */\n breakpoints: {\n [key: string]: boolean;\n };\n}\n\n/** The current state of a layout breakpoint. */\ninterface InternalBreakpointState {\n /** Whether the breakpoint is currently matching. */\n matches: boolean;\n /** The media query being to be matched */\n query: string;\n}\n\ninterface Query {\n observable: Observable<InternalBreakpointState>;\n mql: MediaQueryList;\n}\n\n/** Utility for checking the matching state of @media queries. */\n@Injectable({providedIn: 'root'})\nexport class BreakpointObserver implements OnDestroy {\n /** A map of all media queries currently being listened for. */\n private _queries = new Map<string, Query>();\n /** A subject for all other observables to takeUntil based on. */\n private _destroySubject = new Subject<void>();\n\n constructor(private _mediaMatcher: MediaMatcher, private _zone: NgZone) {}\n\n /** Completes the active subject, signalling to all other observables to complete. */\n ngOnDestroy() {\n this._destroySubject.next();\n this._destroySubject.complete();\n }\n\n /**\n * Whether one or more media queries match the current viewport size.\n * @param value One or more media queries to check.\n * @returns Whether any of the media queries match.\n */\n isMatched(value: string | readonly string[]): boolean {\n const queries = splitQueries(coerceArray(value));\n return queries.some(mediaQuery => this._registerQuery(mediaQuery).mql.matches);\n }\n\n /**\n * Gets an observable of results for the given queries that will emit new results for any changes\n * in matching of the given queries.\n * @param value One or more media queries to check.\n * @returns A stream of matches for the given queries.\n */\n observe(value: string | readonly string[]): Observable<BreakpointState> {\n const queries = splitQueries(coerceArray(value));\n const observables = queries.map(query => this._registerQuery(query).observable);\n\n let stateObservable = combineLatest(observables);\n // Emit the first state immediately, and then debounce the subsequent emissions.\n stateObservable = concat(\n stateObservable.pipe(take(1)),\n stateObservable.pipe(skip(1), debounceTime(0)));\n return stateObservable.pipe(map(breakpointStates => {\n const response: BreakpointState = {\n matches: false,\n breakpoints: {},\n };\n breakpointStates.forEach(({matches, query}) => {\n response.matches = response.matches || matches;\n response.breakpoints[query] = matches;\n });\n return response;\n }));\n }\n\n /** Registers a specific query to be listened for. */\n private _registerQuery(query: string): Query {\n // Only set up a new MediaQueryList if it is not already being listened for.\n if (this._queries.has(query)) {\n return this._queries.get(query)!;\n }\n\n const mql = this._mediaMatcher.matchMedia(query);\n\n // Create callback for match changes and add it is as a listener.\n const queryObservable = new Observable((observer: Observer<MediaQueryList>) => {\n // Listener callback methods are wrapped to be placed back in ngZone. Callbacks must be placed\n // back into the zone because matchMedia is only included in Zone.js by loading the\n // webapis-media-query.js file alongside the zone.js file. Additionally, some browsers do not\n // have MediaQueryList inherit from EventTarget, which causes inconsistencies in how Zone.js\n // patches it.\n const handler = (e: any) => this._zone.run(() => observer.next(e));\n mql.addListener(handler);\n\n return () => {\n mql.removeListener(handler);\n };\n }).pipe(\n startWith(mql),\n map(({matches}) => ({query, matches})),\n takeUntil(this._destroySubject)\n );\n\n // Add the MediaQueryList to the set of queries.\n const output = {observable: queryObservable, mql};\n this._queries.set(query, output);\n return output;\n }\n}\n\n/**\n * Split each query string into separate query strings if two queries are provided as comma\n * separated.\n */\nfunction splitQueries(queries: readonly string[]): readonly string[] {\n return queries.map(query => query.split(','))\n .reduce((a1, a2) => a1.concat(a2))\n .map(query => query.trim());\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// PascalCase is being used as Breakpoints is used like an enum.\n// tslint:disable-next-line:variable-name\nexport const Breakpoints = {\n XSmall: '(max-width: 599.99px)',\n Small: '(min-width: 600px) and (max-width: 959.99px)',\n Medium: '(min-width: 960px) and (max-width: 1279.99px)',\n Large: '(min-width: 1280px) and (max-width: 1919.99px)',\n XLarge: '(min-width: 1920px)',\n\n Handset: '(max-width: 599.99px) and (orientation: portrait), ' +\n '(max-width: 959.99px) and (orientation: landscape)',\n Tablet: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait), ' +\n '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n Web: '(min-width: 840px) and (orientation: portrait), ' +\n '(min-width: 1280px) and (orientation: landscape)',\n\n HandsetPortrait: '(max-width: 599.99px) and (orientation: portrait)',\n TabletPortrait: '(min-width: 600px) and (max-width: 839.99px) and (orientation: portrait)',\n WebPortrait: '(min-width: 840px) and (orientation: portrait)',\n\n HandsetLandscape: '(max-width: 959.99px) and (orientation: landscape)',\n TabletLandscape: '(min-width: 960px) and (max-width: 1279.99px) and (orientation: landscape)',\n WebLandscape: '(min-width: 1280px) and (orientation: landscape)',\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 {LayoutModule} from './layout-module';\nexport {BreakpointObserver, BreakpointState} from './breakpoints-observer';\nexport {Breakpoints} from './breakpoints';\nexport {MediaMatcher} from './media-matcher';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;AAOA,MAIa,YAAY;;;YADxB,QAAQ,SAAC,EAAE;;;ACVZ;;;;;;;AAOA,AAGA;AACA,MAAM,kCAAkC,GAAgB,IAAI,GAAG,EAAU,CAAC;;AAG1E,IAAI,mBAAiD,CAAC;;AAItD,MAAa,YAAY;IAIvB,YAAoB,SAAmB;QAAnB,cAAS,GAAT,SAAS,CAAU;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU;;;YAG9D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC;YAC9B,cAAc,CAAC;KAClB;;;;;;;IAQD,UAAU,CAAC,KAAa;QACtB,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE;YACzB,oBAAoB,CAAC,KAAK,CAAC,CAAC;SAC7B;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;KAChC;;;;YAxBF,UAAU,SAAC,EAAC,UAAU,EAAE,MAAM,EAAC;;;YATxB,QAAQ;;;;;;AAwChB,SAAS,oBAAoB,CAAC,KAAa;IACzC,IAAI,kCAAkC,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE;QACjD,OAAO;KACR;IAED,IAAI;QACF,IAAI,CAAC,mBAAmB,EAAE;YACxB,mBAAmB,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;YACtD,mBAAmB,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;YACrD,QAAQ,CAAC,IAAK,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;SACjD;QAED,IAAI,mBAAmB,CAAC,KAAK,EAAE;YAC5B,mBAAmB,C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;;;;;;GAMG;;ACNH;;GAEG;;;;"}
@@ -7,7 +7,7 @@ import { Directionality, BidiModule } from '@angular/cdk/bidi';
7
7
  import { DomPortalOutlet, TemplatePortal, PortalModule } from '@angular/cdk/portal';
8
8
  import { Platform } from '@angular/cdk/platform';
9
9
  import { Subject, Subscription, merge } from 'rxjs';
10
- import { take, takeUntil } from 'rxjs/operators';
10
+ import { take, takeUntil, takeWhile } from 'rxjs/operators';
11
11
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
12
12
 
13
13
  /**
@@ -114,7 +114,7 @@ class CloseScrollStrategy {
114
114
  }
115
115
  /** Attaches this scroll strategy to an overlay. */
116
116
  attach(overlayRef) {
117
- if (this._overlayRef) {
117
+ if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
118
118
  throw getMatScrollStrategyAlreadyAttachedError();
119
119
  }
120
120
  this._overlayRef = overlayRef;
@@ -233,7 +233,7 @@ class RepositionScrollStrategy {
233
233
  }
234
234
  /** Attaches this scroll strategy to an overlay. */
235
235
  attach(overlayRef) {
236
- if (this._overlayRef) {
236
+ if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
237
237
  throw getMatScrollStrategyAlreadyAttachedError();
238
238
  }
239
239
  this._overlayRef = overlayRef;
@@ -351,10 +351,6 @@ class OverlayConfig {
351
351
  * the `HashLocationStrategy`).
352
352
  */
353
353
  this.disposeOnNavigation = false;
354
- /**
355
- * Array of HTML elements clicking on which should not be considered as outside click
356
- */
357
- this.excludeFromOutsideClick = [];
358
354
  if (config) {
359
355
  // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
360
356
  // loses the array generic type in the `for of`. But we *also* have to use `Array` because
@@ -609,22 +605,22 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
609
605
  this._clickListener = (event) => {
610
606
  // Get the target through the `composedPath` if possible to account for shadow DOM.
611
607
  const target = event.composedPath ? event.composedPath()[0] : event.target;
612
- const overlays = this._attachedOverlays;
608
+ // We copy the array because the original may be modified asynchronously if the
609
+ // outsidePointerEvents listener decides to detach overlays resulting in index errors inside
610
+ // the for loop.
611
+ const overlays = this._attachedOverlays.slice();
613
612
  // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.
614
613
  // We want to target all overlays for which the click could be considered as outside click.
615
614
  // As soon as we reach an overlay for which the click is not outside click we break off
616
615
  // the loop.
617
616
  for (let i = overlays.length - 1; i > -1; i--) {
618
617
  const overlayRef = overlays[i];
619
- if (overlayRef._outsidePointerEvents.observers.length < 1) {
618
+ if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {
620
619
  continue;
621
620
  }
622
- const config = overlayRef.getConfig();
623
- const excludeElements = [...config.excludeFromOutsideClick, overlayRef.overlayElement];
624
- const isInsideClick = excludeElements.some(e => e.contains(target));
625
- // If it is inside click just break - we should do nothing
626
- // If it is outside click dispatch the mouse event, and proceed with the next overlay
627
- if (isInsideClick) {
621
+ // If it's a click inside the overlay, just break - we should do nothing
622
+ // If it's an outside click dispatch the mouse event, and proceed with the next overlay
623
+ if (overlayRef.overlayElement.contains(target)) {
628
624
  break;
629
625
  }
630
626
  overlayRef._outsidePointerEvents.next(event);
@@ -644,6 +640,7 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
644
640
  // tslint:enable: max-line-length
645
641
  if (!this._isAttached) {
646
642
  this._document.body.addEventListener('click', this._clickListener, true);
643
+ this._document.body.addEventListener('contextmenu', this._clickListener, true);
647
644
  // click event is not fired on iOS. To make element "clickable" we are
648
645
  // setting the cursor to pointer
649
646
  if (this._platform.IOS && !this._cursorStyleIsSet) {
@@ -658,6 +655,7 @@ class OverlayOutsideClickDispatcher extends BaseOverlayDispatcher {
658
655
  detach() {
659
656
  if (this._isAttached) {
660
657
  this._document.body.removeEventListener('click', this._clickListener, true);
658
+ this._document.body.removeEventListener('contextmenu', this._clickListener, true);
661
659
  if (this._platform.IOS && this._cursorStyleIsSet) {
662
660
  this._document.body.style.cursor = this._cursorOriginalValue;
663
661
  this._cursorStyleIsSet = false;
@@ -862,7 +860,6 @@ class OverlayRef {
862
860
  // before attempting to position it, as the position may depend on the size of the rendered
863
861
  // content.
864
862
  this._ngZone.onStable
865
- .asObservable()
866
863
  .pipe(take(1))
867
864
  .subscribe(() => {
868
865
  // The overlay could've been detached before the zone has stabilized.
@@ -963,23 +960,23 @@ class OverlayRef {
963
960
  }
964
961
  /** Gets an observable that emits when the backdrop has been clicked. */
965
962
  backdropClick() {
966
- return this._backdropClick.asObservable();
963
+ return this._backdropClick;
967
964
  }
968
965
  /** Gets an observable that emits when the overlay has been attached. */
969
966
  attachments() {
970
- return this._attachments.asObservable();
967
+ return this._attachments;
971
968
  }
972
969
  /** Gets an observable that emits when the overlay has been detached. */
973
970
  detachments() {
974
- return this._detachments.asObservable();
971
+ return this._detachments;
975
972
  }
976
973
  /** Gets an observable of keydown events targeted to this overlay. */
977
974
  keydownEvents() {
978
- return this._keydownEvents.asObservable();
975
+ return this._keydownEvents;
979
976
  }
980
977
  /** Gets an observable of pointer events targeted outside this overlay. */
981
978
  outsidePointerEvents() {
982
- return this._outsidePointerEvents.asObservable();
979
+ return this._outsidePointerEvents;
983
980
  }
984
981
  /** Gets the current overlay configuration, which is immutable. */
985
982
  getConfig() {
@@ -1170,7 +1167,6 @@ class OverlayRef {
1170
1167
  // might still be animating. This stream helps us avoid interrupting the animation
1171
1168
  // by waiting for the pane to become empty.
1172
1169
  const subscription = this._ngZone.onStable
1173
- .asObservable()
1174
1170
  .pipe(takeUntil(merge(this._attachments, this._detachments)))
1175
1171
  .subscribe(() => {
1176
1172
  // Needs a couple of checks for the pane and host, because
@@ -1255,7 +1251,7 @@ class FlexibleConnectedPositionStrategy {
1255
1251
  /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */
1256
1252
  this._appliedPanelClasses = [];
1257
1253
  /** Observable sequence of position changes. */
1258
- this.positionChanges = this._positionChanges.asObservable();
1254
+ this.positionChanges = this._positionChanges;
1259
1255
  this.setOrigin(connectedTo);
1260
1256
  }
1261
1257
  /** Ordered list of preferred positions, from most to least desirable. */
@@ -1264,7 +1260,8 @@ class FlexibleConnectedPositionStrategy {
1264
1260
  }
1265
1261
  /** Attaches this position strategy to an overlay. */
1266
1262
  attach(overlayRef) {
1267
- if (this._overlayRef && overlayRef !== this._overlayRef) {
1263
+ if (this._overlayRef && overlayRef !== this._overlayRef &&
1264
+ (typeof ngDevMode === 'undefined' || ngDevMode)) {
1268
1265
  throw Error('This position strategy is already attached to an overlay');
1269
1266
  }
1270
1267
  this._validatePositions();
@@ -1663,8 +1660,8 @@ class FlexibleConnectedPositionStrategy {
1663
1660
  const viewport = this._viewportRect;
1664
1661
  // Determine how much the overlay goes outside the viewport on each
1665
1662
  // side, which we'll use to decide which direction to push it.
1666
- const overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
1667
- const overflowBottom = Math.max(start.y + overlay.height - viewport.bottom, 0);
1663
+ const overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);
1664
+ const overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);
1668
1665
  const overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
1669
1666
  const overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
1670
1667
  // Amount by which to push the overlay in each axis such that it remains on-screen.
@@ -2054,17 +2051,19 @@ class FlexibleConnectedPositionStrategy {
2054
2051
  }
2055
2052
  /** Validates that the current position match the expected values. */
2056
2053
  _validatePositions() {
2057
- if (!this._preferredPositions.length) {
2058
- throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');
2059
- }
2060
- // TODO(crisbeto): remove these once Angular's template type
2061
- // checking is advanced enough to catch these cases.
2062
- this._preferredPositions.forEach(pair => {
2063
- validateHorizontalPosition('originX', pair.originX);
2064
- validateVerticalPosition('originY', pair.originY);
2065
- validateHorizontalPosition('overlayX', pair.overlayX);
2066
- validateVerticalPosition('overlayY', pair.overlayY);
2067
- });
2054
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2055
+ if (!this._preferredPositions.length) {
2056
+ throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');
2057
+ }
2058
+ // TODO(crisbeto): remove these once Angular's template type
2059
+ // checking is advanced enough to catch these cases.
2060
+ this._preferredPositions.forEach(pair => {
2061
+ validateHorizontalPosition('originX', pair.originX);
2062
+ validateVerticalPosition('originY', pair.originY);
2063
+ validateHorizontalPosition('overlayX', pair.overlayX);
2064
+ validateVerticalPosition('overlayY', pair.overlayY);
2065
+ });
2066
+ }
2068
2067
  }
2069
2068
  /** Adds a single CSS class or an array of classes on the overlay panel. */
2070
2069
  _addPanelClasses(cssClasses) {
@@ -2159,14 +2158,7 @@ class ConnectedPositionStrategy {
2159
2158
  .withPush(false)
2160
2159
  .withViewportMargin(0);
2161
2160
  this.withFallbackPosition(originPos, overlayPos);
2162
- }
2163
- /** Whether the we're dealing with an RTL context */
2164
- get _isRtl() {
2165
- return this._overlayRef.getDirection() === 'rtl';
2166
- }
2167
- /** Emits an event when the connection point changes. */
2168
- get onPositionChange() {
2169
- return this._positionStrategy.positionChanges;
2161
+ this.onPositionChange = this._positionStrategy.positionChanges;
2170
2162
  }
2171
2163
  /** Ordered list of preferred positions, from most to least desirable. */
2172
2164
  get positions() {
@@ -2641,8 +2633,8 @@ Overlay.ctorParameters = () => [
2641
2633
  { type: NgZone },
2642
2634
  { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] },
2643
2635
  { type: Directionality },
2644
- { type: Location, decorators: [{ type: Optional }] },
2645
- { type: OverlayOutsideClickDispatcher, decorators: [{ type: Optional }] }
2636
+ { type: Location },
2637
+ { type: OverlayOutsideClickDispatcher }
2646
2638
  ];
2647
2639
 
2648
2640
  /**
@@ -2722,6 +2714,7 @@ class CdkConnectedOverlay {
2722
2714
  this._backdropSubscription = Subscription.EMPTY;
2723
2715
  this._attachSubscription = Subscription.EMPTY;
2724
2716
  this._detachSubscription = Subscription.EMPTY;
2717
+ this._positionSubscription = Subscription.EMPTY;
2725
2718
  /** Margin between the overlay and the viewport edges. */
2726
2719
  this.viewportMargin = 0;
2727
2720
  /** Whether the overlay is open. */
@@ -2787,6 +2780,7 @@ class CdkConnectedOverlay {
2787
2780
  this._attachSubscription.unsubscribe();
2788
2781
  this._detachSubscription.unsubscribe();
2789
2782
  this._backdropSubscription.unsubscribe();
2783
+ this._positionSubscription.unsubscribe();
2790
2784
  if (this._overlayRef) {
2791
2785
  this._overlayRef.dispose();
2792
2786
  }
@@ -2882,7 +2876,6 @@ class CdkConnectedOverlay {
2882
2876
  _createPositionStrategy() {
2883
2877
  const strategy = this._overlay.position().flexibleConnectedTo(this.origin.elementRef);
2884
2878
  this._updatePositionStrategy(strategy);
2885
- strategy.positionChanges.subscribe(p => this.positionChange.emit(p));
2886
2879
  return strategy;
2887
2880
  }
2888
2881
  /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
@@ -2905,6 +2898,19 @@ class CdkConnectedOverlay {
2905
2898
  else {
2906
2899
  this._backdropSubscription.unsubscribe();
2907
2900
  }
2901
+ this._positionSubscription.unsubscribe();
2902
+ // Only subscribe to `positionChanges` if requested, because putting
2903
+ // together all the information for it can be expensive.
2904
+ if (this.positionChange.observers.length > 0) {
2905
+ this._positionSubscription = this._position.positionChanges
2906
+ .pipe(takeWhile(() => this.positionChange.observers.length > 0))
2907
+ .subscribe(position => {
2908
+ this.positionChange.emit(position);
2909
+ if (this.positionChange.observers.length === 0) {
2910
+ this._positionSubscription.unsubscribe();
2911
+ }
2912
+ });
2913
+ }
2908
2914
  }
2909
2915
  /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
2910
2916
  _detachOverlay() {
@@ -2912,6 +2918,7 @@ class CdkConnectedOverlay {
2912
2918
  this._overlayRef.detach();
2913
2919
  }
2914
2920
  this._backdropSubscription.unsubscribe();
2921
+ this._positionSubscription.unsubscribe();
2915
2922
  }
2916
2923
  }
2917
2924
  CdkConnectedOverlay.decorators = [