@angular/cdk 10.0.2 → 10.1.3

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 (216) hide show
  1. package/a11y/aria-describer/aria-describer.d.ts +10 -1
  2. package/a11y/index.metadata.json +1 -1
  3. package/a11y/interactivity-checker/interactivity-checker.d.ts +11 -1
  4. package/a11y/key-manager/list-key-manager.d.ts +6 -0
  5. package/accordion/accordion.d.ts +7 -1
  6. package/accordion/index.d.ts +1 -0
  7. package/accordion/index.metadata.json +1 -1
  8. package/bundles/cdk-a11y.umd.js +514 -410
  9. package/bundles/cdk-a11y.umd.js.map +1 -1
  10. package/bundles/cdk-a11y.umd.min.js +35 -11
  11. package/bundles/cdk-a11y.umd.min.js.map +1 -1
  12. package/bundles/cdk-accordion.umd.js +47 -39
  13. package/bundles/cdk-accordion.umd.js.map +1 -1
  14. package/bundles/cdk-accordion.umd.min.js +10 -2
  15. package/bundles/cdk-accordion.umd.min.js.map +1 -1
  16. package/bundles/cdk-bidi.umd.js +25 -25
  17. package/bundles/cdk-bidi.umd.js.map +1 -1
  18. package/bundles/cdk-bidi.umd.min.js +5 -4
  19. package/bundles/cdk-bidi.umd.min.js.map +1 -1
  20. package/bundles/cdk-clipboard.umd.js +37 -36
  21. package/bundles/cdk-clipboard.umd.js.map +1 -1
  22. package/bundles/cdk-clipboard.umd.min.js +10 -2
  23. package/bundles/cdk-clipboard.umd.min.js.map +1 -1
  24. package/bundles/cdk-coercion.umd.js.map +1 -1
  25. package/bundles/cdk-collections.umd.js +303 -237
  26. package/bundles/cdk-collections.umd.js.map +1 -1
  27. package/bundles/cdk-collections.umd.min.js +3 -9
  28. package/bundles/cdk-collections.umd.min.js.map +1 -1
  29. package/bundles/cdk-drag-drop.umd.js +1059 -927
  30. package/bundles/cdk-drag-drop.umd.js.map +1 -1
  31. package/bundles/cdk-drag-drop.umd.min.js +72 -10
  32. package/bundles/cdk-drag-drop.umd.min.js.map +1 -1
  33. package/bundles/cdk-keycodes.umd.js.map +1 -1
  34. package/bundles/cdk-layout.umd.js +18 -18
  35. package/bundles/cdk-layout.umd.js.map +1 -1
  36. package/bundles/cdk-layout.umd.min.js +6 -5
  37. package/bundles/cdk-layout.umd.min.js.map +1 -1
  38. package/bundles/cdk-observers.umd.js +34 -34
  39. package/bundles/cdk-observers.umd.js.map +1 -1
  40. package/bundles/cdk-observers.umd.min.js +2 -2
  41. package/bundles/cdk-observers.umd.min.js.map +1 -1
  42. package/bundles/cdk-overlay.umd.js +638 -416
  43. package/bundles/cdk-overlay.umd.js.map +1 -1
  44. package/bundles/cdk-overlay.umd.min.js +51 -12
  45. package/bundles/cdk-overlay.umd.min.js.map +1 -1
  46. package/bundles/cdk-platform.umd.js +10 -10
  47. package/bundles/cdk-platform.umd.js.map +1 -1
  48. package/bundles/cdk-platform.umd.min.js +4 -11
  49. package/bundles/cdk-platform.umd.min.js.map +1 -1
  50. package/bundles/cdk-portal.umd.js +355 -300
  51. package/bundles/cdk-portal.umd.js.map +1 -1
  52. package/bundles/cdk-portal.umd.min.js +4 -5
  53. package/bundles/cdk-portal.umd.min.js.map +1 -1
  54. package/bundles/cdk-scrolling.umd.js +482 -392
  55. package/bundles/cdk-scrolling.umd.js.map +1 -1
  56. package/bundles/cdk-scrolling.umd.min.js +20 -12
  57. package/bundles/cdk-scrolling.umd.min.js.map +1 -1
  58. package/bundles/cdk-stepper.umd.js +117 -117
  59. package/bundles/cdk-stepper.umd.js.map +1 -1
  60. package/bundles/cdk-stepper.umd.min.js +11 -2
  61. package/bundles/cdk-stepper.umd.min.js.map +1 -1
  62. package/bundles/cdk-table.umd.js +862 -607
  63. package/bundles/cdk-table.umd.js.map +1 -1
  64. package/bundles/cdk-table.umd.min.js +8 -15
  65. package/bundles/cdk-table.umd.min.js.map +1 -1
  66. package/bundles/cdk-testing-protractor.umd.js +300 -241
  67. package/bundles/cdk-testing-protractor.umd.js.map +1 -1
  68. package/bundles/cdk-testing-protractor.umd.min.js +2 -9
  69. package/bundles/cdk-testing-protractor.umd.min.js.map +1 -1
  70. package/bundles/cdk-testing-testbed.umd.js +337 -276
  71. package/bundles/cdk-testing-testbed.umd.js.map +1 -1
  72. package/bundles/cdk-testing-testbed.umd.min.js +7 -30
  73. package/bundles/cdk-testing-testbed.umd.min.js.map +1 -1
  74. package/bundles/cdk-testing.umd.js +358 -270
  75. package/bundles/cdk-testing.umd.js.map +1 -1
  76. package/bundles/cdk-testing.umd.min.js +3 -18
  77. package/bundles/cdk-testing.umd.min.js.map +1 -1
  78. package/bundles/cdk-text-field.umd.js +51 -51
  79. package/bundles/cdk-text-field.umd.js.map +1 -1
  80. package/bundles/cdk-text-field.umd.min.js +10 -2
  81. package/bundles/cdk-text-field.umd.min.js.map +1 -1
  82. package/bundles/cdk-tree.umd.js +449 -396
  83. package/bundles/cdk-tree.umd.js.map +1 -1
  84. package/bundles/cdk-tree.umd.min.js +28 -3
  85. package/bundles/cdk-tree.umd.min.js.map +1 -1
  86. package/bundles/cdk.umd.js +1 -1
  87. package/bundles/cdk.umd.js.map +1 -1
  88. package/bundles/cdk.umd.min.js +1 -1
  89. package/bundles/cdk.umd.min.js.map +1 -1
  90. package/drag-drop/clone-node.d.ts +9 -0
  91. package/drag-drop/directives/drag-handle.d.ts +8 -2
  92. package/drag-drop/directives/drag-placeholder.d.ts +7 -1
  93. package/drag-drop/directives/drag-preview.d.ts +7 -1
  94. package/drag-drop/directives/drag.d.ts +3 -7
  95. package/drag-drop/directives/drop-list-group.d.ts +7 -1
  96. package/drag-drop/directives/drop-list.d.ts +7 -1
  97. package/drag-drop/index.d.ts +2 -2
  98. package/drag-drop/index.metadata.json +1 -1
  99. package/drag-drop/parent-position-tracker.d.ts +1 -1
  100. package/esm2015/a11y/aria-describer/aria-describer.js +21 -7
  101. package/esm2015/a11y/focus-trap/configurable-focus-trap-factory.js +3 -3
  102. package/esm2015/a11y/focus-trap/focus-trap.js +1 -1
  103. package/esm2015/a11y/interactivity-checker/interactivity-checker.js +43 -30
  104. package/esm2015/a11y/key-manager/list-key-manager.js +27 -2
  105. package/esm2015/a11y/live-announcer/live-announcer.js +1 -1
  106. package/esm2015/accordion/accordion-item.js +7 -7
  107. package/esm2015/accordion/accordion.js +9 -2
  108. package/esm2015/accordion/index.js +2 -1
  109. package/esm2015/clipboard/pending-copy.js +7 -6
  110. package/esm2015/drag-drop/clone-node.js +54 -0
  111. package/esm2015/drag-drop/directives/drag-handle.js +12 -5
  112. package/esm2015/drag-drop/directives/drag-placeholder.js +10 -3
  113. package/esm2015/drag-drop/directives/drag-preview.js +10 -3
  114. package/esm2015/drag-drop/directives/drag.js +19 -15
  115. package/esm2015/drag-drop/directives/drop-list-group.js +9 -2
  116. package/esm2015/drag-drop/directives/drop-list.js +19 -8
  117. package/esm2015/drag-drop/drag-ref.js +2 -29
  118. package/esm2015/drag-drop/index.js +3 -2
  119. package/esm2015/layout/breakpoints-observer.js +1 -1
  120. package/esm2015/overlay/dispatchers/base-overlay-dispatcher.js +51 -0
  121. package/esm2015/overlay/dispatchers/index.js +10 -0
  122. package/esm2015/overlay/dispatchers/overlay-keyboard-dispatcher.js +79 -0
  123. package/esm2015/overlay/dispatchers/overlay-outside-click-dispatcher.js +94 -0
  124. package/esm2015/overlay/index.js +5 -4
  125. package/esm2015/overlay/overlay-config.js +5 -1
  126. package/esm2015/overlay/overlay-directives.js +34 -8
  127. package/esm2015/overlay/overlay-module.js +2 -2
  128. package/esm2015/overlay/overlay-ref.js +24 -2
  129. package/esm2015/overlay/overlay-reference.js +1 -1
  130. package/esm2015/overlay/overlay.js +10 -5
  131. package/esm2015/overlay/position/connected-position-strategy.js +1 -5
  132. package/esm2015/overlay/position/flexible-connected-position-strategy.js +3 -3
  133. package/esm2015/overlay/position/overlay-position-builder.js +1 -1
  134. package/esm2015/overlay/public-api.js +2 -2
  135. package/esm2015/portal/dom-portal-outlet.js +5 -2
  136. package/esm2015/scrolling/public-api.js +2 -1
  137. package/esm2015/scrolling/scrolling-module.js +4 -1
  138. package/esm2015/scrolling/viewport-ruler.js +24 -10
  139. package/esm2015/scrolling/virtual-for-of.js +26 -12
  140. package/esm2015/scrolling/virtual-scroll-repeater.js +8 -0
  141. package/esm2015/scrolling/virtual-scroll-viewport.js +2 -2
  142. package/esm2015/table/cell.js +18 -3
  143. package/esm2015/table/coalesced-style-scheduler.js +87 -0
  144. package/esm2015/table/public-api.js +2 -1
  145. package/esm2015/table/sticky-styler.js +79 -45
  146. package/esm2015/table/table.js +33 -12
  147. package/esm2015/testing/component-harness.js +19 -1
  148. package/esm2015/testing/harness-environment.js +7 -1
  149. package/esm2015/testing/testbed/fake-events/dispatch-events.js +5 -4
  150. package/esm2015/testing/testbed/fake-events/event-objects.js +10 -7
  151. package/esm2015/testing/testbed/fake-events/type-in-element.js +4 -4
  152. package/esm2015/testing/testbed/unit-test-element.js +20 -12
  153. package/esm2015/tree/control/nested-tree-control.js +7 -3
  154. package/esm2015/tree/tree.js +9 -23
  155. package/esm2015/version.js +1 -1
  156. package/fesm2015/a11y.js +88 -38
  157. package/fesm2015/a11y.js.map +1 -1
  158. package/fesm2015/accordion.js +13 -6
  159. package/fesm2015/accordion.js.map +1 -1
  160. package/fesm2015/cdk.js +1 -1
  161. package/fesm2015/cdk.js.map +1 -1
  162. package/fesm2015/clipboard.js +6 -5
  163. package/fesm2015/clipboard.js.map +1 -1
  164. package/fesm2015/drag-drop.js +669 -600
  165. package/fesm2015/drag-drop.js.map +1 -1
  166. package/fesm2015/overlay.js +215 -40
  167. package/fesm2015/overlay.js.map +1 -1
  168. package/fesm2015/portal.js +4 -1
  169. package/fesm2015/portal.js.map +1 -1
  170. package/fesm2015/scrolling.js +60 -21
  171. package/fesm2015/scrolling.js.map +1 -1
  172. package/fesm2015/table.js +214 -61
  173. package/fesm2015/table.js.map +1 -1
  174. package/fesm2015/testing/testbed.js +35 -23
  175. package/fesm2015/testing/testbed.js.map +1 -1
  176. package/fesm2015/testing.js +25 -1
  177. package/fesm2015/testing.js.map +1 -1
  178. package/fesm2015/tree.js +13 -23
  179. package/fesm2015/tree.js.map +1 -1
  180. package/overlay/dispatchers/base-overlay-dispatcher.d.ts +28 -0
  181. package/overlay/dispatchers/index.d.ts +9 -0
  182. package/overlay/{keyboard → dispatchers}/overlay-keyboard-dispatcher.d.ts +4 -10
  183. package/overlay/dispatchers/overlay-outside-click-dispatcher.d.ts +27 -0
  184. package/overlay/index.d.ts +4 -3
  185. package/overlay/index.metadata.json +1 -1
  186. package/overlay/overlay-config.d.ts +4 -0
  187. package/overlay/overlay-directives.d.ts +5 -0
  188. package/overlay/overlay-ref.d.ts +8 -2
  189. package/overlay/overlay-reference.d.ts +1 -0
  190. package/overlay/overlay.d.ts +4 -2
  191. package/overlay/position/connected-position-strategy.d.ts +0 -2
  192. package/overlay/public-api.d.ts +1 -1
  193. package/package.json +1 -1
  194. package/schematics/ng-add/index.js +1 -1
  195. package/scrolling/index.metadata.json +1 -1
  196. package/scrolling/public-api.d.ts +1 -0
  197. package/scrolling/scrolling-module.d.ts +3 -0
  198. package/scrolling/viewport-ruler.d.ts +2 -2
  199. package/scrolling/virtual-for-of.d.ts +2 -1
  200. package/scrolling/virtual-scroll-repeater.d.ts +16 -0
  201. package/scrolling/virtual-scroll-viewport.d.ts +4 -4
  202. package/table/cell.d.ts +13 -0
  203. package/table/coalesced-style-scheduler.d.ts +41 -0
  204. package/table/index.metadata.json +1 -1
  205. package/table/public-api.d.ts +1 -0
  206. package/table/sticky-styler.d.ts +7 -1
  207. package/table/table.d.ts +9 -1
  208. package/testing/component-harness.d.ts +12 -0
  209. package/testing/harness-environment.d.ts +1 -0
  210. package/testing/testbed/fake-events/dispatch-events.d.ts +3 -2
  211. package/testing/testbed/fake-events/event-objects.d.ts +2 -2
  212. package/testing/testbed/unit-test-element.d.ts +7 -0
  213. package/tree/control/nested-tree-control.d.ts +7 -2
  214. package/tree/index.metadata.json +1 -1
  215. package/tree/tree.d.ts +2 -4
  216. package/esm2015/overlay/keyboard/overlay-keyboard-dispatcher.js +0 -96
@@ -4,232 +4,305 @@
4
4
  (global = 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.bidi, global.ng.cdk.portal, global.ng.cdk.platform, global.rxjs, global.rxjs.operators, global.ng.cdk.keycodes));
5
5
  }(this, (function (exports, i1, i1$1, i0, coercion, bidi, portal, i2, rxjs, operators, keycodes) { 'use strict';
6
6
 
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
76
- return new (P || (P = Promise))(function (resolve, reject) {
77
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
78
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
79
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
80
- step((generator = generator.apply(thisArg, _arguments || [])).next());
81
- });
82
- }
83
-
84
- function __generator(thisArg, body) {
85
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87
- function verb(n) { return function (v) { return step([n, v]); }; }
88
- function step(op) {
89
- if (f) throw new TypeError("Generator is already executing.");
90
- while (_) try {
91
- 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) return t;
92
- if (y = 0, t) op = [op[0] & 2, t.value];
93
- switch (op[0]) {
94
- case 0: case 1: t = op; break;
95
- case 4: _.label++; return { value: op[1], done: false };
96
- case 5: _.label++; y = op[1]; op = [0]; continue;
97
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
98
- default:
99
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103
- if (t[2]) _.ops.pop();
104
- _.trys.pop(); continue;
105
- }
106
- op = body.call(thisArg, _);
107
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109
- }
110
- }
111
-
112
- var __createBinding = Object.create ? (function(o, m, k, k2) {
113
- if (k2 === undefined) k2 = k;
114
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
115
- }) : (function(o, m, k, k2) {
116
- if (k2 === undefined) k2 = k;
117
- o[k2] = m[k];
118
- });
119
-
120
- function __exportStar(m, exports) {
121
- for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p);
122
- }
123
-
124
- function __values(o) {
125
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
126
- if (m) return m.call(o);
127
- if (o && typeof o.length === "number") return {
128
- next: function () {
129
- if (o && i >= o.length) o = void 0;
130
- return { value: o && o[i++], done: !o };
131
- }
132
- };
133
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
134
- }
135
-
136
- function __read(o, n) {
137
- var m = typeof Symbol === "function" && o[Symbol.iterator];
138
- if (!m) return o;
139
- var i = m.call(o), r, ar = [], e;
140
- try {
141
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
142
- }
143
- catch (error) { e = { error: error }; }
144
- finally {
145
- try {
146
- if (r && !r.done && (m = i["return"])) m.call(i);
147
- }
148
- finally { if (e) throw e.error; }
149
- }
150
- return ar;
151
- }
152
-
153
- function __spread() {
154
- for (var ar = [], i = 0; i < arguments.length; i++)
155
- ar = ar.concat(__read(arguments[i]));
156
- return ar;
157
- }
158
-
159
- function __spreadArrays() {
160
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
161
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
162
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
163
- r[k] = a[j];
164
- return r;
165
- };
166
-
167
- function __await(v) {
168
- return this instanceof __await ? (this.v = v, this) : new __await(v);
169
- }
170
-
171
- function __asyncGenerator(thisArg, _arguments, generator) {
172
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
173
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
174
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
175
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
176
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
177
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
178
- function fulfill(value) { resume("next", value); }
179
- function reject(value) { resume("throw", value); }
180
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
181
- }
182
-
183
- function __asyncDelegator(o) {
184
- var i, p;
185
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
186
- 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; }
187
- }
188
-
189
- function __asyncValues(o) {
190
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
191
- var m = o[Symbol.asyncIterator], i;
192
- 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);
193
- 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); }); }; }
194
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
195
- }
196
-
197
- function __makeTemplateObject(cooked, raw) {
198
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
199
- return cooked;
200
- };
201
-
202
- var __setModuleDefault = Object.create ? (function(o, v) {
203
- Object.defineProperty(o, "default", { enumerable: true, value: v });
204
- }) : function(o, v) {
205
- o["default"] = v;
206
- };
207
-
208
- function __importStar(mod) {
209
- if (mod && mod.__esModule) return mod;
210
- var result = {};
211
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
212
- __setModuleDefault(result, mod);
213
- return result;
214
- }
215
-
216
- function __importDefault(mod) {
217
- return (mod && mod.__esModule) ? mod : { default: mod };
218
- }
219
-
220
- function __classPrivateFieldGet(receiver, privateMap) {
221
- if (!privateMap.has(receiver)) {
222
- throw new TypeError("attempted to get private field on non-instance");
223
- }
224
- return privateMap.get(receiver);
225
- }
226
-
227
- function __classPrivateFieldSet(receiver, privateMap, value) {
228
- if (!privateMap.has(receiver)) {
229
- throw new TypeError("attempted to set private field on non-instance");
230
- }
231
- privateMap.set(receiver, value);
232
- return value;
7
+ /*! *****************************************************************************
8
+ Copyright (c) Microsoft Corporation.
9
+
10
+ Permission to use, copy, modify, and/or distribute this software for any
11
+ purpose with or without fee is hereby granted.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
+ PERFORMANCE OF THIS SOFTWARE.
20
+ ***************************************************************************** */
21
+ /* global Reflect, Promise */
22
+ var extendStatics = function (d, b) {
23
+ extendStatics = Object.setPrototypeOf ||
24
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
+ function (d, b) { for (var p in b)
26
+ if (b.hasOwnProperty(p))
27
+ d[p] = b[p]; };
28
+ return extendStatics(d, b);
29
+ };
30
+ function __extends(d, b) {
31
+ extendStatics(d, b);
32
+ function __() { this.constructor = d; }
33
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
+ }
35
+ var __assign = function () {
36
+ __assign = Object.assign || function __assign(t) {
37
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
38
+ s = arguments[i];
39
+ for (var p in s)
40
+ if (Object.prototype.hasOwnProperty.call(s, p))
41
+ t[p] = s[p];
42
+ }
43
+ return t;
44
+ };
45
+ return __assign.apply(this, arguments);
46
+ };
47
+ function __rest(s, e) {
48
+ var t = {};
49
+ for (var p in s)
50
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
+ t[p] = s[p];
52
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
+ t[p[i]] = s[p[i]];
56
+ }
57
+ return t;
58
+ }
59
+ function __decorate(decorators, target, key, desc) {
60
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
62
+ r = Reflect.decorate(decorators, target, key, desc);
63
+ else
64
+ for (var i = decorators.length - 1; i >= 0; i--)
65
+ if (d = decorators[i])
66
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
67
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
68
+ }
69
+ function __param(paramIndex, decorator) {
70
+ return function (target, key) { decorator(target, key, paramIndex); };
71
+ }
72
+ function __metadata(metadataKey, metadataValue) {
73
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
74
+ return Reflect.metadata(metadataKey, metadataValue);
75
+ }
76
+ function __awaiter(thisArg, _arguments, P, generator) {
77
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
+ return new (P || (P = Promise))(function (resolve, reject) {
79
+ function fulfilled(value) { try {
80
+ step(generator.next(value));
81
+ }
82
+ catch (e) {
83
+ reject(e);
84
+ } }
85
+ function rejected(value) { try {
86
+ step(generator["throw"](value));
87
+ }
88
+ catch (e) {
89
+ reject(e);
90
+ } }
91
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
92
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
93
+ });
94
+ }
95
+ function __generator(thisArg, body) {
96
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
97
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
98
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
99
+ function verb(n) { return function (v) { return step([n, v]); }; }
100
+ function step(op) {
101
+ if (f)
102
+ throw new TypeError("Generator is already executing.");
103
+ while (_)
104
+ try {
105
+ 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)
106
+ return t;
107
+ if (y = 0, t)
108
+ op = [op[0] & 2, t.value];
109
+ switch (op[0]) {
110
+ case 0:
111
+ case 1:
112
+ t = op;
113
+ break;
114
+ case 4:
115
+ _.label++;
116
+ return { value: op[1], done: false };
117
+ case 5:
118
+ _.label++;
119
+ y = op[1];
120
+ op = [0];
121
+ continue;
122
+ case 7:
123
+ op = _.ops.pop();
124
+ _.trys.pop();
125
+ continue;
126
+ default:
127
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
128
+ _ = 0;
129
+ continue;
130
+ }
131
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
132
+ _.label = op[1];
133
+ break;
134
+ }
135
+ if (op[0] === 6 && _.label < t[1]) {
136
+ _.label = t[1];
137
+ t = op;
138
+ break;
139
+ }
140
+ if (t && _.label < t[2]) {
141
+ _.label = t[2];
142
+ _.ops.push(op);
143
+ break;
144
+ }
145
+ if (t[2])
146
+ _.ops.pop();
147
+ _.trys.pop();
148
+ continue;
149
+ }
150
+ op = body.call(thisArg, _);
151
+ }
152
+ catch (e) {
153
+ op = [6, e];
154
+ y = 0;
155
+ }
156
+ finally {
157
+ f = t = 0;
158
+ }
159
+ if (op[0] & 5)
160
+ throw op[1];
161
+ return { value: op[0] ? op[1] : void 0, done: true };
162
+ }
163
+ }
164
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
165
+ if (k2 === undefined)
166
+ k2 = k;
167
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
168
+ }) : (function (o, m, k, k2) {
169
+ if (k2 === undefined)
170
+ k2 = k;
171
+ o[k2] = m[k];
172
+ });
173
+ function __exportStar(m, exports) {
174
+ for (var p in m)
175
+ if (p !== "default" && !exports.hasOwnProperty(p))
176
+ __createBinding(exports, m, p);
177
+ }
178
+ function __values(o) {
179
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
180
+ if (m)
181
+ return m.call(o);
182
+ if (o && typeof o.length === "number")
183
+ return {
184
+ next: function () {
185
+ if (o && i >= o.length)
186
+ o = void 0;
187
+ return { value: o && o[i++], done: !o };
188
+ }
189
+ };
190
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
191
+ }
192
+ function __read(o, n) {
193
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
194
+ if (!m)
195
+ return o;
196
+ var i = m.call(o), r, ar = [], e;
197
+ try {
198
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
199
+ ar.push(r.value);
200
+ }
201
+ catch (error) {
202
+ e = { error: error };
203
+ }
204
+ finally {
205
+ try {
206
+ if (r && !r.done && (m = i["return"]))
207
+ m.call(i);
208
+ }
209
+ finally {
210
+ if (e)
211
+ throw e.error;
212
+ }
213
+ }
214
+ return ar;
215
+ }
216
+ function __spread() {
217
+ for (var ar = [], i = 0; i < arguments.length; i++)
218
+ ar = ar.concat(__read(arguments[i]));
219
+ return ar;
220
+ }
221
+ function __spreadArrays() {
222
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
+ s += arguments[i].length;
224
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
225
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
226
+ r[k] = a[j];
227
+ return r;
228
+ }
229
+ ;
230
+ function __await(v) {
231
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
232
+ }
233
+ function __asyncGenerator(thisArg, _arguments, generator) {
234
+ if (!Symbol.asyncIterator)
235
+ throw new TypeError("Symbol.asyncIterator is not defined.");
236
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
237
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
238
+ function verb(n) { if (g[n])
239
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
240
+ function resume(n, v) { try {
241
+ step(g[n](v));
242
+ }
243
+ catch (e) {
244
+ settle(q[0][3], e);
245
+ } }
246
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
247
+ function fulfill(value) { resume("next", value); }
248
+ function reject(value) { resume("throw", value); }
249
+ function settle(f, v) { if (f(v), q.shift(), q.length)
250
+ resume(q[0][0], q[0][1]); }
251
+ }
252
+ function __asyncDelegator(o) {
253
+ var i, p;
254
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
255
+ 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; }
256
+ }
257
+ function __asyncValues(o) {
258
+ if (!Symbol.asyncIterator)
259
+ throw new TypeError("Symbol.asyncIterator is not defined.");
260
+ var m = o[Symbol.asyncIterator], i;
261
+ 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);
262
+ 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); }); }; }
263
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
264
+ }
265
+ function __makeTemplateObject(cooked, raw) {
266
+ if (Object.defineProperty) {
267
+ Object.defineProperty(cooked, "raw", { value: raw });
268
+ }
269
+ else {
270
+ cooked.raw = raw;
271
+ }
272
+ return cooked;
273
+ }
274
+ ;
275
+ var __setModuleDefault = Object.create ? (function (o, v) {
276
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
277
+ }) : function (o, v) {
278
+ o["default"] = v;
279
+ };
280
+ function __importStar(mod) {
281
+ if (mod && mod.__esModule)
282
+ return mod;
283
+ var result = {};
284
+ if (mod != null)
285
+ for (var k in mod)
286
+ if (Object.hasOwnProperty.call(mod, k))
287
+ __createBinding(result, mod, k);
288
+ __setModuleDefault(result, mod);
289
+ return result;
290
+ }
291
+ function __importDefault(mod) {
292
+ return (mod && mod.__esModule) ? mod : { default: mod };
293
+ }
294
+ function __classPrivateFieldGet(receiver, privateMap) {
295
+ if (!privateMap.has(receiver)) {
296
+ throw new TypeError("attempted to get private field on non-instance");
297
+ }
298
+ return privateMap.get(receiver);
299
+ }
300
+ function __classPrivateFieldSet(receiver, privateMap, value) {
301
+ if (!privateMap.has(receiver)) {
302
+ throw new TypeError("attempted to set private field on non-instance");
303
+ }
304
+ privateMap.set(receiver, value);
305
+ return value;
233
306
  }
234
307
 
235
308
  /**
@@ -539,18 +612,18 @@
539
612
  this.reposition = function (config) { return new RepositionScrollStrategy(_this._scrollDispatcher, _this._viewportRuler, _this._ngZone, config); };
540
613
  this._document = document;
541
614
  }
542
- ScrollStrategyOptions.ɵprov = i0.ɵɵdefineInjectable({ factory: function ScrollStrategyOptions_Factory() { return new ScrollStrategyOptions(i0.ɵɵinject(i1.ScrollDispatcher), i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1$1.DOCUMENT)); }, token: ScrollStrategyOptions, providedIn: "root" });
543
- ScrollStrategyOptions.decorators = [
544
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
545
- ];
546
- ScrollStrategyOptions.ctorParameters = function () { return [
547
- { type: i1.ScrollDispatcher },
548
- { type: i1.ViewportRuler },
549
- { type: i0.NgZone },
550
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
551
- ]; };
552
615
  return ScrollStrategyOptions;
553
616
  }());
617
+ ScrollStrategyOptions.ɵprov = i0.ɵɵdefineInjectable({ factory: function ScrollStrategyOptions_Factory() { return new ScrollStrategyOptions(i0.ɵɵinject(i1.ScrollDispatcher), i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(i0.NgZone), i0.ɵɵinject(i1$1.DOCUMENT)); }, token: ScrollStrategyOptions, providedIn: "root" });
618
+ ScrollStrategyOptions.decorators = [
619
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
620
+ ];
621
+ ScrollStrategyOptions.ctorParameters = function () { return [
622
+ { type: i1.ScrollDispatcher },
623
+ { type: i1.ViewportRuler },
624
+ { type: i0.NgZone },
625
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
626
+ ]; };
554
627
 
555
628
  /**
556
629
  * @license
@@ -560,13 +633,6 @@
560
633
  * found in the LICENSE file at https://angular.io/license
561
634
  */
562
635
 
563
- /**
564
- * @license
565
- * Copyright Google LLC All Rights Reserved.
566
- *
567
- * Use of this source code is governed by an MIT-style license that can be
568
- * found in the LICENSE file at https://angular.io/license
569
- */
570
636
  /** Initial configuration used when creating an overlay. */
571
637
  var OverlayConfig = /** @class */ (function () {
572
638
  function OverlayConfig(config) {
@@ -585,6 +651,10 @@
585
651
  * the `HashLocationStrategy`).
586
652
  */
587
653
  this.disposeOnNavigation = false;
654
+ /**
655
+ * Array of HTML elements clicking on which should not be considered as outside click
656
+ */
657
+ this.excludeFromOutsideClick = [];
588
658
  if (config) {
589
659
  // Use `Iterable` instead of `Array` because TypeScript, as of 3.6.3,
590
660
  // loses the array generic type in the `for of`. But we *also* have to use `Array` because
@@ -682,12 +752,12 @@
682
752
  this.connectionPair = connectionPair;
683
753
  this.scrollableViewProperties = scrollableViewProperties;
684
754
  }
685
- ConnectedOverlayPositionChange.ctorParameters = function () { return [
686
- { type: ConnectionPositionPair },
687
- { type: ScrollingVisibility, decorators: [{ type: i0.Optional }] }
688
- ]; };
689
755
  return ConnectedOverlayPositionChange;
690
756
  }());
757
+ ConnectedOverlayPositionChange.ctorParameters = function () { return [
758
+ { type: ConnectionPositionPair },
759
+ { type: ScrollingVisibility, decorators: [{ type: i0.Optional }] }
760
+ ]; };
691
761
  /**
692
762
  * Validates whether a vertical position property matches the expected values.
693
763
  * @param property Name of the property being validated.
@@ -721,17 +791,57 @@
721
791
  * found in the LICENSE file at https://angular.io/license
722
792
  */
723
793
  /**
724
- * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
794
+ * Service for dispatching events that land on the body to appropriate overlay ref,
725
795
  * if any. It maintains a list of attached overlays to determine best suited overlay based
726
796
  * on event target and order of overlay opens.
727
797
  */
728
- var OverlayKeyboardDispatcher = /** @class */ (function () {
729
- function OverlayKeyboardDispatcher(document) {
730
- var _this = this;
798
+ var BaseOverlayDispatcher = /** @class */ (function () {
799
+ function BaseOverlayDispatcher(document) {
731
800
  /** Currently attached overlays in the order they were attached. */
732
801
  this._attachedOverlays = [];
802
+ this._document = document;
803
+ }
804
+ BaseOverlayDispatcher.prototype.ngOnDestroy = function () {
805
+ this.detach();
806
+ };
807
+ /** Add a new overlay to the list of attached overlay refs. */
808
+ BaseOverlayDispatcher.prototype.add = function (overlayRef) {
809
+ // Ensure that we don't get the same overlay multiple times.
810
+ this.remove(overlayRef);
811
+ this._attachedOverlays.push(overlayRef);
812
+ };
813
+ /** Remove an overlay from the list of attached overlay refs. */
814
+ BaseOverlayDispatcher.prototype.remove = function (overlayRef) {
815
+ var index = this._attachedOverlays.indexOf(overlayRef);
816
+ if (index > -1) {
817
+ this._attachedOverlays.splice(index, 1);
818
+ }
819
+ // Remove the global listener once there are no more overlays.
820
+ if (this._attachedOverlays.length === 0) {
821
+ this.detach();
822
+ }
823
+ };
824
+ return BaseOverlayDispatcher;
825
+ }());
826
+ BaseOverlayDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function BaseOverlayDispatcher_Factory() { return new BaseOverlayDispatcher(i0.ɵɵinject(i1$1.DOCUMENT)); }, token: BaseOverlayDispatcher, providedIn: "root" });
827
+ BaseOverlayDispatcher.decorators = [
828
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
829
+ ];
830
+ BaseOverlayDispatcher.ctorParameters = function () { return [
831
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
832
+ ]; };
833
+
834
+ /**
835
+ * Service for dispatching keyboard events that land on the body to appropriate overlay ref,
836
+ * if any. It maintains a list of attached overlays to determine best suited overlay based
837
+ * on event target and order of overlay opens.
838
+ */
839
+ var OverlayKeyboardDispatcher = /** @class */ (function (_super) {
840
+ __extends(OverlayKeyboardDispatcher, _super);
841
+ function OverlayKeyboardDispatcher(document) {
842
+ var _this = _super.call(this, document) || this;
733
843
  /** Keyboard event listener that will be attached to the body. */
734
- this._keydownListener = function (event) {
844
+ _this._keydownListener = function (event) {
735
845
  var overlays = _this._attachedOverlays;
736
846
  for (var i = overlays.length - 1; i > -1; i--) {
737
847
  // Dispatch the keydown event to the top overlay which has subscribers to its keydown events.
@@ -746,49 +856,33 @@
746
856
  }
747
857
  }
748
858
  };
749
- this._document = document;
859
+ return _this;
750
860
  }
751
- OverlayKeyboardDispatcher.prototype.ngOnDestroy = function () {
752
- this._detach();
753
- };
754
861
  /** Add a new overlay to the list of attached overlay refs. */
755
862
  OverlayKeyboardDispatcher.prototype.add = function (overlayRef) {
756
- // Ensure that we don't get the same overlay multiple times.
757
- this.remove(overlayRef);
863
+ _super.prototype.add.call(this, overlayRef);
758
864
  // Lazily start dispatcher once first overlay is added
759
865
  if (!this._isAttached) {
760
866
  this._document.body.addEventListener('keydown', this._keydownListener);
761
867
  this._isAttached = true;
762
868
  }
763
- this._attachedOverlays.push(overlayRef);
764
- };
765
- /** Remove an overlay from the list of attached overlay refs. */
766
- OverlayKeyboardDispatcher.prototype.remove = function (overlayRef) {
767
- var index = this._attachedOverlays.indexOf(overlayRef);
768
- if (index > -1) {
769
- this._attachedOverlays.splice(index, 1);
770
- }
771
- // Remove the global listener once there are no more overlays.
772
- if (this._attachedOverlays.length === 0) {
773
- this._detach();
774
- }
775
869
  };
776
870
  /** Detaches the global keyboard event listener. */
777
- OverlayKeyboardDispatcher.prototype._detach = function () {
871
+ OverlayKeyboardDispatcher.prototype.detach = function () {
778
872
  if (this._isAttached) {
779
873
  this._document.body.removeEventListener('keydown', this._keydownListener);
780
874
  this._isAttached = false;
781
875
  }
782
876
  };
783
- OverlayKeyboardDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayKeyboardDispatcher_Factory() { return new OverlayKeyboardDispatcher(i0.ɵɵinject(i1$1.DOCUMENT)); }, token: OverlayKeyboardDispatcher, providedIn: "root" });
784
- OverlayKeyboardDispatcher.decorators = [
785
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
786
- ];
787
- OverlayKeyboardDispatcher.ctorParameters = function () { return [
788
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
789
- ]; };
790
877
  return OverlayKeyboardDispatcher;
791
- }());
878
+ }(BaseOverlayDispatcher));
879
+ OverlayKeyboardDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayKeyboardDispatcher_Factory() { return new OverlayKeyboardDispatcher(i0.ɵɵinject(i1$1.DOCUMENT)); }, token: OverlayKeyboardDispatcher, providedIn: "root" });
880
+ OverlayKeyboardDispatcher.decorators = [
881
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
882
+ ];
883
+ OverlayKeyboardDispatcher.ctorParameters = function () { return [
884
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] }
885
+ ]; };
792
886
  /** @docs-private @deprecated @breaking-change 8.0.0 */
793
887
  function OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY(dispatcher, _document) {
794
888
  return dispatcher || new OverlayKeyboardDispatcher(_document);
@@ -807,6 +901,89 @@
807
901
  useFactory: OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY
808
902
  };
809
903
 
904
+ /**
905
+ * Service for dispatching mouse click events that land on the body to appropriate overlay ref,
906
+ * if any. It maintains a list of attached overlays to determine best suited overlay based
907
+ * on event target and order of overlay opens.
908
+ */
909
+ var OverlayOutsideClickDispatcher = /** @class */ (function (_super) {
910
+ __extends(OverlayOutsideClickDispatcher, _super);
911
+ function OverlayOutsideClickDispatcher(document, _platform) {
912
+ var _this = _super.call(this, document) || this;
913
+ _this._platform = _platform;
914
+ _this._cursorStyleIsSet = false;
915
+ /** Click event listener that will be attached to the body propagate phase. */
916
+ _this._clickListener = function (event) {
917
+ // Get the target through the `composedPath` if possible to account for shadow DOM.
918
+ var target = event.composedPath ? event.composedPath()[0] : event.target;
919
+ var overlays = _this._attachedOverlays;
920
+ // Dispatch the mouse event to the top overlay which has subscribers to its mouse events.
921
+ // We want to target all overlays for which the click could be considered as outside click.
922
+ // As soon as we reach an overlay for which the click is not outside click we break off
923
+ // the loop.
924
+ for (var i = overlays.length - 1; i > -1; i--) {
925
+ var overlayRef = overlays[i];
926
+ if (overlayRef._outsidePointerEvents.observers.length < 1) {
927
+ continue;
928
+ }
929
+ var config = overlayRef.getConfig();
930
+ var excludeElements = __spread(config.excludeFromOutsideClick, [overlayRef.overlayElement]);
931
+ var isInsideClick = excludeElements.some(function (e) { return e.contains(target); });
932
+ // If it is inside click just break - we should do nothing
933
+ // If it is outside click dispatch the mouse event, and proceed with the next overlay
934
+ if (isInsideClick) {
935
+ break;
936
+ }
937
+ overlayRef._outsidePointerEvents.next(event);
938
+ }
939
+ };
940
+ return _this;
941
+ }
942
+ /** Add a new overlay to the list of attached overlay refs. */
943
+ OverlayOutsideClickDispatcher.prototype.add = function (overlayRef) {
944
+ _super.prototype.add.call(this, overlayRef);
945
+ // tslint:disable: max-line-length
946
+ // Safari on iOS does not generate click events for non-interactive
947
+ // elements. However, we want to receive a click for any element outside
948
+ // the overlay. We can force a "clickable" state by setting
949
+ // `cursor: pointer` on the document body.
950
+ // See https://developer.mozilla.org/en-US/docs/Web/API/Element/click_event#Safari_Mobile
951
+ // and https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
952
+ // tslint:enable: max-line-length
953
+ if (!this._isAttached) {
954
+ this._document.body.addEventListener('click', this._clickListener, true);
955
+ // click event is not fired on iOS. To make element "clickable" we are
956
+ // setting the cursor to pointer
957
+ if (this._platform.IOS && !this._cursorStyleIsSet) {
958
+ this._cursorOriginalValue = this._document.body.style.cursor;
959
+ this._document.body.style.cursor = 'pointer';
960
+ this._cursorStyleIsSet = true;
961
+ }
962
+ this._isAttached = true;
963
+ }
964
+ };
965
+ /** Detaches the global keyboard event listener. */
966
+ OverlayOutsideClickDispatcher.prototype.detach = function () {
967
+ if (this._isAttached) {
968
+ this._document.body.removeEventListener('click', this._clickListener, true);
969
+ if (this._platform.IOS && this._cursorStyleIsSet) {
970
+ this._document.body.style.cursor = this._cursorOriginalValue;
971
+ this._cursorStyleIsSet = false;
972
+ }
973
+ this._isAttached = false;
974
+ }
975
+ };
976
+ return OverlayOutsideClickDispatcher;
977
+ }(BaseOverlayDispatcher));
978
+ OverlayOutsideClickDispatcher.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayOutsideClickDispatcher_Factory() { return new OverlayOutsideClickDispatcher(i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: OverlayOutsideClickDispatcher, providedIn: "root" });
979
+ OverlayOutsideClickDispatcher.decorators = [
980
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
981
+ ];
982
+ OverlayOutsideClickDispatcher.ctorParameters = function () { return [
983
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
984
+ { type: i2.Platform }
985
+ ]; };
986
+
810
987
  /**
811
988
  * @license
812
989
  * Copyright Google LLC All Rights Reserved.
@@ -886,16 +1063,16 @@
886
1063
  this._document.body.appendChild(container);
887
1064
  this._containerElement = container;
888
1065
  };
889
- OverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: OverlayContainer, providedIn: "root" });
890
- OverlayContainer.decorators = [
891
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
892
- ];
893
- OverlayContainer.ctorParameters = function () { return [
894
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
895
- { type: i2.Platform }
896
- ]; };
897
1066
  return OverlayContainer;
898
1067
  }());
1068
+ OverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayContainer_Factory() { return new OverlayContainer(i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: OverlayContainer, providedIn: "root" });
1069
+ OverlayContainer.decorators = [
1070
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1071
+ ];
1072
+ OverlayContainer.ctorParameters = function () { return [
1073
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
1074
+ { type: i2.Platform }
1075
+ ]; };
899
1076
  /** @docs-private @deprecated @breaking-change 8.0.0 */
900
1077
  function OVERLAY_CONTAINER_PROVIDER_FACTORY(parentContainer, _document) {
901
1078
  return parentContainer || new OverlayContainer(_document);
@@ -925,7 +1102,9 @@
925
1102
  var OverlayRef = /** @class */ (function () {
926
1103
  function OverlayRef(_portalOutlet, _host, _pane, _config, _ngZone, _keyboardDispatcher, _document,
927
1104
  // @breaking-change 8.0.0 `_location` parameter to be made required.
928
- _location) {
1105
+ _location,
1106
+ // @breaking-change 9.0.0 `_mouseClickDispatcher` parameter to be made required.
1107
+ _outsideClickDispatcher) {
929
1108
  var _this = this;
930
1109
  this._portalOutlet = _portalOutlet;
931
1110
  this._host = _host;
@@ -935,6 +1114,7 @@
935
1114
  this._keyboardDispatcher = _keyboardDispatcher;
936
1115
  this._document = _document;
937
1116
  this._location = _location;
1117
+ this._outsideClickDispatcher = _outsideClickDispatcher;
938
1118
  this._backdropElement = null;
939
1119
  this._backdropClick = new rxjs.Subject();
940
1120
  this._attachments = new rxjs.Subject();
@@ -943,6 +1123,8 @@
943
1123
  this._backdropClickHandler = function (event) { return _this._backdropClick.next(event); };
944
1124
  /** Stream of keydown events dispatched to this overlay. */
945
1125
  this._keydownEvents = new rxjs.Subject();
1126
+ /** Stream of mouse outside events dispatched to this overlay. */
1127
+ this._outsidePointerEvents = new rxjs.Subject();
946
1128
  if (_config.scrollStrategy) {
947
1129
  this._scrollStrategy = _config.scrollStrategy;
948
1130
  this._scrollStrategy.attach(this);
@@ -1029,6 +1211,10 @@
1029
1211
  if (this._config.disposeOnNavigation && this._location) {
1030
1212
  this._locationChanges = this._location.subscribe(function () { return _this.dispose(); });
1031
1213
  }
1214
+ // @breaking-change 9.0.0 remove the null check for `_mouseClickDispatcher`
1215
+ if (this._outsideClickDispatcher) {
1216
+ this._outsideClickDispatcher.add(this);
1217
+ }
1032
1218
  return attachResult;
1033
1219
  };
1034
1220
  /**
@@ -1060,6 +1246,10 @@
1060
1246
  this._detachContentWhenStable();
1061
1247
  // Stop listening for location changes.
1062
1248
  this._locationChanges.unsubscribe();
1249
+ // @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`
1250
+ if (this._outsideClickDispatcher) {
1251
+ this._outsideClickDispatcher.remove(this);
1252
+ }
1063
1253
  return detachmentResult;
1064
1254
  };
1065
1255
  /** Cleans up the overlay from the DOM. */
@@ -1076,6 +1266,11 @@
1076
1266
  this._attachments.complete();
1077
1267
  this._backdropClick.complete();
1078
1268
  this._keydownEvents.complete();
1269
+ this._outsidePointerEvents.complete();
1270
+ // @breaking-change 9.0.0 remove the null check for `_outsideClickDispatcher`
1271
+ if (this._outsideClickDispatcher) {
1272
+ this._outsideClickDispatcher.remove(this);
1273
+ }
1079
1274
  if (this._host && this._host.parentNode) {
1080
1275
  this._host.parentNode.removeChild(this._host);
1081
1276
  this._host = null;
@@ -1106,6 +1301,10 @@
1106
1301
  OverlayRef.prototype.keydownEvents = function () {
1107
1302
  return this._keydownEvents.asObservable();
1108
1303
  };
1304
+ /** Gets an observable of pointer events targeted outside this overlay. */
1305
+ OverlayRef.prototype.outsidePointerEvents = function () {
1306
+ return this._outsidePointerEvents.asObservable();
1307
+ };
1109
1308
  /** Gets the current overlay configuration, which is immutable. */
1110
1309
  OverlayRef.prototype.getConfig = function () {
1111
1310
  return this._config;
@@ -1132,12 +1331,12 @@
1132
1331
  };
1133
1332
  /** Update the size properties of the overlay. */
1134
1333
  OverlayRef.prototype.updateSize = function (sizeConfig) {
1135
- this._config = __assign(__assign({}, this._config), sizeConfig);
1334
+ this._config = Object.assign(Object.assign({}, this._config), sizeConfig);
1136
1335
  this._updateElementSize();
1137
1336
  };
1138
1337
  /** Sets the LTR/RTL direction for the overlay. */
1139
1338
  OverlayRef.prototype.setDirection = function (dir) {
1140
- this._config = __assign(__assign({}, this._config), { direction: dir });
1339
+ this._config = Object.assign(Object.assign({}, this._config), { direction: dir });
1141
1340
  this._updateElementDirection();
1142
1341
  };
1143
1342
  /** Add a CSS class or an array of classes to the overlay pane. */
@@ -1329,13 +1528,6 @@
1329
1528
  return OverlayRef;
1330
1529
  }());
1331
1530
 
1332
- /**
1333
- * @license
1334
- * Copyright Google LLC All Rights Reserved.
1335
- *
1336
- * Use of this source code is governed by an MIT-style license that can be
1337
- * found in the LICENSE file at https://angular.io/license
1338
- */
1339
1531
  // TODO: refactor clipping detection into a separate thing (part of scrolling module)
1340
1532
  // TODO: doesn't handle both flexible width and height when it has to scroll along both axis.
1341
1533
  /** Class to be added to the overlay bounding box. */
@@ -1822,8 +2014,8 @@
1822
2014
  var viewport = this._viewportRect;
1823
2015
  // Determine how much the overlay goes outside the viewport on each
1824
2016
  // side, which we'll use to decide which direction to push it.
1825
- var overflowRight = Math.max(start.x + overlay.width - viewport.right, 0);
1826
- var overflowBottom = Math.max(start.y + overlay.height - viewport.bottom, 0);
2017
+ var overflowRight = Math.max(start.x + overlay.width - viewport.width, 0);
2018
+ var overflowBottom = Math.max(start.y + overlay.height - viewport.height, 0);
1827
2019
  var overflowTop = Math.max(viewport.top - scrollPosition.top - start.y, 0);
1828
2020
  var overflowLeft = Math.max(viewport.left - scrollPosition.left - start.x, 0);
1829
2021
  // Amount by which to push the overlay in each axis such that it remains on-screen.
@@ -2326,14 +2518,6 @@
2326
2518
  .withViewportMargin(0);
2327
2519
  this.withFallbackPosition(originPos, overlayPos);
2328
2520
  }
2329
- Object.defineProperty(ConnectedPositionStrategy.prototype, "_isRtl", {
2330
- /** Whether the we're dealing with an RTL context */
2331
- get: function () {
2332
- return this._overlayRef.getDirection() === 'rtl';
2333
- },
2334
- enumerable: false,
2335
- configurable: true
2336
- });
2337
2521
  Object.defineProperty(ConnectedPositionStrategy.prototype, "onPositionChange", {
2338
2522
  /** Emits an event when the connection point changes. */
2339
2523
  get: function () {
@@ -2709,18 +2893,18 @@
2709
2893
  OverlayPositionBuilder.prototype.flexibleConnectedTo = function (origin) {
2710
2894
  return new FlexibleConnectedPositionStrategy(origin, this._viewportRuler, this._document, this._platform, this._overlayContainer);
2711
2895
  };
2712
- OverlayPositionBuilder.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayPositionBuilder_Factory() { return new OverlayPositionBuilder(i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform), i0.ɵɵinject(OverlayContainer)); }, token: OverlayPositionBuilder, providedIn: "root" });
2713
- OverlayPositionBuilder.decorators = [
2714
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2715
- ];
2716
- OverlayPositionBuilder.ctorParameters = function () { return [
2717
- { type: i1.ViewportRuler },
2718
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
2719
- { type: i2.Platform },
2720
- { type: OverlayContainer }
2721
- ]; };
2722
2896
  return OverlayPositionBuilder;
2723
2897
  }());
2898
+ OverlayPositionBuilder.ɵprov = i0.ɵɵdefineInjectable({ factory: function OverlayPositionBuilder_Factory() { return new OverlayPositionBuilder(i0.ɵɵinject(i1.ViewportRuler), i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform), i0.ɵɵinject(OverlayContainer)); }, token: OverlayPositionBuilder, providedIn: "root" });
2899
+ OverlayPositionBuilder.decorators = [
2900
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
2901
+ ];
2902
+ OverlayPositionBuilder.ctorParameters = function () { return [
2903
+ { type: i1.ViewportRuler },
2904
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
2905
+ { type: i2.Platform },
2906
+ { type: OverlayContainer }
2907
+ ]; };
2724
2908
 
2725
2909
  /**
2726
2910
  * @license
@@ -2746,7 +2930,9 @@
2746
2930
  /** Scrolling strategies that can be used when creating an overlay. */
2747
2931
  scrollStrategies, _overlayContainer, _componentFactoryResolver, _positionBuilder, _keyboardDispatcher, _injector, _ngZone, _document, _directionality,
2748
2932
  // @breaking-change 8.0.0 `_location` parameter to be made required.
2749
- _location) {
2933
+ _location,
2934
+ // @breaking-change 9.0.0 `_outsideClickDispatcher` parameter to be made required.
2935
+ _outsideClickDispatcher) {
2750
2936
  this.scrollStrategies = scrollStrategies;
2751
2937
  this._overlayContainer = _overlayContainer;
2752
2938
  this._componentFactoryResolver = _componentFactoryResolver;
@@ -2757,6 +2943,7 @@
2757
2943
  this._document = _document;
2758
2944
  this._directionality = _directionality;
2759
2945
  this._location = _location;
2946
+ this._outsideClickDispatcher = _outsideClickDispatcher;
2760
2947
  }
2761
2948
  /**
2762
2949
  * Creates an overlay.
@@ -2769,7 +2956,7 @@
2769
2956
  var portalOutlet = this._createPortalOutlet(pane);
2770
2957
  var overlayConfig = new OverlayConfig(config);
2771
2958
  overlayConfig.direction = overlayConfig.direction || this._directionality.value;
2772
- return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location);
2959
+ return new OverlayRef(portalOutlet, host, pane, overlayConfig, this._ngZone, this._keyboardDispatcher, this._document, this._location, this._outsideClickDispatcher);
2773
2960
  };
2774
2961
  /**
2775
2962
  * Gets a position builder that can be used, via fluent API,
@@ -2813,23 +3000,24 @@
2813
3000
  }
2814
3001
  return new portal.DomPortalOutlet(pane, this._componentFactoryResolver, this._appRef, this._injector, this._document);
2815
3002
  };
2816
- Overlay.decorators = [
2817
- { type: i0.Injectable }
2818
- ];
2819
- Overlay.ctorParameters = function () { return [
2820
- { type: ScrollStrategyOptions },
2821
- { type: OverlayContainer },
2822
- { type: i0.ComponentFactoryResolver },
2823
- { type: OverlayPositionBuilder },
2824
- { type: OverlayKeyboardDispatcher },
2825
- { type: i0.Injector },
2826
- { type: i0.NgZone },
2827
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
2828
- { type: bidi.Directionality },
2829
- { type: i1$1.Location, decorators: [{ type: i0.Optional }] }
2830
- ]; };
2831
3003
  return Overlay;
2832
3004
  }());
3005
+ Overlay.decorators = [
3006
+ { type: i0.Injectable }
3007
+ ];
3008
+ Overlay.ctorParameters = function () { return [
3009
+ { type: ScrollStrategyOptions },
3010
+ { type: OverlayContainer },
3011
+ { type: i0.ComponentFactoryResolver },
3012
+ { type: OverlayPositionBuilder },
3013
+ { type: OverlayKeyboardDispatcher },
3014
+ { type: i0.Injector },
3015
+ { type: i0.NgZone },
3016
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
3017
+ { type: bidi.Directionality },
3018
+ { type: i1$1.Location, decorators: [{ type: i0.Optional }] },
3019
+ { type: OverlayOutsideClickDispatcher, decorators: [{ type: i0.Optional }] }
3020
+ ]; };
2833
3021
 
2834
3022
  /**
2835
3023
  * @license
@@ -2881,17 +3069,17 @@
2881
3069
  elementRef) {
2882
3070
  this.elementRef = elementRef;
2883
3071
  }
2884
- CdkOverlayOrigin.decorators = [
2885
- { type: i0.Directive, args: [{
2886
- selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
2887
- exportAs: 'cdkOverlayOrigin',
2888
- },] }
2889
- ];
2890
- CdkOverlayOrigin.ctorParameters = function () { return [
2891
- { type: i0.ElementRef }
2892
- ]; };
2893
3072
  return CdkOverlayOrigin;
2894
3073
  }());
3074
+ CdkOverlayOrigin.decorators = [
3075
+ { type: i0.Directive, args: [{
3076
+ selector: '[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]',
3077
+ exportAs: 'cdkOverlayOrigin',
3078
+ },] }
3079
+ ];
3080
+ CdkOverlayOrigin.ctorParameters = function () { return [
3081
+ { type: i0.ElementRef }
3082
+ ]; };
2895
3083
  /**
2896
3084
  * Directive to facilitate declarative creation of an
2897
3085
  * Overlay using a FlexibleConnectedPositionStrategy.
@@ -2907,6 +3095,9 @@
2907
3095
  this._flexibleDimensions = false;
2908
3096
  this._push = false;
2909
3097
  this._backdropSubscription = rxjs.Subscription.EMPTY;
3098
+ this._attachSubscription = rxjs.Subscription.EMPTY;
3099
+ this._detachSubscription = rxjs.Subscription.EMPTY;
3100
+ this._positionSubscription = rxjs.Subscription.EMPTY;
2910
3101
  /** Margin between the overlay and the viewport edges. */
2911
3102
  this.viewportMargin = 0;
2912
3103
  /** Whether the overlay is open. */
@@ -2921,6 +3112,8 @@
2921
3112
  this.detach = new i0.EventEmitter();
2922
3113
  /** Emits when there are keyboard events that are targeted at the overlay. */
2923
3114
  this.overlayKeydown = new i0.EventEmitter();
3115
+ /** Emits when there are mouse outside click events that are targeted at the overlay. */
3116
+ this.overlayOutsideClick = new i0.EventEmitter();
2924
3117
  this._templatePortal = new portal.TemplatePortal(templateRef, viewContainerRef);
2925
3118
  this._scrollStrategyFactory = scrollStrategyFactory;
2926
3119
  this.scrollStrategy = this._scrollStrategyFactory();
@@ -3003,10 +3196,13 @@
3003
3196
  configurable: true
3004
3197
  });
3005
3198
  CdkConnectedOverlay.prototype.ngOnDestroy = function () {
3199
+ this._attachSubscription.unsubscribe();
3200
+ this._detachSubscription.unsubscribe();
3201
+ this._backdropSubscription.unsubscribe();
3202
+ this._positionSubscription.unsubscribe();
3006
3203
  if (this._overlayRef) {
3007
3204
  this._overlayRef.dispose();
3008
3205
  }
3009
- this._backdropSubscription.unsubscribe();
3010
3206
  };
3011
3207
  CdkConnectedOverlay.prototype.ngOnChanges = function (changes) {
3012
3208
  if (this._position) {
@@ -3031,14 +3227,19 @@
3031
3227
  if (!this.positions || !this.positions.length) {
3032
3228
  this.positions = defaultPositionList;
3033
3229
  }
3034
- this._overlayRef = this._overlay.create(this._buildConfig());
3035
- this._overlayRef.keydownEvents().subscribe(function (event) {
3230
+ var overlayRef = this._overlayRef = this._overlay.create(this._buildConfig());
3231
+ this._attachSubscription = overlayRef.attachments().subscribe(function () { return _this.attach.emit(); });
3232
+ this._detachSubscription = overlayRef.detachments().subscribe(function () { return _this.detach.emit(); });
3233
+ overlayRef.keydownEvents().subscribe(function (event) {
3036
3234
  _this.overlayKeydown.next(event);
3037
3235
  if (event.keyCode === keycodes.ESCAPE && !keycodes.hasModifierKey(event)) {
3038
3236
  event.preventDefault();
3039
3237
  _this._detachOverlay();
3040
3238
  }
3041
3239
  });
3240
+ this._overlayRef.outsidePointerEvents().subscribe(function (event) {
3241
+ _this.overlayOutsideClick.next(event);
3242
+ });
3042
3243
  };
3043
3244
  /** Builds the overlay config based on the directive's inputs */
3044
3245
  CdkConnectedOverlay.prototype._buildConfig = function () {
@@ -3094,10 +3295,8 @@
3094
3295
  };
3095
3296
  /** Returns the position strategy of the overlay to be set on the overlay config */
3096
3297
  CdkConnectedOverlay.prototype._createPositionStrategy = function () {
3097
- var _this = this;
3098
3298
  var strategy = this._overlay.position().flexibleConnectedTo(this.origin.elementRef);
3099
3299
  this._updatePositionStrategy(strategy);
3100
- strategy.positionChanges.subscribe(function (p) { return _this.positionChange.emit(p); });
3101
3300
  return strategy;
3102
3301
  };
3103
3302
  /** Attaches the overlay and subscribes to backdrop clicks if backdrop exists */
@@ -3112,7 +3311,6 @@
3112
3311
  }
3113
3312
  if (!this._overlayRef.hasAttached()) {
3114
3313
  this._overlayRef.attach(this._templatePortal);
3115
- this.attach.emit();
3116
3314
  }
3117
3315
  if (this.hasBackdrop) {
3118
3316
  this._backdropSubscription = this._overlayRef.backdropClick().subscribe(function (event) {
@@ -3122,57 +3320,71 @@
3122
3320
  else {
3123
3321
  this._backdropSubscription.unsubscribe();
3124
3322
  }
3323
+ this._positionSubscription.unsubscribe();
3324
+ // Only subscribe to `positionChanges` if requested, because putting
3325
+ // together all the information for it can be expensive.
3326
+ if (this.positionChange.observers.length > 0) {
3327
+ this._positionSubscription = this._position.positionChanges
3328
+ .pipe(operators.takeWhile(function () { return _this.positionChange.observers.length > 0; }))
3329
+ .subscribe(function (position) {
3330
+ _this.positionChange.emit(position);
3331
+ if (_this.positionChange.observers.length === 0) {
3332
+ _this._positionSubscription.unsubscribe();
3333
+ }
3334
+ });
3335
+ }
3125
3336
  };
3126
3337
  /** Detaches the overlay and unsubscribes to backdrop clicks if backdrop exists */
3127
3338
  CdkConnectedOverlay.prototype._detachOverlay = function () {
3128
3339
  if (this._overlayRef) {
3129
3340
  this._overlayRef.detach();
3130
- this.detach.emit();
3131
3341
  }
3132
3342
  this._backdropSubscription.unsubscribe();
3133
- };
3134
- CdkConnectedOverlay.decorators = [
3135
- { type: i0.Directive, args: [{
3136
- selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
3137
- exportAs: 'cdkConnectedOverlay'
3138
- },] }
3139
- ];
3140
- CdkConnectedOverlay.ctorParameters = function () { return [
3141
- { type: Overlay },
3142
- { type: i0.TemplateRef },
3143
- { type: i0.ViewContainerRef },
3144
- { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,] }] },
3145
- { type: bidi.Directionality, decorators: [{ type: i0.Optional }] }
3146
- ]; };
3147
- CdkConnectedOverlay.propDecorators = {
3148
- origin: [{ type: i0.Input, args: ['cdkConnectedOverlayOrigin',] }],
3149
- positions: [{ type: i0.Input, args: ['cdkConnectedOverlayPositions',] }],
3150
- positionStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayPositionStrategy',] }],
3151
- offsetX: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetX',] }],
3152
- offsetY: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetY',] }],
3153
- width: [{ type: i0.Input, args: ['cdkConnectedOverlayWidth',] }],
3154
- height: [{ type: i0.Input, args: ['cdkConnectedOverlayHeight',] }],
3155
- minWidth: [{ type: i0.Input, args: ['cdkConnectedOverlayMinWidth',] }],
3156
- minHeight: [{ type: i0.Input, args: ['cdkConnectedOverlayMinHeight',] }],
3157
- backdropClass: [{ type: i0.Input, args: ['cdkConnectedOverlayBackdropClass',] }],
3158
- panelClass: [{ type: i0.Input, args: ['cdkConnectedOverlayPanelClass',] }],
3159
- viewportMargin: [{ type: i0.Input, args: ['cdkConnectedOverlayViewportMargin',] }],
3160
- scrollStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayScrollStrategy',] }],
3161
- open: [{ type: i0.Input, args: ['cdkConnectedOverlayOpen',] }],
3162
- transformOriginSelector: [{ type: i0.Input, args: ['cdkConnectedOverlayTransformOriginOn',] }],
3163
- hasBackdrop: [{ type: i0.Input, args: ['cdkConnectedOverlayHasBackdrop',] }],
3164
- lockPosition: [{ type: i0.Input, args: ['cdkConnectedOverlayLockPosition',] }],
3165
- flexibleDimensions: [{ type: i0.Input, args: ['cdkConnectedOverlayFlexibleDimensions',] }],
3166
- growAfterOpen: [{ type: i0.Input, args: ['cdkConnectedOverlayGrowAfterOpen',] }],
3167
- push: [{ type: i0.Input, args: ['cdkConnectedOverlayPush',] }],
3168
- backdropClick: [{ type: i0.Output }],
3169
- positionChange: [{ type: i0.Output }],
3170
- attach: [{ type: i0.Output }],
3171
- detach: [{ type: i0.Output }],
3172
- overlayKeydown: [{ type: i0.Output }]
3343
+ this._positionSubscription.unsubscribe();
3173
3344
  };
3174
3345
  return CdkConnectedOverlay;
3175
3346
  }());
3347
+ CdkConnectedOverlay.decorators = [
3348
+ { type: i0.Directive, args: [{
3349
+ selector: '[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]',
3350
+ exportAs: 'cdkConnectedOverlay'
3351
+ },] }
3352
+ ];
3353
+ CdkConnectedOverlay.ctorParameters = function () { return [
3354
+ { type: Overlay },
3355
+ { type: i0.TemplateRef },
3356
+ { type: i0.ViewContainerRef },
3357
+ { type: undefined, decorators: [{ type: i0.Inject, args: [CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY,] }] },
3358
+ { type: bidi.Directionality, decorators: [{ type: i0.Optional }] }
3359
+ ]; };
3360
+ CdkConnectedOverlay.propDecorators = {
3361
+ origin: [{ type: i0.Input, args: ['cdkConnectedOverlayOrigin',] }],
3362
+ positions: [{ type: i0.Input, args: ['cdkConnectedOverlayPositions',] }],
3363
+ positionStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayPositionStrategy',] }],
3364
+ offsetX: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetX',] }],
3365
+ offsetY: [{ type: i0.Input, args: ['cdkConnectedOverlayOffsetY',] }],
3366
+ width: [{ type: i0.Input, args: ['cdkConnectedOverlayWidth',] }],
3367
+ height: [{ type: i0.Input, args: ['cdkConnectedOverlayHeight',] }],
3368
+ minWidth: [{ type: i0.Input, args: ['cdkConnectedOverlayMinWidth',] }],
3369
+ minHeight: [{ type: i0.Input, args: ['cdkConnectedOverlayMinHeight',] }],
3370
+ backdropClass: [{ type: i0.Input, args: ['cdkConnectedOverlayBackdropClass',] }],
3371
+ panelClass: [{ type: i0.Input, args: ['cdkConnectedOverlayPanelClass',] }],
3372
+ viewportMargin: [{ type: i0.Input, args: ['cdkConnectedOverlayViewportMargin',] }],
3373
+ scrollStrategy: [{ type: i0.Input, args: ['cdkConnectedOverlayScrollStrategy',] }],
3374
+ open: [{ type: i0.Input, args: ['cdkConnectedOverlayOpen',] }],
3375
+ transformOriginSelector: [{ type: i0.Input, args: ['cdkConnectedOverlayTransformOriginOn',] }],
3376
+ hasBackdrop: [{ type: i0.Input, args: ['cdkConnectedOverlayHasBackdrop',] }],
3377
+ lockPosition: [{ type: i0.Input, args: ['cdkConnectedOverlayLockPosition',] }],
3378
+ flexibleDimensions: [{ type: i0.Input, args: ['cdkConnectedOverlayFlexibleDimensions',] }],
3379
+ growAfterOpen: [{ type: i0.Input, args: ['cdkConnectedOverlayGrowAfterOpen',] }],
3380
+ push: [{ type: i0.Input, args: ['cdkConnectedOverlayPush',] }],
3381
+ backdropClick: [{ type: i0.Output }],
3382
+ positionChange: [{ type: i0.Output }],
3383
+ attach: [{ type: i0.Output }],
3384
+ detach: [{ type: i0.Output }],
3385
+ overlayKeydown: [{ type: i0.Output }],
3386
+ overlayOutsideClick: [{ type: i0.Output }]
3387
+ };
3176
3388
  /** @docs-private */
3177
3389
  function CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY(overlay) {
3178
3390
  return function () { return overlay.scrollStrategies.reposition(); };
@@ -3194,19 +3406,19 @@
3194
3406
  var OverlayModule = /** @class */ (function () {
3195
3407
  function OverlayModule() {
3196
3408
  }
3197
- OverlayModule.decorators = [
3198
- { type: i0.NgModule, args: [{
3199
- imports: [bidi.BidiModule, portal.PortalModule, i1.ScrollingModule],
3200
- exports: [CdkConnectedOverlay, CdkOverlayOrigin, i1.ScrollingModule],
3201
- declarations: [CdkConnectedOverlay, CdkOverlayOrigin],
3202
- providers: [
3203
- Overlay,
3204
- CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
3205
- ],
3206
- },] }
3207
- ];
3208
3409
  return OverlayModule;
3209
3410
  }());
3411
+ OverlayModule.decorators = [
3412
+ { type: i0.NgModule, args: [{
3413
+ imports: [bidi.BidiModule, portal.PortalModule, i1.ScrollingModule],
3414
+ exports: [CdkConnectedOverlay, CdkOverlayOrigin, i1.ScrollingModule],
3415
+ declarations: [CdkConnectedOverlay, CdkOverlayOrigin],
3416
+ providers: [
3417
+ Overlay,
3418
+ CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
3419
+ ],
3420
+ },] }
3421
+ ];
3210
3422
  /**
3211
3423
  * @deprecated Use `OverlayModule` instead.
3212
3424
  * @breaking-change 8.0.0
@@ -3220,6 +3432,14 @@
3220
3432
  CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER,
3221
3433
  ];
3222
3434
 
3435
+ /**
3436
+ * @license
3437
+ * Copyright Google LLC All Rights Reserved.
3438
+ *
3439
+ * Use of this source code is governed by an MIT-style license that can be
3440
+ * found in the LICENSE file at https://angular.io/license
3441
+ */
3442
+
3223
3443
  /**
3224
3444
  * Alternative to OverlayContainer that supports correct displaying of overlay elements in
3225
3445
  * Fullscreen mode
@@ -3297,16 +3517,16 @@
3297
3517
  _document.msFullscreenElement ||
3298
3518
  null;
3299
3519
  };
3300
- FullscreenOverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: FullscreenOverlayContainer, providedIn: "root" });
3301
- FullscreenOverlayContainer.decorators = [
3302
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3303
- ];
3304
- FullscreenOverlayContainer.ctorParameters = function () { return [
3305
- { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
3306
- { type: i2.Platform }
3307
- ]; };
3308
3520
  return FullscreenOverlayContainer;
3309
3521
  }(OverlayContainer));
3522
+ FullscreenOverlayContainer.ɵprov = i0.ɵɵdefineInjectable({ factory: function FullscreenOverlayContainer_Factory() { return new FullscreenOverlayContainer(i0.ɵɵinject(i1$1.DOCUMENT), i0.ɵɵinject(i2.Platform)); }, token: FullscreenOverlayContainer, providedIn: "root" });
3523
+ FullscreenOverlayContainer.decorators = [
3524
+ { type: i0.Injectable, args: [{ providedIn: 'root' },] }
3525
+ ];
3526
+ FullscreenOverlayContainer.ctorParameters = function () { return [
3527
+ { type: undefined, decorators: [{ type: i0.Inject, args: [i1$1.DOCUMENT,] }] },
3528
+ { type: i2.Platform }
3529
+ ]; };
3310
3530
 
3311
3531
  /**
3312
3532
  * @license
@@ -3355,6 +3575,7 @@
3355
3575
  exports.OverlayContainer = OverlayContainer;
3356
3576
  exports.OverlayKeyboardDispatcher = OverlayKeyboardDispatcher;
3357
3577
  exports.OverlayModule = OverlayModule;
3578
+ exports.OverlayOutsideClickDispatcher = OverlayOutsideClickDispatcher;
3358
3579
  exports.OverlayPositionBuilder = OverlayPositionBuilder;
3359
3580
  exports.OverlayRef = OverlayRef;
3360
3581
  exports.RepositionScrollStrategy = RepositionScrollStrategy;
@@ -3362,13 +3583,14 @@
3362
3583
  exports.ScrollingVisibility = ScrollingVisibility;
3363
3584
  exports.validateHorizontalPosition = validateHorizontalPosition;
3364
3585
  exports.validateVerticalPosition = validateVerticalPosition;
3365
- exports.ɵangular_material_src_cdk_overlay_overlay_a = OVERLAY_CONTAINER_PROVIDER_FACTORY;
3366
- exports.ɵangular_material_src_cdk_overlay_overlay_b = OVERLAY_CONTAINER_PROVIDER;
3367
- exports.ɵangular_material_src_cdk_overlay_overlay_c = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY;
3368
- exports.ɵangular_material_src_cdk_overlay_overlay_d = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY;
3369
- exports.ɵangular_material_src_cdk_overlay_overlay_e = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER;
3370
- exports.ɵangular_material_src_cdk_overlay_overlay_f = OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY;
3371
- exports.ɵangular_material_src_cdk_overlay_overlay_g = OVERLAY_KEYBOARD_DISPATCHER_PROVIDER;
3586
+ exports.ɵangular_material_src_cdk_overlay_overlay_a = OVERLAY_KEYBOARD_DISPATCHER_PROVIDER_FACTORY;
3587
+ exports.ɵangular_material_src_cdk_overlay_overlay_b = OVERLAY_KEYBOARD_DISPATCHER_PROVIDER;
3588
+ exports.ɵangular_material_src_cdk_overlay_overlay_c = OVERLAY_CONTAINER_PROVIDER_FACTORY;
3589
+ exports.ɵangular_material_src_cdk_overlay_overlay_d = OVERLAY_CONTAINER_PROVIDER;
3590
+ exports.ɵangular_material_src_cdk_overlay_overlay_e = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY;
3591
+ exports.ɵangular_material_src_cdk_overlay_overlay_f = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER_FACTORY;
3592
+ exports.ɵangular_material_src_cdk_overlay_overlay_g = CDK_CONNECTED_OVERLAY_SCROLL_STRATEGY_PROVIDER;
3593
+ exports.ɵangular_material_src_cdk_overlay_overlay_h = BaseOverlayDispatcher;
3372
3594
 
3373
3595
  Object.defineProperty(exports, '__esModule', { value: true });
3374
3596