@angular/cdk 13.0.0-next.6 → 13.0.0-rc.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 (796) hide show
  1. package/a11y/a11y-module.d.ts +9 -7
  2. package/a11y/aria-describer/aria-describer.d.ts +3 -7
  3. package/a11y/focus-monitor/focus-monitor.d.ts +5 -0
  4. package/a11y/focus-trap/configurable-focus-trap-factory.d.ts +3 -7
  5. package/a11y/focus-trap/focus-trap-manager.d.ts +3 -7
  6. package/a11y/focus-trap/focus-trap.d.ts +5 -0
  7. package/a11y/high-contrast-mode/high-contrast-mode-detector.d.ts +3 -0
  8. package/a11y/index.d.ts +0 -1
  9. package/a11y/input-modality/input-modality-detector.d.ts +3 -7
  10. package/a11y/interactivity-checker/interactivity-checker.d.ts +3 -0
  11. package/a11y/live-announcer/live-announcer.d.ts +6 -1
  12. package/a11y/package.json +5 -5
  13. package/accordion/accordion-item.d.ts +3 -0
  14. package/accordion/accordion-module.d.ts +6 -7
  15. package/accordion/accordion.d.ts +3 -0
  16. package/accordion/index.d.ts +0 -1
  17. package/accordion/package.json +5 -5
  18. package/bidi/bidi-module.d.ts +5 -7
  19. package/bidi/dir.d.ts +3 -0
  20. package/bidi/directionality.d.ts +3 -0
  21. package/bidi/index.d.ts +0 -1
  22. package/bidi/package.json +5 -5
  23. package/clipboard/clipboard-module.d.ts +5 -7
  24. package/clipboard/clipboard.d.ts +3 -7
  25. package/clipboard/copy-to-clipboard.d.ts +3 -0
  26. package/clipboard/package.json +5 -5
  27. package/coercion/package.json +5 -5
  28. package/collections/package.json +5 -5
  29. package/collections/unique-selection-dispatcher.d.ts +3 -0
  30. package/drag-drop/client-rect.d.ts +8 -1
  31. package/drag-drop/directives/drag-handle.d.ts +3 -0
  32. package/drag-drop/directives/drag-placeholder.d.ts +3 -0
  33. package/drag-drop/directives/drag-preview.d.ts +3 -0
  34. package/drag-drop/directives/drag.d.ts +3 -0
  35. package/drag-drop/directives/drop-list-group.d.ts +3 -0
  36. package/drag-drop/directives/drop-list.d.ts +3 -0
  37. package/drag-drop/drag-drop-module.d.ts +11 -7
  38. package/drag-drop/drag-drop-registry.d.ts +3 -0
  39. package/drag-drop/drag-drop.d.ts +3 -0
  40. package/drag-drop/index.d.ts +0 -1
  41. package/drag-drop/package.json +5 -5
  42. package/esm2020/a11y/a11y-module.mjs +33 -0
  43. package/esm2020/a11y/aria-describer/aria-describer.mjs +208 -0
  44. package/{esm2015/a11y/aria-describer/aria-reference.js → esm2020/a11y/aria-describer/aria-reference.mjs} +1 -1
  45. package/esm2020/a11y/fake-event-detection.mjs +29 -0
  46. package/esm2020/a11y/focus-monitor/focus-monitor.mjs +400 -0
  47. package/{esm2015/a11y/focus-trap/configurable-focus-trap-config.js → esm2020/a11y/focus-trap/configurable-focus-trap-config.mjs} +0 -0
  48. package/esm2020/a11y/focus-trap/configurable-focus-trap-factory.mjs +53 -0
  49. package/esm2020/a11y/focus-trap/configurable-focus-trap.mjs +51 -0
  50. package/esm2020/a11y/focus-trap/event-listener-inert-strategy.mjs +61 -0
  51. package/esm2020/a11y/focus-trap/focus-trap-inert-strategy.mjs +11 -0
  52. package/esm2020/a11y/focus-trap/focus-trap-manager.mjs +53 -0
  53. package/esm2020/a11y/focus-trap/focus-trap.mjs +399 -0
  54. package/esm2020/a11y/high-contrast-mode/high-contrast-mode-detector.mjs +95 -0
  55. package/esm2020/a11y/index.mjs +5 -0
  56. package/esm2020/a11y/input-modality/input-modality-detector.mjs +176 -0
  57. package/esm2020/a11y/interactivity-checker/interactivity-checker.mjs +238 -0
  58. package/{esm2015/a11y/key-manager/activedescendant-key-manager.js → esm2020/a11y/key-manager/activedescendant-key-manager.mjs} +1 -1
  59. package/{esm2015/a11y/key-manager/focus-key-manager.js → esm2020/a11y/key-manager/focus-key-manager.mjs} +0 -0
  60. package/esm2020/a11y/key-manager/list-key-manager.mjs +321 -0
  61. package/esm2020/a11y/live-announcer/live-announcer-tokens.mjs +19 -0
  62. package/esm2020/a11y/live-announcer/live-announcer.mjs +170 -0
  63. package/{esm2015/a11y/public-api.js → esm2020/a11y/public-api.mjs} +0 -0
  64. package/esm2020/accordion/accordion-item.mjs +167 -0
  65. package/esm2020/accordion/accordion-module.mjs +24 -0
  66. package/esm2020/accordion/accordion.mjs +70 -0
  67. package/esm2020/accordion/index.mjs +5 -0
  68. package/{esm2015/accordion/public-api.js → esm2020/accordion/public-api.mjs} +0 -0
  69. package/esm2020/bidi/bidi-module.mjs +23 -0
  70. package/{esm2015/bidi/dir-document-token.js → esm2020/bidi/dir-document-token.mjs} +1 -1
  71. package/esm2020/bidi/dir.mjs +67 -0
  72. package/esm2020/bidi/directionality.mjs +47 -0
  73. package/esm2020/bidi/index.mjs +5 -0
  74. package/{esm2015/bidi/public-api.js → esm2020/bidi/public-api.mjs} +1 -1
  75. package/esm2020/clipboard/clipboard-module.mjs +23 -0
  76. package/esm2020/clipboard/clipboard.mjs +53 -0
  77. package/esm2020/clipboard/copy-to-clipboard.mjs +99 -0
  78. package/{esm2015/clipboard/index.js → esm2020/clipboard/index.mjs} +0 -0
  79. package/esm2020/clipboard/pending-copy.mjs +67 -0
  80. package/{esm2015/clipboard/public-api.js → esm2020/clipboard/public-api.mjs} +0 -0
  81. package/{esm2015/coercion/array.js → esm2020/coercion/array.mjs} +0 -0
  82. package/{esm2015/coercion/boolean-property.js → esm2020/coercion/boolean-property.mjs} +0 -0
  83. package/{esm2015/coercion/css-pixel-value.js → esm2020/coercion/css-pixel-value.mjs} +0 -0
  84. package/{esm2015/coercion/element.js → esm2020/coercion/element.mjs} +0 -0
  85. package/{esm2015/coercion/index.js → esm2020/coercion/index.mjs} +0 -0
  86. package/{esm2015/coercion/number-property.js → esm2020/coercion/number-property.mjs} +0 -0
  87. package/{esm2015/coercion/public-api.js → esm2020/coercion/public-api.mjs} +0 -0
  88. package/{esm2015/coercion/string-array.js → esm2020/coercion/string-array.mjs} +0 -0
  89. package/{esm2015/collections/array-data-source.js → esm2020/collections/array-data-source.mjs} +1 -1
  90. package/esm2020/collections/collection-viewer.mjs +9 -0
  91. package/{esm2015/collections/data-source.js → esm2020/collections/data-source.mjs} +0 -0
  92. package/esm2020/collections/dispose-view-repeater-strategy.mjs +47 -0
  93. package/{esm2015/collections/index.js → esm2020/collections/index.mjs} +0 -0
  94. package/{esm2015/collections/public-api.js → esm2020/collections/public-api.mjs} +0 -0
  95. package/esm2020/collections/recycle-view-repeater-strategy.mjs +128 -0
  96. package/{esm2015/collections/selection-model.js → esm2020/collections/selection-model.mjs} +2 -2
  97. package/esm2020/collections/tree-adapter.mjs +9 -0
  98. package/esm2020/collections/unique-selection-dispatcher.mjs +55 -0
  99. package/esm2020/collections/view-repeater.mjs +14 -0
  100. package/esm2020/drag-drop/client-rect.mjs +64 -0
  101. package/esm2020/drag-drop/clone-node.mjs +65 -0
  102. package/esm2020/drag-drop/directives/assertions.mjs +18 -0
  103. package/{esm2015/drag-drop/directives/config.js → esm2020/drag-drop/directives/config.mjs} +1 -1
  104. package/esm2020/drag-drop/directives/drag-handle.mjs +66 -0
  105. package/esm2020/drag-drop/directives/drag-placeholder.mjs +36 -0
  106. package/esm2020/drag-drop/directives/drag-preview.mjs +47 -0
  107. package/esm2020/drag-drop/directives/drag.mjs +483 -0
  108. package/esm2020/drag-drop/directives/drop-list-group.mjs +53 -0
  109. package/esm2020/drag-drop/directives/drop-list.mjs +344 -0
  110. package/esm2020/drag-drop/drag-drop-module.mjs +57 -0
  111. package/esm2020/drag-drop/drag-drop-registry.mjs +231 -0
  112. package/esm2020/drag-drop/drag-drop.mjs +57 -0
  113. package/esm2020/drag-drop/drag-events.mjs +9 -0
  114. package/{esm2015/drag-drop/drag-parent.js → esm2020/drag-drop/drag-parent.mjs} +0 -0
  115. package/esm2020/drag-drop/drag-ref.mjs +1108 -0
  116. package/esm2020/drag-drop/drag-styling.mjs +69 -0
  117. package/esm2020/drag-drop/drag-utils.mjs +60 -0
  118. package/esm2020/drag-drop/drop-list-ref.mjs +830 -0
  119. package/{esm2015/drag-drop/index.js → esm2020/drag-drop/index.mjs} +1 -1
  120. package/{esm2015/drag-drop/parent-position-tracker.js → esm2020/drag-drop/parent-position-tracker.mjs} +2 -2
  121. package/{esm2015/drag-drop/public-api.js → esm2020/drag-drop/public-api.mjs} +0 -0
  122. package/esm2020/drag-drop/transition-duration.mjs +36 -0
  123. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  124. package/{esm2015/keycodes/index.js → esm2020/keycodes/index.mjs} +0 -0
  125. package/{esm2015/keycodes/keycodes.js → esm2020/keycodes/keycodes.mjs} +1 -1
  126. package/{esm2015/keycodes/modifiers.js → esm2020/keycodes/modifiers.mjs} +0 -0
  127. package/{esm2015/keycodes/public-api.js → esm2020/keycodes/public-api.mjs} +0 -0
  128. package/esm2020/layout/breakpoints-observer.mjs +105 -0
  129. package/{esm2015/layout/breakpoints.js → esm2020/layout/breakpoints.mjs} +1 -1
  130. package/{esm2015/layout/index.js → esm2020/layout/index.mjs} +0 -0
  131. package/esm2020/layout/layout-module.mjs +19 -0
  132. package/esm2020/layout/media-matcher.mjs +85 -0
  133. package/{esm2015/layout/public-api.js → esm2020/layout/public-api.mjs} +0 -0
  134. package/{esm2015/observers/index.js → esm2020/observers/index.mjs} +0 -0
  135. package/esm2020/observers/observe-content.mjs +187 -0
  136. package/{esm2015/observers/public-api.js → esm2020/observers/public-api.mjs} +0 -0
  137. package/esm2020/overlay/dispatchers/base-overlay-dispatcher.mjs +52 -0
  138. package/{esm2015/overlay/dispatchers/index.js → esm2020/overlay/dispatchers/index.mjs} +0 -0
  139. package/esm2020/overlay/dispatchers/overlay-keyboard-dispatcher.mjs +63 -0
  140. package/esm2020/overlay/dispatchers/overlay-outside-click-dispatcher.mjs +116 -0
  141. package/esm2020/overlay/fullscreen-overlay-container.mjs +94 -0
  142. package/esm2020/overlay/index.mjs +5 -0
  143. package/esm2020/overlay/overlay-config.mjs +45 -0
  144. package/esm2020/overlay/overlay-container.mjs +81 -0
  145. package/esm2020/overlay/overlay-directives.mjs +427 -0
  146. package/esm2020/overlay/overlay-module.mjs +29 -0
  147. package/esm2020/overlay/overlay-ref.mjs +402 -0
  148. package/{esm2015/overlay/overlay-reference.js → esm2020/overlay/overlay-reference.mjs} +0 -0
  149. package/esm2020/overlay/overlay.mjs +119 -0
  150. package/esm2020/overlay/position/connected-position.mjs +97 -0
  151. package/esm2020/overlay/position/flexible-connected-position-strategy.mjs +959 -0
  152. package/esm2020/overlay/position/global-position-strategy.mjs +203 -0
  153. package/esm2020/overlay/position/overlay-position-builder.mjs +50 -0
  154. package/{esm2015/overlay/position/position-strategy.js → esm2020/overlay/position/position-strategy.mjs} +0 -0
  155. package/esm2020/overlay/position/scroll-clip.mjs +40 -0
  156. package/{esm2015/overlay/public-api.js → esm2020/overlay/public-api.mjs} +0 -0
  157. package/{esm2015/overlay/scroll/block-scroll-strategy.js → esm2020/overlay/scroll/block-scroll-strategy.mjs} +1 -1
  158. package/esm2020/overlay/scroll/close-scroll-strategy.mjs +61 -0
  159. package/{esm2015/overlay/scroll/index.js → esm2020/overlay/scroll/index.mjs} +2 -2
  160. package/{esm2015/overlay/scroll/noop-scroll-strategy.js → esm2020/overlay/scroll/noop-scroll-strategy.mjs} +1 -1
  161. package/{esm2015/overlay/scroll/reposition-scroll-strategy.js → esm2020/overlay/scroll/reposition-scroll-strategy.mjs} +1 -1
  162. package/esm2020/overlay/scroll/scroll-strategy-options.mjs +55 -0
  163. package/{esm2015/overlay/scroll/scroll-strategy.js → esm2020/overlay/scroll/scroll-strategy.mjs} +0 -0
  164. package/{esm2015/platform/features/input-types.js → esm2020/platform/features/input-types.mjs} +1 -1
  165. package/esm2020/platform/features/passive-listeners.mjs +36 -0
  166. package/esm2020/platform/features/scrolling.mjs +85 -0
  167. package/{esm2015/platform/features/shadow-dom.js → esm2020/platform/features/shadow-dom.mjs} +4 -3
  168. package/esm2020/platform/features/test-environment.mjs +27 -0
  169. package/{esm2015/platform/index.js → esm2020/platform/index.mjs} +0 -0
  170. package/esm2020/platform/platform-module.mjs +19 -0
  171. package/esm2020/platform/platform.mjs +85 -0
  172. package/{esm2015/platform/public-api.js → esm2020/platform/public-api.mjs} +0 -0
  173. package/esm2020/portal/dom-portal-outlet.mjs +134 -0
  174. package/{esm2015/portal/index.js → esm2020/portal/index.mjs} +0 -0
  175. package/esm2020/portal/portal-directives.mjs +244 -0
  176. package/{esm2015/portal/portal-errors.js → esm2020/portal/portal-errors.mjs} +1 -1
  177. package/esm2020/portal/portal-injector.mjs +28 -0
  178. package/esm2020/portal/portal.mjs +179 -0
  179. package/{esm2015/portal/public-api.js → esm2020/portal/public-api.mjs} +0 -0
  180. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  181. package/esm2020/scrolling/fixed-size-virtual-scroll.mjs +217 -0
  182. package/{esm2015/scrolling/index.js → esm2020/scrolling/index.mjs} +0 -0
  183. package/{esm2015/scrolling/public-api.js → esm2020/scrolling/public-api.mjs} +0 -0
  184. package/esm2020/scrolling/scroll-dispatcher.mjs +163 -0
  185. package/esm2020/scrolling/scrollable.mjs +176 -0
  186. package/esm2020/scrolling/scrolling-module.mjs +52 -0
  187. package/esm2020/scrolling/viewport-ruler.mjs +146 -0
  188. package/esm2020/scrolling/virtual-for-of.mjs +296 -0
  189. package/{esm2015/scrolling/virtual-scroll-repeater.js → esm2020/scrolling/virtual-scroll-repeater.mjs} +0 -0
  190. package/esm2020/scrolling/virtual-scroll-strategy.mjs +11 -0
  191. package/esm2020/scrolling/virtual-scroll-viewport.mjs +378 -0
  192. package/{esm2015/stepper/index.js → esm2020/stepper/index.mjs} +0 -0
  193. package/{esm2015/stepper/public-api.js → esm2020/stepper/public-api.mjs} +0 -0
  194. package/esm2020/stepper/step-header.mjs +30 -0
  195. package/esm2020/stepper/step-label.mjs +23 -0
  196. package/esm2020/stepper/stepper-button.mjs +76 -0
  197. package/esm2020/stepper/stepper-module.mjs +40 -0
  198. package/esm2020/stepper/stepper.mjs +471 -0
  199. package/esm2020/table/can-stick.mjs +44 -0
  200. package/esm2020/table/cell.mjs +222 -0
  201. package/esm2020/table/coalesced-style-scheduler.mjs +91 -0
  202. package/{esm2015/table/index.js → esm2020/table/index.mjs} +0 -0
  203. package/{esm2015/table/public-api.js → esm2020/table/public-api.mjs} +0 -0
  204. package/esm2020/table/row.mjs +254 -0
  205. package/esm2020/table/sticky-position-listener.mjs +11 -0
  206. package/esm2020/table/sticky-styler.mjs +345 -0
  207. package/{esm2015/table/table-errors.js → esm2020/table/table-errors.mjs} +1 -1
  208. package/esm2020/table/table-module.mjs +94 -0
  209. package/esm2020/table/table.mjs +1023 -0
  210. package/esm2020/table/text-column.mjs +153 -0
  211. package/{esm2015/table/tokens.js → esm2020/table/tokens.mjs} +1 -1
  212. package/esm2020/testing/change-detection.mjs +102 -0
  213. package/esm2020/testing/component-harness.mjs +322 -0
  214. package/{esm2015/testing/element-dimensions.js → esm2020/testing/element-dimensions.mjs} +1 -1
  215. package/esm2020/testing/harness-environment.mjs +202 -0
  216. package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
  217. package/{esm2015/testing/protractor/index.js → esm2020/testing/protractor/index.mjs} +0 -0
  218. package/esm2020/testing/protractor/protractor-element.mjs +234 -0
  219. package/esm2020/testing/protractor/protractor-harness-environment.mjs +72 -0
  220. package/{esm2015/testing/protractor/public-api.js → esm2020/testing/protractor/public-api.mjs} +0 -0
  221. package/{esm2015/testing/public-api.js → esm2020/testing/public-api.mjs} +0 -0
  222. package/{esm2015/testing/selenium-webdriver/index.js → esm2020/testing/selenium-webdriver/index.mjs} +0 -0
  223. package/{esm2015/testing/selenium-webdriver/public-api.js → esm2020/testing/selenium-webdriver/public-api.mjs} +0 -0
  224. package/esm2020/testing/selenium-webdriver/selenium-web-driver-element.mjs +199 -0
  225. package/esm2020/testing/selenium-webdriver/selenium-web-driver-harness-environment.mjs +87 -0
  226. package/{esm2015/testing/selenium-webdriver/selenium-webdriver-keys.js → esm2020/testing/selenium-webdriver/selenium-webdriver-keys.mjs} +2 -2
  227. package/esm2020/testing/test-element.mjs +48 -0
  228. package/esm2020/testing/testbed/fake-events/dispatch-events.mjs +53 -0
  229. package/esm2020/testing/testbed/fake-events/element-focus.mjs +39 -0
  230. package/esm2020/testing/testbed/fake-events/event-objects.mjs +113 -0
  231. package/{esm2015/testing/testbed/fake-events/index.js → esm2020/testing/testbed/fake-events/index.mjs} +0 -0
  232. package/esm2020/testing/testbed/fake-events/type-in-element.mjs +88 -0
  233. package/{esm2015/testing/testbed/index.js → esm2020/testing/testbed/index.mjs} +0 -0
  234. package/{esm2015/testing/testbed/public-api.js → esm2020/testing/testbed/public-api.mjs} +0 -0
  235. package/esm2020/testing/testbed/task-state-zone-interceptor.mjs +82 -0
  236. package/esm2020/testing/testbed/testbed-harness-environment.mjs +162 -0
  237. package/esm2020/testing/testbed/unit-test-element.mjs +224 -0
  238. package/esm2020/testing/text-filtering.mjs +21 -0
  239. package/esm2020/text-field/autofill.mjs +113 -0
  240. package/esm2020/text-field/autosize.mjs +310 -0
  241. package/{esm2015/text-field/index.js → esm2020/text-field/index.mjs} +0 -0
  242. package/{esm2015/text-field/public-api.js → esm2020/text-field/public-api.mjs} +0 -0
  243. package/esm2020/text-field/text-field-module.mjs +26 -0
  244. package/{esm2015/tree/control/base-tree-control.js → esm2020/tree/control/base-tree-control.mjs} +4 -4
  245. package/{esm2015/tree/control/flat-tree-control.js → esm2020/tree/control/flat-tree-control.mjs} +1 -1
  246. package/esm2020/tree/control/nested-tree-control.mjs +58 -0
  247. package/{esm2015/tree/control/tree-control.js → esm2020/tree/control/tree-control.mjs} +0 -0
  248. package/{esm2015/tree/index.js → esm2020/tree/index.mjs} +0 -0
  249. package/esm2020/tree/nested-node.mjs +117 -0
  250. package/esm2020/tree/node.mjs +35 -0
  251. package/esm2020/tree/outlet.mjs +39 -0
  252. package/esm2020/tree/padding.mjs +131 -0
  253. package/{esm2015/tree/public-api.js → esm2020/tree/public-api.mjs} +0 -0
  254. package/esm2020/tree/toggle.mjs +53 -0
  255. package/{esm2015/tree/tree-errors.js → esm2020/tree/tree-errors.mjs} +0 -0
  256. package/esm2020/tree/tree-module.mjs +49 -0
  257. package/esm2020/tree/tree.mjs +361 -0
  258. package/{esm2015/version.js → esm2020/version.mjs} +1 -1
  259. package/fesm2015/a11y.mjs +2356 -0
  260. package/fesm2015/a11y.mjs.map +1 -0
  261. package/fesm2015/accordion.mjs +267 -0
  262. package/fesm2015/accordion.mjs.map +1 -0
  263. package/fesm2015/bidi.mjs +179 -0
  264. package/fesm2015/bidi.mjs.map +1 -0
  265. package/fesm2015/{cdk.js → cdk.mjs} +2 -2
  266. package/fesm2015/cdk.mjs.map +1 -0
  267. package/fesm2015/clipboard.mjs +253 -0
  268. package/fesm2015/clipboard.mjs.map +1 -0
  269. package/fesm2015/{coercion.js → coercion.mjs} +1 -1
  270. package/fesm2015/coercion.mjs.map +1 -0
  271. package/fesm2015/{collections.js → collections.mjs} +15 -27
  272. package/fesm2015/collections.mjs.map +1 -0
  273. package/fesm2015/drag-drop.mjs +3667 -0
  274. package/fesm2015/drag-drop.mjs.map +1 -0
  275. package/fesm2015/{keycodes.js → keycodes.mjs} +1 -1
  276. package/fesm2015/keycodes.mjs.map +1 -0
  277. package/fesm2015/{layout.js → layout.mjs} +30 -28
  278. package/fesm2015/layout.mjs.map +1 -0
  279. package/fesm2015/{observers.js → observers.mjs} +50 -41
  280. package/fesm2015/observers.mjs.map +1 -0
  281. package/fesm2015/overlay.mjs +3004 -0
  282. package/fesm2015/overlay.mjs.map +1 -0
  283. package/fesm2015/platform.mjs +380 -0
  284. package/fesm2015/platform.mjs.map +1 -0
  285. package/fesm2015/portal.mjs +649 -0
  286. package/fesm2015/portal.mjs.map +1 -0
  287. package/fesm2015/scrolling.mjs +1394 -0
  288. package/fesm2015/scrolling.mjs.map +1 -0
  289. package/fesm2015/{stepper.js → stepper.mjs} +186 -133
  290. package/fesm2015/stepper.mjs.map +1 -0
  291. package/fesm2015/{table.js → table.mjs} +500 -359
  292. package/fesm2015/table.mjs.map +1 -0
  293. package/fesm2015/testing/{protractor.js → protractor.mjs} +12 -25
  294. package/fesm2015/testing/protractor.mjs.map +1 -0
  295. package/fesm2015/testing/{selenium-webdriver.js → selenium-webdriver.mjs} +14 -28
  296. package/fesm2015/testing/selenium-webdriver.mjs.map +1 -0
  297. package/fesm2015/testing/{testbed.js → testbed.mjs} +23 -29
  298. package/fesm2015/testing/testbed.mjs.map +1 -0
  299. package/fesm2015/{testing.js → testing.mjs} +19 -45
  300. package/fesm2015/testing.mjs.map +1 -0
  301. package/fesm2015/text-field.mjs +455 -0
  302. package/fesm2015/text-field.mjs.map +1 -0
  303. package/fesm2015/{tree.js → tree.mjs} +198 -152
  304. package/fesm2015/tree.mjs.map +1 -0
  305. package/{fesm2015/a11y.js → fesm2020/a11y.mjs} +272 -233
  306. package/fesm2020/a11y.mjs.map +1 -0
  307. package/{fesm2015/accordion.js → fesm2020/accordion.mjs} +87 -57
  308. package/fesm2020/accordion.mjs.map +1 -0
  309. package/{fesm2015/bidi.js → fesm2020/bidi.mjs} +47 -31
  310. package/fesm2020/bidi.mjs.map +1 -0
  311. package/fesm2020/cdk.mjs +30 -0
  312. package/fesm2020/cdk.mjs.map +1 -0
  313. package/{fesm2015/clipboard.js → fesm2020/clipboard.mjs} +51 -40
  314. package/fesm2020/clipboard.mjs.map +1 -0
  315. package/fesm2020/coercion.mjs +132 -0
  316. package/fesm2020/coercion.mjs.map +1 -0
  317. package/fesm2020/collections.mjs +472 -0
  318. package/fesm2020/collections.mjs.map +1 -0
  319. package/{fesm2015/drag-drop.js → fesm2020/drag-drop.mjs} +523 -366
  320. package/fesm2020/drag-drop.mjs.map +1 -0
  321. package/fesm2020/keycodes.mjs +159 -0
  322. package/fesm2020/keycodes.mjs.map +1 -0
  323. package/fesm2020/layout.mjs +246 -0
  324. package/fesm2020/layout.mjs.map +1 -0
  325. package/fesm2020/observers.mjs +202 -0
  326. package/fesm2020/observers.mjs.map +1 -0
  327. package/{fesm2015/overlay.js → fesm2020/overlay.mjs} +312 -228
  328. package/fesm2020/overlay.mjs.map +1 -0
  329. package/{fesm2015/platform.js → fesm2020/platform.mjs} +52 -28
  330. package/fesm2020/platform.mjs.map +1 -0
  331. package/{fesm2015/portal.js → fesm2020/portal.mjs} +85 -64
  332. package/fesm2020/portal.mjs.map +1 -0
  333. package/{fesm2015/scrolling.js → fesm2020/scrolling.mjs} +213 -170
  334. package/fesm2020/scrolling.mjs.map +1 -0
  335. package/fesm2020/stepper.mjs +638 -0
  336. package/fesm2020/stepper.mjs.map +1 -0
  337. package/fesm2020/table.mjs +2295 -0
  338. package/fesm2020/table.mjs.map +1 -0
  339. package/fesm2020/testing/protractor.mjs +322 -0
  340. package/fesm2020/testing/protractor.mjs.map +1 -0
  341. package/fesm2020/testing/selenium-webdriver.mjs +362 -0
  342. package/fesm2020/testing/selenium-webdriver.mjs.map +1 -0
  343. package/fesm2020/testing/testbed.mjs +780 -0
  344. package/fesm2020/testing/testbed.mjs.map +1 -0
  345. package/fesm2020/testing.mjs +719 -0
  346. package/fesm2020/testing.mjs.map +1 -0
  347. package/{fesm2015/text-field.js → fesm2020/text-field.mjs} +83 -68
  348. package/fesm2020/text-field.mjs.map +1 -0
  349. package/fesm2020/tree.mjs +967 -0
  350. package/fesm2020/tree.mjs.map +1 -0
  351. package/keycodes/package.json +5 -5
  352. package/layout/breakpoints-observer.d.ts +3 -7
  353. package/layout/layout-module.d.ts +4 -0
  354. package/layout/media-matcher.d.ts +3 -0
  355. package/layout/package.json +5 -5
  356. package/observers/observe-content.d.ts +10 -0
  357. package/observers/package.json +5 -5
  358. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +3 -7
  359. package/overlay/dispatchers/overlay-keyboard-dispatcher.d.ts +3 -7
  360. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +6 -7
  361. package/overlay/fullscreen-overlay-container.d.ts +3 -0
  362. package/overlay/index.d.ts +0 -2
  363. package/overlay/overlay-container.d.ts +3 -7
  364. package/overlay/overlay-directives.d.ts +5 -0
  365. package/overlay/overlay-module.d.ts +8 -7
  366. package/overlay/overlay.d.ts +3 -0
  367. package/overlay/package.json +5 -5
  368. package/overlay/position/flexible-connected-position-strategy.d.ts +2 -2
  369. package/overlay/position/overlay-position-builder.d.ts +3 -0
  370. package/overlay/position/scroll-clip.d.ts +5 -2
  371. package/overlay/scroll/index.d.ts +1 -1
  372. package/overlay/scroll/scroll-strategy-options.d.ts +3 -0
  373. package/package.json +219 -7
  374. package/platform/package.json +5 -5
  375. package/platform/platform-module.d.ts +4 -7
  376. package/platform/platform.d.ts +3 -7
  377. package/portal/package.json +5 -5
  378. package/portal/portal-directives.d.ts +12 -0
  379. package/schematics/ng-add/index.js +3 -3
  380. package/schematics/ng-add/index.mjs +3 -3
  381. package/schematics/ng-add/package-config.js +4 -2
  382. package/schematics/ng-add/package-config.mjs +4 -2
  383. package/schematics/ng-add/schema.js +1 -1
  384. package/schematics/ng-add/schema.mjs +1 -1
  385. package/schematics/ng-generate/drag-drop/index.js +6 -6
  386. package/schematics/ng-generate/drag-drop/index.mjs +6 -6
  387. package/schematics/ng-update/data/attribute-selectors.js +7 -5
  388. package/schematics/ng-update/data/attribute-selectors.mjs +7 -5
  389. package/schematics/ng-update/data/class-names.js +13 -11
  390. package/schematics/ng-update/data/class-names.mjs +13 -11
  391. package/schematics/ng-update/data/constructor-checks.js +28 -20
  392. package/schematics/ng-update/data/constructor-checks.mjs +28 -20
  393. package/schematics/ng-update/data/css-selectors.js +2 -2
  394. package/schematics/ng-update/data/css-selectors.mjs +2 -2
  395. package/schematics/ng-update/data/element-selectors.js +2 -2
  396. package/schematics/ng-update/data/element-selectors.mjs +2 -2
  397. package/schematics/ng-update/data/input-names.js +40 -16
  398. package/schematics/ng-update/data/input-names.mjs +40 -16
  399. package/schematics/ng-update/data/method-call-checks.js +32 -18
  400. package/schematics/ng-update/data/method-call-checks.mjs +32 -18
  401. package/schematics/ng-update/data/output-names.js +8 -6
  402. package/schematics/ng-update/data/output-names.mjs +8 -6
  403. package/schematics/ng-update/data/property-names.js +40 -32
  404. package/schematics/ng-update/data/property-names.mjs +40 -32
  405. package/schematics/ng-update/devkit-file-system.js +2 -2
  406. package/schematics/ng-update/devkit-file-system.mjs +2 -2
  407. package/schematics/ng-update/devkit-migration-rule.js +8 -7
  408. package/schematics/ng-update/devkit-migration-rule.mjs +8 -7
  409. package/schematics/ng-update/devkit-migration.d.ts +1 -1
  410. package/schematics/ng-update/devkit-migration.js +1 -1
  411. package/schematics/ng-update/devkit-migration.mjs +1 -1
  412. package/schematics/ng-update/find-stylesheets.js +3 -3
  413. package/schematics/ng-update/find-stylesheets.mjs +3 -3
  414. package/schematics/ng-update/html-parsing/angular.js +7 -7
  415. package/schematics/ng-update/html-parsing/angular.mjs +7 -7
  416. package/schematics/ng-update/html-parsing/elements.js +2 -2
  417. package/schematics/ng-update/html-parsing/elements.mjs +2 -2
  418. package/schematics/ng-update/index.js +11 -9
  419. package/schematics/ng-update/index.mjs +11 -9
  420. package/schematics/ng-update/migrations/attribute-selectors.js +11 -7
  421. package/schematics/ng-update/migrations/attribute-selectors.mjs +11 -7
  422. package/schematics/ng-update/migrations/class-inheritance.js +3 -3
  423. package/schematics/ng-update/migrations/class-inheritance.mjs +3 -3
  424. package/schematics/ng-update/migrations/class-names.js +7 -6
  425. package/schematics/ng-update/migrations/class-names.mjs +7 -6
  426. package/schematics/ng-update/migrations/constructor-signature.js +16 -13
  427. package/schematics/ng-update/migrations/constructor-signature.mjs +16 -13
  428. package/schematics/ng-update/migrations/css-selectors.js +7 -6
  429. package/schematics/ng-update/migrations/css-selectors.mjs +7 -6
  430. package/schematics/ng-update/migrations/element-selectors.js +7 -6
  431. package/schematics/ng-update/migrations/element-selectors.mjs +7 -6
  432. package/schematics/ng-update/migrations/input-names.js +8 -9
  433. package/schematics/ng-update/migrations/input-names.mjs +8 -9
  434. package/schematics/ng-update/migrations/method-call-arguments.js +4 -3
  435. package/schematics/ng-update/migrations/method-call-arguments.mjs +4 -3
  436. package/schematics/ng-update/migrations/misc-template.js +3 -3
  437. package/schematics/ng-update/migrations/misc-template.mjs +3 -3
  438. package/schematics/ng-update/migrations/output-names.js +7 -8
  439. package/schematics/ng-update/migrations/output-names.mjs +7 -8
  440. package/schematics/ng-update/migrations/property-names.js +4 -3
  441. package/schematics/ng-update/migrations/property-names.mjs +4 -3
  442. package/schematics/ng-update/migrations/symbol-removal.js +2 -2
  443. package/schematics/ng-update/migrations/symbol-removal.mjs +2 -2
  444. package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.d.ts +14 -0
  445. package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.js +38 -0
  446. package/schematics/ng-update/migrations/tilde-import-v13/tilde-import-migration.mjs +38 -0
  447. package/schematics/ng-update/typescript/base-types.js +1 -1
  448. package/schematics/ng-update/typescript/base-types.mjs +1 -1
  449. package/schematics/ng-update/typescript/literal.d.ts +1 -1
  450. package/schematics/ng-update/typescript/literal.js +1 -1
  451. package/schematics/ng-update/typescript/literal.mjs +1 -1
  452. package/schematics/ng-update/typescript/module-specifiers.js +5 -5
  453. package/schematics/ng-update/typescript/module-specifiers.mjs +5 -5
  454. package/schematics/ng-update/upgrade-data.js +2 -2
  455. package/schematics/ng-update/upgrade-data.mjs +2 -2
  456. package/schematics/package.json +3 -0
  457. package/schematics/paths.js +3 -3
  458. package/schematics/paths.mjs +3 -3
  459. package/schematics/update-tool/component-resource-collector.js +10 -10
  460. package/schematics/update-tool/component-resource-collector.mjs +10 -10
  461. package/schematics/update-tool/file-system.js +1 -1
  462. package/schematics/update-tool/file-system.mjs +1 -1
  463. package/schematics/update-tool/index.d.ts +4 -1
  464. package/schematics/update-tool/index.js +9 -5
  465. package/schematics/update-tool/index.mjs +9 -5
  466. package/schematics/update-tool/migration.d.ts +1 -1
  467. package/schematics/update-tool/migration.js +1 -1
  468. package/schematics/update-tool/migration.mjs +1 -1
  469. package/schematics/update-tool/target-version.js +1 -1
  470. package/schematics/update-tool/target-version.mjs +1 -1
  471. package/schematics/update-tool/utils/decorators.js +8 -4
  472. package/schematics/update-tool/utils/decorators.mjs +8 -4
  473. package/schematics/update-tool/utils/functions.js +1 -1
  474. package/schematics/update-tool/utils/functions.mjs +1 -1
  475. package/schematics/update-tool/utils/imports.js +2 -2
  476. package/schematics/update-tool/utils/imports.mjs +2 -2
  477. package/schematics/update-tool/utils/line-mappings.js +1 -1
  478. package/schematics/update-tool/utils/line-mappings.mjs +1 -1
  479. package/schematics/update-tool/utils/parse-tsconfig.js +2 -2
  480. package/schematics/update-tool/utils/parse-tsconfig.mjs +2 -2
  481. package/schematics/update-tool/utils/property-name.js +1 -1
  482. package/schematics/update-tool/utils/property-name.mjs +1 -1
  483. package/schematics/update-tool/utils/virtual-host.d.ts +1 -1
  484. package/schematics/update-tool/utils/virtual-host.js +3 -3
  485. package/schematics/update-tool/utils/virtual-host.mjs +3 -3
  486. package/schematics/update-tool/version-changes.js +1 -1
  487. package/schematics/update-tool/version-changes.mjs +1 -1
  488. package/schematics/utils/ast/ng-module-imports.js +5 -3
  489. package/schematics/utils/ast/ng-module-imports.mjs +5 -3
  490. package/schematics/utils/ast.js +5 -5
  491. package/schematics/utils/ast.mjs +5 -5
  492. package/schematics/utils/build-component.js +32 -38
  493. package/schematics/utils/build-component.mjs +32 -38
  494. package/schematics/utils/get-project.js +1 -1
  495. package/schematics/utils/get-project.mjs +1 -1
  496. package/schematics/utils/html-manipulation.js +8 -7
  497. package/schematics/utils/html-manipulation.mjs +8 -7
  498. package/schematics/utils/parse5-element.js +9 -10
  499. package/schematics/utils/parse5-element.mjs +9 -10
  500. package/schematics/utils/project-index-file.js +2 -2
  501. package/schematics/utils/project-index-file.mjs +2 -2
  502. package/schematics/utils/project-main-file.js +2 -2
  503. package/schematics/utils/project-main-file.mjs +2 -2
  504. package/schematics/utils/project-style-file.js +7 -9
  505. package/schematics/utils/project-style-file.mjs +7 -9
  506. package/schematics/utils/project-targets.js +1 -1
  507. package/schematics/utils/project-targets.mjs +1 -1
  508. package/schematics/utils/project-tsconfig-paths.js +4 -4
  509. package/schematics/utils/project-tsconfig-paths.mjs +4 -4
  510. package/schematics/utils/schematic-options.js +7 -5
  511. package/schematics/utils/schematic-options.mjs +7 -5
  512. package/schematics/utils/vendored-ast-utils/index.js +17 -18
  513. package/schematics/utils/vendored-ast-utils/index.mjs +17 -18
  514. package/scrolling/fixed-size-virtual-scroll.d.ts +3 -0
  515. package/scrolling/package.json +5 -5
  516. package/scrolling/scroll-dispatcher.d.ts +3 -7
  517. package/scrolling/scrollable.d.ts +3 -0
  518. package/scrolling/scrolling-module.d.ts +13 -7
  519. package/scrolling/viewport-ruler.d.ts +11 -1
  520. package/scrolling/virtual-for-of.d.ts +3 -0
  521. package/scrolling/virtual-scroll-viewport.d.ts +3 -0
  522. package/stepper/package.json +5 -5
  523. package/stepper/step-header.d.ts +3 -0
  524. package/stepper/step-label.d.ts +3 -0
  525. package/stepper/stepper-button.d.ts +5 -7
  526. package/stepper/stepper-module.d.ts +9 -7
  527. package/stepper/stepper.d.ts +5 -7
  528. package/table/cell.d.ts +15 -0
  529. package/table/coalesced-style-scheduler.d.ts +3 -0
  530. package/table/package.json +5 -5
  531. package/table/row.d.ts +19 -0
  532. package/table/table-module.d.ts +9 -7
  533. package/table/table.d.ts +13 -0
  534. package/table/text-column.d.ts +3 -0
  535. package/testing/package.json +5 -5
  536. package/testing/protractor/package.json +5 -5
  537. package/testing/selenium-webdriver/package.json +5 -5
  538. package/testing/testbed/package.json +5 -5
  539. package/testing/testbed/proxy-zone-types.d.ts +1 -1
  540. package/testing/testbed/zone-types.d.ts +1 -1
  541. package/text-field/autofill.d.ts +5 -0
  542. package/text-field/autosize.d.ts +3 -0
  543. package/text-field/package.json +5 -5
  544. package/text-field/text-field-module.d.ts +7 -7
  545. package/tree/control/base-tree-control.d.ts +1 -1
  546. package/tree/control/nested-tree-control.d.ts +2 -2
  547. package/tree/nested-node.d.ts +3 -0
  548. package/tree/node.d.ts +3 -0
  549. package/tree/outlet.d.ts +3 -0
  550. package/tree/package.json +5 -5
  551. package/tree/padding.d.ts +3 -0
  552. package/tree/toggle.d.ts +3 -0
  553. package/tree/tree-module.d.ts +10 -7
  554. package/tree/tree.d.ts +5 -0
  555. package/a11y/index.metadata.json +0 -1
  556. package/accordion/index.metadata.json +0 -1
  557. package/bidi/index.metadata.json +0 -1
  558. package/bundles/cdk-a11y.umd.js +0 -2752
  559. package/bundles/cdk-a11y.umd.js.map +0 -1
  560. package/bundles/cdk-accordion.umd.js +0 -262
  561. package/bundles/cdk-accordion.umd.js.map +0 -1
  562. package/bundles/cdk-bidi.umd.js +0 -206
  563. package/bundles/cdk-bidi.umd.js.map +0 -1
  564. package/bundles/cdk-clipboard.umd.js +0 -278
  565. package/bundles/cdk-clipboard.umd.js.map +0 -1
  566. package/bundles/cdk-coercion.umd.js +0 -477
  567. package/bundles/cdk-coercion.umd.js.map +0 -1
  568. package/bundles/cdk-collections.umd.js +0 -846
  569. package/bundles/cdk-collections.umd.js.map +0 -1
  570. package/bundles/cdk-drag-drop.umd.js +0 -3915
  571. package/bundles/cdk-drag-drop.umd.js.map +0 -1
  572. package/bundles/cdk-keycodes.umd.js +0 -292
  573. package/bundles/cdk-keycodes.umd.js.map +0 -1
  574. package/bundles/cdk-layout.umd.js +0 -284
  575. package/bundles/cdk-layout.umd.js.map +0 -1
  576. package/bundles/cdk-observers.umd.js +0 -242
  577. package/bundles/cdk-observers.umd.js.map +0 -1
  578. package/bundles/cdk-overlay.umd.js +0 -3417
  579. package/bundles/cdk-overlay.umd.js.map +0 -1
  580. package/bundles/cdk-platform.umd.js +0 -397
  581. package/bundles/cdk-platform.umd.js.map +0 -1
  582. package/bundles/cdk-portal.umd.js +0 -1008
  583. package/bundles/cdk-portal.umd.js.map +0 -1
  584. package/bundles/cdk-scrolling.umd.js +0 -1787
  585. package/bundles/cdk-scrolling.umd.js.map +0 -1
  586. package/bundles/cdk-stepper.umd.js +0 -648
  587. package/bundles/cdk-stepper.umd.js.map +0 -1
  588. package/bundles/cdk-table.umd.js +0 -2730
  589. package/bundles/cdk-table.umd.js.map +0 -1
  590. package/bundles/cdk-testing-protractor.umd.js +0 -833
  591. package/bundles/cdk-testing-protractor.umd.js.map +0 -1
  592. package/bundles/cdk-testing-selenium-webdriver.umd.js +0 -1002
  593. package/bundles/cdk-testing-selenium-webdriver.umd.js.map +0 -1
  594. package/bundles/cdk-testing-testbed.umd.js +0 -1396
  595. package/bundles/cdk-testing-testbed.umd.js.map +0 -1
  596. package/bundles/cdk-testing.umd.js +0 -1285
  597. package/bundles/cdk-testing.umd.js.map +0 -1
  598. package/bundles/cdk-text-field.umd.js +0 -494
  599. package/bundles/cdk-text-field.umd.js.map +0 -1
  600. package/bundles/cdk-tree.umd.js +0 -1308
  601. package/bundles/cdk-tree.umd.js.map +0 -1
  602. package/bundles/cdk.umd.js +0 -38
  603. package/bundles/cdk.umd.js.map +0 -1
  604. package/clipboard/index.metadata.json +0 -1
  605. package/collections/index.metadata.json +0 -1
  606. package/drag-drop/index.metadata.json +0 -1
  607. package/esm2015/a11y/a11y-module.js +0 -30
  608. package/esm2015/a11y/a11y.externs.js +0 -6
  609. package/esm2015/a11y/aria-describer/aria-describer.js +0 -213
  610. package/esm2015/a11y/fake-event-detection.js +0 -28
  611. package/esm2015/a11y/focus-monitor/focus-monitor.js +0 -394
  612. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +0 -52
  613. package/esm2015/a11y/focus-trap/configurable-focus-trap.js +0 -49
  614. package/esm2015/a11y/focus-trap/event-listener-inert-strategy.js +0 -62
  615. package/esm2015/a11y/focus-trap/focus-trap-inert-strategy.js +0 -11
  616. package/esm2015/a11y/focus-trap/focus-trap-manager.js +0 -51
  617. package/esm2015/a11y/focus-trap/focus-trap.js +0 -391
  618. package/esm2015/a11y/high-contrast-mode/high-contrast-mode-detector.js +0 -92
  619. package/esm2015/a11y/index.js +0 -6
  620. package/esm2015/a11y/input-modality/input-modality-detector.js +0 -171
  621. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +0 -237
  622. package/esm2015/a11y/key-manager/list-key-manager.js +0 -317
  623. package/esm2015/a11y/live-announcer/live-announcer-tokens.js +0 -19
  624. package/esm2015/a11y/live-announcer/live-announcer.js +0 -167
  625. package/esm2015/accordion/accordion-item.js +0 -146
  626. package/esm2015/accordion/accordion-module.js +0 -19
  627. package/esm2015/accordion/accordion.externs.js +0 -6
  628. package/esm2015/accordion/accordion.js +0 -63
  629. package/esm2015/accordion/index.js +0 -6
  630. package/esm2015/bidi/bidi-module.js +0 -18
  631. package/esm2015/bidi/bidi.externs.js +0 -6
  632. package/esm2015/bidi/dir.js +0 -58
  633. package/esm2015/bidi/directionality.js +0 -44
  634. package/esm2015/bidi/index.js +0 -6
  635. package/esm2015/cdk.externs.js +0 -0
  636. package/esm2015/clipboard/clipboard-module.js +0 -18
  637. package/esm2015/clipboard/clipboard.externs.js +0 -6
  638. package/esm2015/clipboard/clipboard.js +0 -52
  639. package/esm2015/clipboard/copy-to-clipboard.js +0 -90
  640. package/esm2015/clipboard/pending-copy.js +0 -68
  641. package/esm2015/coercion/coercion.externs.js +0 -0
  642. package/esm2015/collections/collection-viewer.js +0 -9
  643. package/esm2015/collections/collections.externs.js +0 -6
  644. package/esm2015/collections/dispose-view-repeater-strategy.js +0 -48
  645. package/esm2015/collections/recycle-view-repeater-strategy.js +0 -125
  646. package/esm2015/collections/tree-adapter.js +0 -9
  647. package/esm2015/collections/unique-selection-dispatcher.js +0 -53
  648. package/esm2015/collections/view-repeater.js +0 -14
  649. package/esm2015/drag-drop/client-rect.js +0 -60
  650. package/esm2015/drag-drop/clone-node.js +0 -65
  651. package/esm2015/drag-drop/directives/assertions.js +0 -19
  652. package/esm2015/drag-drop/directives/drag-handle.js +0 -57
  653. package/esm2015/drag-drop/directives/drag-placeholder.js +0 -36
  654. package/esm2015/drag-drop/directives/drag-preview.js +0 -42
  655. package/esm2015/drag-drop/directives/drag.js +0 -407
  656. package/esm2015/drag-drop/directives/drop-list-group.js +0 -47
  657. package/esm2015/drag-drop/directives/drop-list.js +0 -301
  658. package/esm2015/drag-drop/drag-drop-module.js +0 -43
  659. package/esm2015/drag-drop/drag-drop-registry.js +0 -231
  660. package/esm2015/drag-drop/drag-drop.externs.js +0 -6
  661. package/esm2015/drag-drop/drag-drop.js +0 -59
  662. package/esm2015/drag-drop/drag-events.js +0 -9
  663. package/esm2015/drag-drop/drag-ref.js +0 -1110
  664. package/esm2015/drag-drop/drag-styling.js +0 -69
  665. package/esm2015/drag-drop/drag-utils.js +0 -60
  666. package/esm2015/drag-drop/drop-list-ref.js +0 -813
  667. package/esm2015/drag-drop/transition-duration.js +0 -36
  668. package/esm2015/keycodes/keycodes.externs.js +0 -6
  669. package/esm2015/layout/breakpoints-observer.js +0 -106
  670. package/esm2015/layout/layout-module.js +0 -14
  671. package/esm2015/layout/layout.externs.js +0 -6
  672. package/esm2015/layout/media-matcher.js +0 -85
  673. package/esm2015/observers/observe-content.js +0 -179
  674. package/esm2015/observers/observers.externs.js +0 -6
  675. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +0 -51
  676. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +0 -62
  677. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +0 -97
  678. package/esm2015/overlay/fullscreen-overlay-container.js +0 -94
  679. package/esm2015/overlay/index.js +0 -7
  680. package/esm2015/overlay/overlay-config.js +0 -45
  681. package/esm2015/overlay/overlay-container.js +0 -85
  682. package/esm2015/overlay/overlay-directives.js +0 -352
  683. package/esm2015/overlay/overlay-module.js +0 -27
  684. package/esm2015/overlay/overlay-ref.js +0 -409
  685. package/esm2015/overlay/overlay.externs.js +0 -6
  686. package/esm2015/overlay/overlay.js +0 -119
  687. package/esm2015/overlay/position/connected-position.js +0 -94
  688. package/esm2015/overlay/position/flexible-connected-position-strategy.js +0 -960
  689. package/esm2015/overlay/position/global-position-strategy.js +0 -197
  690. package/esm2015/overlay/position/overlay-position-builder.js +0 -52
  691. package/esm2015/overlay/position/scroll-clip.js +0 -42
  692. package/esm2015/overlay/scroll/close-scroll-strategy.js +0 -61
  693. package/esm2015/overlay/scroll/scroll-strategy-options.js +0 -57
  694. package/esm2015/platform/features/passive-listeners.js +0 -36
  695. package/esm2015/platform/features/scrolling.js +0 -85
  696. package/esm2015/platform/features/test-environment.js +0 -16
  697. package/esm2015/platform/platform-module.js +0 -14
  698. package/esm2015/platform/platform.externs.js +0 -6
  699. package/esm2015/platform/platform.js +0 -77
  700. package/esm2015/portal/dom-portal-outlet.js +0 -136
  701. package/esm2015/portal/portal-directives.js +0 -221
  702. package/esm2015/portal/portal-injector.js +0 -28
  703. package/esm2015/portal/portal.externs.js +0 -6
  704. package/esm2015/portal/portal.js +0 -179
  705. package/esm2015/scrolling/fixed-size-virtual-scroll.js +0 -188
  706. package/esm2015/scrolling/scroll-dispatcher.js +0 -163
  707. package/esm2015/scrolling/scrollable.js +0 -173
  708. package/esm2015/scrolling/scrolling-module.js +0 -49
  709. package/esm2015/scrolling/scrolling.externs.js +0 -6
  710. package/esm2015/scrolling/viewport-ruler.js +0 -139
  711. package/esm2015/scrolling/virtual-for-of.js +0 -293
  712. package/esm2015/scrolling/virtual-scroll-strategy.js +0 -11
  713. package/esm2015/scrolling/virtual-scroll-viewport.js +0 -371
  714. package/esm2015/stepper/step-header.js +0 -29
  715. package/esm2015/stepper/step-label.js +0 -22
  716. package/esm2015/stepper/stepper-button.js +0 -72
  717. package/esm2015/stepper/stepper-module.js +0 -37
  718. package/esm2015/stepper/stepper.externs.js +0 -6
  719. package/esm2015/stepper/stepper.js +0 -428
  720. package/esm2015/table/can-stick.js +0 -42
  721. package/esm2015/table/cell.js +0 -211
  722. package/esm2015/table/coalesced-style-scheduler.js +0 -89
  723. package/esm2015/table/row.js +0 -244
  724. package/esm2015/table/sticky-position-listener.js +0 -11
  725. package/esm2015/table/sticky-styler.js +0 -336
  726. package/esm2015/table/table-module.js +0 -47
  727. package/esm2015/table/table.externs.js +0 -6
  728. package/esm2015/table/table.js +0 -987
  729. package/esm2015/table/text-column.js +0 -127
  730. package/esm2015/testing/change-detection.js +0 -110
  731. package/esm2015/testing/component-harness.js +0 -344
  732. package/esm2015/testing/harness-environment.js +0 -219
  733. package/esm2015/testing/protractor/protractor-element.js +0 -274
  734. package/esm2015/testing/protractor/protractor-harness-environment.js +0 -79
  735. package/esm2015/testing/protractor/protractor.externs.js +0 -0
  736. package/esm2015/testing/selenium-webdriver/selenium-web-driver-element.js +0 -241
  737. package/esm2015/testing/selenium-webdriver/selenium-web-driver-harness-environment.js +0 -97
  738. package/esm2015/testing/selenium-webdriver/selenium-webdriver.externs.js +0 -0
  739. package/esm2015/testing/test-element.js +0 -48
  740. package/esm2015/testing/testbed/fake-events/dispatch-events.js +0 -53
  741. package/esm2015/testing/testbed/fake-events/element-focus.js +0 -39
  742. package/esm2015/testing/testbed/fake-events/event-objects.js +0 -107
  743. package/esm2015/testing/testbed/fake-events/type-in-element.js +0 -79
  744. package/esm2015/testing/testbed/task-state-zone-interceptor.js +0 -82
  745. package/esm2015/testing/testbed/testbed-harness-environment.js +0 -173
  746. package/esm2015/testing/testbed/testbed.externs.js +0 -0
  747. package/esm2015/testing/testbed/unit-test-element.js +0 -266
  748. package/esm2015/testing/testing.externs.js +0 -0
  749. package/esm2015/testing/text-filtering.js +0 -23
  750. package/esm2015/text-field/autofill.js +0 -117
  751. package/esm2015/text-field/autosize.js +0 -293
  752. package/esm2015/text-field/text-field-module.js +0 -21
  753. package/esm2015/text-field/text-field.externs.js +0 -6
  754. package/esm2015/tree/control/nested-tree-control.js +0 -59
  755. package/esm2015/tree/nested-node.js +0 -112
  756. package/esm2015/tree/node.js +0 -36
  757. package/esm2015/tree/outlet.js +0 -34
  758. package/esm2015/tree/padding.js +0 -119
  759. package/esm2015/tree/toggle.js +0 -46
  760. package/esm2015/tree/tree-module.js +0 -32
  761. package/esm2015/tree/tree.externs.js +0 -6
  762. package/esm2015/tree/tree.js +0 -345
  763. package/fesm2015/a11y.js.map +0 -1
  764. package/fesm2015/accordion.js.map +0 -1
  765. package/fesm2015/bidi.js.map +0 -1
  766. package/fesm2015/cdk.js.map +0 -1
  767. package/fesm2015/clipboard.js.map +0 -1
  768. package/fesm2015/coercion.js.map +0 -1
  769. package/fesm2015/collections.js.map +0 -1
  770. package/fesm2015/drag-drop.js.map +0 -1
  771. package/fesm2015/keycodes.js.map +0 -1
  772. package/fesm2015/layout.js.map +0 -1
  773. package/fesm2015/observers.js.map +0 -1
  774. package/fesm2015/overlay.js.map +0 -1
  775. package/fesm2015/platform.js.map +0 -1
  776. package/fesm2015/portal.js.map +0 -1
  777. package/fesm2015/scrolling.js.map +0 -1
  778. package/fesm2015/stepper.js.map +0 -1
  779. package/fesm2015/table.js.map +0 -1
  780. package/fesm2015/testing/protractor.js.map +0 -1
  781. package/fesm2015/testing/selenium-webdriver.js.map +0 -1
  782. package/fesm2015/testing/testbed.js.map +0 -1
  783. package/fesm2015/testing.js.map +0 -1
  784. package/fesm2015/text-field.js.map +0 -1
  785. package/fesm2015/tree.js.map +0 -1
  786. package/keycodes/index.metadata.json +0 -1
  787. package/layout/index.metadata.json +0 -1
  788. package/observers/index.metadata.json +0 -1
  789. package/overlay/index.metadata.json +0 -1
  790. package/platform/index.metadata.json +0 -1
  791. package/portal/index.metadata.json +0 -1
  792. package/scrolling/index.metadata.json +0 -1
  793. package/stepper/index.metadata.json +0 -1
  794. package/table/index.metadata.json +0 -1
  795. package/text-field/index.metadata.json +0 -1
  796. package/tree/index.metadata.json +0 -1
@@ -1,3417 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/cdk/scrolling'), require('@angular/common'), require('@angular/core'), require('@angular/cdk/coercion'), require('@angular/cdk/platform'), require('@angular/cdk/bidi'), require('@angular/cdk/portal'), require('rxjs'), require('rxjs/operators'), require('@angular/cdk/keycodes')) :
3
- typeof define === 'function' && define.amd ? define('@angular/cdk/overlay', ['exports', '@angular/cdk/scrolling', '@angular/common', '@angular/core', '@angular/cdk/coercion', '@angular/cdk/platform', '@angular/cdk/bidi', '@angular/cdk/portal', 'rxjs', 'rxjs/operators', '@angular/cdk/keycodes'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.ng = global.ng || {}, global.ng.cdk = global.ng.cdk || {}, global.ng.cdk.overlay = {}), global.ng.cdk.scrolling, global.ng.common, global.ng.core, global.ng.cdk.coercion, global.ng.cdk.platform, global.ng.cdk.bidi, global.ng.cdk.portal, global.rxjs, global.rxjs.operators, global.ng.cdk.keycodes));
5
- }(this, (function (exports, i1, i1$1, i0, coercion, i2, bidi, portal, rxjs, operators, keycodes) { 'use strict';
6
-
7
- function _interopNamespace(e) {
8
- if (e && e.__esModule) return e;
9
- var n = Object.create(null);
10
- if (e) {
11
- Object.keys(e).forEach(function (k) {
12
- if (k !== 'default') {
13
- var d = Object.getOwnPropertyDescriptor(e, k);
14
- Object.defineProperty(n, k, d.get ? d : {
15
- enumerable: true,
16
- get: function () {
17
- return e[k];
18
- }
19
- });
20
- }
21
- });
22
- }
23
- n['default'] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
28
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$1);
29
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
30
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
31
-
32
- /*! *****************************************************************************
33
- Copyright (c) Microsoft Corporation.
34
-
35
- Permission to use, copy, modify, and/or distribute this software for any
36
- purpose with or without fee is hereby granted.
37
-
38
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
39
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
40
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
41
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
42
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
43
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
44
- PERFORMANCE OF THIS SOFTWARE.
45
- ***************************************************************************** */
46
- /* global Reflect, Promise */
47
- var extendStatics = function (d, b) {
48
- extendStatics = Object.setPrototypeOf ||
49
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
50
- function (d, b) { for (var p in b)
51
- if (Object.prototype.hasOwnProperty.call(b, p))
52
- d[p] = b[p]; };
53
- return extendStatics(d, b);
54
- };
55
- function __extends(d, b) {
56
- if (typeof b !== "function" && b !== null)
57
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
58
- extendStatics(d, b);
59
- function __() { this.constructor = d; }
60
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
61
- }
62
- var __assign = function () {
63
- __assign = Object.assign || function __assign(t) {
64
- for (var s, i = 1, n = arguments.length; i < n; i++) {
65
- s = arguments[i];
66
- for (var p in s)
67
- if (Object.prototype.hasOwnProperty.call(s, p))
68
- t[p] = s[p];
69
- }
70
- return t;
71
- };
72
- return __assign.apply(this, arguments);
73
- };
74
- function __rest(s, e) {
75
- var t = {};
76
- for (var p in s)
77
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
78
- t[p] = s[p];
79
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
80
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
81
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
82
- t[p[i]] = s[p[i]];
83
- }
84
- return t;
85
- }
86
- function __decorate(decorators, target, key, desc) {
87
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
88
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
89
- r = Reflect.decorate(decorators, target, key, desc);
90
- else
91
- for (var i = decorators.length - 1; i >= 0; i--)
92
- if (d = decorators[i])
93
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
94
- return c > 3 && r && Object.defineProperty(target, key, r), r;
95
- }
96
- function __param(paramIndex, decorator) {
97
- return function (target, key) { decorator(target, key, paramIndex); };
98
- }
99
- function __metadata(metadataKey, metadataValue) {
100
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
101
- return Reflect.metadata(metadataKey, metadataValue);
102
- }
103
- function __awaiter(thisArg, _arguments, P, generator) {
104
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
105
- return new (P || (P = Promise))(function (resolve, reject) {
106
- function fulfilled(value) { try {
107
- step(generator.next(value));
108
- }
109
- catch (e) {
110
- reject(e);
111
- } }
112
- function rejected(value) { try {
113
- step(generator["throw"](value));
114
- }
115
- catch (e) {
116
- reject(e);
117
- } }
118
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
119
- step((generator = generator.apply(thisArg, _arguments || [])).next());
120
- });
121
- }
122
- function __generator(thisArg, body) {
123
- var _ = { label: 0, sent: function () { if (t[0] & 1)
124
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
125
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
126
- function verb(n) { return function (v) { return step([n, v]); }; }
127
- function step(op) {
128
- if (f)
129
- throw new TypeError("Generator is already executing.");
130
- while (_)
131
- try {
132
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
133
- return t;
134
- if (y = 0, t)
135
- op = [op[0] & 2, t.value];
136
- switch (op[0]) {
137
- case 0:
138
- case 1:
139
- t = op;
140
- break;
141
- case 4:
142
- _.label++;
143
- return { value: op[1], done: false };
144
- case 5:
145
- _.label++;
146
- y = op[1];
147
- op = [0];
148
- continue;
149
- case 7:
150
- op = _.ops.pop();
151
- _.trys.pop();
152
- continue;
153
- default:
154
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
155
- _ = 0;
156
- continue;
157
- }
158
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
159
- _.label = op[1];
160
- break;
161
- }
162
- if (op[0] === 6 && _.label < t[1]) {
163
- _.label = t[1];
164
- t = op;
165
- break;
166
- }
167
- if (t && _.label < t[2]) {
168
- _.label = t[2];
169
- _.ops.push(op);
170
- break;
171
- }
172
- if (t[2])
173
- _.ops.pop();
174
- _.trys.pop();
175
- continue;
176
- }
177
- op = body.call(thisArg, _);
178
- }
179
- catch (e) {
180
- op = [6, e];
181
- y = 0;
182
- }
183
- finally {
184
- f = t = 0;
185
- }
186
- if (op[0] & 5)
187
- throw op[1];
188
- return { value: op[0] ? op[1] : void 0, done: true };
189
- }
190
- }
191
- var __createBinding = Object.create ? (function (o, m, k, k2) {
192
- if (k2 === undefined)
193
- k2 = k;
194
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
195
- }) : (function (o, m, k, k2) {
196
- if (k2 === undefined)
197
- k2 = k;
198
- o[k2] = m[k];
199
- });
200
- function __exportStar(m, o) {
201
- for (var p in m)
202
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
203
- __createBinding(o, m, p);
204
- }
205
- function __values(o) {
206
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
207
- if (m)
208
- return m.call(o);
209
- if (o && typeof o.length === "number")
210
- return {
211
- next: function () {
212
- if (o && i >= o.length)
213
- o = void 0;
214
- return { value: o && o[i++], done: !o };
215
- }
216
- };
217
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
218
- }
219
- function __read(o, n) {
220
- var m = typeof Symbol === "function" && o[Symbol.iterator];
221
- if (!m)
222
- return o;
223
- var i = m.call(o), r, ar = [], e;
224
- try {
225
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
226
- ar.push(r.value);
227
- }
228
- catch (error) {
229
- e = { error: error };
230
- }
231
- finally {
232
- try {
233
- if (r && !r.done && (m = i["return"]))
234
- m.call(i);
235
- }
236
- finally {
237
- if (e)
238
- throw e.error;
239
- }
240
- }
241
- return ar;
242
- }
243
- /** @deprecated */
244
- function __spread() {
245
- for (var ar = [], i = 0; i < arguments.length; i++)
246
- ar = ar.concat(__read(arguments[i]));
247
- return ar;
248
- }
249
- /** @deprecated */
250
- function __spreadArrays() {
251
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
252
- s += arguments[i].length;
253
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
254
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
255
- r[k] = a[j];
256
- return r;
257
- }
258
- function __spreadArray(to, from, pack) {
259
- if (pack || arguments.length === 2)
260
- for (var i = 0, l = from.length, ar; i < l; i++) {
261
- if (ar || !(i in from)) {
262
- if (!ar)
263
- ar = Array.prototype.slice.call(from, 0, i);
264
- ar[i] = from[i];
265
- }
266
- }
267
- return to.concat(ar || Array.prototype.slice.call(from));
268
- }
269
- function __await(v) {
270
- return this instanceof __await ? (this.v = v, this) : new __await(v);
271
- }
272
- function __asyncGenerator(thisArg, _arguments, generator) {
273
- if (!Symbol.asyncIterator)
274
- throw new TypeError("Symbol.asyncIterator is not defined.");
275
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
276
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
277
- function verb(n) { if (g[n])
278
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
279
- function resume(n, v) { try {
280
- step(g[n](v));
281
- }
282
- catch (e) {
283
- settle(q[0][3], e);
284
- } }
285
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
286
- function fulfill(value) { resume("next", value); }
287
- function reject(value) { resume("throw", value); }
288
- function settle(f, v) { if (f(v), q.shift(), q.length)
289
- resume(q[0][0], q[0][1]); }
290
- }
291
- function __asyncDelegator(o) {
292
- var i, p;
293
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
294
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
295
- }
296
- function __asyncValues(o) {
297
- if (!Symbol.asyncIterator)
298
- throw new TypeError("Symbol.asyncIterator is not defined.");
299
- var m = o[Symbol.asyncIterator], i;
300
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
301
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
302
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
303
- }
304
- function __makeTemplateObject(cooked, raw) {
305
- if (Object.defineProperty) {
306
- Object.defineProperty(cooked, "raw", { value: raw });
307
- }
308
- else {
309
- cooked.raw = raw;
310
- }
311
- return cooked;
312
- }
313
- ;
314
- var __setModuleDefault = Object.create ? (function (o, v) {
315
- Object.defineProperty(o, "default", { enumerable: true, value: v });
316
- }) : function (o, v) {
317
- o["default"] = v;
318
- };
319
- function __importStar(mod) {
320
- if (mod && mod.__esModule)
321
- return mod;
322
- var result = {};
323
- if (mod != null)
324
- for (var k in mod)
325
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
326
- __createBinding(result, mod, k);
327
- __setModuleDefault(result, mod);
328
- return result;
329
- }
330
- function __importDefault(mod) {
331
- return (mod && mod.__esModule) ? mod : { default: mod };
332
- }
333
- function __classPrivateFieldGet(receiver, state, kind, f) {
334
- if (kind === "a" && !f)
335
- throw new TypeError("Private accessor was defined without a getter");
336
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
337
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
338
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
339
- }
340
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
341
- if (kind === "m")
342
- throw new TypeError("Private method is not writable");
343
- if (kind === "a" && !f)
344
- throw new TypeError("Private accessor was defined without a setter");
345
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
346
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
347
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
348
- }
349
-
350
- /**
351
- * @license
352
- * Copyright Google LLC All Rights Reserved.
353
- *
354
- * Use of this source code is governed by an MIT-style license that can be
355
- * found in the LICENSE file at https://angular.io/license
356
- */
357
- var scrollBehaviorSupported = i2.supportsScrollBehavior();
358
- /**
359
- * Strategy that will prevent the user from scrolling while the overlay is visible.
360
- */
361
- var BlockScrollStrategy = /** @class */ (function () {
362
- function BlockScrollStrategy(_viewportRuler, document) {
363
- this._viewportRuler = _viewportRuler;
364
- this._previousHTMLStyles = { top: '', left: '' };
365
- this._isEnabled = false;
366
- this._document = document;
367
- }
368
- /** Attaches this scroll strategy to an overlay. */
369
- BlockScrollStrategy.prototype.attach = function () { };
370
- /** Blocks page-level scroll while the attached overlay is open. */
371
- BlockScrollStrategy.prototype.enable = function () {
372
- if (this._canBeEnabled()) {
373
- var root = this._document.documentElement;
374
- this._previousScrollPosition = this._viewportRuler.getViewportScrollPosition();
375
- // Cache the previous inline styles in case the user had set them.
376
- this._previousHTMLStyles.left = root.style.left || '';
377
- this._previousHTMLStyles.top = root.style.top || '';
378
- // Note: we're using the `html` node, instead of the `body`, because the `body` may
379
- // have the user agent margin, whereas the `html` is guaranteed not to have one.
380
- root.style.left = coercion.coerceCssPixelValue(-this._previousScrollPosition.left);
381
- root.style.top = coercion.coerceCssPixelValue(-this._previousScrollPosition.top);
382
- root.classList.add('cdk-global-scrollblock');
383
- this._isEnabled = true;
384
- }
385
- };
386
- /** Unblocks page-level scroll while the attached overlay is open. */
387
- BlockScrollStrategy.prototype.disable = function () {
388
- if (this._isEnabled) {
389
- var html = this._document.documentElement;
390
- var body = this._document.body;
391
- var htmlStyle = html.style;
392
- var bodyStyle = body.style;
393
- var previousHtmlScrollBehavior = htmlStyle.scrollBehavior || '';
394
- var previousBodyScrollBehavior = bodyStyle.scrollBehavior || '';
395
- this._isEnabled = false;
396
- htmlStyle.left = this._previousHTMLStyles.left;
397
- htmlStyle.top = this._previousHTMLStyles.top;
398
- html.classList.remove('cdk-global-scrollblock');
399
- // Disable user-defined smooth scrolling temporarily while we restore the scroll position.
400
- // See https://developer.mozilla.org/en-US/docs/Web/CSS/scroll-behavior
401
- // Note that we don't mutate the property if the browser doesn't support `scroll-behavior`,
402
- // because it can throw off feature detections in `supportsScrollBehavior` which
403
- // checks for `'scrollBehavior' in documentElement.style`.
404
- if (scrollBehaviorSupported) {
405
- htmlStyle.scrollBehavior = bodyStyle.scrollBehavior = 'auto';
406
- }
407
- window.scroll(this._previousScrollPosition.left, this._previousScrollPosition.top);
408
- if (scrollBehaviorSupported) {
409
- htmlStyle.scrollBehavior = previousHtmlScrollBehavior;
410
- bodyStyle.scrollBehavior = previousBodyScrollBehavior;
411
- }
412
- }
413
- };
414
- BlockScrollStrategy.prototype._canBeEnabled = function () {
415
- // Since the scroll strategies can't be singletons, we have to use a global CSS class
416
- // (`cdk-global-scrollblock`) to make sure that we don't try to disable global
417
- // scrolling multiple times.
418
- var html = this._document.documentElement;
419
- if (html.classList.contains('cdk-global-scrollblock') || this._isEnabled) {
420
- return false;
421
- }
422
- var body = this._document.body;
423
- var viewport = this._viewportRuler.getViewportSize();
424
- return body.scrollHeight > viewport.height || body.scrollWidth > viewport.width;
425
- };
426
- return BlockScrollStrategy;
427
- }());
428
-
429
- /**
430
- * @license
431
- * Copyright Google LLC All Rights Reserved.
432
- *
433
- * Use of this source code is governed by an MIT-style license that can be
434
- * found in the LICENSE file at https://angular.io/license
435
- */
436
- /**
437
- * Returns an error to be thrown when attempting to attach an already-attached scroll strategy.
438
- */
439
- function getMatScrollStrategyAlreadyAttachedError() {
440
- return Error("Scroll strategy has already been attached.");
441
- }
442
-
443
- /**
444
- * Strategy that will close the overlay as soon as the user starts scrolling.
445
- */
446
- var CloseScrollStrategy = /** @class */ (function () {
447
- function CloseScrollStrategy(_scrollDispatcher, _ngZone, _viewportRuler, _config) {
448
- var _this = this;
449
- this._scrollDispatcher = _scrollDispatcher;
450
- this._ngZone = _ngZone;
451
- this._viewportRuler = _viewportRuler;
452
- this._config = _config;
453
- this._scrollSubscription = null;
454
- /** Detaches the overlay ref and disables the scroll strategy. */
455
- this._detach = function () {
456
- _this.disable();
457
- if (_this._overlayRef.hasAttached()) {
458
- _this._ngZone.run(function () { return _this._overlayRef.detach(); });
459
- }
460
- };
461
- }
462
- /** Attaches this scroll strategy to an overlay. */
463
- CloseScrollStrategy.prototype.attach = function (overlayRef) {
464
- if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
465
- throw getMatScrollStrategyAlreadyAttachedError();
466
- }
467
- this._overlayRef = overlayRef;
468
- };
469
- /** Enables the closing of the attached overlay on scroll. */
470
- CloseScrollStrategy.prototype.enable = function () {
471
- var _this = this;
472
- if (this._scrollSubscription) {
473
- return;
474
- }
475
- var stream = this._scrollDispatcher.scrolled(0);
476
- if (this._config && this._config.threshold && this._config.threshold > 1) {
477
- this._initialScrollPosition = this._viewportRuler.getViewportScrollPosition().top;
478
- this._scrollSubscription = stream.subscribe(function () {
479
- var scrollPosition = _this._viewportRuler.getViewportScrollPosition().top;
480
- if (Math.abs(scrollPosition - _this._initialScrollPosition) > _this._config.threshold) {
481
- _this._detach();
482
- }
483
- else {
484
- _this._overlayRef.updatePosition();
485
- }
486
- });
487
- }
488
- else {
489
- this._scrollSubscription = stream.subscribe(this._detach);
490
- }
491
- };
492
- /** Disables the closing the attached overlay on scroll. */
493
- CloseScrollStrategy.prototype.disable = function () {
494
- if (this._scrollSubscription) {
495
- this._scrollSubscription.unsubscribe();
496
- this._scrollSubscription = null;
497
- }
498
- };
499
- CloseScrollStrategy.prototype.detach = function () {
500
- this.disable();
501
- this._overlayRef = null;
502
- };
503
- return CloseScrollStrategy;
504
- }());
505
-
506
- /**
507
- * @license
508
- * Copyright Google LLC All Rights Reserved.
509
- *
510
- * Use of this source code is governed by an MIT-style license that can be
511
- * found in the LICENSE file at https://angular.io/license
512
- */
513
- /** Scroll strategy that doesn't do anything. */
514
- var NoopScrollStrategy = /** @class */ (function () {
515
- function NoopScrollStrategy() {
516
- }
517
- /** Does nothing, as this scroll strategy is a no-op. */
518
- NoopScrollStrategy.prototype.enable = function () { };
519
- /** Does nothing, as this scroll strategy is a no-op. */
520
- NoopScrollStrategy.prototype.disable = function () { };
521
- /** Does nothing, as this scroll strategy is a no-op. */
522
- NoopScrollStrategy.prototype.attach = function () { };
523
- return NoopScrollStrategy;
524
- }());
525
-
526
- /**
527
- * @license
528
- * Copyright Google LLC All Rights Reserved.
529
- *
530
- * Use of this source code is governed by an MIT-style license that can be
531
- * found in the LICENSE file at https://angular.io/license
532
- */
533
- // TODO(jelbourn): move this to live with the rest of the scrolling code
534
- // TODO(jelbourn): someday replace this with IntersectionObservers
535
- /**
536
- * Gets whether an element is scrolled outside of view by any of its parent scrolling containers.
537
- * @param element Dimensions of the element (from getBoundingClientRect)
538
- * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)
539
- * @returns Whether the element is scrolled out of view
540
- * @docs-private
541
- */
542
- function isElementScrolledOutsideView(element, scrollContainers) {
543
- return scrollContainers.some(function (containerBounds) {
544
- var outsideAbove = element.bottom < containerBounds.top;
545
- var outsideBelow = element.top > containerBounds.bottom;
546
- var outsideLeft = element.right < containerBounds.left;
547
- var outsideRight = element.left > containerBounds.right;
548
- return outsideAbove || outsideBelow || outsideLeft || outsideRight;
549
- });
550
- }
551
- /**
552
- * Gets whether an element is clipped by any of its scrolling containers.
553
- * @param element Dimensions of the element (from getBoundingClientRect)
554
- * @param scrollContainers Dimensions of element's scrolling containers (from getBoundingClientRect)
555
- * @returns Whether the element is clipped
556
- * @docs-private
557
- */
558
- function isElementClippedByScrolling(element, scrollContainers) {
559
- return scrollContainers.some(function (scrollContainerRect) {
560
- var clippedAbove = element.top < scrollContainerRect.top;
561
- var clippedBelow = element.bottom > scrollContainerRect.bottom;
562
- var clippedLeft = element.left < scrollContainerRect.left;
563
- var clippedRight = element.right > scrollContainerRect.right;
564
- return clippedAbove || clippedBelow || clippedLeft || clippedRight;
565
- });
566
- }
567
-
568
- /**
569
- * @license
570
- * Copyright Google LLC All Rights Reserved.
571
- *
572
- * Use of this source code is governed by an MIT-style license that can be
573
- * found in the LICENSE file at https://angular.io/license
574
- */
575
- /**
576
- * Strategy that will update the element position as the user is scrolling.
577
- */
578
- var RepositionScrollStrategy = /** @class */ (function () {
579
- function RepositionScrollStrategy(_scrollDispatcher, _viewportRuler, _ngZone, _config) {
580
- this._scrollDispatcher = _scrollDispatcher;
581
- this._viewportRuler = _viewportRuler;
582
- this._ngZone = _ngZone;
583
- this._config = _config;
584
- this._scrollSubscription = null;
585
- }
586
- /** Attaches this scroll strategy to an overlay. */
587
- RepositionScrollStrategy.prototype.attach = function (overlayRef) {
588
- if (this._overlayRef && (typeof ngDevMode === 'undefined' || ngDevMode)) {
589
- throw getMatScrollStrategyAlreadyAttachedError();
590
- }
591
- this._overlayRef = overlayRef;
592
- };
593
- /** Enables repositioning of the attached overlay on scroll. */
594
- RepositionScrollStrategy.prototype.enable = function () {
595
- var _this = this;
596
- if (!this._scrollSubscription) {
597
- var throttle = this._config ? this._config.scrollThrottle : 0;
598
- this._scrollSubscription = this._scrollDispatcher.scrolled(throttle).subscribe(function () {
599
- _this._overlayRef.updatePosition();
600
- // TODO(crisbeto): make `close` on by default once all components can handle it.
601
- if (_this._config && _this._config.autoClose) {
602
- var overlayRect = _this._overlayRef.overlayElement.getBoundingClientRect();
603
- var _a = _this._viewportRuler.getViewportSize(), width = _a.width, height = _a.height;
604
- // TODO(crisbeto): include all ancestor scroll containers here once
605
- // we have a way of exposing the trigger element to the scroll strategy.
606
- var parentRects = [{ width: width, height: height, bottom: height, right: width, top: 0, left: 0 }];
607
- if (isElementScrolledOutsideView(overlayRect, parentRects)) {
608
- _this.disable();
609
- _this._ngZone.run(function () { return _this._overlayRef.detach(); });
610
- }
611
- }
612
- });
613
- }
614
- };
615
- /** Disables repositioning of the attached overlay on scroll. */
616
- RepositionScrollStrategy.prototype.disable = function () {
617
- if (this._scrollSubscription) {
618
- this._scrollSubscription.unsubscribe();
619
- this._scrollSubscription = null;
620
- }
621
- };
622
- RepositionScrollStrategy.prototype.detach = function () {
623
- this.disable();
624
- this._overlayRef = null;
625
- };
626
- return RepositionScrollStrategy;
627
- }());
628
-
629
- /**
630
- * @license
631
- * Copyright Google LLC All Rights Reserved.
632
- *
633
- * Use of this source code is governed by an MIT-style license that can be
634
- * found in the LICENSE file at https://angular.io/license
635
- */
636
- /**
637
- * Options for how an overlay will handle scrolling.
638
- *
639
- * Users can provide a custom value for `ScrollStrategyOptions` to replace the default
640
- * behaviors. This class primarily acts as a factory for ScrollStrategy instances.
641
- */
642
- var ScrollStrategyOptions = /** @class */ (function () {
643
- function ScrollStrategyOptions(_scrollDispatcher, _viewportRuler, _ngZone, document) {
644
- var _this = this;
645
- this._scrollDispatcher = _scrollDispatcher;
646
- this._viewportRuler = _viewportRuler;
647
- this._ngZone = _ngZone;
648
- /** Do nothing on scroll. */
649
- this.noop = function () { return new NoopScrollStrategy(); };
650
- /**
651
- * Close the overlay as soon as the user scrolls.
652
- * @param config Configuration to be used inside the scroll strategy.
653
- */
654
- this.close = function (config) { return new CloseScrollStrategy(_this._scrollDispatcher, _this._ngZone, _this._viewportRuler, config); };
655
- /** Block scrolling. */
656
- this.block = function () { return new BlockScrollStrategy(_this._viewportRuler, _this._document); };
657
- /**
658
- * Update the overlay's position on scroll.
659
- * @param config Configuration to be used inside the scroll strategy.
660
- * Allows debouncing the reposition calls.
661
- */
662
- this.reposition = function (config) { return new RepositionScrollStrategy(_this._scrollDispatcher, _this._viewportRuler, _this._ngZone, config); };
663
- this._document = document;
664
- }
665
- return ScrollStrategyOptions;
666
- }());
667
- ScrollStrategyOptions.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function ScrollStrategyOptions_Factory() { return new ScrollStrategyOptions(i0__namespace.ɵɵinject(i1__namespace.ScrollDispatcher), i0__namespace.ɵɵinject(i1__namespace.ViewportRuler), i0__namespace.ɵɵinject(i0__namespace.NgZone), i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT)); }, token: ScrollStrategyOptions, providedIn: "root" });
668
- ScrollStrategyOptions.decorators = [
669
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
670
- ];
671
- ScrollStrategyOptions.ctorParameters = function () { return [
672
- { type: i1.ScrollDispatcher },
673
- { type: i1.ViewportRuler },
674
- { type: i0.NgZone },
675
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
676
- ]; };
677
-
678
- /**
679
- * @license
680
- * Copyright Google LLC All Rights Reserved.
681
- *
682
- * Use of this source code is governed by an MIT-style license that can be
683
- * found in the LICENSE file at https://angular.io/license
684
- */
685
-
686
- /** Initial configuration used when creating an overlay. */
687
- var OverlayConfig = /** @class */ (function () {
688
- function OverlayConfig(config) {
689
- var e_1, _a;
690
- /** Strategy to be used when handling scroll events while the overlay is open. */
691
- this.scrollStrategy = new NoopScrollStrategy();
692
- /** Custom class to add to the overlay pane. */
693
- this.panelClass = '';
694
- /** Whether the overlay has a backdrop. */
695
- this.hasBackdrop = false;
696
- /** Custom class to add to the backdrop */
697
- this.backdropClass = 'cdk-overlay-dark-backdrop';
698
- /**
699
- * Whether the overlay should be disposed of when the user goes backwards/forwards in history.
700
- * Note that this usually doesn't include clicking on links (unless the user is using
701
- * the `HashLocationStrategy`).
702
- */
703
- this.disposeOnNavigation = false;
704
- if (config) {
705
- // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
706
- // loses the array generic type in the `for of`. But we *also* have to use `Array` because
707
- // typescript won't iterate over an `Iterable` unless you compile with `--downlevelIteration`
708
- var configKeys = Object.keys(config);
709
- try {
710
- for (var configKeys_1 = __values(configKeys), configKeys_1_1 = configKeys_1.next(); !configKeys_1_1.done; configKeys_1_1 = configKeys_1.next()) {
711
- var key = configKeys_1_1.value;
712
- if (config[key] !== undefined) {
713
- // TypeScript, as of version 3.5, sees the left-hand-side of this expression
714
- // as "I don't know *which* key this is, so the only valid value is the intersection
715
- // of all the posible values." In this case, that happens to be `undefined`. TypeScript
716
- // is not smart enough to see that the right-hand-side is actually an access of the same
717
- // exact type with the same exact key, meaning that the value type must be identical.
718
- // So we use `any` to work around this.
719
- this[key] = config[key];
720
- }
721
- }
722
- }
723
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
724
- finally {
725
- try {
726
- if (configKeys_1_1 && !configKeys_1_1.done && (_a = configKeys_1.return)) _a.call(configKeys_1);
727
- }
728
- finally { if (e_1) throw e_1.error; }
729
- }
730
- }
731
- }
732
- return OverlayConfig;
733
- }());
734
-
735
- /**
736
- * @license
737
- * Copyright Google LLC All Rights Reserved.
738
- *
739
- * Use of this source code is governed by an MIT-style license that can be
740
- * found in the LICENSE file at https://angular.io/license
741
- */
742
- /** The points of the origin element and the overlay element to connect. */
743
- var ConnectionPositionPair = /** @class */ (function () {
744
- function ConnectionPositionPair(origin, overlay,
745
- /** Offset along the X axis. */
746
- offsetX,
747
- /** Offset along the Y axis. */
748
- offsetY,
749
- /** Class(es) to be applied to the panel while this position is active. */
750
- panelClass) {
751
- this.offsetX = offsetX;
752
- this.offsetY = offsetY;
753
- this.panelClass = panelClass;
754
- this.originX = origin.originX;
755
- this.originY = origin.originY;
756
- this.overlayX = overlay.overlayX;
757
- this.overlayY = overlay.overlayY;
758
- }
759
- return ConnectionPositionPair;
760
- }());
761
- /**
762
- * Set of properties regarding the position of the origin and overlay relative to the viewport
763
- * with respect to the containing Scrollable elements.
764
- *
765
- * The overlay and origin are clipped if any part of their bounding client rectangle exceeds the
766
- * bounds of any one of the strategy's Scrollable's bounding client rectangle.
767
- *
768
- * The overlay and origin are outside view if there is no overlap between their bounding client
769
- * rectangle and any one of the strategy's Scrollable's bounding client rectangle.
770
- *
771
- * ----------- -----------
772
- * | outside | | clipped |
773
- * | view | --------------------------
774
- * | | | | | |
775
- * ---------- | ----------- |
776
- * -------------------------- | |
777
- * | | | Scrollable |
778
- * | | | |
779
- * | | --------------------------
780
- * | Scrollable |
781
- * | |
782
- * --------------------------
783
- *
784
- * @docs-private
785
- */
786
- var ScrollingVisibility = /** @class */ (function () {
787
- function ScrollingVisibility() {
788
- }
789
- return ScrollingVisibility;
790
- }());
791
- /** The change event emitted by the strategy when a fallback position is used. */
792
- var ConnectedOverlayPositionChange = /** @class */ (function () {
793
- function ConnectedOverlayPositionChange(
794
- /** The position used as a result of this change. */
795
- connectionPair,
796
- /** @docs-private */
797
- scrollableViewProperties) {
798
- this.connectionPair = connectionPair;
799
- this.scrollableViewProperties = scrollableViewProperties;
800
- }
801
- return ConnectedOverlayPositionChange;
802
- }());
803
- ConnectedOverlayPositionChange.ctorParameters = function () { return [
804
- { type: ConnectionPositionPair },
805
- { type: ScrollingVisibility, decorators: [{ type: i0.Optional }] }
806
- ]; };
807
- /**
808
- * Validates whether a vertical position property matches the expected values.
809
- * @param property Name of the property being validated.
810
- * @param value Value of the property being validated.
811
- * @docs-private
812
- */
813
- function validateVerticalPosition(property, value) {
814
- if (value !== 'top' && value !== 'bottom' && value !== 'center') {
815
- throw Error("ConnectedPosition: Invalid " + property + " \"" + value + "\". " +
816
- "Expected \"top\", \"bottom\" or \"center\".");
817
- }
818
- }
819
- /**
820
- * Validates whether a horizontal position property matches the expected values.
821
- * @param property Name of the property being validated.
822
- * @param value Value of the property being validated.
823
- * @docs-private
824
- */
825
- function validateHorizontalPosition(property, value) {
826
- if (value !== 'start' && value !== 'end' && value !== 'center') {
827
- throw Error("ConnectedPosition: Invalid " + property + " \"" + value + "\". " +
828
- "Expected \"start\", \"end\" or \"center\".");
829
- }
830
- }
831
-
832
- /**
833
- * @license
834
- * Copyright Google LLC All Rights Reserved.
835
- *
836
- * Use of this source code is governed by an MIT-style license that can be
837
- * found in the LICENSE file at https://angular.io/license
838
- */
839
- /**
840
- * Service for dispatching events that land on the body to appropriate overlay ref,
841
- * if any. It maintains a list of attached overlays to determine best suited overlay based
842
- * on event target and order of overlay opens.
843
- */
844
- var BaseOverlayDispatcher = /** @class */ (function () {
845
- function BaseOverlayDispatcher(document) {
846
- /** Currently attached overlays in the order they were attached. */
847
- this._attachedOverlays = [];
848
- this._document = document;
849
- }
850
- BaseOverlayDispatcher.prototype.ngOnDestroy = function () {
851
- this.detach();
852
- };
853
- /** Add a new overlay to the list of attached overlay refs. */
854
- BaseOverlayDispatcher.prototype.add = function (overlayRef) {
855
- // Ensure that we don't get the same overlay multiple times.
856
- this.remove(overlayRef);
857
- this._attachedOverlays.push(overlayRef);
858
- };
859
- /** Remove an overlay from the list of attached overlay refs. */
860
- BaseOverlayDispatcher.prototype.remove = function (overlayRef) {
861
- var index = this._attachedOverlays.indexOf(overlayRef);
862
- if (index > -1) {
863
- this._attachedOverlays.splice(index, 1);
864
- }
865
- // Remove the global listener once there are no more overlays.
866
- if (this._attachedOverlays.length === 0) {
867
- this.detach();
868
- }
869
- };
870
- return BaseOverlayDispatcher;
871
- }());
872
- BaseOverlayDispatcher.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function BaseOverlayDispatcher_Factory() { return new BaseOverlayDispatcher(i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT)); }, token: BaseOverlayDispatcher, providedIn: "root" });
873
- BaseOverlayDispatcher.decorators = [
874
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
875
- ];
876
- BaseOverlayDispatcher.ctorParameters = function () { return [
877
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
878
- ]; };
879
-
880
- /**
881
- * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
882
- * if any. It maintains a list of attached overlays to determine best suited overlay based
883
- * on event target and order of overlay opens.
884
- */
885
- var OverlayKeyboardDispatcher = /** @class */ (function (_super) {
886
- __extends(OverlayKeyboardDispatcher, _super);
887
- function OverlayKeyboardDispatcher(document) {
888
- var _this = _super.call(this, document) || this;
889
- /** Keyboard event listener that will be attached to the body. */
890
- _this._keydownListener = function (event) {
891
- var overlays = _this._attachedOverlays;
892
- for (var i = overlays.length - 1; i > -1; i--) {
893
- // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.
894
- // We want to target the most recent overlay, rather than trying to match where the event came
895
- // from, because some components might open an overlay, but keep focus on a trigger element
896
- // (e.g. for select and autocomplete). We skip overlays without keydown event subscriptions,
897
- // because we don't want overlays that don't handle keyboard events to block the ones below
898
- // them that do.
899
- if (overlays[i]._keydownEvents.observers.length > 0) {
900
- overlays[i]._keydownEvents.next(event);
901
- break;
902
- }
903
- }
904
- };
905
- return _this;
906
- }
907
- /** Add a new overlay to the list of attached overlay refs. */
908
- OverlayKeyboardDispatcher.prototype.add = function (overlayRef) {
909
- _super.prototype.add.call(this, overlayRef);
910
- // Lazily start dispatcher once first overlay is added
911
- if (!this._isAttached) {
912
- this._document.body.addEventListener('keydown', this._keydownListener);
913
- this._isAttached = true;
914
- }
915
- };
916
- /** Detaches the global keyboard event listener. */
917
- OverlayKeyboardDispatcher.prototype.detach = function () {
918
- if (this._isAttached) {
919
- this._document.body.removeEventListener('keydown', this._keydownListener);
920
- this._isAttached = false;
921
- }
922
- };
923
- return OverlayKeyboardDispatcher;
924
- }(BaseOverlayDispatcher));
925
- OverlayKeyboardDispatcher.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function OverlayKeyboardDispatcher_Factory() { return new OverlayKeyboardDispatcher(i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT)); }, token: OverlayKeyboardDispatcher, providedIn: "root" });
926
- OverlayKeyboardDispatcher.decorators = [
927
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
928
- ];
929
- OverlayKeyboardDispatcher.ctorParameters = function () { return [
930
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
931
- ]; };
932
-
933
- /**
934
- * Service for dispatching mouse click events that land on the body to appropriate overlay ref,
935
- * if any. It maintains a list of attached overlays to determine best suited overlay based
936
- * on event target and order of overlay opens.
937
- */
938
- var OverlayOutsideClickDispatcher = /** @class */ (function (_super) {
939
- __extends(OverlayOutsideClickDispatcher, _super);
940
- function OverlayOutsideClickDispatcher(document, _platform) {
941
- var _this = _super.call(this, document) || this;
942
- _this._platform = _platform;
943
- _this._cursorStyleIsSet = false;
944
- /** Click event listener that will be attached to the body propagate phase. */
945
- _this._clickListener = function (event) {
946
- var target = i2._getEventTarget(event);
947
- // We copy the array because the original may be modified asynchronously if the
948
- // outsidePointerEvents listener decides to detach overlays resulting in index errors inside
949
- // the for loop.
950
- var overlays = _this._attachedOverlays.slice();
951
- // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.
952
- // We want to target all overlays for which the click could be considered as outside click.
953
- // As soon as we reach an overlay for which the click is not outside click we break off
954
- // the loop.
955
- for (var i = overlays.length - 1; i > -1; i--) {
956
- var overlayRef = overlays[i];
957
- if (overlayRef._outsidePointerEvents.observers.length < 1 || !overlayRef.hasAttached()) {
958
- continue;
959
- }
960
- // If it's a click inside the overlay, just break - we should do nothing
961
- // If it's an outside click dispatch the mouse event, and proceed with the next overlay
962
- if (overlayRef.overlayElement.contains(target)) {
963
- break;
964
- }
965
- overlayRef._outsidePointerEvents.next(event);
966
- }
967
- };
968
- return _this;
969
- }
970
- /** Add a new overlay to the list of attached overlay refs. */
971
- OverlayOutsideClickDispatcher.prototype.add = function (overlayRef) {
972
- _super.prototype.add.call(this, overlayRef);
973
- // Safari on iOS does not generate click events for non-interactive
974
- // elements. However, we want to receive a click for any element outside
975
- // the overlay. We can force a "clickable" state by setting
976
- // `cursor: pointer` on the document body. See:
977
- // https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
978
- // https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
979
- if (!this._isAttached) {
980
- var body = this._document.body;
981
- body.addEventListener('click', this._clickListener, true);
982
- body.addEventListener('auxclick', this._clickListener, true);
983
- body.addEventListener('contextmenu', this._clickListener, true);
984
- // click event is not fired on iOS. To make element "clickable" we are
985
- // setting the cursor to pointer
986
- if (this._platform.IOS && !this._cursorStyleIsSet) {
987
- this._cursorOriginalValue = body.style.cursor;
988
- body.style.cursor = 'pointer';
989
- this._cursorStyleIsSet = true;
990
- }
991
- this._isAttached = true;
992
- }
993
- };
994
- /** Detaches the global keyboard event listener. */
995
- OverlayOutsideClickDispatcher.prototype.detach = function () {
996
- if (this._isAttached) {
997
- var body = this._document.body;
998
- body.removeEventListener('click', this._clickListener, true);
999
- body.removeEventListener('auxclick', this._clickListener, true);
1000
- body.removeEventListener('contextmenu', this._clickListener, true);
1001
- if (this._platform.IOS && this._cursorStyleIsSet) {
1002
- body.style.cursor = this._cursorOriginalValue;
1003
- this._cursorStyleIsSet = false;
1004
- }
1005
- this._isAttached = false;
1006
- }
1007
- };
1008
- return OverlayOutsideClickDispatcher;
1009
- }(BaseOverlayDispatcher));
1010
- OverlayOutsideClickDispatcher.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function OverlayOutsideClickDispatcher_Factory() { return new OverlayOutsideClickDispatcher(i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT), i0__namespace.ɵɵinject(i2__namespace.Platform)); }, token: OverlayOutsideClickDispatcher, providedIn: "root" });
1011
- OverlayOutsideClickDispatcher.decorators = [
1012
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1013
- ];
1014
- OverlayOutsideClickDispatcher.ctorParameters = function () { return [
1015
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
1016
- { type: i2.Platform }
1017
- ]; };
1018
-
1019
- /**
1020
- * @license
1021
- * Copyright Google LLC All Rights Reserved.
1022
- *
1023
- * Use of this source code is governed by an MIT-style license that can be
1024
- * found in the LICENSE file at https://angular.io/license
1025
- */
1026
- /** Container inside which all overlays will render. */
1027
- var OverlayContainer = /** @class */ (function () {
1028
- function OverlayContainer(document, _platform) {
1029
- this._platform = _platform;
1030
- this._document = document;
1031
- }
1032
- OverlayContainer.prototype.ngOnDestroy = function () {
1033
- var container = this._containerElement;
1034
- if (container && container.parentNode) {
1035
- container.parentNode.removeChild(container);
1036
- }
1037
- };
1038
- /**
1039
- * This method returns the overlay container element. It will lazily
1040
- * create the element the first time it is called to facilitate using
1041
- * the container in non-browser environments.
1042
- * @returns the container element
1043
- */
1044
- OverlayContainer.prototype.getContainerElement = function () {
1045
- if (!this._containerElement) {
1046
- this._createContainer();
1047
- }
1048
- return this._containerElement;
1049
- };
1050
- /**
1051
- * Create the overlay container element, which is simply a div
1052
- * with the 'cdk-overlay-container' class on the document body.
1053
- */
1054
- OverlayContainer.prototype._createContainer = function () {
1055
- var containerClass = 'cdk-overlay-container';
1056
- // TODO(crisbeto): remove the testing check once we have an overlay testing
1057
- // module or Angular starts tearing down the testing `NgModule`. See:
1058
- // https://github.com/angular/angular/issues/18831
1059
- if (this._platform.isBrowser || i2._isTestEnvironment()) {
1060
- var oppositePlatformContainers = this._document.querySelectorAll("." + containerClass + "[platform=\"server\"], " +
1061
- ("." + containerClass + "[platform=\"test\"]"));
1062
- // Remove any old containers from the opposite platform.
1063
- // This can happen when transitioning from the server to the client.
1064
- for (var i = 0; i < oppositePlatformContainers.length; i++) {
1065
- oppositePlatformContainers[i].parentNode.removeChild(oppositePlatformContainers[i]);
1066
- }
1067
- }
1068
- var container = this._document.createElement('div');
1069
- container.classList.add(containerClass);
1070
- // A long time ago we kept adding new overlay containers whenever a new app was instantiated,
1071
- // but at some point we added logic which clears the duplicate ones in order to avoid leaks.
1072
- // The new logic was a little too aggressive since it was breaking some legitimate use cases.
1073
- // To mitigate the problem we made it so that only containers from a different platform are
1074
- // cleared, but the side-effect was that people started depending on the overly-aggressive
1075
- // logic to clean up their tests for them. Until we can introduce an overlay-specific testing
1076
- // module which does the cleanup, we try to detect that we're in a test environment and we
1077
- // always clear the container. See #17006.
1078
- // TODO(crisbeto): remove the test environment check once we have an overlay testing module.
1079
- if (i2._isTestEnvironment()) {
1080
- container.setAttribute('platform', 'test');
1081
- }
1082
- else if (!this._platform.isBrowser) {
1083
- container.setAttribute('platform', 'server');
1084
- }
1085
- this._document.body.appendChild(container);
1086
- this._containerElement = container;
1087
- };
1088
- return OverlayContainer;
1089
- }());
1090
- OverlayContainer.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT), i0__namespace.ɵɵinject(i2__namespace.Platform)); }, token: OverlayContainer, providedIn: "root" });
1091
- OverlayContainer.decorators = [
1092
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1093
- ];
1094
- OverlayContainer.ctorParameters = function () { return [
1095
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
1096
- { type: i2.Platform }
1097
- ]; };
1098
-
1099
- /**
1100
- * Reference to an overlay that has been created with the Overlay service.
1101
- * Used to manipulate or dispose of said overlay.
1102
- */
1103
- var OverlayRef = /** @class */ (function () {
1104
- function OverlayRef(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document, _location, _outsideClickDispatcher) {
1105
- var _this = this;
1106
- this._portalOutlet = _portalOutlet;
1107
- this._host = _host;
1108
- this._pane = _pane;
1109
- this._config = _config;
1110
- this._ngZone = _ngZone;
1111
- this._keyboardDispatcher = _keyboardDispatcher;
1112
- this._document = _document;
1113
- this._location = _location;
1114
- this._outsideClickDispatcher = _outsideClickDispatcher;
1115
- this._backdropElement = null;
1116
- this._backdropClick = new rxjs.Subject();
1117
- this._attachments = new rxjs.Subject();
1118
- this._detachments = new rxjs.Subject();
1119
- this._locationChanges = rxjs.Subscription.EMPTY;
1120
- this._backdropClickHandler = function (event) { return _this._backdropClick.next(event); };
1121
- /** Stream of keydown events dispatched to this overlay. */
1122
- this._keydownEvents = new rxjs.Subject();
1123
- /** Stream of mouse outside events dispatched to this overlay. */
1124
- this._outsidePointerEvents = new rxjs.Subject();
1125
- if (_config.scrollStrategy) {
1126
- this._scrollStrategy = _config.scrollStrategy;
1127
- this._scrollStrategy.attach(this);
1128
- }
1129
- this._positionStrategy = _config.positionStrategy;
1130
- }
1131
- Object.defineProperty(OverlayRef.prototype, "overlayElement", {
1132
- /** The overlay's HTML element */
1133
- get: function () {
1134
- return this._pane;
1135
- },
1136
- enumerable: false,
1137
- configurable: true
1138
- });
1139
- Object.defineProperty(OverlayRef.prototype, "backdropElement", {
1140
- /** The overlay's backdrop HTML element. */
1141
- get: function () {
1142
- return this._backdropElement;
1143
- },
1144
- enumerable: false,
1145
- configurable: true
1146
- });
1147
- Object.defineProperty(OverlayRef.prototype, "hostElement", {
1148
- /**
1149
- * Wrapper around the panel element. Can be used for advanced
1150
- * positioning where a wrapper with specific styling is
1151
- * required around the overlay pane.
1152
- */
1153
- get: function () {
1154
- return this._host;
1155
- },
1156
- enumerable: false,
1157
- configurable: true
1158
- });
1159
- /**
1160
- * Attaches content, given via a Portal, to the overlay.
1161
- * If the overlay is configured to have a backdrop, it will be created.
1162
- *
1163
- * @param portal Portal instance to which to attach the overlay.
1164
- * @returns The portal attachment result.
1165
- */
1166
- OverlayRef.prototype.attach = function (portal) {
1167
- var _this = this;
1168
- var attachResult = this._portalOutlet.attach(portal);
1169
- // Update the pane element with the given configuration.
1170
- if (!this._host.parentElement && this._previousHostParent) {
1171
- this._previousHostParent.appendChild(this._host);
1172
- }
1173
- if (this._positionStrategy) {
1174
- this._positionStrategy.attach(this);
1175
- }
1176
- this._updateStackingOrder();
1177
- this._updateElementSize();
1178
- this._updateElementDirection();
1179
- if (this._scrollStrategy) {
1180
- this._scrollStrategy.enable();
1181
- }
1182
- // Update the position once the zone is stable so that the overlay will be fully rendered
1183
- // before attempting to position it, as the position may depend on the size of the rendered
1184
- // content.
1185
- this._ngZone.onStable
1186
- .pipe(operators.take(1))
1187
- .subscribe(function () {
1188
- // The overlay could've been detached before the zone has stabilized.
1189
- if (_this.hasAttached()) {
1190
- _this.updatePosition();
1191
- }
1192
- });
1193
- // Enable pointer events for the overlay pane element.
1194
- this._togglePointerEvents(true);
1195
- if (this._config.hasBackdrop) {
1196
- this._attachBackdrop();
1197
- }
1198
- if (this._config.panelClass) {
1199
- this._toggleClasses(this._pane, this._config.panelClass, true);
1200
- }
1201
- // Only emit the `attachments` event once all other setup is done.
1202
- this._attachments.next();
1203
- // Track this overlay by the keyboard dispatcher
1204
- this._keyboardDispatcher.add(this);
1205
- if (this._config.disposeOnNavigation) {
1206
- this._locationChanges = this._location.subscribe(function () { return _this.dispose(); });
1207
- }
1208
- this._outsideClickDispatcher.add(this);
1209
- return attachResult;
1210
- };
1211
- /**
1212
- * Detaches an overlay from a portal.
1213
- * @returns The portal detachment result.
1214
- */
1215
- OverlayRef.prototype.detach = function () {
1216
- if (!this.hasAttached()) {
1217
- return;
1218
- }
1219
- this.detachBackdrop();
1220
- // When the overlay is detached, the pane element should disable pointer events.
1221
- // This is necessary because otherwise the pane element will cover the page and disable
1222
- // pointer events therefore. Depends on the position strategy and the applied pane boundaries.
1223
- this._togglePointerEvents(false);
1224
- if (this._positionStrategy && this._positionStrategy.detach) {
1225
- this._positionStrategy.detach();
1226
- }
1227
- if (this._scrollStrategy) {
1228
- this._scrollStrategy.disable();
1229
- }
1230
- var detachmentResult = this._portalOutlet.detach();
1231
- // Only emit after everything is detached.
1232
- this._detachments.next();
1233
- // Remove this overlay from keyboard dispatcher tracking.
1234
- this._keyboardDispatcher.remove(this);
1235
- // Keeping the host element in the DOM can cause scroll jank, because it still gets
1236
- // rendered, even though it's transparent and unclickable which is why we remove it.
1237
- this._detachContentWhenStable();
1238
- this._locationChanges.unsubscribe();
1239
- this._outsideClickDispatcher.remove(this);
1240
- return detachmentResult;
1241
- };
1242
- /** Cleans up the overlay from the DOM. */
1243
- OverlayRef.prototype.dispose = function () {
1244
- var isAttached = this.hasAttached();
1245
- if (this._positionStrategy) {
1246
- this._positionStrategy.dispose();
1247
- }
1248
- this._disposeScrollStrategy();
1249
- this._disposeBackdrop(this._backdropElement);
1250
- this._locationChanges.unsubscribe();
1251
- this._keyboardDispatcher.remove(this);
1252
- this._portalOutlet.dispose();
1253
- this._attachments.complete();
1254
- this._backdropClick.complete();
1255
- this._keydownEvents.complete();
1256
- this._outsidePointerEvents.complete();
1257
- this._outsideClickDispatcher.remove(this);
1258
- if (this._host && this._host.parentNode) {
1259
- this._host.parentNode.removeChild(this._host);
1260
- this._host = null;
1261
- }
1262
- this._previousHostParent = this._pane = null;
1263
- if (isAttached) {
1264
- this._detachments.next();
1265
- }
1266
- this._detachments.complete();
1267
- };
1268
- /** Whether the overlay has attached content. */
1269
- OverlayRef.prototype.hasAttached = function () {
1270
- return this._portalOutlet.hasAttached();
1271
- };
1272
- /** Gets an observable that emits when the backdrop has been clicked. */
1273
- OverlayRef.prototype.backdropClick = function () {
1274
- return this._backdropClick;
1275
- };
1276
- /** Gets an observable that emits when the overlay has been attached. */
1277
- OverlayRef.prototype.attachments = function () {
1278
- return this._attachments;
1279
- };
1280
- /** Gets an observable that emits when the overlay has been detached. */
1281
- OverlayRef.prototype.detachments = function () {
1282
- return this._detachments;
1283
- };
1284
- /** Gets an observable of keydown events targeted to this overlay. */
1285
- OverlayRef.prototype.keydownEvents = function () {
1286
- return this._keydownEvents;
1287
- };
1288
- /** Gets an observable of pointer events targeted outside this overlay. */
1289
- OverlayRef.prototype.outsidePointerEvents = function () {
1290
- return this._outsidePointerEvents;
1291
- };
1292
- /** Gets the current overlay configuration, which is immutable. */
1293
- OverlayRef.prototype.getConfig = function () {
1294
- return this._config;
1295
- };
1296
- /** Updates the position of the overlay based on the position strategy. */
1297
- OverlayRef.prototype.updatePosition = function () {
1298
- if (this._positionStrategy) {
1299
- this._positionStrategy.apply();
1300
- }
1301
- };
1302
- /** Switches to a new position strategy and updates the overlay position. */
1303
- OverlayRef.prototype.updatePositionStrategy = function (strategy) {
1304
- if (strategy === this._positionStrategy) {
1305
- return;
1306
- }
1307
- if (this._positionStrategy) {
1308
- this._positionStrategy.dispose();
1309
- }
1310
- this._positionStrategy = strategy;
1311
- if (this.hasAttached()) {
1312
- strategy.attach(this);
1313
- this.updatePosition();
1314
- }
1315
- };
1316
- /** Update the size properties of the overlay. */
1317
- OverlayRef.prototype.updateSize = function (sizeConfig) {
1318
- this._config = Object.assign(Object.assign({}, this._config), sizeConfig);
1319
- this._updateElementSize();
1320
- };
1321
- /** Sets the LTR/RTL direction for the overlay. */
1322
- OverlayRef.prototype.setDirection = function (dir) {
1323
- this._config = Object.assign(Object.assign({}, this._config), { direction: dir });
1324
- this._updateElementDirection();
1325
- };
1326
- /** Add a CSS class or an array of classes to the overlay pane. */
1327
- OverlayRef.prototype.addPanelClass = function (classes) {
1328
- if (this._pane) {
1329
- this._toggleClasses(this._pane, classes, true);
1330
- }
1331
- };
1332
- /** Remove a CSS class or an array of classes from the overlay pane. */
1333
- OverlayRef.prototype.removePanelClass = function (classes) {
1334
- if (this._pane) {
1335
- this._toggleClasses(this._pane, classes, false);
1336
- }
1337
- };
1338
- /**
1339
- * Returns the layout direction of the overlay panel.
1340
- */
1341
- OverlayRef.prototype.getDirection = function () {
1342
- var direction = this._config.direction;
1343
- if (!direction) {
1344
- return 'ltr';
1345
- }
1346
- return typeof direction === 'string' ? direction : direction.value;
1347
- };
1348
- /** Switches to a new scroll strategy. */
1349
- OverlayRef.prototype.updateScrollStrategy = function (strategy) {
1350
- if (strategy === this._scrollStrategy) {
1351
- return;
1352
- }
1353
- this._disposeScrollStrategy();
1354
- this._scrollStrategy = strategy;
1355
- if (this.hasAttached()) {
1356
- strategy.attach(this);
1357
- strategy.enable();
1358
- }
1359
- };
1360
- /** Updates the text direction of the overlay panel. */
1361
- OverlayRef.prototype._updateElementDirection = function () {
1362
- this._host.setAttribute('dir', this.getDirection());
1363
- };
1364
- /** Updates the size of the overlay element based on the overlay config. */
1365
- OverlayRef.prototype._updateElementSize = function () {
1366
- if (!this._pane) {
1367
- return;
1368
- }
1369
- var style = this._pane.style;
1370
- style.width = coercion.coerceCssPixelValue(this._config.width);
1371
- style.height = coercion.coerceCssPixelValue(this._config.height);
1372
- style.minWidth = coercion.coerceCssPixelValue(this._config.minWidth);
1373
- style.minHeight = coercion.coerceCssPixelValue(this._config.minHeight);
1374
- style.maxWidth = coercion.coerceCssPixelValue(this._config.maxWidth);
1375
- style.maxHeight = coercion.coerceCssPixelValue(this._config.maxHeight);
1376
- };
1377
- /** Toggles the pointer events for the overlay pane element. */
1378
- OverlayRef.prototype._togglePointerEvents = function (enablePointer) {
1379
- this._pane.style.pointerEvents = enablePointer ? '' : 'none';
1380
- };
1381
- /** Attaches a backdrop for this overlay. */
1382
- OverlayRef.prototype._attachBackdrop = function () {
1383
- var _this = this;
1384
- var showingClass = 'cdk-overlay-backdrop-showing';
1385
- this._backdropElement = this._document.createElement('div');
1386
- this._backdropElement.classList.add('cdk-overlay-backdrop');
1387
- if (this._config.backdropClass) {
1388
- this._toggleClasses(this._backdropElement, this._config.backdropClass, true);
1389
- }
1390
- // Insert the backdrop before the pane in the DOM order,
1391
- // in order to handle stacked overlays properly.
1392
- this._host.parentElement.insertBefore(this._backdropElement, this._host);
1393
- // Forward backdrop clicks such that the consumer of the overlay can perform whatever
1394
- // action desired when such a click occurs (usually closing the overlay).
1395
- this._backdropElement.addEventListener('click', this._backdropClickHandler);
1396
- // Add class to fade-in the backdrop after one frame.
1397
- if (typeof requestAnimationFrame !== 'undefined') {
1398
- this._ngZone.runOutsideAngular(function () {
1399
- requestAnimationFrame(function () {
1400
- if (_this._backdropElement) {
1401
- _this._backdropElement.classList.add(showingClass);
1402
- }
1403
- });
1404
- });
1405
- }
1406
- else {
1407
- this._backdropElement.classList.add(showingClass);
1408
- }
1409
- };
1410
- /**
1411
- * Updates the stacking order of the element, moving it to the top if necessary.
1412
- * This is required in cases where one overlay was detached, while another one,
1413
- * that should be behind it, was destroyed. The next time both of them are opened,
1414
- * the stacking will be wrong, because the detached element's pane will still be
1415
- * in its original DOM position.
1416
- */
1417
- OverlayRef.prototype._updateStackingOrder = function () {
1418
- if (this._host.nextSibling) {
1419
- this._host.parentNode.appendChild(this._host);
1420
- }
1421
- };
1422
- /** Detaches the backdrop (if any) associated with the overlay. */
1423
- OverlayRef.prototype.detachBackdrop = function () {
1424
- var _this = this;
1425
- var backdropToDetach = this._backdropElement;
1426
- if (!backdropToDetach) {
1427
- return;
1428
- }
1429
- var timeoutId;
1430
- var finishDetach = function () {
1431
- // It may not be attached to anything in certain cases (e.g. unit tests).
1432
- if (backdropToDetach) {
1433
- backdropToDetach.removeEventListener('click', _this._backdropClickHandler);
1434
- backdropToDetach.removeEventListener('transitionend', finishDetach);
1435
- _this._disposeBackdrop(backdropToDetach);
1436
- }
1437
- if (_this._config.backdropClass) {
1438
- _this._toggleClasses(backdropToDetach, _this._config.backdropClass, false);
1439
- }
1440
- clearTimeout(timeoutId);
1441
- };
1442
- backdropToDetach.classList.remove('cdk-overlay-backdrop-showing');
1443
- this._ngZone.runOutsideAngular(function () {
1444
- backdropToDetach.addEventListener('transitionend', finishDetach);
1445
- });
1446
- // If the backdrop doesn't have a transition, the `transitionend` event won't fire.
1447
- // In this case we make it unclickable and we try to remove it after a delay.
1448
- backdropToDetach.style.pointerEvents = 'none';
1449
- // Run this outside the Angular zone because there's nothing that Angular cares about.
1450
- // If it were to run inside the Angular zone, every test that used Overlay would have to be
1451
- // either async or fakeAsync.
1452
- timeoutId = this._ngZone.runOutsideAngular(function () { return setTimeout(finishDetach, 500); });
1453
- };
1454
- /** Toggles a single CSS class or an array of classes on an element. */
1455
- OverlayRef.prototype._toggleClasses = function (element, cssClasses, isAdd) {
1456
- var _a, _b;
1457
- var classes = coercion.coerceArray(cssClasses || []).filter(function (c) { return !!c; });
1458
- if (classes.length) {
1459
- isAdd ? (_a = element.classList).add.apply(_a, __spreadArray([], __read(classes))) : (_b = element.classList).remove.apply(_b, __spreadArray([], __read(classes)));
1460
- }
1461
- };
1462
- /** Detaches the overlay content next time the zone stabilizes. */
1463
- OverlayRef.prototype._detachContentWhenStable = function () {
1464
- var _this = this;
1465
- // Normally we wouldn't have to explicitly run this outside the `NgZone`, however
1466
- // if the consumer is using `zone-patch-rxjs`, the `Subscription.unsubscribe` call will
1467
- // be patched to run inside the zone, which will throw us into an infinite loop.
1468
- this._ngZone.runOutsideAngular(function () {
1469
- // We can't remove the host here immediately, because the overlay pane's content
1470
- // might still be animating. This stream helps us avoid interrupting the animation
1471
- // by waiting for the pane to become empty.
1472
- var subscription = _this._ngZone.onStable
1473
- .pipe(operators.takeUntil(rxjs.merge(_this._attachments, _this._detachments)))
1474
- .subscribe(function () {
1475
- // Needs a couple of checks for the pane and host, because
1476
- // they may have been removed by the time the zone stabilizes.
1477
- if (!_this._pane || !_this._host || _this._pane.children.length === 0) {
1478
- if (_this._pane && _this._config.panelClass) {
1479
- _this._toggleClasses(_this._pane, _this._config.panelClass, false);
1480
- }
1481
- if (_this._host && _this._host.parentElement) {
1482
- _this._previousHostParent = _this._host.parentElement;
1483
- _this._previousHostParent.removeChild(_this._host);
1484
- }
1485
- subscription.unsubscribe();
1486
- }
1487
- });
1488
- });
1489
- };
1490
- /** Disposes of a scroll strategy. */
1491
- OverlayRef.prototype._disposeScrollStrategy = function () {
1492
- var scrollStrategy = this._scrollStrategy;
1493
- if (scrollStrategy) {
1494
- scrollStrategy.disable();
1495
- if (scrollStrategy.detach) {
1496
- scrollStrategy.detach();
1497
- }
1498
- }
1499
- };
1500
- /** Removes a backdrop element from the DOM. */
1501
- OverlayRef.prototype._disposeBackdrop = function (backdrop) {
1502
- if (backdrop) {
1503
- if (backdrop.parentNode) {
1504
- backdrop.parentNode.removeChild(backdrop);
1505
- }
1506
- // It is possible that a new portal has been attached to this overlay since we started
1507
- // removing the backdrop. If that is the case, only clear the backdrop reference if it
1508
- // is still the same instance that we started to remove.
1509
- if (this._backdropElement === backdrop) {
1510
- this._backdropElement = null;
1511
- }
1512
- }
1513
- };
1514
- return OverlayRef;
1515
- }());
1516
-
1517
- // TODO: refactor clipping detection into a separate thing (part of scrolling module)
1518
- // TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
1519
- /** Class to be added to the overlay bounding box. */
1520
- var boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
1521
- /** Regex used to split a string on its CSS units. */
1522
- var cssUnitPattern = /([A-Za-z%]+)$/;
1523
- /**
1524
- * A strategy for positioning overlays. Using this strategy, an overlay is given an
1525
- * implicit position relative some origin element. The relative position is defined in terms of
1526
- * a point on the origin element that is connected to a point on the overlay element. For example,
1527
- * a basic dropdown is connecting the bottom-left corner of the origin to the top-left corner
1528
- * of the overlay.
1529
- */
1530
- var FlexibleConnectedPositionStrategy = /** @class */ (function () {
1531
- function FlexibleConnectedPositionStrategy(connectedTo, _viewportRuler, _document, _platform, _overlayContainer) {
1532
- this._viewportRuler = _viewportRuler;
1533
- this._document = _document;
1534
- this._platform = _platform;
1535
- this._overlayContainer = _overlayContainer;
1536
- /** Last size used for the bounding box. Used to avoid resizing the overlay after open. */
1537
- this._lastBoundingBoxSize = { width: 0, height: 0 };
1538
- /** Whether the overlay was pushed in a previous positioning. */
1539
- this._isPushed = false;
1540
- /** Whether the overlay can be pushed on-screen on the initial open. */
1541
- this._canPush = true;
1542
- /** Whether the overlay can grow via flexible width/height after the initial open. */
1543
- this._growAfterOpen = false;
1544
- /** Whether the overlay's width and height can be constrained to fit within the viewport. */
1545
- this._hasFlexibleDimensions = true;
1546
- /** Whether the overlay position is locked. */
1547
- this._positionLocked = false;
1548
- /** Amount of space that must be maintained between the overlay and the edge of the viewport. */
1549
- this._viewportMargin = 0;
1550
- /** The Scrollable containers used to check scrollable view properties on position change. */
1551
- this._scrollables = [];
1552
- /** Ordered list of preferred positions, from most to least desirable. */
1553
- this._preferredPositions = [];
1554
- /** Subject that emits whenever the position changes. */
1555
- this._positionChanges = new rxjs.Subject();
1556
- /** Subscription to viewport size changes. */
1557
- this._resizeSubscription = rxjs.Subscription.EMPTY;
1558
- /** Default offset for the overlay along the x axis. */
1559
- this._offsetX = 0;
1560
- /** Default offset for the overlay along the y axis. */
1561
- this._offsetY = 0;
1562
- /** Keeps track of the CSS classes that the position strategy has applied on the overlay panel. */
1563
- this._appliedPanelClasses = [];
1564
- /** Observable sequence of position changes. */
1565
- this.positionChanges = this._positionChanges;
1566
- this.setOrigin(connectedTo);
1567
- }
1568
- Object.defineProperty(FlexibleConnectedPositionStrategy.prototype, "positions", {
1569
- /** Ordered list of preferred positions, from most to least desirable. */
1570
- get: function () {
1571
- return this._preferredPositions;
1572
- },
1573
- enumerable: false,
1574
- configurable: true
1575
- });
1576
- /** Attaches this position strategy to an overlay. */
1577
- FlexibleConnectedPositionStrategy.prototype.attach = function (overlayRef) {
1578
- var _this = this;
1579
- if (this._overlayRef && overlayRef !== this._overlayRef &&
1580
- (typeof ngDevMode === 'undefined' || ngDevMode)) {
1581
- throw Error('This position strategy is already attached to an overlay');
1582
- }
1583
- this._validatePositions();
1584
- overlayRef.hostElement.classList.add(boundingBoxClass);
1585
- this._overlayRef = overlayRef;
1586
- this._boundingBox = overlayRef.hostElement;
1587
- this._pane = overlayRef.overlayElement;
1588
- this._isDisposed = false;
1589
- this._isInitialRender = true;
1590
- this._lastPosition = null;
1591
- this._resizeSubscription.unsubscribe();
1592
- this._resizeSubscription = this._viewportRuler.change().subscribe(function () {
1593
- // When the window is resized, we want to trigger the next reposition as if it
1594
- // was an initial render, in order for the strategy to pick a new optimal position,
1595
- // otherwise position locking will cause it to stay at the old one.
1596
- _this._isInitialRender = true;
1597
- _this.apply();
1598
- });
1599
- };
1600
- /**
1601
- * Updates the position of the overlay element, using whichever preferred position relative
1602
- * to the origin best fits on-screen.
1603
- *
1604
- * The selection of a position goes as follows:
1605
- * - If any positions fit completely within the viewport as-is,
1606
- * choose the first position that does so.
1607
- * - If flexible dimensions are enabled and at least one satifies the given minimum width/height,
1608
- * choose the position with the greatest available size modified by the positions' weight.
1609
- * - If pushing is enabled, take the position that went off-screen the least and push it
1610
- * on-screen.
1611
- * - If none of the previous criteria were met, use the position that goes off-screen the least.
1612
- * @docs-private
1613
- */
1614
- FlexibleConnectedPositionStrategy.prototype.apply = function () {
1615
- var e_1, _a, e_2, _b;
1616
- // We shouldn't do anything if the strategy was disposed or we're on the server.
1617
- if (this._isDisposed || !this._platform.isBrowser) {
1618
- return;
1619
- }
1620
- // If the position has been applied already (e.g. when the overlay was opened) and the
1621
- // consumer opted into locking in the position, re-use the old position, in order to
1622
- // prevent the overlay from jumping around.
1623
- if (!this._isInitialRender && this._positionLocked && this._lastPosition) {
1624
- this.reapplyLastPosition();
1625
- return;
1626
- }
1627
- this._clearPanelClasses();
1628
- this._resetOverlayElementStyles();
1629
- this._resetBoundingBoxStyles();
1630
- // We need the bounding rects for the origin and the overlay to determine how to position
1631
- // the overlay relative to the origin.
1632
- // We use the viewport rect to determine whether a position would go off-screen.
1633
- this._viewportRect = this._getNarrowedViewportRect();
1634
- this._originRect = this._getOriginRect();
1635
- this._overlayRect = this._pane.getBoundingClientRect();
1636
- var originRect = this._originRect;
1637
- var overlayRect = this._overlayRect;
1638
- var viewportRect = this._viewportRect;
1639
- // Positions where the overlay will fit with flexible dimensions.
1640
- var flexibleFits = [];
1641
- // Fallback if none of the preferred positions fit within the viewport.
1642
- var fallback;
1643
- try {
1644
- // Go through each of the preferred positions looking for a good fit.
1645
- // If a good fit is found, it will be applied immediately.
1646
- for (var _c = __values(this._preferredPositions), _d = _c.next(); !_d.done; _d = _c.next()) {
1647
- var pos = _d.value;
1648
- // Get the exact (x, y) coordinate for the point-of-origin on the origin element.
1649
- var originPoint = this._getOriginPoint(originRect, pos);
1650
- // From that point-of-origin, get the exact (x, y) coordinate for the top-left corner of the
1651
- // overlay in this position. We use the top-left corner for calculations and later translate
1652
- // this into an appropriate (top, left, bottom, right) style.
1653
- var overlayPoint = this._getOverlayPoint(originPoint, overlayRect, pos);
1654
- // Calculate how well the overlay would fit into the viewport with this point.
1655
- var overlayFit = this._getOverlayFit(overlayPoint, overlayRect, viewportRect, pos);
1656
- // If the overlay, without any further work, fits into the viewport, use this position.
1657
- if (overlayFit.isCompletelyWithinViewport) {
1658
- this._isPushed = false;
1659
- this._applyPosition(pos, originPoint);
1660
- return;
1661
- }
1662
- // If the overlay has flexible dimensions, we can use this position
1663
- // so long as there's enough space for the minimum dimensions.
1664
- if (this._canFitWithFlexibleDimensions(overlayFit, overlayPoint, viewportRect)) {
1665
- // Save positions where the overlay will fit with flexible dimensions. We will use these
1666
- // if none of the positions fit *without* flexible dimensions.
1667
- flexibleFits.push({
1668
- position: pos,
1669
- origin: originPoint,
1670
- overlayRect: overlayRect,
1671
- boundingBoxRect: this._calculateBoundingBoxRect(originPoint, pos)
1672
- });
1673
- continue;
1674
- }
1675
- // If the current preferred position does not fit on the screen, remember the position
1676
- // if it has more visible area on-screen than we've seen and move onto the next preferred
1677
- // position.
1678
- if (!fallback || fallback.overlayFit.visibleArea < overlayFit.visibleArea) {
1679
- fallback = { overlayFit: overlayFit, overlayPoint: overlayPoint, originPoint: originPoint, position: pos, overlayRect: overlayRect };
1680
- }
1681
- }
1682
- }
1683
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
1684
- finally {
1685
- try {
1686
- if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
1687
- }
1688
- finally { if (e_1) throw e_1.error; }
1689
- }
1690
- // If there are any positions where the overlay would fit with flexible dimensions, choose the
1691
- // one that has the greatest area available modified by the position's weight
1692
- if (flexibleFits.length) {
1693
- var bestFit = null;
1694
- var bestScore = -1;
1695
- try {
1696
- for (var flexibleFits_1 = __values(flexibleFits), flexibleFits_1_1 = flexibleFits_1.next(); !flexibleFits_1_1.done; flexibleFits_1_1 = flexibleFits_1.next()) {
1697
- var fit = flexibleFits_1_1.value;
1698
- var score = fit.boundingBoxRect.width * fit.boundingBoxRect.height * (fit.position.weight || 1);
1699
- if (score > bestScore) {
1700
- bestScore = score;
1701
- bestFit = fit;
1702
- }
1703
- }
1704
- }
1705
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
1706
- finally {
1707
- try {
1708
- if (flexibleFits_1_1 && !flexibleFits_1_1.done && (_b = flexibleFits_1.return)) _b.call(flexibleFits_1);
1709
- }
1710
- finally { if (e_2) throw e_2.error; }
1711
- }
1712
- this._isPushed = false;
1713
- this._applyPosition(bestFit.position, bestFit.origin);
1714
- return;
1715
- }
1716
- // When none of the preferred positions fit within the viewport, take the position
1717
- // that went off-screen the least and attempt to push it on-screen.
1718
- if (this._canPush) {
1719
- // TODO(jelbourn): after pushing, the opening "direction" of the overlay might not make sense.
1720
- this._isPushed = true;
1721
- this._applyPosition(fallback.position, fallback.originPoint);
1722
- return;
1723
- }
1724
- // All options for getting the overlay within the viewport have been exhausted, so go with the
1725
- // position that went off-screen the least.
1726
- this._applyPosition(fallback.position, fallback.originPoint);
1727
- };
1728
- FlexibleConnectedPositionStrategy.prototype.detach = function () {
1729
- this._clearPanelClasses();
1730
- this._lastPosition = null;
1731
- this._previousPushAmount = null;
1732
- this._resizeSubscription.unsubscribe();
1733
- };
1734
- /** Cleanup after the element gets destroyed. */
1735
- FlexibleConnectedPositionStrategy.prototype.dispose = function () {
1736
- if (this._isDisposed) {
1737
- return;
1738
- }
1739
- // We can't use `_resetBoundingBoxStyles` here, because it resets
1740
- // some properties to zero, rather than removing them.
1741
- if (this._boundingBox) {
1742
- extendStyles(this._boundingBox.style, {
1743
- top: '',
1744
- left: '',
1745
- right: '',
1746
- bottom: '',
1747
- height: '',
1748
- width: '',
1749
- alignItems: '',
1750
- justifyContent: '',
1751
- });
1752
- }
1753
- if (this._pane) {
1754
- this._resetOverlayElementStyles();
1755
- }
1756
- if (this._overlayRef) {
1757
- this._overlayRef.hostElement.classList.remove(boundingBoxClass);
1758
- }
1759
- this.detach();
1760
- this._positionChanges.complete();
1761
- this._overlayRef = this._boundingBox = null;
1762
- this._isDisposed = true;
1763
- };
1764
- /**
1765
- * This re-aligns the overlay element with the trigger in its last calculated position,
1766
- * even if a position higher in the "preferred positions" list would now fit. This
1767
- * allows one to re-align the panel without changing the orientation of the panel.
1768
- */
1769
- FlexibleConnectedPositionStrategy.prototype.reapplyLastPosition = function () {
1770
- if (!this._isDisposed && (!this._platform || this._platform.isBrowser)) {
1771
- this._originRect = this._getOriginRect();
1772
- this._overlayRect = this._pane.getBoundingClientRect();
1773
- this._viewportRect = this._getNarrowedViewportRect();
1774
- var lastPosition = this._lastPosition || this._preferredPositions[0];
1775
- var originPoint = this._getOriginPoint(this._originRect, lastPosition);
1776
- this._applyPosition(lastPosition, originPoint);
1777
- }
1778
- };
1779
- /**
1780
- * Sets the list of Scrollable containers that host the origin element so that
1781
- * on reposition we can evaluate if it or the overlay has been clipped or outside view. Every
1782
- * Scrollable must be an ancestor element of the strategy's origin element.
1783
- */
1784
- FlexibleConnectedPositionStrategy.prototype.withScrollableContainers = function (scrollables) {
1785
- this._scrollables = scrollables;
1786
- return this;
1787
- };
1788
- /**
1789
- * Adds new preferred positions.
1790
- * @param positions List of positions options for this overlay.
1791
- */
1792
- FlexibleConnectedPositionStrategy.prototype.withPositions = function (positions) {
1793
- this._preferredPositions = positions;
1794
- // If the last calculated position object isn't part of the positions anymore, clear
1795
- // it in order to avoid it being picked up if the consumer tries to re-apply.
1796
- if (positions.indexOf(this._lastPosition) === -1) {
1797
- this._lastPosition = null;
1798
- }
1799
- this._validatePositions();
1800
- return this;
1801
- };
1802
- /**
1803
- * Sets a minimum distance the overlay may be positioned to the edge of the viewport.
1804
- * @param margin Required margin between the overlay and the viewport edge in pixels.
1805
- */
1806
- FlexibleConnectedPositionStrategy.prototype.withViewportMargin = function (margin) {
1807
- this._viewportMargin = margin;
1808
- return this;
1809
- };
1810
- /** Sets whether the overlay's width and height can be constrained to fit within the viewport. */
1811
- FlexibleConnectedPositionStrategy.prototype.withFlexibleDimensions = function (flexibleDimensions) {
1812
- if (flexibleDimensions === void 0) { flexibleDimensions = true; }
1813
- this._hasFlexibleDimensions = flexibleDimensions;
1814
- return this;
1815
- };
1816
- /** Sets whether the overlay can grow after the initial open via flexible width/height. */
1817
- FlexibleConnectedPositionStrategy.prototype.withGrowAfterOpen = function (growAfterOpen) {
1818
- if (growAfterOpen === void 0) { growAfterOpen = true; }
1819
- this._growAfterOpen = growAfterOpen;
1820
- return this;
1821
- };
1822
- /** Sets whether the overlay can be pushed on-screen if none of the provided positions fit. */
1823
- FlexibleConnectedPositionStrategy.prototype.withPush = function (canPush) {
1824
- if (canPush === void 0) { canPush = true; }
1825
- this._canPush = canPush;
1826
- return this;
1827
- };
1828
- /**
1829
- * Sets whether the overlay's position should be locked in after it is positioned
1830
- * initially. When an overlay is locked in, it won't attempt to reposition itself
1831
- * when the position is re-applied (e.g. when the user scrolls away).
1832
- * @param isLocked Whether the overlay should locked in.
1833
- */
1834
- FlexibleConnectedPositionStrategy.prototype.withLockedPosition = function (isLocked) {
1835
- if (isLocked === void 0) { isLocked = true; }
1836
- this._positionLocked = isLocked;
1837
- return this;
1838
- };
1839
- /**
1840
- * Sets the origin, relative to which to position the overlay.
1841
- * Using an element origin is useful for building components that need to be positioned
1842
- * relatively to a trigger (e.g. dropdown menus or tooltips), whereas using a point can be
1843
- * used for cases like contextual menus which open relative to the user's pointer.
1844
- * @param origin Reference to the new origin.
1845
- */
1846
- FlexibleConnectedPositionStrategy.prototype.setOrigin = function (origin) {
1847
- this._origin = origin;
1848
- return this;
1849
- };
1850
- /**
1851
- * Sets the default offset for the overlay's connection point on the x-axis.
1852
- * @param offset New offset in the X axis.
1853
- */
1854
- FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetX = function (offset) {
1855
- this._offsetX = offset;
1856
- return this;
1857
- };
1858
- /**
1859
- * Sets the default offset for the overlay's connection point on the y-axis.
1860
- * @param offset New offset in the Y axis.
1861
- */
1862
- FlexibleConnectedPositionStrategy.prototype.withDefaultOffsetY = function (offset) {
1863
- this._offsetY = offset;
1864
- return this;
1865
- };
1866
- /**
1867
- * Configures that the position strategy should set a `transform-origin` on some elements
1868
- * inside the overlay, depending on the current position that is being applied. This is
1869
- * useful for the cases where the origin of an animation can change depending on the
1870
- * alignment of the overlay.
1871
- * @param selector CSS selector that will be used to find the target
1872
- * elements onto which to set the transform origin.
1873
- */
1874
- FlexibleConnectedPositionStrategy.prototype.withTransformOriginOn = function (selector) {
1875
- this._transformOriginSelector = selector;
1876
- return this;
1877
- };
1878
- /**
1879
- * Gets the (x, y) coordinate of a connection point on the origin based on a relative position.
1880
- */
1881
- FlexibleConnectedPositionStrategy.prototype._getOriginPoint = function (originRect, pos) {
1882
- var x;
1883
- if (pos.originX == 'center') {
1884
- // Note: when centering we should always use the `left`
1885
- // offset, otherwise the position will be wrong in RTL.
1886
- x = originRect.left + (originRect.width / 2);
1887
- }
1888
- else {
1889
- var startX = this._isRtl() ? originRect.right : originRect.left;
1890
- var endX = this._isRtl() ? originRect.left : originRect.right;
1891
- x = pos.originX == 'start' ? startX : endX;
1892
- }
1893
- var y;
1894
- if (pos.originY == 'center') {
1895
- y = originRect.top + (originRect.height / 2);
1896
- }
1897
- else {
1898
- y = pos.originY == 'top' ? originRect.top : originRect.bottom;
1899
- }
1900
- return { x: x, y: y };
1901
- };
1902
- /**
1903
- * Gets the (x, y) coordinate of the top-left corner of the overlay given a given position and
1904
- * origin point to which the overlay should be connected.
1905
- */
1906
- FlexibleConnectedPositionStrategy.prototype._getOverlayPoint = function (originPoint, overlayRect, pos) {
1907
- // Calculate the (overlayStartX, overlayStartY), the start of the
1908
- // potential overlay position relative to the origin point.
1909
- var overlayStartX;
1910
- if (pos.overlayX == 'center') {
1911
- overlayStartX = -overlayRect.width / 2;
1912
- }
1913
- else if (pos.overlayX === 'start') {
1914
- overlayStartX = this._isRtl() ? -overlayRect.width : 0;
1915
- }
1916
- else {
1917
- overlayStartX = this._isRtl() ? 0 : -overlayRect.width;
1918
- }
1919
- var overlayStartY;
1920
- if (pos.overlayY == 'center') {
1921
- overlayStartY = -overlayRect.height / 2;
1922
- }
1923
- else {
1924
- overlayStartY = pos.overlayY == 'top' ? 0 : -overlayRect.height;
1925
- }
1926
- // The (x, y) coordinates of the overlay.
1927
- return {
1928
- x: originPoint.x + overlayStartX,
1929
- y: originPoint.y + overlayStartY,
1930
- };
1931
- };
1932
- /** Gets how well an overlay at the given point will fit within the viewport. */
1933
- FlexibleConnectedPositionStrategy.prototype._getOverlayFit = function (point, rawOverlayRect, viewport, position) {
1934
- // Round the overlay rect when comparing against the
1935
- // viewport, because the viewport is always rounded.
1936
- var overlay = getRoundedBoundingClientRect(rawOverlayRect);
1937
- var x = point.x, y = point.y;
1938
- var offsetX = this._getOffset(position, 'x');
1939
- var offsetY = this._getOffset(position, 'y');
1940
- // Account for the offsets since they could push the overlay out of the viewport.
1941
- if (offsetX) {
1942
- x += offsetX;
1943
- }
1944
- if (offsetY) {
1945
- y += offsetY;
1946
- }
1947
- // How much the overlay would overflow at this position, on each side.
1948
- var leftOverflow = 0 - x;
1949
- var rightOverflow = (x + overlay.width) - viewport.width;
1950
- var topOverflow = 0 - y;
1951
- var bottomOverflow = (y + overlay.height) - viewport.height;
1952
- // Visible parts of the element on each axis.
1953
- var visibleWidth = this._subtractOverflows(overlay.width, leftOverflow, rightOverflow);
1954
- var visibleHeight = this._subtractOverflows(overlay.height, topOverflow, bottomOverflow);
1955
- var visibleArea = visibleWidth * visibleHeight;
1956
- return {
1957
- visibleArea: visibleArea,
1958
- isCompletelyWithinViewport: (overlay.width * overlay.height) === visibleArea,
1959
- fitsInViewportVertically: visibleHeight === overlay.height,
1960
- fitsInViewportHorizontally: visibleWidth == overlay.width,
1961
- };
1962
- };
1963
- /**
1964
- * Whether the overlay can fit within the viewport when it may resize either its width or height.
1965
- * @param fit How well the overlay fits in the viewport at some position.
1966
- * @param point The (x, y) coordinates of the overlat at some position.
1967
- * @param viewport The geometry of the viewport.
1968
- */
1969
- FlexibleConnectedPositionStrategy.prototype._canFitWithFlexibleDimensions = function (fit, point, viewport) {
1970
- if (this._hasFlexibleDimensions) {
1971
- var availableHeight = viewport.bottom - point.y;
1972
- var availableWidth = viewport.right - point.x;
1973
- var minHeight = getPixelValue(this._overlayRef.getConfig().minHeight);
1974
- var minWidth = getPixelValue(this._overlayRef.getConfig().minWidth);
1975
- var verticalFit = fit.fitsInViewportVertically ||
1976
- (minHeight != null && minHeight <= availableHeight);
1977
- var horizontalFit = fit.fitsInViewportHorizontally ||
1978
- (minWidth != null && minWidth <= availableWidth);
1979
- return verticalFit && horizontalFit;
1980
- }
1981
- return false;
1982
- };
1983
- /**
1984
- * Gets the point at which the overlay can be "pushed" on-screen. If the overlay is larger than
1985
- * the viewport, the top-left corner will be pushed on-screen (with overflow occuring on the
1986
- * right and bottom).
1987
- *
1988
- * @param start Starting point from which the overlay is pushed.
1989
- * @param overlay Dimensions of the overlay.
1990
- * @param scrollPosition Current viewport scroll position.
1991
- * @returns The point at which to position the overlay after pushing. This is effectively a new
1992
- * originPoint.
1993
- */
1994
- FlexibleConnectedPositionStrategy.prototype._pushOverlayOnScreen = function (start, rawOverlayRect, scrollPosition) {
1995
- // If the position is locked and we've pushed the overlay already, reuse the previous push
1996
- // amount, rather than pushing it again. If we were to continue pushing, the element would
1997
- // remain in the viewport, which goes against the expectations when position locking is enabled.
1998
- if (this._previousPushAmount && this._positionLocked) {
1999
- return {
2000
- x: start.x + this._previousPushAmount.x,
2001
- y: start.y + this._previousPushAmount.y
2002
- };
2003
- }
2004
- // Round the overlay rect when comparing against the
2005
- // viewport, because the viewport is always rounded.
2006
- var overlay = getRoundedBoundingClientRect(rawOverlayRect);
2007
- var viewport = this._viewportRect;
2008
- // Determine how much the overlay goes outside the viewport on each
2009
- // side, which we'll use to decide which direction to push it.
2010
- var overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);
2011
- var overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);
2012
- var overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
2013
- var overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
2014
- // Amount by which to push the overlay in each axis such that it remains on-screen.
2015
- var pushX = 0;
2016
- var pushY = 0;
2017
- // If the overlay fits completely within the bounds of the viewport, push it from whichever
2018
- // direction is goes off-screen. Otherwise, push the top-left corner such that its in the
2019
- // viewport and allow for the trailing end of the overlay to go out of bounds.
2020
- if (overlay.width <= viewport.width) {
2021
- pushX = overflowLeft || -overflowRight;
2022
- }
2023
- else {
2024
- pushX = start.x < this._viewportMargin ? (viewport.left - scrollPosition.left) - start.x : 0;
2025
- }
2026
- if (overlay.height <= viewport.height) {
2027
- pushY = overflowTop || -overflowBottom;
2028
- }
2029
- else {
2030
- pushY = start.y < this._viewportMargin ? (viewport.top - scrollPosition.top) - start.y : 0;
2031
- }
2032
- this._previousPushAmount = { x: pushX, y: pushY };
2033
- return {
2034
- x: start.x + pushX,
2035
- y: start.y + pushY,
2036
- };
2037
- };
2038
- /**
2039
- * Applies a computed position to the overlay and emits a position change.
2040
- * @param position The position preference
2041
- * @param originPoint The point on the origin element where the overlay is connected.
2042
- */
2043
- FlexibleConnectedPositionStrategy.prototype._applyPosition = function (position, originPoint) {
2044
- this._setTransformOrigin(position);
2045
- this._setOverlayElementStyles(originPoint, position);
2046
- this._setBoundingBoxStyles(originPoint, position);
2047
- if (position.panelClass) {
2048
- this._addPanelClasses(position.panelClass);
2049
- }
2050
- // Save the last connected position in case the position needs to be re-calculated.
2051
- this._lastPosition = position;
2052
- // Notify that the position has been changed along with its change properties.
2053
- // We only emit if we've got any subscriptions, because the scroll visibility
2054
- // calculcations can be somewhat expensive.
2055
- if (this._positionChanges.observers.length) {
2056
- var scrollableViewProperties = this._getScrollVisibility();
2057
- var changeEvent = new ConnectedOverlayPositionChange(position, scrollableViewProperties);
2058
- this._positionChanges.next(changeEvent);
2059
- }
2060
- this._isInitialRender = false;
2061
- };
2062
- /** Sets the transform origin based on the configured selector and the passed-in position. */
2063
- FlexibleConnectedPositionStrategy.prototype._setTransformOrigin = function (position) {
2064
- if (!this._transformOriginSelector) {
2065
- return;
2066
- }
2067
- var elements = this._boundingBox.querySelectorAll(this._transformOriginSelector);
2068
- var xOrigin;
2069
- var yOrigin = position.overlayY;
2070
- if (position.overlayX === 'center') {
2071
- xOrigin = 'center';
2072
- }
2073
- else if (this._isRtl()) {
2074
- xOrigin = position.overlayX === 'start' ? 'right' : 'left';
2075
- }
2076
- else {
2077
- xOrigin = position.overlayX === 'start' ? 'left' : 'right';
2078
- }
2079
- for (var i = 0; i < elements.length; i++) {
2080
- elements[i].style.transformOrigin = xOrigin + " " + yOrigin;
2081
- }
2082
- };
2083
- /**
2084
- * Gets the position and size of the overlay's sizing container.
2085
- *
2086
- * This method does no measuring and applies no styles so that we can cheaply compute the
2087
- * bounds for all positions and choose the best fit based on these results.
2088
- */
2089
- FlexibleConnectedPositionStrategy.prototype._calculateBoundingBoxRect = function (origin, position) {
2090
- var viewport = this._viewportRect;
2091
- var isRtl = this._isRtl();
2092
- var height, top, bottom;
2093
- if (position.overlayY === 'top') {
2094
- // Overlay is opening "downward" and thus is bound by the bottom viewport edge.
2095
- top = origin.y;
2096
- height = viewport.height - top + this._viewportMargin;
2097
- }
2098
- else if (position.overlayY === 'bottom') {
2099
- // Overlay is opening "upward" and thus is bound by the top viewport edge. We need to add
2100
- // the viewport margin back in, because the viewport rect is narrowed down to remove the
2101
- // margin, whereas the `origin` position is calculated based on its `ClientRect`.
2102
- bottom = viewport.height - origin.y + this._viewportMargin * 2;
2103
- height = viewport.height - bottom + this._viewportMargin;
2104
- }
2105
- else {
2106
- // If neither top nor bottom, it means that the overlay is vertically centered on the
2107
- // origin point. Note that we want the position relative to the viewport, rather than
2108
- // the page, which is why we don't use something like `viewport.bottom - origin.y` and
2109
- // `origin.y - viewport.top`.
2110
- var smallestDistanceToViewportEdge = Math.min(viewport.bottom - origin.y + viewport.top, origin.y);
2111
- var previousHeight = this._lastBoundingBoxSize.height;
2112
- height = smallestDistanceToViewportEdge * 2;
2113
- top = origin.y - smallestDistanceToViewportEdge;
2114
- if (height > previousHeight && !this._isInitialRender && !this._growAfterOpen) {
2115
- top = origin.y - (previousHeight / 2);
2116
- }
2117
- }
2118
- // The overlay is opening 'right-ward' (the content flows to the right).
2119
- var isBoundedByRightViewportEdge = (position.overlayX === 'start' && !isRtl) ||
2120
- (position.overlayX === 'end' && isRtl);
2121
- // The overlay is opening 'left-ward' (the content flows to the left).
2122
- var isBoundedByLeftViewportEdge = (position.overlayX === 'end' && !isRtl) ||
2123
- (position.overlayX === 'start' && isRtl);
2124
- var width, left, right;
2125
- if (isBoundedByLeftViewportEdge) {
2126
- right = viewport.width - origin.x + this._viewportMargin;
2127
- width = origin.x - this._viewportMargin;
2128
- }
2129
- else if (isBoundedByRightViewportEdge) {
2130
- left = origin.x;
2131
- width = viewport.right - origin.x;
2132
- }
2133
- else {
2134
- // If neither start nor end, it means that the overlay is horizontally centered on the
2135
- // origin point. Note that we want the position relative to the viewport, rather than
2136
- // the page, which is why we don't use something like `viewport.right - origin.x` and
2137
- // `origin.x - viewport.left`.
2138
- var smallestDistanceToViewportEdge = Math.min(viewport.right - origin.x + viewport.left, origin.x);
2139
- var previousWidth = this._lastBoundingBoxSize.width;
2140
- width = smallestDistanceToViewportEdge * 2;
2141
- left = origin.x - smallestDistanceToViewportEdge;
2142
- if (width > previousWidth && !this._isInitialRender && !this._growAfterOpen) {
2143
- left = origin.x - (previousWidth / 2);
2144
- }
2145
- }
2146
- return { top: top, left: left, bottom: bottom, right: right, width: width, height: height };
2147
- };
2148
- /**
2149
- * Sets the position and size of the overlay's sizing wrapper. The wrapper is positioned on the
2150
- * origin's connection point and stetches to the bounds of the viewport.
2151
- *
2152
- * @param origin The point on the origin element where the overlay is connected.
2153
- * @param position The position preference
2154
- */
2155
- FlexibleConnectedPositionStrategy.prototype._setBoundingBoxStyles = function (origin, position) {
2156
- var boundingBoxRect = this._calculateBoundingBoxRect(origin, position);
2157
- // It's weird if the overlay *grows* while scrolling, so we take the last size into account
2158
- // when applying a new size.
2159
- if (!this._isInitialRender && !this._growAfterOpen) {
2160
- boundingBoxRect.height = Math.min(boundingBoxRect.height, this._lastBoundingBoxSize.height);
2161
- boundingBoxRect.width = Math.min(boundingBoxRect.width, this._lastBoundingBoxSize.width);
2162
- }
2163
- var styles = {};
2164
- if (this._hasExactPosition()) {
2165
- styles.top = styles.left = '0';
2166
- styles.bottom = styles.right = styles.maxHeight = styles.maxWidth = '';
2167
- styles.width = styles.height = '100%';
2168
- }
2169
- else {
2170
- var maxHeight = this._overlayRef.getConfig().maxHeight;
2171
- var maxWidth = this._overlayRef.getConfig().maxWidth;
2172
- styles.height = coercion.coerceCssPixelValue(boundingBoxRect.height);
2173
- styles.top = coercion.coerceCssPixelValue(boundingBoxRect.top);
2174
- styles.bottom = coercion.coerceCssPixelValue(boundingBoxRect.bottom);
2175
- styles.width = coercion.coerceCssPixelValue(boundingBoxRect.width);
2176
- styles.left = coercion.coerceCssPixelValue(boundingBoxRect.left);
2177
- styles.right = coercion.coerceCssPixelValue(boundingBoxRect.right);
2178
- // Push the pane content towards the proper direction.
2179
- if (position.overlayX === 'center') {
2180
- styles.alignItems = 'center';
2181
- }
2182
- else {
2183
- styles.alignItems = position.overlayX === 'end' ? 'flex-end' : 'flex-start';
2184
- }
2185
- if (position.overlayY === 'center') {
2186
- styles.justifyContent = 'center';
2187
- }
2188
- else {
2189
- styles.justifyContent = position.overlayY === 'bottom' ? 'flex-end' : 'flex-start';
2190
- }
2191
- if (maxHeight) {
2192
- styles.maxHeight = coercion.coerceCssPixelValue(maxHeight);
2193
- }
2194
- if (maxWidth) {
2195
- styles.maxWidth = coercion.coerceCssPixelValue(maxWidth);
2196
- }
2197
- }
2198
- this._lastBoundingBoxSize = boundingBoxRect;
2199
- extendStyles(this._boundingBox.style, styles);
2200
- };
2201
- /** Resets the styles for the bounding box so that a new positioning can be computed. */
2202
- FlexibleConnectedPositionStrategy.prototype._resetBoundingBoxStyles = function () {
2203
- extendStyles(this._boundingBox.style, {
2204
- top: '0',
2205
- left: '0',
2206
- right: '0',
2207
- bottom: '0',
2208
- height: '',
2209
- width: '',
2210
- alignItems: '',
2211
- justifyContent: '',
2212
- });
2213
- };
2214
- /** Resets the styles for the overlay pane so that a new positioning can be computed. */
2215
- FlexibleConnectedPositionStrategy.prototype._resetOverlayElementStyles = function () {
2216
- extendStyles(this._pane.style, {
2217
- top: '',
2218
- left: '',
2219
- bottom: '',
2220
- right: '',
2221
- position: '',
2222
- transform: '',
2223
- });
2224
- };
2225
- /** Sets positioning styles to the overlay element. */
2226
- FlexibleConnectedPositionStrategy.prototype._setOverlayElementStyles = function (originPoint, position) {
2227
- var styles = {};
2228
- var hasExactPosition = this._hasExactPosition();
2229
- var hasFlexibleDimensions = this._hasFlexibleDimensions;
2230
- var config = this._overlayRef.getConfig();
2231
- if (hasExactPosition) {
2232
- var scrollPosition = this._viewportRuler.getViewportScrollPosition();
2233
- extendStyles(styles, this._getExactOverlayY(position, originPoint, scrollPosition));
2234
- extendStyles(styles, this._getExactOverlayX(position, originPoint, scrollPosition));
2235
- }
2236
- else {
2237
- styles.position = 'static';
2238
- }
2239
- // Use a transform to apply the offsets. We do this because the `center` positions rely on
2240
- // being in the normal flex flow and setting a `top` / `left` at all will completely throw
2241
- // off the position. We also can't use margins, because they won't have an effect in some
2242
- // cases where the element doesn't have anything to "push off of". Finally, this works
2243
- // better both with flexible and non-flexible positioning.
2244
- var transformString = '';
2245
- var offsetX = this._getOffset(position, 'x');
2246
- var offsetY = this._getOffset(position, 'y');
2247
- if (offsetX) {
2248
- transformString += "translateX(" + offsetX + "px) ";
2249
- }
2250
- if (offsetY) {
2251
- transformString += "translateY(" + offsetY + "px)";
2252
- }
2253
- styles.transform = transformString.trim();
2254
- // If a maxWidth or maxHeight is specified on the overlay, we remove them. We do this because
2255
- // we need these values to both be set to "100%" for the automatic flexible sizing to work.
2256
- // The maxHeight and maxWidth are set on the boundingBox in order to enforce the constraint.
2257
- // Note that this doesn't apply when we have an exact position, in which case we do want to
2258
- // apply them because they'll be cleared from the bounding box.
2259
- if (config.maxHeight) {
2260
- if (hasExactPosition) {
2261
- styles.maxHeight = coercion.coerceCssPixelValue(config.maxHeight);
2262
- }
2263
- else if (hasFlexibleDimensions) {
2264
- styles.maxHeight = '';
2265
- }
2266
- }
2267
- if (config.maxWidth) {
2268
- if (hasExactPosition) {
2269
- styles.maxWidth = coercion.coerceCssPixelValue(config.maxWidth);
2270
- }
2271
- else if (hasFlexibleDimensions) {
2272
- styles.maxWidth = '';
2273
- }
2274
- }
2275
- extendStyles(this._pane.style, styles);
2276
- };
2277
- /** Gets the exact top/bottom for the overlay when not using flexible sizing or when pushing. */
2278
- FlexibleConnectedPositionStrategy.prototype._getExactOverlayY = function (position, originPoint, scrollPosition) {
2279
- // Reset any existing styles. This is necessary in case the
2280
- // preferred position has changed since the last `apply`.
2281
- var styles = { top: '', bottom: '' };
2282
- var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2283
- if (this._isPushed) {
2284
- overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2285
- }
2286
- var virtualKeyboardOffset = this._overlayContainer.getContainerElement().getBoundingClientRect().top;
2287
- // Normally this would be zero, however when the overlay is attached to an input (e.g. in an
2288
- // autocomplete), mobile browsers will shift everything in order to put the input in the middle
2289
- // of the screen and to make space for the virtual keyboard. We need to account for this offset,
2290
- // otherwise our positioning will be thrown off.
2291
- overlayPoint.y -= virtualKeyboardOffset;
2292
- // We want to set either `top` or `bottom` based on whether the overlay wants to appear
2293
- // above or below the origin and the direction in which the element will expand.
2294
- if (position.overlayY === 'bottom') {
2295
- // When using `bottom`, we adjust the y position such that it is the distance
2296
- // from the bottom of the viewport rather than the top.
2297
- var documentHeight = this._document.documentElement.clientHeight;
2298
- styles.bottom = documentHeight - (overlayPoint.y + this._overlayRect.height) + "px";
2299
- }
2300
- else {
2301
- styles.top = coercion.coerceCssPixelValue(overlayPoint.y);
2302
- }
2303
- return styles;
2304
- };
2305
- /** Gets the exact left/right for the overlay when not using flexible sizing or when pushing. */
2306
- FlexibleConnectedPositionStrategy.prototype._getExactOverlayX = function (position, originPoint, scrollPosition) {
2307
- // Reset any existing styles. This is necessary in case the preferred position has
2308
- // changed since the last `apply`.
2309
- var styles = { left: '', right: '' };
2310
- var overlayPoint = this._getOverlayPoint(originPoint, this._overlayRect, position);
2311
- if (this._isPushed) {
2312
- overlayPoint = this._pushOverlayOnScreen(overlayPoint, this._overlayRect, scrollPosition);
2313
- }
2314
- // We want to set either `left` or `right` based on whether the overlay wants to appear "before"
2315
- // or "after" the origin, which determines the direction in which the element will expand.
2316
- // For the horizontal axis, the meaning of "before" and "after" change based on whether the
2317
- // page is in RTL or LTR.
2318
- var horizontalStyleProperty;
2319
- if (this._isRtl()) {
2320
- horizontalStyleProperty = position.overlayX === 'end' ? 'left' : 'right';
2321
- }
2322
- else {
2323
- horizontalStyleProperty = position.overlayX === 'end' ? 'right' : 'left';
2324
- }
2325
- // When we're setting `right`, we adjust the x position such that it is the distance
2326
- // from the right edge of the viewport rather than the left edge.
2327
- if (horizontalStyleProperty === 'right') {
2328
- var documentWidth = this._document.documentElement.clientWidth;
2329
- styles.right = documentWidth - (overlayPoint.x + this._overlayRect.width) + "px";
2330
- }
2331
- else {
2332
- styles.left = coercion.coerceCssPixelValue(overlayPoint.x);
2333
- }
2334
- return styles;
2335
- };
2336
- /**
2337
- * Gets the view properties of the trigger and overlay, including whether they are clipped
2338
- * or completely outside the view of any of the strategy's scrollables.
2339
- */
2340
- FlexibleConnectedPositionStrategy.prototype._getScrollVisibility = function () {
2341
- // Note: needs fresh rects since the position could've changed.
2342
- var originBounds = this._getOriginRect();
2343
- var overlayBounds = this._pane.getBoundingClientRect();
2344
- // TODO(jelbourn): instead of needing all of the client rects for these scrolling containers
2345
- // every time, we should be able to use the scrollTop of the containers if the size of those
2346
- // containers hasn't changed.
2347
- var scrollContainerBounds = this._scrollables.map(function (scrollable) {
2348
- return scrollable.getElementRef().nativeElement.getBoundingClientRect();
2349
- });
2350
- return {
2351
- isOriginClipped: isElementClippedByScrolling(originBounds, scrollContainerBounds),
2352
- isOriginOutsideView: isElementScrolledOutsideView(originBounds, scrollContainerBounds),
2353
- isOverlayClipped: isElementClippedByScrolling(overlayBounds, scrollContainerBounds),
2354
- isOverlayOutsideView: isElementScrolledOutsideView(overlayBounds, scrollContainerBounds),
2355
- };
2356
- };
2357
- /** Subtracts the amount that an element is overflowing on an axis from its length. */
2358
- FlexibleConnectedPositionStrategy.prototype._subtractOverflows = function (length) {
2359
- var overflows = [];
2360
- for (var _i = 1; _i < arguments.length; _i++) {
2361
- overflows[_i - 1] = arguments[_i];
2362
- }
2363
- return overflows.reduce(function (currentValue, currentOverflow) {
2364
- return currentValue - Math.max(currentOverflow, 0);
2365
- }, length);
2366
- };
2367
- /** Narrows the given viewport rect by the current _viewportMargin. */
2368
- FlexibleConnectedPositionStrategy.prototype._getNarrowedViewportRect = function () {
2369
- // We recalculate the viewport rect here ourselves, rather than using the ViewportRuler,
2370
- // because we want to use the `clientWidth` and `clientHeight` as the base. The difference
2371
- // being that the client properties don't include the scrollbar, as opposed to `innerWidth`
2372
- // and `innerHeight` that do. This is necessary, because the overlay container uses
2373
- // 100% `width` and `height` which don't include the scrollbar either.
2374
- var width = this._document.documentElement.clientWidth;
2375
- var height = this._document.documentElement.clientHeight;
2376
- var scrollPosition = this._viewportRuler.getViewportScrollPosition();
2377
- return {
2378
- top: scrollPosition.top + this._viewportMargin,
2379
- left: scrollPosition.left + this._viewportMargin,
2380
- right: scrollPosition.left + width - this._viewportMargin,
2381
- bottom: scrollPosition.top + height - this._viewportMargin,
2382
- width: width - (2 * this._viewportMargin),
2383
- height: height - (2 * this._viewportMargin),
2384
- };
2385
- };
2386
- /** Whether the we're dealing with an RTL context */
2387
- FlexibleConnectedPositionStrategy.prototype._isRtl = function () {
2388
- return this._overlayRef.getDirection() === 'rtl';
2389
- };
2390
- /** Determines whether the overlay uses exact or flexible positioning. */
2391
- FlexibleConnectedPositionStrategy.prototype._hasExactPosition = function () {
2392
- return !this._hasFlexibleDimensions || this._isPushed;
2393
- };
2394
- /** Retrieves the offset of a position along the x or y axis. */
2395
- FlexibleConnectedPositionStrategy.prototype._getOffset = function (position, axis) {
2396
- if (axis === 'x') {
2397
- // We don't do something like `position['offset' + axis]` in
2398
- // order to avoid breking minifiers that rename properties.
2399
- return position.offsetX == null ? this._offsetX : position.offsetX;
2400
- }
2401
- return position.offsetY == null ? this._offsetY : position.offsetY;
2402
- };
2403
- /** Validates that the current position match the expected values. */
2404
- FlexibleConnectedPositionStrategy.prototype._validatePositions = function () {
2405
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
2406
- if (!this._preferredPositions.length) {
2407
- throw Error('FlexibleConnectedPositionStrategy: At least one position is required.');
2408
- }
2409
- // TODO(crisbeto): remove these once Angular's template type
2410
- // checking is advanced enough to catch these cases.
2411
- this._preferredPositions.forEach(function (pair) {
2412
- validateHorizontalPosition('originX', pair.originX);
2413
- validateVerticalPosition('originY', pair.originY);
2414
- validateHorizontalPosition('overlayX', pair.overlayX);
2415
- validateVerticalPosition('overlayY', pair.overlayY);
2416
- });
2417
- }
2418
- };
2419
- /** Adds a single CSS class or an array of classes on the overlay panel. */
2420
- FlexibleConnectedPositionStrategy.prototype._addPanelClasses = function (cssClasses) {
2421
- var _this = this;
2422
- if (this._pane) {
2423
- coercion.coerceArray(cssClasses).forEach(function (cssClass) {
2424
- if (cssClass !== '' && _this._appliedPanelClasses.indexOf(cssClass) === -1) {
2425
- _this._appliedPanelClasses.push(cssClass);
2426
- _this._pane.classList.add(cssClass);
2427
- }
2428
- });
2429
- }
2430
- };
2431
- /** Clears the classes that the position strategy has applied from the overlay panel. */
2432
- FlexibleConnectedPositionStrategy.prototype._clearPanelClasses = function () {
2433
- var _this = this;
2434
- if (this._pane) {
2435
- this._appliedPanelClasses.forEach(function (cssClass) {
2436
- _this._pane.classList.remove(cssClass);
2437
- });
2438
- this._appliedPanelClasses = [];
2439
- }
2440
- };
2441
- /** Returns the ClientRect of the current origin. */
2442
- FlexibleConnectedPositionStrategy.prototype._getOriginRect = function () {
2443
- var origin = this._origin;
2444
- if (origin instanceof i0.ElementRef) {
2445
- return origin.nativeElement.getBoundingClientRect();
2446
- }
2447
- // Check for Element so SVG elements are also supported.
2448
- if (origin instanceof Element) {
2449
- return origin.getBoundingClientRect();
2450
- }
2451
- var width = origin.width || 0;
2452
- var height = origin.height || 0;
2453
- // If the origin is a point, return a client rect as if it was a 0x0 element at the point.
2454
- return {
2455
- top: origin.y,
2456
- bottom: origin.y + height,
2457
- left: origin.x,
2458
- right: origin.x + width,
2459
- height: height,
2460
- width: width
2461
- };
2462
- };
2463
- return FlexibleConnectedPositionStrategy;
2464
- }());
2465
- /** Shallow-extends a stylesheet object with another stylesheet object. */
2466
- function extendStyles(destination, source) {
2467
- for (var key in source) {
2468
- if (source.hasOwnProperty(key)) {
2469
- destination[key] = source[key];
2470
- }
2471
- }
2472
- return destination;
2473
- }
2474
- /**
2475
- * Extracts the pixel value as a number from a value, if it's a number
2476
- * or a CSS pixel string (e.g. `1337px`). Otherwise returns null.
2477
- */
2478
- function getPixelValue(input) {
2479
- if (typeof input !== 'number' && input != null) {
2480
- var _a = __read(input.split(cssUnitPattern), 2), value = _a[0], units = _a[1];
2481
- return (!units || units === 'px') ? parseFloat(value) : null;
2482
- }
2483
- return input || null;
2484
- }
2485
- /**
2486
- * Gets a version of an element's bounding `ClientRect` where all the values are rounded down to
2487
- * the nearest pixel. This allows us to account for the cases where there may be sub-pixel
2488
- * deviations in the `ClientRect` returned by the browser (e.g. when zoomed in with a percentage
2489
- * size, see #21350).
2490
- */
2491
- function getRoundedBoundingClientRect(clientRect) {
2492
- return {
2493
- top: Math.floor(clientRect.top),
2494
- right: Math.floor(clientRect.right),
2495
- bottom: Math.floor(clientRect.bottom),
2496
- left: Math.floor(clientRect.left),
2497
- width: Math.floor(clientRect.width),
2498
- height: Math.floor(clientRect.height)
2499
- };
2500
- }
2501
-
2502
- /**
2503
- * @license
2504
- * Copyright Google LLC All Rights Reserved.
2505
- *
2506
- * Use of this source code is governed by an MIT-style license that can be
2507
- * found in the LICENSE file at https://angular.io/license
2508
- */
2509
- /** Class to be added to the overlay pane wrapper. */
2510
- var wrapperClass = 'cdk-global-overlay-wrapper';
2511
- /**
2512
- * A strategy for positioning overlays. Using this strategy, an overlay is given an
2513
- * explicit position relative to the browser's viewport. We use flexbox, instead of
2514
- * transforms, in order to avoid issues with subpixel rendering which can cause the
2515
- * element to become blurry.
2516
- */
2517
- var GlobalPositionStrategy = /** @class */ (function () {
2518
- function GlobalPositionStrategy() {
2519
- this._cssPosition = 'static';
2520
- this._topOffset = '';
2521
- this._bottomOffset = '';
2522
- this._leftOffset = '';
2523
- this._rightOffset = '';
2524
- this._alignItems = '';
2525
- this._justifyContent = '';
2526
- this._width = '';
2527
- this._height = '';
2528
- }
2529
- GlobalPositionStrategy.prototype.attach = function (overlayRef) {
2530
- var config = overlayRef.getConfig();
2531
- this._overlayRef = overlayRef;
2532
- if (this._width && !config.width) {
2533
- overlayRef.updateSize({ width: this._width });
2534
- }
2535
- if (this._height && !config.height) {
2536
- overlayRef.updateSize({ height: this._height });
2537
- }
2538
- overlayRef.hostElement.classList.add(wrapperClass);
2539
- this._isDisposed = false;
2540
- };
2541
- /**
2542
- * Sets the top position of the overlay. Clears any previously set vertical position.
2543
- * @param value New top offset.
2544
- */
2545
- GlobalPositionStrategy.prototype.top = function (value) {
2546
- if (value === void 0) { value = ''; }
2547
- this._bottomOffset = '';
2548
- this._topOffset = value;
2549
- this._alignItems = 'flex-start';
2550
- return this;
2551
- };
2552
- /**
2553
- * Sets the left position of the overlay. Clears any previously set horizontal position.
2554
- * @param value New left offset.
2555
- */
2556
- GlobalPositionStrategy.prototype.left = function (value) {
2557
- if (value === void 0) { value = ''; }
2558
- this._rightOffset = '';
2559
- this._leftOffset = value;
2560
- this._justifyContent = 'flex-start';
2561
- return this;
2562
- };
2563
- /**
2564
- * Sets the bottom position of the overlay. Clears any previously set vertical position.
2565
- * @param value New bottom offset.
2566
- */
2567
- GlobalPositionStrategy.prototype.bottom = function (value) {
2568
- if (value === void 0) { value = ''; }
2569
- this._topOffset = '';
2570
- this._bottomOffset = value;
2571
- this._alignItems = 'flex-end';
2572
- return this;
2573
- };
2574
- /**
2575
- * Sets the right position of the overlay. Clears any previously set horizontal position.
2576
- * @param value New right offset.
2577
- */
2578
- GlobalPositionStrategy.prototype.right = function (value) {
2579
- if (value === void 0) { value = ''; }
2580
- this._leftOffset = '';
2581
- this._rightOffset = value;
2582
- this._justifyContent = 'flex-end';
2583
- return this;
2584
- };
2585
- /**
2586
- * Sets the overlay width and clears any previously set width.
2587
- * @param value New width for the overlay
2588
- * @deprecated Pass the `width` through the `OverlayConfig`.
2589
- * @breaking-change 8.0.0
2590
- */
2591
- GlobalPositionStrategy.prototype.width = function (value) {
2592
- if (value === void 0) { value = ''; }
2593
- if (this._overlayRef) {
2594
- this._overlayRef.updateSize({ width: value });
2595
- }
2596
- else {
2597
- this._width = value;
2598
- }
2599
- return this;
2600
- };
2601
- /**
2602
- * Sets the overlay height and clears any previously set height.
2603
- * @param value New height for the overlay
2604
- * @deprecated Pass the `height` through the `OverlayConfig`.
2605
- * @breaking-change 8.0.0
2606
- */
2607
- GlobalPositionStrategy.prototype.height = function (value) {
2608
- if (value === void 0) { value = ''; }
2609
- if (this._overlayRef) {
2610
- this._overlayRef.updateSize({ height: value });
2611
- }
2612
- else {
2613
- this._height = value;
2614
- }
2615
- return this;
2616
- };
2617
- /**
2618
- * Centers the overlay horizontally with an optional offset.
2619
- * Clears any previously set horizontal position.
2620
- *
2621
- * @param offset Overlay offset from the horizontal center.
2622
- */
2623
- GlobalPositionStrategy.prototype.centerHorizontally = function (offset) {
2624
- if (offset === void 0) { offset = ''; }
2625
- this.left(offset);
2626
- this._justifyContent = 'center';
2627
- return this;
2628
- };
2629
- /**
2630
- * Centers the overlay vertically with an optional offset.
2631
- * Clears any previously set vertical position.
2632
- *
2633
- * @param offset Overlay offset from the vertical center.
2634
- */
2635
- GlobalPositionStrategy.prototype.centerVertically = function (offset) {
2636
- if (offset === void 0) { offset = ''; }
2637
- this.top(offset);
2638
- this._alignItems = 'center';
2639
- return this;
2640
- };
2641
- /**
2642
- * Apply the position to the element.
2643
- * @docs-private
2644
- */
2645
- GlobalPositionStrategy.prototype.apply = function () {
2646
- // Since the overlay ref applies the strategy asynchronously, it could
2647
- // have been disposed before it ends up being applied. If that is the
2648
- // case, we shouldn't do anything.
2649
- if (!this._overlayRef || !this._overlayRef.hasAttached()) {
2650
- return;
2651
- }
2652
- var styles = this._overlayRef.overlayElement.style;
2653
- var parentStyles = this._overlayRef.hostElement.style;
2654
- var config = this._overlayRef.getConfig();
2655
- var width = config.width, height = config.height, maxWidth = config.maxWidth, maxHeight = config.maxHeight;
2656
- var shouldBeFlushHorizontally = (width === '100%' || width === '100vw') &&
2657
- (!maxWidth || maxWidth === '100%' || maxWidth === '100vw');
2658
- var shouldBeFlushVertically = (height === '100%' || height === '100vh') &&
2659
- (!maxHeight || maxHeight === '100%' || maxHeight === '100vh');
2660
- styles.position = this._cssPosition;
2661
- styles.marginLeft = shouldBeFlushHorizontally ? '0' : this._leftOffset;
2662
- styles.marginTop = shouldBeFlushVertically ? '0' : this._topOffset;
2663
- styles.marginBottom = this._bottomOffset;
2664
- styles.marginRight = this._rightOffset;
2665
- if (shouldBeFlushHorizontally) {
2666
- parentStyles.justifyContent = 'flex-start';
2667
- }
2668
- else if (this._justifyContent === 'center') {
2669
- parentStyles.justifyContent = 'center';
2670
- }
2671
- else if (this._overlayRef.getConfig().direction === 'rtl') {
2672
- // In RTL the browser will invert `flex-start` and `flex-end` automatically, but we
2673
- // don't want that because our positioning is explicitly `left` and `right`, hence
2674
- // why we do another inversion to ensure that the overlay stays in the same position.
2675
- // TODO: reconsider this if we add `start` and `end` methods.
2676
- if (this._justifyContent === 'flex-start') {
2677
- parentStyles.justifyContent = 'flex-end';
2678
- }
2679
- else if (this._justifyContent === 'flex-end') {
2680
- parentStyles.justifyContent = 'flex-start';
2681
- }
2682
- }
2683
- else {
2684
- parentStyles.justifyContent = this._justifyContent;
2685
- }
2686
- parentStyles.alignItems = shouldBeFlushVertically ? 'flex-start' : this._alignItems;
2687
- };
2688
- /**
2689
- * Cleans up the DOM changes from the position strategy.
2690
- * @docs-private
2691
- */
2692
- GlobalPositionStrategy.prototype.dispose = function () {
2693
- if (this._isDisposed || !this._overlayRef) {
2694
- return;
2695
- }
2696
- var styles = this._overlayRef.overlayElement.style;
2697
- var parent = this._overlayRef.hostElement;
2698
- var parentStyles = parent.style;
2699
- parent.classList.remove(wrapperClass);
2700
- parentStyles.justifyContent = parentStyles.alignItems = styles.marginTop =
2701
- styles.marginBottom = styles.marginLeft = styles.marginRight = styles.position = '';
2702
- this._overlayRef = null;
2703
- this._isDisposed = true;
2704
- };
2705
- return GlobalPositionStrategy;
2706
- }());
2707
-
2708
- /**
2709
- * @license
2710
- * Copyright Google LLC All Rights Reserved.
2711
- *
2712
- * Use of this source code is governed by an MIT-style license that can be
2713
- * found in the LICENSE file at https://angular.io/license
2714
- */
2715
- /** Builder for overlay position strategy. */
2716
- var OverlayPositionBuilder = /** @class */ (function () {
2717
- function OverlayPositionBuilder(_viewportRuler, _document, _platform, _overlayContainer) {
2718
- this._viewportRuler = _viewportRuler;
2719
- this._document = _document;
2720
- this._platform = _platform;
2721
- this._overlayContainer = _overlayContainer;
2722
- }
2723
- /**
2724
- * Creates a global position strategy.
2725
- */
2726
- OverlayPositionBuilder.prototype.global = function () {
2727
- return new GlobalPositionStrategy();
2728
- };
2729
- /**
2730
- * Creates a flexible position strategy.
2731
- * @param origin Origin relative to which to position the overlay.
2732
- */
2733
- OverlayPositionBuilder.prototype.flexibleConnectedTo = function (origin) {
2734
- return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
2735
- };
2736
- return OverlayPositionBuilder;
2737
- }());
2738
- OverlayPositionBuilder.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function OverlayPositionBuilder_Factory() { return new OverlayPositionBuilder(i0__namespace.ɵɵinject(i1__namespace.ViewportRuler), i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT), i0__namespace.ɵɵinject(i2__namespace.Platform), i0__namespace.ɵɵinject(OverlayContainer)); }, token: OverlayPositionBuilder, providedIn: "root" });
2739
- OverlayPositionBuilder.decorators = [
2740
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2741
- ];
2742
- OverlayPositionBuilder.ctorParameters = function () { return [
2743
- { type: i1.ViewportRuler },
2744
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
2745
- { type: i2.Platform },
2746
- { type: OverlayContainer }
2747
- ]; };
2748
-
2749
- /**
2750
- * @license
2751
- * Copyright Google LLC All Rights Reserved.
2752
- *
2753
- * Use of this source code is governed by an MIT-style license that can be
2754
- * found in the LICENSE file at https://angular.io/license
2755
- */
2756
- /** Next overlay unique ID. */
2757
- var nextUniqueId = 0;
2758
- // Note that Overlay is *not* scoped to the app root because of the ComponentFactoryResolver
2759
- // which needs to be different depending on where OverlayModule is imported.
2760
- /**
2761
- * Service to create Overlays. Overlays are dynamically added pieces of floating UI, meant to be
2762
- * used as a low-level building block for other components. Dialogs, tooltips, menus,
2763
- * selects, etc. can all be built using overlays. The service should primarily be used by authors
2764
- * of re-usable components rather than developers building end-user applications.
2765
- *
2766
- * An overlay *is* a PortalOutlet, so any kind of Portal can be loaded into one.
2767
- */
2768
- var Overlay = /** @class */ (function () {
2769
- function Overlay(
2770
- /** Scrolling strategies that can be used when creating an overlay. */
2771
- scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality, _location, _outsideClickDispatcher) {
2772
- this.scrollStrategies = scrollStrategies;
2773
- this._overlayContainer = _overlayContainer;
2774
- this._componentFactoryResolver = _componentFactoryResolver;
2775
- this._positionBuilder = _positionBuilder;
2776
- this._keyboardDispatcher = _keyboardDispatcher;
2777
- this._injector = _injector;
2778
- this._ngZone = _ngZone;
2779
- this._document = _document;
2780
- this._directionality = _directionality;
2781
- this._location = _location;
2782
- this._outsideClickDispatcher = _outsideClickDispatcher;
2783
- }
2784
- /**
2785
- * Creates an overlay.
2786
- * @param config Configuration applied to the overlay.
2787
- * @returns Reference to the created overlay.
2788
- */
2789
- Overlay.prototype.create = function (config) {
2790
- var host = this._createHostElement();
2791
- var pane = this._createPaneElement(host);
2792
- var portalOutlet = this._createPortalOutlet(pane);
2793
- var overlayConfig = new OverlayConfig(config);
2794
- overlayConfig.direction = overlayConfig.direction || this._directionality.value;
2795
- return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher);
2796
- };
2797
- /**
2798
- * Gets a position builder that can be used, via fluent API,
2799
- * to construct and configure a position strategy.
2800
- * @returns An overlay position builder.
2801
- */
2802
- Overlay.prototype.position = function () {
2803
- return this._positionBuilder;
2804
- };
2805
- /**
2806
- * Creates the DOM element for an overlay and appends it to the overlay container.
2807
- * @returns Newly-created pane element
2808
- */
2809
- Overlay.prototype._createPaneElement = function (host) {
2810
- var pane = this._document.createElement('div');
2811
- pane.id = "cdk-overlay-" + nextUniqueId++;
2812
- pane.classList.add('cdk-overlay-pane');
2813
- host.appendChild(pane);
2814
- return pane;
2815
- };
2816
- /**
2817
- * Creates the host element that wraps around an overlay
2818
- * and can be used for advanced positioning.
2819
- * @returns Newly-create host element.
2820
- */
2821
- Overlay.prototype._createHostElement = function () {
2822
- var host = this._document.createElement('div');
2823
- this._overlayContainer.getContainerElement().appendChild(host);
2824
- return host;
2825
- };
2826
- /**
2827
- * Create a DomPortalOutlet into which the overlay content can be loaded.
2828
- * @param pane The DOM element to turn into a portal outlet.
2829
- * @returns A portal outlet for the given DOM element.
2830
- */
2831
- Overlay.prototype._createPortalOutlet = function (pane) {
2832
- // We have to resolve the ApplicationRef later in order to allow people
2833
- // to use overlay-based providers during app initialization.
2834
- if (!this._appRef) {
2835
- this._appRef = this._injector.get(i0.ApplicationRef);
2836
- }
2837
- return new portal.DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
2838
- };
2839
- return Overlay;
2840
- }());
2841
- Overlay.decorators = [
2842
- { type: i0.Injectable }
2843
- ];
2844
- Overlay.ctorParameters = function () { return [
2845
- { type: ScrollStrategyOptions },
2846
- { type: OverlayContainer },
2847
- { type: i0.ComponentFactoryResolver },
2848
- { type: OverlayPositionBuilder },
2849
- { type: OverlayKeyboardDispatcher },
2850
- { type: i0.Injector },
2851
- { type: i0.NgZone },
2852
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
2853
- { type: bidi.Directionality },
2854
- { type: i1$1.Location },
2855
- { type: OverlayOutsideClickDispatcher }
2856
- ]; };
2857
-
2858
- /**
2859
- * @license
2860
- * Copyright Google LLC All Rights Reserved.
2861
- *
2862
- * Use of this source code is governed by an MIT-style license that can be
2863
- * found in the LICENSE file at https://angular.io/license
2864
- */
2865
- /** Default set of positions for the overlay. Follows the behavior of a dropdown. */
2866
- var defaultPositionList = [
2867
- {
2868
- originX: 'start',
2869
- originY: 'bottom',
2870
- overlayX: 'start',
2871
- overlayY: 'top'
2872
- },
2873
- {
2874
- originX: 'start',
2875
- originY: 'top',
2876
- overlayX: 'start',
2877
- overlayY: 'bottom'
2878
- },
2879
- {
2880
- originX: 'end',
2881
- originY: 'top',
2882
- overlayX: 'end',
2883
- overlayY: 'bottom'
2884
- },
2885
- {
2886
- originX: 'end',
2887
- originY: 'bottom',
2888
- overlayX: 'end',
2889
- overlayY: 'top'
2890
- }
2891
- ];
2892
- /** Injection token that determines the scroll handling while the connected overlay is open. */
2893
- var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY = new i0.InjectionToken('cdk-connected-overlay-scroll-strategy');
2894
- /**
2895
- * Directive applied to an element to make it usable as an origin for an Overlay using a
2896
- * ConnectedPositionStrategy.
2897
- */
2898
- var CdkOverlayOrigin = /** @class */ (function () {
2899
- function CdkOverlayOrigin(
2900
- /** Reference to the element on which the directive is applied. */
2901
- elementRef) {
2902
- this.elementRef = elementRef;
2903
- }
2904
- return CdkOverlayOrigin;
2905
- }());
2906
- CdkOverlayOrigin.decorators = [
2907
- { type: i0.Directive, args: [{
2908
- selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
2909
- exportAs: 'cdkOverlayOrigin',
2910
- },] }
2911
- ];
2912
- CdkOverlayOrigin.ctorParameters = function () { return [
2913
- { type: i0.ElementRef }
2914
- ]; };
2915
- /**
2916
- * Directive to facilitate declarative creation of an
2917
- * Overlay using a FlexibleConnectedPositionStrategy.
2918
- */
2919
- var CdkConnectedOverlay = /** @class */ (function () {
2920
- // TODO(jelbourn): inputs for size, scroll behavior, animation, etc.
2921
- function CdkConnectedOverlay(_overlay, templateRef, viewContainerRef, scrollStrategyFactory, _dir) {
2922
- this._overlay = _overlay;
2923
- this._dir = _dir;
2924
- this._hasBackdrop = false;
2925
- this._lockPosition = false;
2926
- this._growAfterOpen = false;
2927
- this._flexibleDimensions = false;
2928
- this._push = false;
2929
- this._backdropSubscription = rxjs.Subscription.EMPTY;
2930
- this._attachSubscription = rxjs.Subscription.EMPTY;
2931
- this._detachSubscription = rxjs.Subscription.EMPTY;
2932
- this._positionSubscription = rxjs.Subscription.EMPTY;
2933
- /** Margin between the overlay and the viewport edges. */
2934
- this.viewportMargin = 0;
2935
- /** Whether the overlay is open. */
2936
- this.open = false;
2937
- /** Whether the overlay can be closed by user interaction. */
2938
- this.disableClose = false;
2939
- /** Event emitted when the backdrop is clicked. */
2940
- this.backdropClick = new i0.EventEmitter();
2941
- /** Event emitted when the position has changed. */
2942
- this.positionChange = new i0.EventEmitter();
2943
- /** Event emitted when the overlay has been attached. */
2944
- this.attach = new i0.EventEmitter();
2945
- /** Event emitted when the overlay has been detached. */
2946
- this.detach = new i0.EventEmitter();
2947
- /** Emits when there are keyboard events that are targeted at the overlay. */
2948
- this.overlayKeydown = new i0.EventEmitter();
2949
- /** Emits when there are mouse outside click events that are targeted at the overlay. */
2950
- this.overlayOutsideClick = new i0.EventEmitter();
2951
- this._templatePortal = new portal.TemplatePortal(templateRef, viewContainerRef);
2952
- this._scrollStrategyFactory = scrollStrategyFactory;
2953
- this.scrollStrategy = this._scrollStrategyFactory();
2954
- }
2955
- Object.defineProperty(CdkConnectedOverlay.prototype, "offsetX", {
2956
- /** The offset in pixels for the overlay connection point on the x-axis */
2957
- get: function () { return this._offsetX; },
2958
- set: function (offsetX) {
2959
- this._offsetX = offsetX;
2960
- if (this._position) {
2961
- this._updatePositionStrategy(this._position);
2962
- }
2963
- },
2964
- enumerable: false,
2965
- configurable: true
2966
- });
2967
- Object.defineProperty(CdkConnectedOverlay.prototype, "offsetY", {
2968
- /** The offset in pixels for the overlay connection point on the y-axis */
2969
- get: function () { return this._offsetY; },
2970
- set: function (offsetY) {
2971
- this._offsetY = offsetY;
2972
- if (this._position) {
2973
- this._updatePositionStrategy(this._position);
2974
- }
2975
- },
2976
- enumerable: false,
2977
- configurable: true
2978
- });
2979
- Object.defineProperty(CdkConnectedOverlay.prototype, "hasBackdrop", {
2980
- /** Whether or not the overlay should attach a backdrop. */
2981
- get: function () { return this._hasBackdrop; },
2982
- set: function (value) { this._hasBackdrop = coercion.coerceBooleanProperty(value); },
2983
- enumerable: false,
2984
- configurable: true
2985
- });
2986
- Object.defineProperty(CdkConnectedOverlay.prototype, "lockPosition", {
2987
- /** Whether or not the overlay should be locked when scrolling. */
2988
- get: function () { return this._lockPosition; },
2989
- set: function (value) { this._lockPosition = coercion.coerceBooleanProperty(value); },
2990
- enumerable: false,
2991
- configurable: true
2992
- });
2993
- Object.defineProperty(CdkConnectedOverlay.prototype, "flexibleDimensions", {
2994
- /** Whether the overlay's width and height can be constrained to fit within the viewport. */
2995
- get: function () { return this._flexibleDimensions; },
2996
- set: function (value) {
2997
- this._flexibleDimensions = coercion.coerceBooleanProperty(value);
2998
- },
2999
- enumerable: false,
3000
- configurable: true
3001
- });
3002
- Object.defineProperty(CdkConnectedOverlay.prototype, "growAfterOpen", {
3003
- /** Whether the overlay can grow after the initial open when flexible positioning is turned on. */
3004
- get: function () { return this._growAfterOpen; },
3005
- set: function (value) { this._growAfterOpen = coercion.coerceBooleanProperty(value); },
3006
- enumerable: false,
3007
- configurable: true
3008
- });
3009
- Object.defineProperty(CdkConnectedOverlay.prototype, "push", {
3010
- /** Whether the overlay can be pushed on-screen if none of the provided positions fit. */
3011
- get: function () { return this._push; },
3012
- set: function (value) { this._push = coercion.coerceBooleanProperty(value); },
3013
- enumerable: false,
3014
- configurable: true
3015
- });
3016
- Object.defineProperty(CdkConnectedOverlay.prototype, "overlayRef", {
3017
- /** The associated overlay reference. */
3018
- get: function () {
3019
- return this._overlayRef;
3020
- },
3021
- enumerable: false,
3022
- configurable: true
3023
- });
3024
- Object.defineProperty(CdkConnectedOverlay.prototype, "dir", {
3025
- /** The element's layout direction. */
3026
- get: function () {
3027
- return this._dir ? this._dir.value : 'ltr';
3028
- },
3029
- enumerable: false,
3030
- configurable: true
3031
- });
3032
- CdkConnectedOverlay.prototype.ngOnDestroy = function () {
3033
- this._attachSubscription.unsubscribe();
3034
- this._detachSubscription.unsubscribe();
3035
- this._backdropSubscription.unsubscribe();
3036
- this._positionSubscription.unsubscribe();
3037
- if (this._overlayRef) {
3038
- this._overlayRef.dispose();
3039
- }
3040
- };
3041
- CdkConnectedOverlay.prototype.ngOnChanges = function (changes) {
3042
- if (this._position) {
3043
- this._updatePositionStrategy(this._position);
3044
- this._overlayRef.updateSize({
3045
- width: this.width,
3046
- minWidth: this.minWidth,
3047
- height: this.height,
3048
- minHeight: this.minHeight,
3049
- });
3050
- if (changes['origin'] && this.open) {
3051
- this._position.apply();
3052
- }
3053
- }
3054
- if (changes['open']) {
3055
- this.open ? this._attachOverlay() : this._detachOverlay();
3056
- }
3057
- };
3058
- /** Creates an overlay */
3059
- CdkConnectedOverlay.prototype._createOverlay = function () {
3060
- var _this = this;
3061
- if (!this.positions || !this.positions.length) {
3062
- this.positions = defaultPositionList;
3063
- }
3064
- var overlayRef = this._overlayRef = this._overlay.create(this._buildConfig());
3065
- this._attachSubscription = overlayRef.attachments().subscribe(function () { return _this.attach.emit(); });
3066
- this._detachSubscription = overlayRef.detachments().subscribe(function () { return _this.detach.emit(); });
3067
- overlayRef.keydownEvents().subscribe(function (event) {
3068
- _this.overlayKeydown.next(event);
3069
- if (event.keyCode === keycodes.ESCAPE && !_this.disableClose && !keycodes.hasModifierKey(event)) {
3070
- event.preventDefault();
3071
- _this._detachOverlay();
3072
- }
3073
- });
3074
- this._overlayRef.outsidePointerEvents().subscribe(function (event) {
3075
- _this.overlayOutsideClick.next(event);
3076
- });
3077
- };
3078
- /** Builds the overlay config based on the directive's inputs */
3079
- CdkConnectedOverlay.prototype._buildConfig = function () {
3080
- var positionStrategy = this._position =
3081
- this.positionStrategy || this._createPositionStrategy();
3082
- var overlayConfig = new OverlayConfig({
3083
- direction: this._dir,
3084
- positionStrategy: positionStrategy,
3085
- scrollStrategy: this.scrollStrategy,
3086
- hasBackdrop: this.hasBackdrop
3087
- });
3088
- if (this.width || this.width === 0) {
3089
- overlayConfig.width = this.width;
3090
- }
3091
- if (this.height || this.height === 0) {
3092
- overlayConfig.height = this.height;
3093
- }
3094
- if (this.minWidth || this.minWidth === 0) {
3095
- overlayConfig.minWidth = this.minWidth;
3096
- }
3097
- if (this.minHeight || this.minHeight === 0) {
3098
- overlayConfig.minHeight = this.minHeight;
3099
- }
3100
- if (this.backdropClass) {
3101
- overlayConfig.backdropClass = this.backdropClass;
3102
- }
3103
- if (this.panelClass) {
3104
- overlayConfig.panelClass = this.panelClass;
3105
- }
3106
- return overlayConfig;
3107
- };
3108
- /** Updates the state of a position strategy, based on the values of the directive inputs. */
3109
- CdkConnectedOverlay.prototype._updatePositionStrategy = function (positionStrategy) {
3110
- var _this = this;
3111
- var positions = this.positions.map(function (currentPosition) { return ({
3112
- originX: currentPosition.originX,
3113
- originY: currentPosition.originY,
3114
- overlayX: currentPosition.overlayX,
3115
- overlayY: currentPosition.overlayY,
3116
- offsetX: currentPosition.offsetX || _this.offsetX,
3117
- offsetY: currentPosition.offsetY || _this.offsetY,
3118
- panelClass: currentPosition.panelClass || undefined,
3119
- }); });
3120
- return positionStrategy.setOrigin(this._getFlexibleConnectedPositionStrategyOrigin())
3121
- .withPositions(positions)
3122
- .withFlexibleDimensions(this.flexibleDimensions)
3123
- .withPush(this.push)
3124
- .withGrowAfterOpen(this.growAfterOpen)
3125
- .withViewportMargin(this.viewportMargin)
3126
- .withLockedPosition(this.lockPosition)
3127
- .withTransformOriginOn(this.transformOriginSelector);
3128
- };
3129
- /** Returns the position strategy of the overlay to be set on the overlay config */
3130
- CdkConnectedOverlay.prototype._createPositionStrategy = function () {
3131
- var strategy = this._overlay.position().flexibleConnectedTo(this._getFlexibleConnectedPositionStrategyOrigin());
3132
- this._updatePositionStrategy(strategy);
3133
- return strategy;
3134
- };
3135
- CdkConnectedOverlay.prototype._getFlexibleConnectedPositionStrategyOrigin = function () {
3136
- if (this.origin instanceof CdkOverlayOrigin) {
3137
- return this.origin.elementRef;
3138
- }
3139
- else {
3140
- return this.origin;
3141
- }
3142
- };
3143
- /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
3144
- CdkConnectedOverlay.prototype._attachOverlay = function () {
3145
- var _this = this;
3146
- if (!this._overlayRef) {
3147
- this._createOverlay();
3148
- }
3149
- else {
3150
- // Update the overlay size, in case the directive's inputs have changed
3151
- this._overlayRef.getConfig().hasBackdrop = this.hasBackdrop;
3152
- }
3153
- if (!this._overlayRef.hasAttached()) {
3154
- this._overlayRef.attach(this._templatePortal);
3155
- }
3156
- if (this.hasBackdrop) {
3157
- this._backdropSubscription = this._overlayRef.backdropClick().subscribe(function (event) {
3158
- _this.backdropClick.emit(event);
3159
- });
3160
- }
3161
- else {
3162
- this._backdropSubscription.unsubscribe();
3163
- }
3164
- this._positionSubscription.unsubscribe();
3165
- // Only subscribe to `positionChanges` if requested, because putting
3166
- // together all the information for it can be expensive.
3167
- if (this.positionChange.observers.length > 0) {
3168
- this._positionSubscription = this._position.positionChanges
3169
- .pipe(operators.takeWhile(function () { return _this.positionChange.observers.length > 0; }))
3170
- .subscribe(function (position) {
3171
- _this.positionChange.emit(position);
3172
- if (_this.positionChange.observers.length === 0) {
3173
- _this._positionSubscription.unsubscribe();
3174
- }
3175
- });
3176
- }
3177
- };
3178
- /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
3179
- CdkConnectedOverlay.prototype._detachOverlay = function () {
3180
- if (this._overlayRef) {
3181
- this._overlayRef.detach();
3182
- }
3183
- this._backdropSubscription.unsubscribe();
3184
- this._positionSubscription.unsubscribe();
3185
- };
3186
- return CdkConnectedOverlay;
3187
- }());
3188
- CdkConnectedOverlay.decorators = [
3189
- { type: i0.Directive, args: [{
3190
- selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
3191
- exportAs: 'cdkConnectedOverlay'
3192
- },] }
3193
- ];
3194
- CdkConnectedOverlay.ctorParameters = function () { return [
3195
- { type: Overlay },
3196
- { type: i0.TemplateRef },
3197
- { type: i0.ViewContainerRef },
3198
- { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,] }] },
3199
- { type: bidi.Directionality, decorators: [{ type: i0.Optional }] }
3200
- ]; };
3201
- CdkConnectedOverlay.propDecorators = {
3202
- origin: [{ type: i0.Input, args: ['cdkConnectedOverlayOrigin',] }],
3203
- positions: [{ type: i0.Input, args: ['cdkConnectedOverlayPositions',] }],
3204
- positionStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayPositionStrategy',] }],
3205
- offsetX: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetX',] }],
3206
- offsetY: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetY',] }],
3207
- width: [{ type: i0.Input, args: ['cdkConnectedOverlayWidth',] }],
3208
- height: [{ type: i0.Input, args: ['cdkConnectedOverlayHeight',] }],
3209
- minWidth: [{ type: i0.Input, args: ['cdkConnectedOverlayMinWidth',] }],
3210
- minHeight: [{ type: i0.Input, args: ['cdkConnectedOverlayMinHeight',] }],
3211
- backdropClass: [{ type: i0.Input, args: ['cdkConnectedOverlayBackdropClass',] }],
3212
- panelClass: [{ type: i0.Input, args: ['cdkConnectedOverlayPanelClass',] }],
3213
- viewportMargin: [{ type: i0.Input, args: ['cdkConnectedOverlayViewportMargin',] }],
3214
- scrollStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayScrollStrategy',] }],
3215
- open: [{ type: i0.Input, args: ['cdkConnectedOverlayOpen',] }],
3216
- disableClose: [{ type: i0.Input, args: ['cdkConnectedOverlayDisableClose',] }],
3217
- transformOriginSelector: [{ type: i0.Input, args: ['cdkConnectedOverlayTransformOriginOn',] }],
3218
- hasBackdrop: [{ type: i0.Input, args: ['cdkConnectedOverlayHasBackdrop',] }],
3219
- lockPosition: [{ type: i0.Input, args: ['cdkConnectedOverlayLockPosition',] }],
3220
- flexibleDimensions: [{ type: i0.Input, args: ['cdkConnectedOverlayFlexibleDimensions',] }],
3221
- growAfterOpen: [{ type: i0.Input, args: ['cdkConnectedOverlayGrowAfterOpen',] }],
3222
- push: [{ type: i0.Input, args: ['cdkConnectedOverlayPush',] }],
3223
- backdropClick: [{ type: i0.Output }],
3224
- positionChange: [{ type: i0.Output }],
3225
- attach: [{ type: i0.Output }],
3226
- detach: [{ type: i0.Output }],
3227
- overlayKeydown: [{ type: i0.Output }],
3228
- overlayOutsideClick: [{ type: i0.Output }]
3229
- };
3230
- /** @docs-private */
3231
- function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
3232
- return function () { return overlay.scrollStrategies.reposition(); };
3233
- }
3234
- /** @docs-private */
3235
- var CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER = {
3236
- provide: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,
3237
- deps: [Overlay],
3238
- useFactory: CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY,
3239
- };
3240
-
3241
- /**
3242
- * @license
3243
- * Copyright Google LLC All Rights Reserved.
3244
- *
3245
- * Use of this source code is governed by an MIT-style license that can be
3246
- * found in the LICENSE file at https://angular.io/license
3247
- */
3248
- var OverlayModule = /** @class */ (function () {
3249
- function OverlayModule() {
3250
- }
3251
- return OverlayModule;
3252
- }());
3253
- OverlayModule.decorators = [
3254
- { type: i0.NgModule, args: [{
3255
- imports: [bidi.BidiModule, portal.PortalModule, i1.ScrollingModule],
3256
- exports: [CdkConnectedOverlay, CdkOverlayOrigin, i1.ScrollingModule],
3257
- declarations: [CdkConnectedOverlay, CdkOverlayOrigin],
3258
- providers: [
3259
- Overlay,
3260
- CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
3261
- ],
3262
- },] }
3263
- ];
3264
-
3265
- /**
3266
- * @license
3267
- * Copyright Google LLC All Rights Reserved.
3268
- *
3269
- * Use of this source code is governed by an MIT-style license that can be
3270
- * found in the LICENSE file at https://angular.io/license
3271
- */
3272
-
3273
- /**
3274
- * Alternative to OverlayContainer that supports correct displaying of overlay elements in
3275
- * Fullscreen mode
3276
- * https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen
3277
- *
3278
- * Should be provided in the root component.
3279
- */
3280
- var FullscreenOverlayContainer = /** @class */ (function (_super) {
3281
- __extends(FullscreenOverlayContainer, _super);
3282
- function FullscreenOverlayContainer(_document, platform) {
3283
- return _super.call(this, _document, platform) || this;
3284
- }
3285
- FullscreenOverlayContainer.prototype.ngOnDestroy = function () {
3286
- _super.prototype.ngOnDestroy.call(this);
3287
- if (this._fullScreenEventName && this._fullScreenListener) {
3288
- this._document.removeEventListener(this._fullScreenEventName, this._fullScreenListener);
3289
- }
3290
- };
3291
- FullscreenOverlayContainer.prototype._createContainer = function () {
3292
- var _this = this;
3293
- _super.prototype._createContainer.call(this);
3294
- this._adjustParentForFullscreenChange();
3295
- this._addFullscreenChangeListener(function () { return _this._adjustParentForFullscreenChange(); });
3296
- };
3297
- FullscreenOverlayContainer.prototype._adjustParentForFullscreenChange = function () {
3298
- if (!this._containerElement) {
3299
- return;
3300
- }
3301
- var fullscreenElement = this.getFullscreenElement();
3302
- var parent = fullscreenElement || this._document.body;
3303
- parent.appendChild(this._containerElement);
3304
- };
3305
- FullscreenOverlayContainer.prototype._addFullscreenChangeListener = function (fn) {
3306
- var eventName = this._getEventName();
3307
- if (eventName) {
3308
- if (this._fullScreenListener) {
3309
- this._document.removeEventListener(eventName, this._fullScreenListener);
3310
- }
3311
- this._document.addEventListener(eventName, fn);
3312
- this._fullScreenListener = fn;
3313
- }
3314
- };
3315
- FullscreenOverlayContainer.prototype._getEventName = function () {
3316
- if (!this._fullScreenEventName) {
3317
- var _document = this._document;
3318
- if (_document.fullscreenEnabled) {
3319
- this._fullScreenEventName = 'fullscreenchange';
3320
- }
3321
- else if (_document.webkitFullscreenEnabled) {
3322
- this._fullScreenEventName = 'webkitfullscreenchange';
3323
- }
3324
- else if (_document.mozFullScreenEnabled) {
3325
- this._fullScreenEventName = 'mozfullscreenchange';
3326
- }
3327
- else if (_document.msFullscreenEnabled) {
3328
- this._fullScreenEventName = 'MSFullscreenChange';
3329
- }
3330
- }
3331
- return this._fullScreenEventName;
3332
- };
3333
- /**
3334
- * When the page is put into fullscreen mode, a specific element is specified.
3335
- * Only that element and its children are visible when in fullscreen mode.
3336
- */
3337
- FullscreenOverlayContainer.prototype.getFullscreenElement = function () {
3338
- var _document = this._document;
3339
- return _document.fullscreenElement ||
3340
- _document.webkitFullscreenElement ||
3341
- _document.mozFullScreenElement ||
3342
- _document.msFullscreenElement ||
3343
- null;
3344
- };
3345
- return FullscreenOverlayContainer;
3346
- }(OverlayContainer));
3347
- FullscreenOverlayContainer.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(i0__namespace.ɵɵinject(i1__namespace$1.DOCUMENT), i0__namespace.ɵɵinject(i2__namespace.Platform)); }, token: FullscreenOverlayContainer, providedIn: "root" });
3348
- FullscreenOverlayContainer.decorators = [
3349
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3350
- ];
3351
- FullscreenOverlayContainer.ctorParameters = function () { return [
3352
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
3353
- { type: i2.Platform }
3354
- ]; };
3355
-
3356
- /**
3357
- * @license
3358
- * Copyright Google LLC All Rights Reserved.
3359
- *
3360
- * Use of this source code is governed by an MIT-style license that can be
3361
- * found in the LICENSE file at https://angular.io/license
3362
- */
3363
-
3364
- /**
3365
- * Generated bundle index. Do not edit.
3366
- */
3367
-
3368
- Object.defineProperty(exports, 'CdkScrollable', {
3369
- enumerable: true,
3370
- get: function () {
3371
- return i1.CdkScrollable;
3372
- }
3373
- });
3374
- Object.defineProperty(exports, 'ScrollDispatcher', {
3375
- enumerable: true,
3376
- get: function () {
3377
- return i1.ScrollDispatcher;
3378
- }
3379
- });
3380
- Object.defineProperty(exports, 'ViewportRuler', {
3381
- enumerable: true,
3382
- get: function () {
3383
- return i1.ViewportRuler;
3384
- }
3385
- });
3386
- exports.BlockScrollStrategy = BlockScrollStrategy;
3387
- exports.CdkConnectedOverlay = CdkConnectedOverlay;
3388
- exports.CdkOverlayOrigin = CdkOverlayOrigin;
3389
- exports.CloseScrollStrategy = CloseScrollStrategy;
3390
- exports.ConnectedOverlayPositionChange = ConnectedOverlayPositionChange;
3391
- exports.ConnectionPositionPair = ConnectionPositionPair;
3392
- exports.FlexibleConnectedPositionStrategy = FlexibleConnectedPositionStrategy;
3393
- exports.FullscreenOverlayContainer = FullscreenOverlayContainer;
3394
- exports.GlobalPositionStrategy = GlobalPositionStrategy;
3395
- exports.NoopScrollStrategy = NoopScrollStrategy;
3396
- exports.Overlay = Overlay;
3397
- exports.OverlayConfig = OverlayConfig;
3398
- exports.OverlayContainer = OverlayContainer;
3399
- exports.OverlayKeyboardDispatcher = OverlayKeyboardDispatcher;
3400
- exports.OverlayModule = OverlayModule;
3401
- exports.OverlayOutsideClickDispatcher = OverlayOutsideClickDispatcher;
3402
- exports.OverlayPositionBuilder = OverlayPositionBuilder;
3403
- exports.OverlayRef = OverlayRef;
3404
- exports.RepositionScrollStrategy = RepositionScrollStrategy;
3405
- exports.ScrollStrategyOptions = ScrollStrategyOptions;
3406
- exports.ScrollingVisibility = ScrollingVisibility;
3407
- exports.validateHorizontalPosition = validateHorizontalPosition;
3408
- exports.validateVerticalPosition = validateVerticalPosition;
3409
- exports.ɵangular_material_src_cdk_overlay_overlay_a = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY;
3410
- exports.ɵangular_material_src_cdk_overlay_overlay_b = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY;
3411
- exports.ɵangular_material_src_cdk_overlay_overlay_c = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER;
3412
- exports.ɵangular_material_src_cdk_overlay_overlay_d = BaseOverlayDispatcher;
3413
-
3414
- Object.defineProperty(exports, '__esModule', { value: true });
3415
-
3416
- })));
3417
- //# sourceMappingURL=cdk-overlay.umd.js.map