@angular/cdk 21.0.0-next.8 → 21.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/_adev_assets/cdk_drag_drop.json +13 -12
  2. package/_adev_assets/cdk_testing.json +15 -25
  3. package/_adev_assets/cdk_testing_protractor.json +1 -1
  4. package/_adev_assets/cdk_testing_selenium_webdriver.json +1 -1
  5. package/_adev_assets/cdk_testing_testbed.json +1 -1
  6. package/fesm2022/_a11y-module-chunk.mjs +755 -869
  7. package/fesm2022/_a11y-module-chunk.mjs.map +1 -1
  8. package/fesm2022/_activedescendant-key-manager-chunk.mjs +8 -8
  9. package/fesm2022/_activedescendant-key-manager-chunk.mjs.map +1 -1
  10. package/fesm2022/_array-chunk.mjs +1 -1
  11. package/fesm2022/_array-chunk.mjs.map +1 -1
  12. package/fesm2022/_breakpoints-observer-chunk.mjs +149 -152
  13. package/fesm2022/_breakpoints-observer-chunk.mjs.map +1 -1
  14. package/fesm2022/_css-pixel-value-chunk.mjs +4 -5
  15. package/fesm2022/_css-pixel-value-chunk.mjs.map +1 -1
  16. package/fesm2022/_data-source-chunk.mjs +2 -8
  17. package/fesm2022/_data-source-chunk.mjs.map +1 -1
  18. package/fesm2022/_directionality-chunk.mjs +54 -54
  19. package/fesm2022/_directionality-chunk.mjs.map +1 -1
  20. package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs +25 -36
  21. package/fesm2022/_dispose-view-repeater-strategy-chunk.mjs.map +1 -1
  22. package/fesm2022/_element-chunk.mjs +6 -17
  23. package/fesm2022/_element-chunk.mjs.map +1 -1
  24. package/fesm2022/_fake-event-detection-chunk.mjs +3 -17
  25. package/fesm2022/_fake-event-detection-chunk.mjs.map +1 -1
  26. package/fesm2022/_focus-key-manager-chunk.mjs +10 -14
  27. package/fesm2022/_focus-key-manager-chunk.mjs.map +1 -1
  28. package/fesm2022/_focus-monitor-chunk.mjs +376 -566
  29. package/fesm2022/_focus-monitor-chunk.mjs.map +1 -1
  30. package/fesm2022/_id-generator-chunk.mjs +36 -27
  31. package/fesm2022/_id-generator-chunk.mjs.map +1 -1
  32. package/fesm2022/_keycodes-chunk.mjs +9 -9
  33. package/fesm2022/_keycodes-chunk.mjs.map +1 -1
  34. package/fesm2022/_list-key-manager-chunk.mjs +248 -336
  35. package/fesm2022/_list-key-manager-chunk.mjs.map +1 -1
  36. package/fesm2022/_overlay-module-chunk.mjs +2534 -2948
  37. package/fesm2022/_overlay-module-chunk.mjs.map +1 -1
  38. package/fesm2022/_passive-listeners-chunk.mjs +10 -22
  39. package/fesm2022/_passive-listeners-chunk.mjs.map +1 -1
  40. package/fesm2022/_platform-chunk.mjs +42 -65
  41. package/fesm2022/_platform-chunk.mjs.map +1 -1
  42. package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs +78 -134
  43. package/fesm2022/_recycle-view-repeater-strategy-chunk.mjs.map +1 -1
  44. package/fesm2022/_scrolling-chunk.mjs +44 -85
  45. package/fesm2022/_scrolling-chunk.mjs.map +1 -1
  46. package/fesm2022/_selection-model-chunk.mjs +138 -209
  47. package/fesm2022/_selection-model-chunk.mjs.map +1 -1
  48. package/fesm2022/_shadow-dom-chunk.mjs +21 -35
  49. package/fesm2022/_shadow-dom-chunk.mjs.map +1 -1
  50. package/fesm2022/_style-loader-chunk.mjs +50 -37
  51. package/fesm2022/_style-loader-chunk.mjs.map +1 -1
  52. package/fesm2022/_test-environment-chunk.mjs +2 -14
  53. package/fesm2022/_test-environment-chunk.mjs.map +1 -1
  54. package/fesm2022/_tree-key-manager-chunk.mjs +229 -308
  55. package/fesm2022/_tree-key-manager-chunk.mjs.map +1 -1
  56. package/fesm2022/_typeahead-chunk.mjs +52 -74
  57. package/fesm2022/_typeahead-chunk.mjs.map +1 -1
  58. package/fesm2022/_unique-selection-dispatcher-chunk.mjs +43 -40
  59. package/fesm2022/_unique-selection-dispatcher-chunk.mjs.map +1 -1
  60. package/fesm2022/a11y.mjs +351 -449
  61. package/fesm2022/a11y.mjs.map +1 -1
  62. package/fesm2022/accordion.mjs +254 -192
  63. package/fesm2022/accordion.mjs.map +1 -1
  64. package/fesm2022/bidi.mjs +121 -64
  65. package/fesm2022/bidi.mjs.map +1 -1
  66. package/fesm2022/cdk.mjs +1 -2
  67. package/fesm2022/cdk.mjs.map +1 -1
  68. package/fesm2022/clipboard.mjs +208 -186
  69. package/fesm2022/clipboard.mjs.map +1 -1
  70. package/fesm2022/coercion-private.mjs +4 -8
  71. package/fesm2022/coercion-private.mjs.map +1 -1
  72. package/fesm2022/coercion.mjs +11 -29
  73. package/fesm2022/coercion.mjs.map +1 -1
  74. package/fesm2022/dialog.mjs +660 -808
  75. package/fesm2022/dialog.mjs.map +1 -1
  76. package/fesm2022/drag-drop.mjs +3347 -4286
  77. package/fesm2022/drag-drop.mjs.map +1 -1
  78. package/fesm2022/keycodes.mjs +4 -8
  79. package/fesm2022/keycodes.mjs.map +1 -1
  80. package/fesm2022/layout.mjs +44 -26
  81. package/fesm2022/layout.mjs.map +1 -1
  82. package/fesm2022/listbox.mjs +841 -895
  83. package/fesm2022/listbox.mjs.map +1 -1
  84. package/fesm2022/menu.mjs +1942 -1858
  85. package/fesm2022/menu.mjs.map +1 -1
  86. package/fesm2022/observers-private.mjs +88 -106
  87. package/fesm2022/observers-private.mjs.map +1 -1
  88. package/fesm2022/observers.mjs +262 -184
  89. package/fesm2022/observers.mjs.map +1 -1
  90. package/fesm2022/overlay.mjs +72 -68
  91. package/fesm2022/overlay.mjs.map +1 -1
  92. package/fesm2022/platform.mjs +43 -54
  93. package/fesm2022/platform.mjs.map +1 -1
  94. package/fesm2022/portal.mjs +402 -560
  95. package/fesm2022/portal.mjs.map +1 -1
  96. package/fesm2022/private.mjs +38 -10
  97. package/fesm2022/private.mjs.map +1 -1
  98. package/fesm2022/scrolling.mjs +1323 -1400
  99. package/fesm2022/scrolling.mjs.map +1 -1
  100. package/fesm2022/stepper.mjs +758 -590
  101. package/fesm2022/stepper.mjs.map +1 -1
  102. package/fesm2022/table.mjs +2327 -2319
  103. package/fesm2022/table.mjs.map +1 -1
  104. package/fesm2022/testing-selenium-webdriver.mjs +252 -325
  105. package/fesm2022/testing-selenium-webdriver.mjs.map +1 -1
  106. package/fesm2022/testing-testbed.mjs +592 -709
  107. package/fesm2022/testing-testbed.mjs.map +1 -1
  108. package/fesm2022/testing.mjs +368 -889
  109. package/fesm2022/testing.mjs.map +1 -1
  110. package/fesm2022/text-field.mjs +459 -388
  111. package/fesm2022/text-field.mjs.map +1 -1
  112. package/fesm2022/tree.mjs +1483 -1731
  113. package/fesm2022/tree.mjs.map +1 -1
  114. package/overlay/_index.scss +28 -0
  115. package/overlay-prebuilt.css +1 -1
  116. package/package.json +1 -1
  117. package/schematics/ng-add/index.js +1 -1
  118. package/types/_harness-environment-chunk.d.ts +1 -2
  119. package/types/_overlay-module-chunk.d.ts +59 -7
  120. package/types/_portal-directives-chunk.d.ts +2 -18
  121. package/types/accordion.d.ts +3 -1
  122. package/types/dialog.d.ts +1 -1
  123. package/types/overlay.d.ts +6 -2
  124. package/types/portal.d.ts +1 -1
@@ -1,614 +1,456 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { ElementRef, NgModuleRef, EnvironmentInjector, createComponent, Injector, inject, TemplateRef, ViewContainerRef, Directive, DOCUMENT, EventEmitter, Input, Output, NgModule } from '@angular/core';
3
3
 
4
- /**
5
- * Throws an exception when attempting to attach a null portal to a host.
6
- * @docs-private
7
- */
8
4
  function throwNullPortalError() {
9
- throw Error('Must provide a portal to attach');
5
+ throw Error('Must provide a portal to attach');
10
6
  }
11
- /**
12
- * Throws an exception when attempting to attach a portal to a host that is already attached.
13
- * @docs-private
14
- */
15
7
  function throwPortalAlreadyAttachedError() {
16
- throw Error('Host already has a portal attached');
8
+ throw Error('Host already has a portal attached');
17
9
  }
18
- /**
19
- * Throws an exception when attempting to attach a portal to an already-disposed host.
20
- * @docs-private
21
- */
22
10
  function throwPortalOutletAlreadyDisposedError() {
23
- throw Error('This PortalOutlet has already been disposed');
11
+ throw Error('This PortalOutlet has already been disposed');
24
12
  }
25
- /**
26
- * Throws an exception when attempting to attach an unknown portal type.
27
- * @docs-private
28
- */
29
13
  function throwUnknownPortalTypeError() {
30
- throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' +
31
- 'a ComponentPortal or a TemplatePortal.');
14
+ throw Error('Attempting to attach an unknown Portal type. BasePortalOutlet accepts either ' + 'a ComponentPortal or a TemplatePortal.');
32
15
  }
33
- /**
34
- * Throws an exception when attempting to attach a portal to a null host.
35
- * @docs-private
36
- */
37
16
  function throwNullPortalOutletError() {
38
- throw Error('Attempting to attach a portal to a null PortalOutlet');
17
+ throw Error('Attempting to attach a portal to a null PortalOutlet');
39
18
  }
40
- /**
41
- * Throws an exception when attempting to detach a portal that is not attached.
42
- * @docs-private
43
- */
44
19
  function throwNoPortalAttachedError() {
45
- throw Error('Attempting to detach a portal that is not attached to a host');
20
+ throw Error('Attempting to detach a portal that is not attached to a host');
46
21
  }
47
22
 
48
- /**
49
- * A `Portal` is something that you want to render somewhere else.
50
- * It can be attach to / detached from a `PortalOutlet`.
51
- */
52
23
  class Portal {
53
- _attachedHost;
54
- /** Attach this portal to a host. */
55
- attach(host) {
56
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
57
- if (host == null) {
58
- throwNullPortalOutletError();
59
- }
60
- if (host.hasAttached()) {
61
- throwPortalAlreadyAttachedError();
62
- }
63
- }
64
- this._attachedHost = host;
65
- return host.attach(this);
66
- }
67
- /** Detach this portal from its host */
68
- detach() {
69
- let host = this._attachedHost;
70
- if (host != null) {
71
- this._attachedHost = null;
72
- host.detach();
73
- }
74
- else if (typeof ngDevMode === 'undefined' || ngDevMode) {
75
- throwNoPortalAttachedError();
76
- }
77
- }
78
- /** Whether this portal is attached to a host. */
79
- get isAttached() {
80
- return this._attachedHost != null;
24
+ _attachedHost;
25
+ attach(host) {
26
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
27
+ if (host == null) {
28
+ throwNullPortalOutletError();
29
+ }
30
+ if (host.hasAttached()) {
31
+ throwPortalAlreadyAttachedError();
32
+ }
81
33
  }
82
- /**
83
- * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
84
- * the PortalOutlet when it is performing an `attach()` or `detach()`.
85
- */
86
- setAttachedHost(host) {
87
- this._attachedHost = host;
34
+ this._attachedHost = host;
35
+ return host.attach(this);
36
+ }
37
+ detach() {
38
+ let host = this._attachedHost;
39
+ if (host != null) {
40
+ this._attachedHost = null;
41
+ host.detach();
42
+ } else if (typeof ngDevMode === 'undefined' || ngDevMode) {
43
+ throwNoPortalAttachedError();
88
44
  }
45
+ }
46
+ get isAttached() {
47
+ return this._attachedHost != null;
48
+ }
49
+ setAttachedHost(host) {
50
+ this._attachedHost = host;
51
+ }
89
52
  }
90
- /**
91
- * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
92
- */
93
53
  class ComponentPortal extends Portal {
94
- /** The type of the component that will be instantiated for attachment. */
95
- component;
96
- /**
97
- * Where the attached component should live in Angular's *logical* component tree.
98
- * This is different from where the component *renders*, which is determined by the PortalOutlet.
99
- * The origin is necessary when the host is outside of the Angular application context.
100
- */
101
- viewContainerRef;
102
- /** Injector used for the instantiation of the component. */
103
- injector;
104
- /**
105
- * List of DOM nodes that should be projected through `<ng-content>` of the attached component.
106
- */
107
- projectableNodes;
108
- constructor(component, viewContainerRef, injector, projectableNodes) {
109
- super();
110
- this.component = component;
111
- this.viewContainerRef = viewContainerRef;
112
- this.injector = injector;
113
- this.projectableNodes = projectableNodes;
114
- }
54
+ component;
55
+ viewContainerRef;
56
+ injector;
57
+ projectableNodes;
58
+ constructor(component, viewContainerRef, injector, projectableNodes) {
59
+ super();
60
+ this.component = component;
61
+ this.viewContainerRef = viewContainerRef;
62
+ this.injector = injector;
63
+ this.projectableNodes = projectableNodes;
64
+ }
115
65
  }
116
- /**
117
- * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
118
- */
119
66
  class TemplatePortal extends Portal {
120
- templateRef;
121
- viewContainerRef;
122
- context;
123
- injector;
124
- constructor(
125
- /** The embedded template that will be used to instantiate an embedded View in the host. */
126
- templateRef,
127
- /** Reference to the ViewContainer into which the template will be stamped out. */
128
- viewContainerRef,
129
- /** Contextual data to be passed in to the embedded view. */
130
- context,
131
- /** The injector to use for the embedded view. */
132
- injector) {
133
- super();
134
- this.templateRef = templateRef;
135
- this.viewContainerRef = viewContainerRef;
136
- this.context = context;
137
- this.injector = injector;
138
- }
139
- get origin() {
140
- return this.templateRef.elementRef;
141
- }
142
- /**
143
- * Attach the portal to the provided `PortalOutlet`.
144
- * When a context is provided it will override the `context` property of the `TemplatePortal`
145
- * instance.
146
- */
147
- attach(host, context = this.context) {
148
- this.context = context;
149
- return super.attach(host);
150
- }
151
- detach() {
152
- this.context = undefined;
153
- return super.detach();
154
- }
67
+ templateRef;
68
+ viewContainerRef;
69
+ context;
70
+ injector;
71
+ constructor(templateRef, viewContainerRef, context, injector) {
72
+ super();
73
+ this.templateRef = templateRef;
74
+ this.viewContainerRef = viewContainerRef;
75
+ this.context = context;
76
+ this.injector = injector;
77
+ }
78
+ get origin() {
79
+ return this.templateRef.elementRef;
80
+ }
81
+ attach(host, context = this.context) {
82
+ this.context = context;
83
+ return super.attach(host);
84
+ }
85
+ detach() {
86
+ this.context = undefined;
87
+ return super.detach();
88
+ }
155
89
  }
156
- /**
157
- * A `DomPortal` is a portal whose DOM element will be taken from its current position
158
- * in the DOM and moved into a portal outlet, when it is attached. On detach, the content
159
- * will be restored to its original position.
160
- */
161
90
  class DomPortal extends Portal {
162
- /** DOM node hosting the portal's content. */
163
- element;
164
- constructor(element) {
165
- super();
166
- this.element = element instanceof ElementRef ? element.nativeElement : element;
167
- }
91
+ element;
92
+ constructor(element) {
93
+ super();
94
+ this.element = element instanceof ElementRef ? element.nativeElement : element;
95
+ }
168
96
  }
169
- /**
170
- * Partial implementation of PortalOutlet that handles attaching
171
- * ComponentPortal and TemplatePortal.
172
- */
173
97
  class BasePortalOutlet {
174
- /** The portal currently attached to the host. */
175
- _attachedPortal;
176
- /** A function that will permanently dispose this host. */
177
- _disposeFn;
178
- /** Whether this host has already been permanently disposed. */
179
- _isDisposed = false;
180
- /** Whether this host has an attached portal. */
181
- hasAttached() {
182
- return !!this._attachedPortal;
98
+ _attachedPortal;
99
+ _disposeFn;
100
+ _isDisposed = false;
101
+ hasAttached() {
102
+ return !!this._attachedPortal;
103
+ }
104
+ attach(portal) {
105
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
106
+ if (!portal) {
107
+ throwNullPortalError();
108
+ }
109
+ if (this.hasAttached()) {
110
+ throwPortalAlreadyAttachedError();
111
+ }
112
+ if (this._isDisposed) {
113
+ throwPortalOutletAlreadyDisposedError();
114
+ }
183
115
  }
184
- /** Attaches a portal. */
185
- attach(portal) {
186
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
187
- if (!portal) {
188
- throwNullPortalError();
189
- }
190
- if (this.hasAttached()) {
191
- throwPortalAlreadyAttachedError();
192
- }
193
- if (this._isDisposed) {
194
- throwPortalOutletAlreadyDisposedError();
195
- }
196
- }
197
- if (portal instanceof ComponentPortal) {
198
- this._attachedPortal = portal;
199
- return this.attachComponentPortal(portal);
200
- }
201
- else if (portal instanceof TemplatePortal) {
202
- this._attachedPortal = portal;
203
- return this.attachTemplatePortal(portal);
204
- // @breaking-change 10.0.0 remove null check for `this.attachDomPortal`.
205
- }
206
- else if (this.attachDomPortal && portal instanceof DomPortal) {
207
- this._attachedPortal = portal;
208
- return this.attachDomPortal(portal);
209
- }
210
- if (typeof ngDevMode === 'undefined' || ngDevMode) {
211
- throwUnknownPortalTypeError();
212
- }
116
+ if (portal instanceof ComponentPortal) {
117
+ this._attachedPortal = portal;
118
+ return this.attachComponentPortal(portal);
119
+ } else if (portal instanceof TemplatePortal) {
120
+ this._attachedPortal = portal;
121
+ return this.attachTemplatePortal(portal);
122
+ } else if (this.attachDomPortal && portal instanceof DomPortal) {
123
+ this._attachedPortal = portal;
124
+ return this.attachDomPortal(portal);
213
125
  }
214
- // @breaking-change 10.0.0 `attachDomPortal` to become a required abstract method.
215
- attachDomPortal = null;
216
- /** Detaches a previously attached portal. */
217
- detach() {
218
- if (this._attachedPortal) {
219
- this._attachedPortal.setAttachedHost(null);
220
- this._attachedPortal = null;
221
- }
222
- this._invokeDisposeFn();
126
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
127
+ throwUnknownPortalTypeError();
223
128
  }
224
- /** Permanently dispose of this portal host. */
225
- dispose() {
226
- if (this.hasAttached()) {
227
- this.detach();
228
- }
229
- this._invokeDisposeFn();
230
- this._isDisposed = true;
129
+ }
130
+ attachDomPortal = null;
131
+ detach() {
132
+ if (this._attachedPortal) {
133
+ this._attachedPortal.setAttachedHost(null);
134
+ this._attachedPortal = null;
231
135
  }
232
- /** @docs-private */
233
- setDisposeFn(fn) {
234
- this._disposeFn = fn;
136
+ this._invokeDisposeFn();
137
+ }
138
+ dispose() {
139
+ if (this.hasAttached()) {
140
+ this.detach();
235
141
  }
236
- _invokeDisposeFn() {
237
- if (this._disposeFn) {
238
- this._disposeFn();
239
- this._disposeFn = null;
240
- }
142
+ this._invokeDisposeFn();
143
+ this._isDisposed = true;
144
+ }
145
+ setDisposeFn(fn) {
146
+ this._disposeFn = fn;
147
+ }
148
+ _invokeDisposeFn() {
149
+ if (this._disposeFn) {
150
+ this._disposeFn();
151
+ this._disposeFn = null;
241
152
  }
153
+ }
242
154
  }
243
155
 
244
- /**
245
- * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
246
- * application context.
247
- */
248
156
  class DomPortalOutlet extends BasePortalOutlet {
249
- outletElement;
250
- _appRef;
251
- _defaultInjector;
252
- /**
253
- * @param outletElement Element into which the content is projected.
254
- * @param _appRef Reference to the application. Only used in component portals when there
255
- * is no `ViewContainerRef` available.
256
- * @param _defaultInjector Injector to use as a fallback when the portal being attached doesn't
257
- * have one. Only used for component portals.
258
- */
259
- constructor(
260
- /** Element into which the content is projected. */
261
- outletElement, _appRef, _defaultInjector) {
262
- super();
263
- this.outletElement = outletElement;
264
- this._appRef = _appRef;
265
- this._defaultInjector = _defaultInjector;
266
- }
267
- /**
268
- * Attach the given ComponentPortal to DOM element.
269
- * @param portal Portal to be attached
270
- * @returns Reference to the created component.
271
- */
272
- attachComponentPortal(portal) {
273
- let componentRef;
274
- // If the portal specifies a ViewContainerRef, we will use that as the attachment point
275
- // for the component (in terms of Angular's component tree, not rendering).
276
- // When the ViewContainerRef is missing, we use the factory to create the component directly
277
- // and then manually attach the view to the application.
278
- if (portal.viewContainerRef) {
279
- const injector = portal.injector || portal.viewContainerRef.injector;
280
- const ngModuleRef = injector.get(NgModuleRef, null, { optional: true }) || undefined;
281
- componentRef = portal.viewContainerRef.createComponent(portal.component, {
282
- index: portal.viewContainerRef.length,
283
- injector,
284
- ngModuleRef,
285
- projectableNodes: portal.projectableNodes || undefined,
286
- });
287
- this.setDisposeFn(() => componentRef.destroy());
288
- }
289
- else {
290
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) {
291
- throw Error('Cannot attach component portal to outlet without an ApplicationRef.');
292
- }
293
- const appRef = this._appRef;
294
- const elementInjector = portal.injector || this._defaultInjector || Injector.NULL;
295
- const environmentInjector = elementInjector.get(EnvironmentInjector, appRef.injector);
296
- componentRef = createComponent(portal.component, {
297
- elementInjector,
298
- environmentInjector,
299
- projectableNodes: portal.projectableNodes || undefined,
300
- });
301
- appRef.attachView(componentRef.hostView);
302
- this.setDisposeFn(() => {
303
- // Verify that the ApplicationRef has registered views before trying to detach a host view.
304
- // This check also protects the `detachView` from being called on a destroyed ApplicationRef.
305
- if (appRef.viewCount > 0) {
306
- appRef.detachView(componentRef.hostView);
307
- }
308
- componentRef.destroy();
309
- });
157
+ outletElement;
158
+ _appRef;
159
+ _defaultInjector;
160
+ constructor(outletElement, _appRef, _defaultInjector) {
161
+ super();
162
+ this.outletElement = outletElement;
163
+ this._appRef = _appRef;
164
+ this._defaultInjector = _defaultInjector;
165
+ }
166
+ attachComponentPortal(portal) {
167
+ let componentRef;
168
+ if (portal.viewContainerRef) {
169
+ const injector = portal.injector || portal.viewContainerRef.injector;
170
+ const ngModuleRef = injector.get(NgModuleRef, null, {
171
+ optional: true
172
+ }) || undefined;
173
+ componentRef = portal.viewContainerRef.createComponent(portal.component, {
174
+ index: portal.viewContainerRef.length,
175
+ injector,
176
+ ngModuleRef,
177
+ projectableNodes: portal.projectableNodes || undefined
178
+ });
179
+ this.setDisposeFn(() => componentRef.destroy());
180
+ } else {
181
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !this._appRef) {
182
+ throw Error('Cannot attach component portal to outlet without an ApplicationRef.');
183
+ }
184
+ const appRef = this._appRef;
185
+ const elementInjector = portal.injector || this._defaultInjector || Injector.NULL;
186
+ const environmentInjector = elementInjector.get(EnvironmentInjector, appRef.injector);
187
+ componentRef = createComponent(portal.component, {
188
+ elementInjector,
189
+ environmentInjector,
190
+ projectableNodes: portal.projectableNodes || undefined
191
+ });
192
+ appRef.attachView(componentRef.hostView);
193
+ this.setDisposeFn(() => {
194
+ if (appRef.viewCount > 0) {
195
+ appRef.detachView(componentRef.hostView);
310
196
  }
311
- // At this point the component has been instantiated, so we move it to the location in the DOM
312
- // where we want it to be rendered.
313
- this.outletElement.appendChild(this._getComponentRootNode(componentRef));
314
- this._attachedPortal = portal;
315
- return componentRef;
197
+ componentRef.destroy();
198
+ });
316
199
  }
317
- /**
318
- * Attaches a template portal to the DOM as an embedded view.
319
- * @param portal Portal to be attached.
320
- * @returns Reference to the created embedded view.
321
- */
322
- attachTemplatePortal(portal) {
323
- let viewContainer = portal.viewContainerRef;
324
- let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
325
- injector: portal.injector,
326
- });
327
- // The method `createEmbeddedView` will add the view as a child of the viewContainer.
328
- // But for the DomPortalOutlet the view can be added everywhere in the DOM
329
- // (e.g Overlay Container) To move the view to the specified host element. We just
330
- // re-append the existing root nodes.
331
- viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));
332
- // Note that we want to detect changes after the nodes have been moved so that
333
- // any directives inside the portal that are looking at the DOM inside a lifecycle
334
- // hook won't be invoked too early.
335
- viewRef.detectChanges();
336
- this.setDisposeFn(() => {
337
- let index = viewContainer.indexOf(viewRef);
338
- if (index !== -1) {
339
- viewContainer.remove(index);
340
- }
341
- });
342
- this._attachedPortal = portal;
343
- // TODO(jelbourn): Return locals from view.
344
- return viewRef;
345
- }
346
- /**
347
- * Attaches a DOM portal by transferring its content into the outlet.
348
- * @param portal Portal to be attached.
349
- * @deprecated To be turned into a method.
350
- * @breaking-change 10.0.0
351
- */
352
- attachDomPortal = (portal) => {
353
- const element = portal.element;
354
- if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
355
- throw Error('DOM portal content must be attached to a parent node.');
356
- }
357
- // Anchor used to save the element's previous position so
358
- // that we can restore it when the portal is detached.
359
- const anchorNode = this.outletElement.ownerDocument.createComment('dom-portal');
360
- element.parentNode.insertBefore(anchorNode, element);
361
- this.outletElement.appendChild(element);
362
- this._attachedPortal = portal;
363
- super.setDisposeFn(() => {
364
- // We can't use `replaceWith` here because IE doesn't support it.
365
- if (anchorNode.parentNode) {
366
- anchorNode.parentNode.replaceChild(element, anchorNode);
367
- }
368
- });
369
- };
370
- /**
371
- * Clears out a portal from the DOM.
372
- */
373
- dispose() {
374
- super.dispose();
375
- this.outletElement.remove();
376
- }
377
- /** Gets the root HTMLElement for an instantiated component. */
378
- _getComponentRootNode(componentRef) {
379
- return componentRef.hostView.rootNodes[0];
200
+ this.outletElement.appendChild(this._getComponentRootNode(componentRef));
201
+ this._attachedPortal = portal;
202
+ return componentRef;
203
+ }
204
+ attachTemplatePortal(portal) {
205
+ let viewContainer = portal.viewContainerRef;
206
+ let viewRef = viewContainer.createEmbeddedView(portal.templateRef, portal.context, {
207
+ injector: portal.injector
208
+ });
209
+ viewRef.rootNodes.forEach(rootNode => this.outletElement.appendChild(rootNode));
210
+ viewRef.detectChanges();
211
+ this.setDisposeFn(() => {
212
+ let index = viewContainer.indexOf(viewRef);
213
+ if (index !== -1) {
214
+ viewContainer.remove(index);
215
+ }
216
+ });
217
+ this._attachedPortal = portal;
218
+ return viewRef;
219
+ }
220
+ attachDomPortal = portal => {
221
+ const element = portal.element;
222
+ if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
223
+ throw Error('DOM portal content must be attached to a parent node.');
380
224
  }
225
+ const anchorNode = this.outletElement.ownerDocument.createComment('dom-portal');
226
+ element.parentNode.insertBefore(anchorNode, element);
227
+ this.outletElement.appendChild(element);
228
+ this._attachedPortal = portal;
229
+ super.setDisposeFn(() => {
230
+ if (anchorNode.parentNode) {
231
+ anchorNode.parentNode.replaceChild(element, anchorNode);
232
+ }
233
+ });
234
+ };
235
+ dispose() {
236
+ super.dispose();
237
+ this.outletElement.remove();
238
+ }
239
+ _getComponentRootNode(componentRef) {
240
+ return componentRef.hostView.rootNodes[0];
241
+ }
381
242
  }
382
243
 
383
- /**
384
- * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
385
- * the directive instance itself can be attached to a host, enabling declarative use of portals.
386
- */
387
244
  class CdkPortal extends TemplatePortal {
388
- constructor() {
389
- const templateRef = inject(TemplateRef);
390
- const viewContainerRef = inject(ViewContainerRef);
391
- super(templateRef, viewContainerRef);
392
- }
393
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortal, deps: [], target: i0.ɵɵFactoryTarget.Directive });
394
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkPortal, isStandalone: true, selector: "[cdkPortal]", exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
245
+ constructor() {
246
+ const templateRef = inject(TemplateRef);
247
+ const viewContainerRef = inject(ViewContainerRef);
248
+ super(templateRef, viewContainerRef);
249
+ }
250
+ static ɵfac = i0.ɵɵngDeclareFactory({
251
+ minVersion: "12.0.0",
252
+ version: "20.2.0-next.2",
253
+ ngImport: i0,
254
+ type: CdkPortal,
255
+ deps: [],
256
+ target: i0.ɵɵFactoryTarget.Directive
257
+ });
258
+ static ɵdir = i0.ɵɵngDeclareDirective({
259
+ minVersion: "14.0.0",
260
+ version: "20.2.0-next.2",
261
+ type: CdkPortal,
262
+ isStandalone: true,
263
+ selector: "[cdkPortal]",
264
+ exportAs: ["cdkPortal"],
265
+ usesInheritance: true,
266
+ ngImport: i0
267
+ });
395
268
  }
396
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortal, decorators: [{
397
- type: Directive,
398
- args: [{
399
- selector: '[cdkPortal]',
400
- exportAs: 'cdkPortal',
401
- }]
402
- }], ctorParameters: () => [] });
403
- /**
404
- * @deprecated Use `CdkPortal` instead.
405
- * @breaking-change 9.0.0
406
- */
407
- class TemplatePortalDirective extends CdkPortal {
408
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TemplatePortalDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
409
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: TemplatePortalDirective, isStandalone: true, selector: "[cdk-portal], [portal]", providers: [
410
- {
411
- provide: CdkPortal,
412
- useExisting: TemplatePortalDirective,
413
- },
414
- ], exportAs: ["cdkPortal"], usesInheritance: true, ngImport: i0 });
415
- }
416
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: TemplatePortalDirective, decorators: [{
417
- type: Directive,
418
- args: [{
419
- selector: '[cdk-portal], [portal]',
420
- exportAs: 'cdkPortal',
421
- providers: [
422
- {
423
- provide: CdkPortal,
424
- useExisting: TemplatePortalDirective,
425
- },
426
- ],
427
- }]
428
- }] });
429
- /**
430
- * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
431
- * directly attached to it, enabling declarative use.
432
- *
433
- * Usage:
434
- * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
435
- */
269
+ i0.ɵɵngDeclareClassMetadata({
270
+ minVersion: "12.0.0",
271
+ version: "20.2.0-next.2",
272
+ ngImport: i0,
273
+ type: CdkPortal,
274
+ decorators: [{
275
+ type: Directive,
276
+ args: [{
277
+ selector: '[cdkPortal]',
278
+ exportAs: 'cdkPortal'
279
+ }]
280
+ }],
281
+ ctorParameters: () => []
282
+ });
436
283
  class CdkPortalOutlet extends BasePortalOutlet {
437
- _moduleRef = inject(NgModuleRef, { optional: true });
438
- _document = inject(DOCUMENT);
439
- _viewContainerRef = inject(ViewContainerRef);
440
- /** Whether the portal component is initialized. */
441
- _isInitialized = false;
442
- /** Reference to the currently-attached component/view ref. */
443
- _attachedRef;
444
- constructor() {
445
- super();
446
- }
447
- /** Portal associated with the Portal outlet. */
448
- get portal() {
449
- return this._attachedPortal;
284
+ _moduleRef = inject(NgModuleRef, {
285
+ optional: true
286
+ });
287
+ _document = inject(DOCUMENT);
288
+ _viewContainerRef = inject(ViewContainerRef);
289
+ _isInitialized = false;
290
+ _attachedRef;
291
+ constructor() {
292
+ super();
293
+ }
294
+ get portal() {
295
+ return this._attachedPortal;
296
+ }
297
+ set portal(portal) {
298
+ if (this.hasAttached() && !portal && !this._isInitialized) {
299
+ return;
450
300
  }
451
- set portal(portal) {
452
- // Ignore the cases where the `portal` is set to a falsy value before the lifecycle hooks have
453
- // run. This handles the cases where the user might do something like `<div cdkPortalOutlet>`
454
- // and attach a portal programmatically in the parent component. When Angular does the first CD
455
- // round, it will fire the setter with empty string, causing the user's content to be cleared.
456
- if (this.hasAttached() && !portal && !this._isInitialized) {
457
- return;
458
- }
459
- if (this.hasAttached()) {
460
- super.detach();
461
- }
462
- if (portal) {
463
- super.attach(portal);
464
- }
465
- this._attachedPortal = portal || null;
301
+ if (this.hasAttached()) {
302
+ super.detach();
466
303
  }
467
- /** Emits when a portal is attached to the outlet. */
468
- attached = new EventEmitter();
469
- /** Component or view reference that is attached to the portal. */
470
- get attachedRef() {
471
- return this._attachedRef;
304
+ if (portal) {
305
+ super.attach(portal);
472
306
  }
473
- ngOnInit() {
474
- this._isInitialized = true;
307
+ this._attachedPortal = portal || null;
308
+ }
309
+ attached = new EventEmitter();
310
+ get attachedRef() {
311
+ return this._attachedRef;
312
+ }
313
+ ngOnInit() {
314
+ this._isInitialized = true;
315
+ }
316
+ ngOnDestroy() {
317
+ super.dispose();
318
+ this._attachedRef = this._attachedPortal = null;
319
+ }
320
+ attachComponentPortal(portal) {
321
+ portal.setAttachedHost(this);
322
+ const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
323
+ const ref = viewContainerRef.createComponent(portal.component, {
324
+ index: viewContainerRef.length,
325
+ injector: portal.injector || viewContainerRef.injector,
326
+ projectableNodes: portal.projectableNodes || undefined,
327
+ ngModuleRef: this._moduleRef || undefined
328
+ });
329
+ if (viewContainerRef !== this._viewContainerRef) {
330
+ this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
475
331
  }
476
- ngOnDestroy() {
477
- super.dispose();
478
- this._attachedRef = this._attachedPortal = null;
479
- }
480
- /**
481
- * Attach the given ComponentPortal to this PortalOutlet.
482
- *
483
- * @param portal Portal to be attached to the portal outlet.
484
- * @returns Reference to the created component.
485
- */
486
- attachComponentPortal(portal) {
487
- portal.setAttachedHost(this);
488
- // If the portal specifies an origin, use that as the logical location of the component
489
- // in the application tree. Otherwise use the location of this PortalOutlet.
490
- const viewContainerRef = portal.viewContainerRef != null ? portal.viewContainerRef : this._viewContainerRef;
491
- const ref = viewContainerRef.createComponent(portal.component, {
492
- index: viewContainerRef.length,
493
- injector: portal.injector || viewContainerRef.injector,
494
- projectableNodes: portal.projectableNodes || undefined,
495
- ngModuleRef: this._moduleRef || undefined,
496
- });
497
- // If we're using a view container that's different from the injected one (e.g. when the portal
498
- // specifies its own) we need to move the component into the outlet, otherwise it'll be rendered
499
- // inside of the alternate view container.
500
- if (viewContainerRef !== this._viewContainerRef) {
501
- this._getRootNode().appendChild(ref.hostView.rootNodes[0]);
502
- }
503
- super.setDisposeFn(() => ref.destroy());
504
- this._attachedPortal = portal;
505
- this._attachedRef = ref;
506
- this.attached.emit(ref);
507
- return ref;
332
+ super.setDisposeFn(() => ref.destroy());
333
+ this._attachedPortal = portal;
334
+ this._attachedRef = ref;
335
+ this.attached.emit(ref);
336
+ return ref;
337
+ }
338
+ attachTemplatePortal(portal) {
339
+ portal.setAttachedHost(this);
340
+ const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
341
+ injector: portal.injector
342
+ });
343
+ super.setDisposeFn(() => this._viewContainerRef.clear());
344
+ this._attachedPortal = portal;
345
+ this._attachedRef = viewRef;
346
+ this.attached.emit(viewRef);
347
+ return viewRef;
348
+ }
349
+ attachDomPortal = portal => {
350
+ const element = portal.element;
351
+ if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
352
+ throw Error('DOM portal content must be attached to a parent node.');
508
353
  }
509
- /**
510
- * Attach the given TemplatePortal to this PortalHost as an embedded View.
511
- * @param portal Portal to be attached.
512
- * @returns Reference to the created embedded view.
513
- */
514
- attachTemplatePortal(portal) {
515
- portal.setAttachedHost(this);
516
- const viewRef = this._viewContainerRef.createEmbeddedView(portal.templateRef, portal.context, {
517
- injector: portal.injector,
518
- });
519
- super.setDisposeFn(() => this._viewContainerRef.clear());
520
- this._attachedPortal = portal;
521
- this._attachedRef = viewRef;
522
- this.attached.emit(viewRef);
523
- return viewRef;
524
- }
525
- /**
526
- * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
527
- * @param portal Portal to be attached.
528
- * @deprecated To be turned into a method.
529
- * @breaking-change 10.0.0
530
- */
531
- attachDomPortal = (portal) => {
532
- const element = portal.element;
533
- if (!element.parentNode && (typeof ngDevMode === 'undefined' || ngDevMode)) {
534
- throw Error('DOM portal content must be attached to a parent node.');
535
- }
536
- // Anchor used to save the element's previous position so
537
- // that we can restore it when the portal is detached.
538
- const anchorNode = this._document.createComment('dom-portal');
539
- portal.setAttachedHost(this);
540
- element.parentNode.insertBefore(anchorNode, element);
541
- this._getRootNode().appendChild(element);
542
- this._attachedPortal = portal;
543
- super.setDisposeFn(() => {
544
- if (anchorNode.parentNode) {
545
- anchorNode.parentNode.replaceChild(element, anchorNode);
546
- }
547
- });
548
- };
549
- /** Gets the root node of the portal outlet. */
550
- _getRootNode() {
551
- const nativeElement = this._viewContainerRef.element.nativeElement;
552
- // The directive could be set on a template which will result in a comment
553
- // node being the root. Use the comment's parent node if that is the case.
554
- return (nativeElement.nodeType === nativeElement.ELEMENT_NODE
555
- ? nativeElement
556
- : nativeElement.parentNode);
557
- }
558
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortalOutlet, deps: [], target: i0.ɵɵFactoryTarget.Directive });
559
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: CdkPortalOutlet, isStandalone: true, selector: "[cdkPortalOutlet]", inputs: { portal: ["cdkPortalOutlet", "portal"] }, outputs: { attached: "attached" }, exportAs: ["cdkPortalOutlet"], usesInheritance: true, ngImport: i0 });
560
- }
561
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: CdkPortalOutlet, decorators: [{
562
- type: Directive,
563
- args: [{
564
- selector: '[cdkPortalOutlet]',
565
- exportAs: 'cdkPortalOutlet',
566
- }]
567
- }], ctorParameters: () => [], propDecorators: { portal: [{
568
- type: Input,
569
- args: ['cdkPortalOutlet']
570
- }], attached: [{
571
- type: Output
572
- }] } });
573
- /**
574
- * @deprecated Use `CdkPortalOutlet` instead.
575
- * @breaking-change 9.0.0
576
- */
577
- class PortalHostDirective extends CdkPortalOutlet {
578
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalHostDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
579
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.0-next.2", type: PortalHostDirective, isStandalone: true, selector: "[cdkPortalHost], [portalHost]", inputs: { portal: ["cdkPortalHost", "portal"] }, providers: [
580
- {
581
- provide: CdkPortalOutlet,
582
- useExisting: PortalHostDirective,
583
- },
584
- ], exportAs: ["cdkPortalHost"], usesInheritance: true, ngImport: i0 });
354
+ const anchorNode = this._document.createComment('dom-portal');
355
+ portal.setAttachedHost(this);
356
+ element.parentNode.insertBefore(anchorNode, element);
357
+ this._getRootNode().appendChild(element);
358
+ this._attachedPortal = portal;
359
+ super.setDisposeFn(() => {
360
+ if (anchorNode.parentNode) {
361
+ anchorNode.parentNode.replaceChild(element, anchorNode);
362
+ }
363
+ });
364
+ };
365
+ _getRootNode() {
366
+ const nativeElement = this._viewContainerRef.element.nativeElement;
367
+ return nativeElement.nodeType === nativeElement.ELEMENT_NODE ? nativeElement : nativeElement.parentNode;
368
+ }
369
+ static ɵfac = i0.ɵɵngDeclareFactory({
370
+ minVersion: "12.0.0",
371
+ version: "20.2.0-next.2",
372
+ ngImport: i0,
373
+ type: CdkPortalOutlet,
374
+ deps: [],
375
+ target: i0.ɵɵFactoryTarget.Directive
376
+ });
377
+ static ɵdir = i0.ɵɵngDeclareDirective({
378
+ minVersion: "14.0.0",
379
+ version: "20.2.0-next.2",
380
+ type: CdkPortalOutlet,
381
+ isStandalone: true,
382
+ selector: "[cdkPortalOutlet]",
383
+ inputs: {
384
+ portal: ["cdkPortalOutlet", "portal"]
385
+ },
386
+ outputs: {
387
+ attached: "attached"
388
+ },
389
+ exportAs: ["cdkPortalOutlet"],
390
+ usesInheritance: true,
391
+ ngImport: i0
392
+ });
585
393
  }
586
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalHostDirective, decorators: [{
587
- type: Directive,
588
- args: [{
589
- selector: '[cdkPortalHost], [portalHost]',
590
- exportAs: 'cdkPortalHost',
591
- inputs: [{ name: 'portal', alias: 'cdkPortalHost' }],
592
- providers: [
593
- {
594
- provide: CdkPortalOutlet,
595
- useExisting: PortalHostDirective,
596
- },
597
- ],
598
- }]
599
- }] });
394
+ i0.ɵɵngDeclareClassMetadata({
395
+ minVersion: "12.0.0",
396
+ version: "20.2.0-next.2",
397
+ ngImport: i0,
398
+ type: CdkPortalOutlet,
399
+ decorators: [{
400
+ type: Directive,
401
+ args: [{
402
+ selector: '[cdkPortalOutlet]',
403
+ exportAs: 'cdkPortalOutlet'
404
+ }]
405
+ }],
406
+ ctorParameters: () => [],
407
+ propDecorators: {
408
+ portal: [{
409
+ type: Input,
410
+ args: ['cdkPortalOutlet']
411
+ }],
412
+ attached: [{
413
+ type: Output
414
+ }]
415
+ }
416
+ });
600
417
  class PortalModule {
601
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
602
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective], exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective] });
603
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule });
418
+ static ɵfac = i0.ɵɵngDeclareFactory({
419
+ minVersion: "12.0.0",
420
+ version: "20.2.0-next.2",
421
+ ngImport: i0,
422
+ type: PortalModule,
423
+ deps: [],
424
+ target: i0.ɵɵFactoryTarget.NgModule
425
+ });
426
+ static ɵmod = i0.ɵɵngDeclareNgModule({
427
+ minVersion: "14.0.0",
428
+ version: "20.2.0-next.2",
429
+ ngImport: i0,
430
+ type: PortalModule,
431
+ imports: [CdkPortal, CdkPortalOutlet],
432
+ exports: [CdkPortal, CdkPortalOutlet]
433
+ });
434
+ static ɵinj = i0.ɵɵngDeclareInjector({
435
+ minVersion: "12.0.0",
436
+ version: "20.2.0-next.2",
437
+ ngImport: i0,
438
+ type: PortalModule
439
+ });
604
440
  }
605
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.0-next.2", ngImport: i0, type: PortalModule, decorators: [{
606
- type: NgModule,
607
- args: [{
608
- imports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
609
- exports: [CdkPortal, CdkPortalOutlet, TemplatePortalDirective, PortalHostDirective],
610
- }]
611
- }] });
441
+ i0.ɵɵngDeclareClassMetadata({
442
+ minVersion: "12.0.0",
443
+ version: "20.2.0-next.2",
444
+ ngImport: i0,
445
+ type: PortalModule,
446
+ decorators: [{
447
+ type: NgModule,
448
+ args: [{
449
+ imports: [CdkPortal, CdkPortalOutlet],
450
+ exports: [CdkPortal, CdkPortalOutlet]
451
+ }]
452
+ }]
453
+ });
612
454
 
613
- export { BasePortalOutlet, CdkPortal, CdkPortalOutlet, ComponentPortal, DomPortal, DomPortalOutlet, Portal, PortalHostDirective, PortalModule, TemplatePortal, TemplatePortalDirective };
455
+ export { BasePortalOutlet, CdkPortal, CdkPortalOutlet, ComponentPortal, DomPortal, DomPortalOutlet, Portal, PortalModule, TemplatePortal };
614
456
  //# sourceMappingURL=portal.mjs.map