@angular/cdk 19.2.1 → 19.2.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 (85) hide show
  1. package/a11y/index.d.ts +926 -999
  2. package/accordion/index.d.ts +8 -27
  3. package/bidi/index.d.ts +38 -48
  4. package/clipboard/index.d.ts +61 -75
  5. package/coercion/index.d.ts +22 -32
  6. package/coercion/private/index.d.ts +2 -2
  7. package/collections/index.d.ts +139 -158
  8. package/dialog/index.d.ts +210 -246
  9. package/drag-drop/index.d.ts +1084 -1160
  10. package/fesm2022/a11y.mjs +62 -54
  11. package/fesm2022/a11y.mjs.map +1 -1
  12. package/fesm2022/accordion.mjs +10 -14
  13. package/fesm2022/accordion.mjs.map +1 -1
  14. package/fesm2022/bidi.mjs +15 -15
  15. package/fesm2022/bidi.mjs.map +1 -1
  16. package/fesm2022/cdk.mjs +1 -1
  17. package/fesm2022/cdk.mjs.map +1 -1
  18. package/fesm2022/clipboard.mjs +10 -14
  19. package/fesm2022/clipboard.mjs.map +1 -1
  20. package/fesm2022/coercion/private.mjs +0 -4
  21. package/fesm2022/coercion/private.mjs.map +1 -1
  22. package/fesm2022/coercion.mjs.map +1 -1
  23. package/fesm2022/collections.mjs +4 -8
  24. package/fesm2022/collections.mjs.map +1 -1
  25. package/fesm2022/dialog.mjs +10 -14
  26. package/fesm2022/dialog.mjs.map +1 -1
  27. package/fesm2022/drag-drop.mjs +31 -35
  28. package/fesm2022/drag-drop.mjs.map +1 -1
  29. package/fesm2022/keycodes.mjs +0 -4
  30. package/fesm2022/keycodes.mjs.map +1 -1
  31. package/fesm2022/layout.mjs +10 -14
  32. package/fesm2022/layout.mjs.map +1 -1
  33. package/fesm2022/listbox.mjs +10 -14
  34. package/fesm2022/listbox.mjs.map +1 -1
  35. package/fesm2022/menu.mjs +49 -53
  36. package/fesm2022/menu.mjs.map +1 -1
  37. package/fesm2022/observers/private.mjs +3 -7
  38. package/fesm2022/observers/private.mjs.map +1 -1
  39. package/fesm2022/observers.mjs +13 -17
  40. package/fesm2022/observers.mjs.map +1 -1
  41. package/fesm2022/overlay.mjs +54 -50
  42. package/fesm2022/overlay.mjs.map +1 -1
  43. package/fesm2022/platform.mjs +7 -11
  44. package/fesm2022/platform.mjs.map +1 -1
  45. package/fesm2022/portal.mjs +25 -26
  46. package/fesm2022/portal.mjs.map +1 -1
  47. package/fesm2022/private.mjs +6 -10
  48. package/fesm2022/private.mjs.map +1 -1
  49. package/fesm2022/scrolling.mjs +36 -40
  50. package/fesm2022/scrolling.mjs.map +1 -1
  51. package/fesm2022/stepper.mjs +29 -32
  52. package/fesm2022/stepper.mjs.map +1 -1
  53. package/fesm2022/table.mjs +78 -88
  54. package/fesm2022/table.mjs.map +1 -1
  55. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
  56. package/fesm2022/testing/testbed.mjs +1 -41
  57. package/fesm2022/testing/testbed.mjs.map +1 -1
  58. package/fesm2022/testing.mjs.map +1 -1
  59. package/fesm2022/text-field.mjs +16 -20
  60. package/fesm2022/text-field.mjs.map +1 -1
  61. package/fesm2022/tree.mjs +25 -29
  62. package/fesm2022/tree.mjs.map +1 -1
  63. package/index.d.ts +2 -2
  64. package/keycodes/index.d.ts +123 -244
  65. package/layout/index.d.ts +23 -25
  66. package/listbox/index.d.ts +90 -107
  67. package/menu/index.d.ts +593 -687
  68. package/observers/index.d.ts +38 -44
  69. package/observers/private/index.d.ts +3 -3
  70. package/overlay/index.d.ts +921 -986
  71. package/package.json +1 -1
  72. package/platform/index.d.ts +50 -62
  73. package/portal/index.d.ts +172 -195
  74. package/private/index.d.ts +3 -3
  75. package/schematics/ng-add/index.js +1 -1
  76. package/schematics/ng-add/index.mjs +1 -1
  77. package/schematics/ng-generate/drag-drop/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.component.spec.ts.template +1 -1
  78. package/scrolling/index.d.ts +268 -351
  79. package/stepper/index.d.ts +72 -124
  80. package/table/index.d.ts +336 -449
  81. package/testing/index.d.ts +490 -517
  82. package/testing/selenium-webdriver/index.d.ts +30 -20
  83. package/testing/testbed/index.d.ts +9 -19
  84. package/text-field/index.d.ts +9 -30
  85. package/tree/index.d.ts +204 -271
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/cdk",
3
- "version": "19.2.1",
3
+ "version": "19.2.3",
4
4
  "description": "Angular Material Component Development Kit",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,60 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Renderer2 } from '@angular/core';
3
3
 
4
- /**
5
- * Binds an event listener with specific options in a backwards-compatible way.
6
- * This function is necessary, because `Renderer2.listen` only supports listener options
7
- * after 19.1 and during the v19 period we support any 19.x version.
8
- * @docs-private
9
- */
10
- export declare function _bindEventWithOptions(renderer: Renderer2, target: EventTarget, eventName: string, callback: (event: any) => boolean | void, options: _ListenerOptions): () => void;
11
-
12
- /** Gets the target of an event while accounting for Shadow DOM. */
13
- export declare function _getEventTarget<T extends EventTarget>(event: Event): T | null;
14
-
15
- /**
16
- * Gets the currently-focused element on the page while
17
- * also piercing through Shadow DOM boundaries.
18
- */
19
- export declare function _getFocusedElementPierceShadowDom(): HTMLElement | null;
20
-
21
- /**
22
- * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,
23
- * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.
24
- */
25
- export declare function getRtlScrollAxisType(): RtlScrollAxisType;
26
-
27
- /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */
28
- export declare function _getShadowRoot(element: HTMLElement): ShadowRoot | null;
29
-
30
-
31
- /** @returns The input types supported by this browser. */
32
- export declare function getSupportedInputTypes(): Set<string>;
33
-
34
-
35
- /** Gets whether the code is currently running in a test environment. */
36
- export declare function _isTestEnvironment(): boolean;
37
-
38
- /** Options when binding events manually. */
39
- export declare interface _ListenerOptions {
40
- capture?: boolean;
41
- once?: boolean;
42
- passive?: boolean;
43
- }
44
-
45
- /**
46
- * Normalizes an `AddEventListener` object to something that can be passed
47
- * to `addEventListener` on any browser, no matter whether it supports the
48
- * `options` parameter.
49
- * @param options Object to be normalized.
50
- */
51
- export declare function normalizePassiveListenerOptions(options: AddEventListenerOptions): AddEventListenerOptions | boolean;
52
-
53
4
  /**
54
5
  * Service to detect the current platform by comparing the userAgent strings and
55
6
  * checking browser-specific global properties.
56
7
  */
57
- export declare class Platform {
8
+ declare class Platform {
58
9
  private _platformId;
59
10
  /** Whether the Angular application is being rendered in the browser. */
60
11
  isBrowser: boolean;
@@ -80,15 +31,30 @@ export declare class Platform {
80
31
  static ɵprov: i0.ɵɵInjectableDeclaration<Platform>;
81
32
  }
82
33
 
83
- export declare class PlatformModule {
34
+ declare class PlatformModule {
84
35
  static ɵfac: i0.ɵɵFactoryDeclaration<PlatformModule, never>;
85
36
  static ɵmod: i0.ɵɵNgModuleDeclaration<PlatformModule, never, never, never>;
86
37
  static ɵinj: i0.ɵɵInjectorDeclaration<PlatformModule>;
87
38
  }
88
39
 
40
+ /** @returns The input types supported by this browser. */
41
+ declare function getSupportedInputTypes(): Set<string>;
42
+
43
+ /**
44
+ * Checks whether the user's browser supports passive event listeners.
45
+ * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
46
+ */
47
+ declare function supportsPassiveEventListeners(): boolean;
48
+ /**
49
+ * Normalizes an `AddEventListener` object to something that can be passed
50
+ * to `addEventListener` on any browser, no matter whether it supports the
51
+ * `options` parameter.
52
+ * @param options Object to be normalized.
53
+ */
54
+ declare function normalizePassiveListenerOptions(options: AddEventListenerOptions): AddEventListenerOptions | boolean;
89
55
 
90
56
  /** The possible ways the browser may handle the horizontal scroll axis in RTL languages. */
91
- export declare enum RtlScrollAxisType {
57
+ declare enum RtlScrollAxisType {
92
58
  /**
93
59
  * scrollLeft is 0 when scrolled all the way left and (scrollWidth - clientWidth) when scrolled
94
60
  * all the way right.
@@ -105,19 +71,41 @@ export declare enum RtlScrollAxisType {
105
71
  */
106
72
  INVERTED = 2
107
73
  }
108
-
109
-
74
+ /** Check whether the browser supports scroll behaviors. */
75
+ declare function supportsScrollBehavior(): boolean;
110
76
  /**
111
- * Checks whether the user's browser supports passive event listeners.
112
- * See: https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
77
+ * Checks the type of RTL scroll axis used by this browser. As of time of writing, Chrome is NORMAL,
78
+ * Firefox & Safari are NEGATED, and IE & Edge are INVERTED.
113
79
  */
114
- export declare function supportsPassiveEventListeners(): boolean;
80
+ declare function getRtlScrollAxisType(): RtlScrollAxisType;
115
81
 
116
- /** Check whether the browser supports scroll behaviors. */
117
- export declare function supportsScrollBehavior(): boolean;
82
+ /** Checks whether the user's browser support Shadow DOM. */
83
+ declare function _supportsShadowDom(): boolean;
84
+ /** Gets the shadow root of an element, if supported and the element is inside the Shadow DOM. */
85
+ declare function _getShadowRoot(element: HTMLElement): ShadowRoot | null;
86
+ /**
87
+ * Gets the currently-focused element on the page while
88
+ * also piercing through Shadow DOM boundaries.
89
+ */
90
+ declare function _getFocusedElementPierceShadowDom(): HTMLElement | null;
91
+ /** Gets the target of an event while accounting for Shadow DOM. */
92
+ declare function _getEventTarget<T extends EventTarget>(event: Event): T | null;
118
93
 
94
+ /** Gets whether the code is currently running in a test environment. */
95
+ declare function _isTestEnvironment(): boolean;
119
96
 
120
- /** Checks whether the user's browser support Shadow DOM. */
121
- export declare function _supportsShadowDom(): boolean;
97
+ /** Options when binding events manually. */
98
+ interface _ListenerOptions {
99
+ capture?: boolean;
100
+ once?: boolean;
101
+ passive?: boolean;
102
+ }
103
+ /**
104
+ * Binds an event listener with specific options in a backwards-compatible way.
105
+ * This function is necessary, because `Renderer2.listen` only supports listener options
106
+ * after 19.1 and during the v19 period we support any 19.x version.
107
+ * @docs-private
108
+ */
109
+ declare function _bindEventWithOptions(renderer: Renderer2, target: EventTarget, eventName: string, callback: (event: any) => boolean | void, options: _ListenerOptions): () => void;
122
110
 
123
- export { }
111
+ export { Platform, PlatformModule, RtlScrollAxisType, type _ListenerOptions, _bindEventWithOptions, _getEventTarget, _getFocusedElementPierceShadowDom, _getShadowRoot, _isTestEnvironment, _supportsShadowDom, getRtlScrollAxisType, getSupportedInputTypes, normalizePassiveListenerOptions, supportsPassiveEventListeners, supportsScrollBehavior };
package/portal/index.d.ts CHANGED
@@ -1,120 +1,32 @@
1
- import { ApplicationRef } from '@angular/core';
2
- import { ComponentRef } from '@angular/core';
3
- import { ElementRef } from '@angular/core';
4
- import { EmbeddedViewRef } from '@angular/core';
5
- import { EventEmitter } from '@angular/core';
6
1
  import * as i0 from '@angular/core';
7
- import { Injector } from '@angular/core';
8
- import { OnDestroy } from '@angular/core';
9
- import { OnInit } from '@angular/core';
10
- import { TemplateRef } from '@angular/core';
11
- import { ViewContainerRef } from '@angular/core';
2
+ import { ComponentRef, ViewContainerRef, Injector, EmbeddedViewRef, TemplateRef, ElementRef, ApplicationRef, OnInit, OnDestroy, EventEmitter } from '@angular/core';
12
3
 
13
- /**
14
- * @deprecated Use `BasePortalOutlet` instead.
15
- * @breaking-change 9.0.0
16
- */
17
- export declare abstract class BasePortalHost extends BasePortalOutlet {
4
+ /** Interface that can be used to generically type a class. */
5
+ interface ComponentType<T> {
6
+ new (...args: any[]): T;
18
7
  }
19
-
20
8
  /**
21
- * Partial implementation of PortalOutlet that handles attaching
22
- * ComponentPortal and TemplatePortal.
9
+ * A `Portal` is something that you want to render somewhere else.
10
+ * It can be attach to / detached from a `PortalOutlet`.
23
11
  */
24
- export declare abstract class BasePortalOutlet implements PortalOutlet {
25
- /** The portal currently attached to the host. */
26
- protected _attachedPortal: Portal<any> | null;
27
- /** A function that will permanently dispose this host. */
28
- private _disposeFn;
29
- /** Whether this host has already been permanently disposed. */
30
- private _isDisposed;
31
- /** Whether this host has an attached portal. */
32
- hasAttached(): boolean;
33
- attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;
34
- attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
35
- attach(portal: any): any;
36
- abstract attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
37
- abstract attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
38
- readonly attachDomPortal: null | ((portal: DomPortal) => any);
39
- /** Detaches a previously attached portal. */
12
+ declare abstract class Portal<T> {
13
+ private _attachedHost;
14
+ /** Attach this portal to a host. */
15
+ attach(host: PortalOutlet): T;
16
+ /** Detach this portal from its host */
40
17
  detach(): void;
41
- /** Permanently dispose of this portal host. */
42
- dispose(): void;
43
- /** @docs-private */
44
- setDisposeFn(fn: () => void): void;
45
- private _invokeDisposeFn;
46
- }
47
-
48
- /**
49
- * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
50
- * the directive instance itself can be attached to a host, enabling declarative use of portals.
51
- */
52
- export declare class CdkPortal extends TemplatePortal {
53
- constructor(...args: unknown[]);
54
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkPortal, never>;
55
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPortal, "[cdkPortal]", ["cdkPortal"], {}, {}, never, never, true, never>;
56
- }
57
-
58
- /**
59
- * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
60
- * directly attached to it, enabling declarative use.
61
- *
62
- * Usage:
63
- * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
64
- */
65
- export declare class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestroy {
66
- private _moduleRef;
67
- private _document;
68
- private _viewContainerRef;
69
- /** Whether the portal component is initialized. */
70
- private _isInitialized;
71
- /** Reference to the currently-attached component/view ref. */
72
- private _attachedRef;
73
- constructor(...args: unknown[]);
74
- /** Portal associated with the Portal outlet. */
75
- get portal(): Portal<any> | null;
76
- set portal(portal: Portal<any> | null | undefined | '');
77
- /** Emits when a portal is attached to the outlet. */
78
- readonly attached: EventEmitter<CdkPortalOutletAttachedRef>;
79
- /** Component or view reference that is attached to the portal. */
80
- get attachedRef(): CdkPortalOutletAttachedRef;
81
- ngOnInit(): void;
82
- ngOnDestroy(): void;
83
- /**
84
- * Attach the given ComponentPortal to this PortalOutlet.
85
- *
86
- * @param portal Portal to be attached to the portal outlet.
87
- * @returns Reference to the created component.
88
- */
89
- attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
90
- /**
91
- * Attach the given TemplatePortal to this PortalHost as an embedded View.
92
- * @param portal Portal to be attached.
93
- * @returns Reference to the created embedded view.
94
- */
95
- attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
18
+ /** Whether this portal is attached to a host. */
19
+ get isAttached(): boolean;
96
20
  /**
97
- * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
98
- * @param portal Portal to be attached.
99
- * @deprecated To be turned into a method.
100
- * @breaking-change 10.0.0
21
+ * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
22
+ * the PortalOutlet when it is performing an `attach()` or `detach()`.
101
23
  */
102
- attachDomPortal: (portal: DomPortal) => void;
103
- /** Gets the root node of the portal outlet. */
104
- private _getRootNode;
105
- static ɵfac: i0.ɵɵFactoryDeclaration<CdkPortalOutlet, never>;
106
- static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPortalOutlet, "[cdkPortalOutlet]", ["cdkPortalOutlet"], { "portal": { "alias": "cdkPortalOutlet"; "required": false; }; }, { "attached": "attached"; }, never, never, true, never>;
24
+ setAttachedHost(host: PortalOutlet | null): void;
107
25
  }
108
-
109
- /**
110
- * Possible attached references to the CdkPortalOutlet.
111
- */
112
- export declare type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any> | null;
113
-
114
26
  /**
115
27
  * A `ComponentPortal` is a portal that instantiates some Component upon attachment.
116
28
  */
117
- export declare class ComponentPortal<T> extends Portal<ComponentRef<T>> {
29
+ declare class ComponentPortal<T> extends Portal<ComponentRef<T>> {
118
30
  /** The type of the component that will be instantiated for attachment. */
119
31
  component: ComponentType<T>;
120
32
  /**
@@ -141,35 +53,101 @@ export declare class ComponentPortal<T> extends Portal<ComponentRef<T>> {
141
53
  */
142
54
  _componentFactoryResolver?: any, projectableNodes?: Node[][] | null);
143
55
  }
144
-
145
- /** Interface that can be used to generically type a class. */
146
- export declare interface ComponentType<T> {
147
- new (...args: any[]): T;
56
+ /**
57
+ * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
58
+ */
59
+ declare class TemplatePortal<C = any> extends Portal<EmbeddedViewRef<C>> {
60
+ /** The embedded template that will be used to instantiate an embedded View in the host. */
61
+ templateRef: TemplateRef<C>;
62
+ /** Reference to the ViewContainer into which the template will be stamped out. */
63
+ viewContainerRef: ViewContainerRef;
64
+ /** Contextual data to be passed in to the embedded view. */
65
+ context?: C | undefined;
66
+ /** The injector to use for the embedded view. */
67
+ injector?: Injector | undefined;
68
+ constructor(
69
+ /** The embedded template that will be used to instantiate an embedded View in the host. */
70
+ templateRef: TemplateRef<C>,
71
+ /** Reference to the ViewContainer into which the template will be stamped out. */
72
+ viewContainerRef: ViewContainerRef,
73
+ /** Contextual data to be passed in to the embedded view. */
74
+ context?: C | undefined,
75
+ /** The injector to use for the embedded view. */
76
+ injector?: Injector | undefined);
77
+ get origin(): ElementRef;
78
+ /**
79
+ * Attach the portal to the provided `PortalOutlet`.
80
+ * When a context is provided it will override the `context` property of the `TemplatePortal`
81
+ * instance.
82
+ */
83
+ attach(host: PortalOutlet, context?: C | undefined): EmbeddedViewRef<C>;
84
+ detach(): void;
148
85
  }
149
-
150
86
  /**
151
87
  * A `DomPortal` is a portal whose DOM element will be taken from its current position
152
88
  * in the DOM and moved into a portal outlet, when it is attached. On detach, the content
153
89
  * will be restored to its original position.
154
90
  */
155
- export declare class DomPortal<T = HTMLElement> extends Portal<T> {
91
+ declare class DomPortal<T = HTMLElement> extends Portal<T> {
156
92
  /** DOM node hosting the portal's content. */
157
93
  readonly element: T;
158
94
  constructor(element: T | ElementRef<T>);
159
95
  }
160
-
96
+ /** A `PortalOutlet` is a space that can contain a single `Portal`. */
97
+ interface PortalOutlet {
98
+ /** Attaches a portal to this outlet. */
99
+ attach(portal: Portal<any>): any;
100
+ /** Detaches the currently attached portal from this outlet. */
101
+ detach(): any;
102
+ /** Performs cleanup before the outlet is destroyed. */
103
+ dispose(): void;
104
+ /** Whether there is currently a portal attached to this outlet. */
105
+ hasAttached(): boolean;
106
+ }
161
107
  /**
162
- * @deprecated Use `DomPortalOutlet` instead.
108
+ * @deprecated Use `PortalOutlet` instead.
109
+ * @breaking-change 9.0.0
110
+ */
111
+ type PortalHost = PortalOutlet;
112
+ /**
113
+ * Partial implementation of PortalOutlet that handles attaching
114
+ * ComponentPortal and TemplatePortal.
115
+ */
116
+ declare abstract class BasePortalOutlet implements PortalOutlet {
117
+ /** The portal currently attached to the host. */
118
+ protected _attachedPortal: Portal<any> | null;
119
+ /** A function that will permanently dispose this host. */
120
+ private _disposeFn;
121
+ /** Whether this host has already been permanently disposed. */
122
+ private _isDisposed;
123
+ /** Whether this host has an attached portal. */
124
+ hasAttached(): boolean;
125
+ attach<T>(portal: ComponentPortal<T>): ComponentRef<T>;
126
+ attach<T>(portal: TemplatePortal<T>): EmbeddedViewRef<T>;
127
+ attach(portal: any): any;
128
+ abstract attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
129
+ abstract attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
130
+ readonly attachDomPortal: null | ((portal: DomPortal) => any);
131
+ /** Detaches a previously attached portal. */
132
+ detach(): void;
133
+ /** Permanently dispose of this portal host. */
134
+ dispose(): void;
135
+ /** @docs-private */
136
+ setDisposeFn(fn: () => void): void;
137
+ private _invokeDisposeFn;
138
+ }
139
+ /**
140
+ * @deprecated Use `BasePortalOutlet` instead.
163
141
  * @breaking-change 9.0.0
164
142
  */
165
- export declare class DomPortalHost extends DomPortalOutlet {
143
+ declare abstract class BasePortalHost extends BasePortalOutlet {
166
144
  }
167
145
 
168
146
  /**
169
147
  * A PortalOutlet for attaching portals to an arbitrary DOM element outside of the Angular
170
148
  * application context.
171
149
  */
172
- export declare class DomPortalOutlet extends BasePortalOutlet {
150
+ declare class DomPortalOutlet extends BasePortalOutlet {
173
151
  /** Element into which the content is projected. */
174
152
  outletElement: Element;
175
153
  private _appRef?;
@@ -225,40 +203,97 @@ export declare class DomPortalOutlet extends BasePortalOutlet {
225
203
  /** Gets the root HTMLElement for an instantiated component. */
226
204
  private _getComponentRootNode;
227
205
  }
228
-
229
206
  /**
230
- * A `Portal` is something that you want to render somewhere else.
231
- * It can be attach to / detached from a `PortalOutlet`.
207
+ * @deprecated Use `DomPortalOutlet` instead.
208
+ * @breaking-change 9.0.0
232
209
  */
233
- export declare abstract class Portal<T> {
234
- private _attachedHost;
235
- /** Attach this portal to a host. */
236
- attach(host: PortalOutlet): T;
237
- /** Detach this portal from its host */
238
- detach(): void;
239
- /** Whether this portal is attached to a host. */
240
- get isAttached(): boolean;
241
- /**
242
- * Sets the PortalOutlet reference without performing `attach()`. This is used directly by
243
- * the PortalOutlet when it is performing an `attach()` or `detach()`.
244
- */
245
- setAttachedHost(host: PortalOutlet | null): void;
210
+ declare class DomPortalHost extends DomPortalOutlet {
246
211
  }
247
212
 
248
213
  /**
249
- * @deprecated Use `PortalOutlet` instead.
214
+ * Directive version of a `TemplatePortal`. Because the directive *is* a TemplatePortal,
215
+ * the directive instance itself can be attached to a host, enabling declarative use of portals.
216
+ */
217
+ declare class CdkPortal extends TemplatePortal {
218
+ constructor(...args: unknown[]);
219
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkPortal, never>;
220
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPortal, "[cdkPortal]", ["cdkPortal"], {}, {}, never, never, true, never>;
221
+ }
222
+ /**
223
+ * @deprecated Use `CdkPortal` instead.
250
224
  * @breaking-change 9.0.0
251
225
  */
252
- export declare type PortalHost = PortalOutlet;
253
-
226
+ declare class TemplatePortalDirective extends CdkPortal {
227
+ static ɵfac: i0.ɵɵFactoryDeclaration<TemplatePortalDirective, never>;
228
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TemplatePortalDirective, "[cdk-portal], [portal]", ["cdkPortal"], {}, {}, never, never, true, never>;
229
+ }
230
+ /**
231
+ * Possible attached references to the CdkPortalOutlet.
232
+ */
233
+ type CdkPortalOutletAttachedRef = ComponentRef<any> | EmbeddedViewRef<any> | null;
234
+ /**
235
+ * Directive version of a PortalOutlet. Because the directive *is* a PortalOutlet, portals can be
236
+ * directly attached to it, enabling declarative use.
237
+ *
238
+ * Usage:
239
+ * `<ng-template [cdkPortalOutlet]="greeting"></ng-template>`
240
+ */
241
+ declare class CdkPortalOutlet extends BasePortalOutlet implements OnInit, OnDestroy {
242
+ private _moduleRef;
243
+ private _document;
244
+ private _viewContainerRef;
245
+ /** Whether the portal component is initialized. */
246
+ private _isInitialized;
247
+ /** Reference to the currently-attached component/view ref. */
248
+ private _attachedRef;
249
+ constructor(...args: unknown[]);
250
+ /** Portal associated with the Portal outlet. */
251
+ get portal(): Portal<any> | null;
252
+ set portal(portal: Portal<any> | null | undefined | '');
253
+ /** Emits when a portal is attached to the outlet. */
254
+ readonly attached: EventEmitter<CdkPortalOutletAttachedRef>;
255
+ /** Component or view reference that is attached to the portal. */
256
+ get attachedRef(): CdkPortalOutletAttachedRef;
257
+ ngOnInit(): void;
258
+ ngOnDestroy(): void;
259
+ /**
260
+ * Attach the given ComponentPortal to this PortalOutlet.
261
+ *
262
+ * @param portal Portal to be attached to the portal outlet.
263
+ * @returns Reference to the created component.
264
+ */
265
+ attachComponentPortal<T>(portal: ComponentPortal<T>): ComponentRef<T>;
266
+ /**
267
+ * Attach the given TemplatePortal to this PortalHost as an embedded View.
268
+ * @param portal Portal to be attached.
269
+ * @returns Reference to the created embedded view.
270
+ */
271
+ attachTemplatePortal<C>(portal: TemplatePortal<C>): EmbeddedViewRef<C>;
272
+ /**
273
+ * Attaches the given DomPortal to this PortalHost by moving all of the portal content into it.
274
+ * @param portal Portal to be attached.
275
+ * @deprecated To be turned into a method.
276
+ * @breaking-change 10.0.0
277
+ */
278
+ attachDomPortal: (portal: DomPortal) => void;
279
+ /** Gets the root node of the portal outlet. */
280
+ private _getRootNode;
281
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkPortalOutlet, never>;
282
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkPortalOutlet, "[cdkPortalOutlet]", ["cdkPortalOutlet"], { "portal": { "alias": "cdkPortalOutlet"; "required": false; }; }, { "attached": "attached"; }, never, never, true, never>;
283
+ }
254
284
  /**
255
285
  * @deprecated Use `CdkPortalOutlet` instead.
256
286
  * @breaking-change 9.0.0
257
287
  */
258
- export declare class PortalHostDirective extends CdkPortalOutlet {
288
+ declare class PortalHostDirective extends CdkPortalOutlet {
259
289
  static ɵfac: i0.ɵɵFactoryDeclaration<PortalHostDirective, never>;
260
290
  static ɵdir: i0.ɵɵDirectiveDeclaration<PortalHostDirective, "[cdkPortalHost], [portalHost]", ["cdkPortalHost"], { "portal": { "alias": "cdkPortalHost"; "required": false; }; }, {}, never, never, true, never>;
261
291
  }
292
+ declare class PortalModule {
293
+ static ɵfac: i0.ɵɵFactoryDeclaration<PortalModule, never>;
294
+ static ɵmod: i0.ɵɵNgModuleDeclaration<PortalModule, never, [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective], [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective]>;
295
+ static ɵinj: i0.ɵɵInjectorDeclaration<PortalModule>;
296
+ }
262
297
 
263
298
  /**
264
299
  * Custom injector to be used when providing custom
@@ -267,69 +302,11 @@ export declare class PortalHostDirective extends CdkPortalOutlet {
267
302
  * @deprecated Use `Injector.create` instead.
268
303
  * @breaking-change 11.0.0
269
304
  */
270
- export declare class PortalInjector implements Injector {
305
+ declare class PortalInjector implements Injector {
271
306
  private _parentInjector;
272
307
  private _customTokens;
273
308
  constructor(_parentInjector: Injector, _customTokens: WeakMap<any, any>);
274
309
  get(token: any, notFoundValue?: any): any;
275
310
  }
276
311
 
277
- export declare class PortalModule {
278
- static ɵfac: i0.ɵɵFactoryDeclaration<PortalModule, never>;
279
- static ɵmod: i0.ɵɵNgModuleDeclaration<PortalModule, never, [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective], [typeof CdkPortal, typeof CdkPortalOutlet, typeof TemplatePortalDirective, typeof PortalHostDirective]>;
280
- static ɵinj: i0.ɵɵInjectorDeclaration<PortalModule>;
281
- }
282
-
283
- /** A `PortalOutlet` is a space that can contain a single `Portal`. */
284
- export declare interface PortalOutlet {
285
- /** Attaches a portal to this outlet. */
286
- attach(portal: Portal<any>): any;
287
- /** Detaches the currently attached portal from this outlet. */
288
- detach(): any;
289
- /** Performs cleanup before the outlet is destroyed. */
290
- dispose(): void;
291
- /** Whether there is currently a portal attached to this outlet. */
292
- hasAttached(): boolean;
293
- }
294
-
295
- /**
296
- * A `TemplatePortal` is a portal that represents some embedded template (TemplateRef).
297
- */
298
- export declare class TemplatePortal<C = any> extends Portal<EmbeddedViewRef<C>> {
299
- /** The embedded template that will be used to instantiate an embedded View in the host. */
300
- templateRef: TemplateRef<C>;
301
- /** Reference to the ViewContainer into which the template will be stamped out. */
302
- viewContainerRef: ViewContainerRef;
303
- /** Contextual data to be passed in to the embedded view. */
304
- context?: C | undefined;
305
- /** The injector to use for the embedded view. */
306
- injector?: Injector | undefined;
307
- constructor(
308
- /** The embedded template that will be used to instantiate an embedded View in the host. */
309
- templateRef: TemplateRef<C>,
310
- /** Reference to the ViewContainer into which the template will be stamped out. */
311
- viewContainerRef: ViewContainerRef,
312
- /** Contextual data to be passed in to the embedded view. */
313
- context?: C | undefined,
314
- /** The injector to use for the embedded view. */
315
- injector?: Injector | undefined);
316
- get origin(): ElementRef;
317
- /**
318
- * Attach the portal to the provided `PortalOutlet`.
319
- * When a context is provided it will override the `context` property of the `TemplatePortal`
320
- * instance.
321
- */
322
- attach(host: PortalOutlet, context?: C | undefined): EmbeddedViewRef<C>;
323
- detach(): void;
324
- }
325
-
326
- /**
327
- * @deprecated Use `CdkPortal` instead.
328
- * @breaking-change 9.0.0
329
- */
330
- export declare class TemplatePortalDirective extends CdkPortal {
331
- static ɵfac: i0.ɵɵFactoryDeclaration<TemplatePortalDirective, never>;
332
- static ɵdir: i0.ɵɵDirectiveDeclaration<TemplatePortalDirective, "[cdk-portal], [portal]", ["cdkPortal"], {}, {}, never, never, true, never>;
333
- }
334
-
335
- export { }
312
+ export { BasePortalHost, BasePortalOutlet, CdkPortal, CdkPortalOutlet, type CdkPortalOutletAttachedRef, ComponentPortal, type ComponentType, DomPortal, DomPortalHost, DomPortalOutlet, Portal, type PortalHost, PortalHostDirective, PortalInjector, PortalModule, type PortalOutlet, TemplatePortal, TemplatePortalDirective };
@@ -5,7 +5,7 @@ import { Type } from '@angular/core';
5
5
  * Service that loads structural styles dynamically
6
6
  * and ensures that they're only loaded once per app.
7
7
  */
8
- export declare class _CdkPrivateStyleLoader {
8
+ declare class _CdkPrivateStyleLoader {
9
9
  private _appRef;
10
10
  private _injector;
11
11
  private _environmentInjector;
@@ -22,9 +22,9 @@ export declare class _CdkPrivateStyleLoader {
22
22
  * Component used to load the .cdk-visually-hidden styles.
23
23
  * @docs-private
24
24
  */
25
- export declare class _VisuallyHiddenLoader {
25
+ declare class _VisuallyHiddenLoader {
26
26
  static ɵfac: i0.ɵɵFactoryDeclaration<_VisuallyHiddenLoader, never>;
27
27
  static ɵcmp: i0.ɵɵComponentDeclaration<_VisuallyHiddenLoader, "ng-component", ["cdkVisuallyHidden"], {}, {}, never, never, true, never>;
28
28
  }
29
29
 
30
- export { }
30
+ export { _CdkPrivateStyleLoader, _VisuallyHiddenLoader };
@@ -29,7 +29,7 @@ function default_1() {
29
29
  // In order to align the CDK version with other Angular dependencies that are setup by
30
30
  // `@schematics/angular`, we use tilde instead of caret. This is default for Angular
31
31
  // dependencies in new CLI projects.
32
- (0, package_config_1.addPackageToPackageJson)(host, '@angular/cdk', `~19.2.1`);
32
+ (0, package_config_1.addPackageToPackageJson)(host, '@angular/cdk', `~19.2.3`);
33
33
  // Add a task to run the package manager. This is necessary because we updated the
34
34
  // workspace "package.json" file and we want lock files to reflect the new version range.
35
35
  context.addTask(new tasks_1.NodePackageInstallTask());
@@ -29,7 +29,7 @@ function default_1() {
29
29
  // In order to align the CDK version with other Angular dependencies that are setup by
30
30
  // `@schematics/angular`, we use tilde instead of caret. This is default for Angular
31
31
  // dependencies in new CLI projects.
32
- (0, package_config_1.addPackageToPackageJson)(host, '@angular/cdk', `~19.2.1`);
32
+ (0, package_config_1.addPackageToPackageJson)(host, '@angular/cdk', `~19.2.3`);
33
33
  // Add a task to run the package manager. This is necessary because we updated the
34
34
  // workspace "package.json" file and we want lock files to reflect the new version range.
35
35
  context.addTask(new tasks_1.NodePackageInstallTask());
@@ -10,7 +10,7 @@ describe('<%= classify(name) %>Component', () => {
10
10
  TestBed.configureTestingModule({
11
11
  declarations: [<%= classify(name) %>Component],
12
12
  imports: [DragDropModule]
13
- }).compileComponents();
13
+ });
14
14
  }));<% } %>
15
15
 
16
16
  beforeEach(() => {