@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
@@ -1,26 +1,17 @@
1
+ import { Observable, Subject } from 'rxjs';
1
2
  import * as i0 from '@angular/core';
2
- import { InjectionToken } from '@angular/core';
3
- import { IterableChangeRecord } from '@angular/core';
4
- import { IterableChanges } from '@angular/core';
5
- import { Observable } from 'rxjs';
6
- import { OnDestroy } from '@angular/core';
7
- import { Subject } from 'rxjs';
8
- import { TemplateRef } from '@angular/core';
9
- import { ViewContainerRef } from '@angular/core';
10
-
11
- /** DataSource wrapper for a native array. */
12
- export declare class ArrayDataSource<T> extends DataSource<T> {
13
- private _data;
14
- constructor(_data: readonly T[] | Observable<readonly T[]>);
15
- connect(): Observable<readonly T[]>;
16
- disconnect(): void;
17
- }
3
+ import { TemplateRef, IterableChangeRecord, IterableChanges, ViewContainerRef, InjectionToken, OnDestroy } from '@angular/core';
18
4
 
5
+ /** Represents a range of numbers with a specified start and end. */
6
+ type ListRange = {
7
+ start: number;
8
+ end: number;
9
+ };
19
10
  /**
20
11
  * Interface for any component that provides a view of some data collection and wants to provide
21
12
  * information regarding the view and any changes made.
22
13
  */
23
- export declare interface CollectionViewer {
14
+ interface CollectionViewer {
24
15
  /**
25
16
  * A stream that emits whenever the `CollectionViewer` starts looking at a new portion of the
26
17
  * data. The `start` index is inclusive, while the `end` is exclusive.
@@ -28,7 +19,7 @@ export declare interface CollectionViewer {
28
19
  viewChange: Observable<ListRange>;
29
20
  }
30
21
 
31
- export declare abstract class DataSource<T> {
22
+ declare abstract class DataSource<T> {
32
23
  /**
33
24
  * Connects a collection viewer (such as a data-table) to this data source. Note that
34
25
  * the stream provided will be accessed during change detection and should not directly change
@@ -47,36 +38,115 @@ export declare abstract class DataSource<T> {
47
38
  */
48
39
  abstract disconnect(collectionViewer: CollectionViewer): void;
49
40
  }
41
+ /** Checks whether an object is a data source. */
42
+ declare function isDataSource(value: any): value is DataSource<any>;
43
+
44
+ /** DataSource wrapper for a native array. */
45
+ declare class ArrayDataSource<T> extends DataSource<T> {
46
+ private _data;
47
+ constructor(_data: readonly T[] | Observable<readonly T[]>);
48
+ connect(): Observable<readonly T[]>;
49
+ disconnect(): void;
50
+ }
50
51
 
51
52
  /**
52
- * A repeater that destroys views when they are removed from a
53
- * {@link ViewContainerRef}. When new items are inserted into the container,
54
- * the repeater will always construct a new embedded view for each item.
53
+ * The context for an embedded view in the repeater's view container.
54
+ *
55
+ * @template T The type for the embedded view's $implicit property.
56
+ */
57
+ interface _ViewRepeaterItemContext<T> {
58
+ $implicit?: T;
59
+ }
60
+ /**
61
+ * The arguments needed to construct an embedded view for an item in a view
62
+ * container.
63
+ *
64
+ * @template C The type for the context passed to each embedded view.
65
+ */
66
+ interface _ViewRepeaterItemInsertArgs<C> {
67
+ templateRef: TemplateRef<C>;
68
+ context?: C;
69
+ index?: number;
70
+ }
71
+ /**
72
+ * A factory that derives the embedded view context for an item in a view
73
+ * container.
55
74
  *
56
75
  * @template T The type for the embedded view's $implicit property.
57
76
  * @template R The type for the item in each IterableDiffer change record.
58
77
  * @template C The type for the context passed to each embedded view.
59
78
  */
60
- export declare class _DisposeViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>> implements _ViewRepeater<T, R, C> {
79
+ type _ViewRepeaterItemContextFactory<T, R, C extends _ViewRepeaterItemContext<T>> = (record: IterableChangeRecord<R>, adjustedPreviousIndex: number | null, currentIndex: number | null) => _ViewRepeaterItemInsertArgs<C>;
80
+ /**
81
+ * Extracts the value of an item from an {@link IterableChangeRecord}.
82
+ *
83
+ * @template T The type for the embedded view's $implicit property.
84
+ * @template R The type for the item in each IterableDiffer change record.
85
+ */
86
+ type _ViewRepeaterItemValueResolver<T, R> = (record: IterableChangeRecord<R>) => T;
87
+ /** Indicates how a view was changed by a {@link _ViewRepeater}. */
88
+ declare enum _ViewRepeaterOperation {
89
+ /** The content of an existing view was replaced with another item. */
90
+ REPLACED = 0,
91
+ /** A new view was created with `createEmbeddedView`. */
92
+ INSERTED = 1,
93
+ /** The position of a view changed, but the content remains the same. */
94
+ MOVED = 2,
95
+ /** A view was detached from the view container. */
96
+ REMOVED = 3
97
+ }
98
+ /**
99
+ * Meta data describing the state of a view after it was updated by a
100
+ * {@link _ViewRepeater}.
101
+ *
102
+ * @template R The type for the item in each IterableDiffer change record.
103
+ * @template C The type for the context passed to each embedded view.
104
+ */
105
+ interface _ViewRepeaterItemChange<R, C> {
106
+ /** The view's context after it was changed. */
107
+ context?: C;
108
+ /** Indicates how the view was changed. */
109
+ operation: _ViewRepeaterOperation;
110
+ /** The view's corresponding change record. */
111
+ record: IterableChangeRecord<R>;
112
+ }
113
+ /**
114
+ * Type for a callback to be executed after a view has changed.
115
+ *
116
+ * @template R The type for the item in each IterableDiffer change record.
117
+ * @template C The type for the context passed to each embedded view.
118
+ */
119
+ type _ViewRepeaterItemChanged<R, C> = (change: _ViewRepeaterItemChange<R, C>) => void;
120
+ /**
121
+ * Describes a strategy for rendering items in a {@link ViewContainerRef}.
122
+ *
123
+ * @template T The type for the embedded view's $implicit property.
124
+ * @template R The type for the item in each IterableDiffer change record.
125
+ * @template C The type for the context passed to each embedded view.
126
+ */
127
+ interface _ViewRepeater<T, R, C extends _ViewRepeaterItemContext<T>> {
61
128
  applyChanges(changes: IterableChanges<R>, viewContainerRef: ViewContainerRef, itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>, itemValueResolver: _ViewRepeaterItemValueResolver<T, R>, itemViewChanged?: _ViewRepeaterItemChanged<R, C>): void;
62
129
  detach(): void;
63
130
  }
64
-
65
131
  /**
66
- * Returns an error that reports that multiple values are passed into a selection model
67
- * with a single value.
132
+ * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.
68
133
  * @docs-private
69
134
  */
70
- export declare function getMultipleValuesInSingleSelectionError(): Error;
135
+ declare const _VIEW_REPEATER_STRATEGY: InjectionToken<_ViewRepeater<unknown, unknown, _ViewRepeaterItemContext<unknown>>>;
71
136
 
72
- /** Checks whether an object is a data source. */
73
- export declare function isDataSource(value: any): value is DataSource<any>;
74
-
75
- /** Represents a range of numbers with a specified start and end. */
76
- export declare type ListRange = {
77
- start: number;
78
- end: number;
79
- };
137
+ /**
138
+ * A repeater that destroys views when they are removed from a
139
+ * {@link ViewContainerRef}. When new items are inserted into the container,
140
+ * the repeater will always construct a new embedded view for each item.
141
+ *
142
+ * @template T The type for the embedded view's $implicit property.
143
+ * @template R The type for the item in each IterableDiffer change record.
144
+ * @template C The type for the context passed to each embedded view.
145
+ */
146
+ declare class _DisposeViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>> implements _ViewRepeater<T, R, C> {
147
+ applyChanges(changes: IterableChanges<R>, viewContainerRef: ViewContainerRef, itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>, itemValueResolver: _ViewRepeaterItemValueResolver<T, R>, itemViewChanged?: _ViewRepeaterItemChanged<R, C>): void;
148
+ detach(): void;
149
+ }
80
150
 
81
151
  /**
82
152
  * A repeater that caches views when they are removed from a
@@ -89,7 +159,7 @@ export declare type ListRange = {
89
159
  * @template R The type for the item in each IterableDiffer change record.
90
160
  * @template C The type for the context passed to each embedded view.
91
161
  */
92
- export declare class _RecycleViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>> implements _ViewRepeater<T, R, C> {
162
+ declare class _RecycleViewRepeaterStrategy<T, R, C extends _ViewRepeaterItemContext<T>> implements _ViewRepeater<T, R, C> {
93
163
  /**
94
164
  * The size of the cache used to store unused views.
95
165
  * Setting the cache size to `0` will disable caching. Defaults to 20 views.
@@ -124,23 +194,10 @@ export declare class _RecycleViewRepeaterStrategy<T, R, C extends _ViewRepeaterI
124
194
  private _insertViewFromCache;
125
195
  }
126
196
 
127
- /**
128
- * Event emitted when the value of a MatSelectionModel has changed.
129
- * @docs-private
130
- */
131
- export declare interface SelectionChange<T> {
132
- /** Model that dispatched the event. */
133
- source: SelectionModel<T>;
134
- /** Options that were added to the model. */
135
- added: T[];
136
- /** Options that were removed from the model. */
137
- removed: T[];
138
- }
139
-
140
197
  /**
141
198
  * Class to be used to power selecting one or more options from a list.
142
199
  */
143
- export declare class SelectionModel<T> {
200
+ declare class SelectionModel<T> {
144
201
  private _multiple;
145
202
  private _emitChanges;
146
203
  compareWith?: ((o1: T, o2: T) => boolean) | undefined;
@@ -231,26 +288,26 @@ export declare class SelectionModel<T> {
231
288
  /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */
232
289
  private _getConcreteValue;
233
290
  }
234
-
235
291
  /**
236
- * Interface for a class that can flatten hierarchical structured data and re-expand the flattened
237
- * data back into its original structure. Should be used in conjunction with the cdk-tree.
292
+ * Event emitted when the value of a MatSelectionModel has changed.
293
+ * @docs-private
238
294
  */
239
- export declare interface TreeDataNodeFlattener<T> {
240
- /** Transforms a set of hierarchical structured data into a flattened data array. */
241
- flattenNodes(structuredData: any[]): T[];
242
- /**
243
- * Expands a flattened array of data into its hierarchical form using the provided expansion
244
- * model.
245
- */
246
- expandFlattenedNodes(nodes: T[], expansionModel: SelectionModel<T>): T[];
247
- /**
248
- * Put node descendants of node in array.
249
- * If `onlyExpandable` is true, then only process expandable descendants.
250
- */
251
- nodeDescendents(node: T, nodes: T[], onlyExpandable: boolean): void;
295
+ interface SelectionChange<T> {
296
+ /** Model that dispatched the event. */
297
+ source: SelectionModel<T>;
298
+ /** Options that were added to the model. */
299
+ added: T[];
300
+ /** Options that were removed from the model. */
301
+ removed: T[];
252
302
  }
303
+ /**
304
+ * Returns an error that reports that multiple values are passed into a selection model
305
+ * with a single value.
306
+ * @docs-private
307
+ */
308
+ declare function getMultipleValuesInSingleSelectionError(): Error;
253
309
 
310
+ type UniqueSelectionDispatcherListener = (id: string, name: string) => void;
254
311
  /**
255
312
  * Class to coordinate unique selection based on name.
256
313
  * Intended to be consumed as an Angular service.
@@ -260,7 +317,7 @@ export declare interface TreeDataNodeFlattener<T> {
260
317
  * This service does not *store* any IDs and names because they may change at any time, so it is
261
318
  * less error-prone if they are simply passed through when the events occur.
262
319
  */
263
- export declare class UniqueSelectionDispatcher implements OnDestroy {
320
+ declare class UniqueSelectionDispatcher implements OnDestroy {
264
321
  private _listeners;
265
322
  /**
266
323
  * Notify other items that selection for the given name has been set.
@@ -278,99 +335,23 @@ export declare class UniqueSelectionDispatcher implements OnDestroy {
278
335
  static ɵprov: i0.ɵɵInjectableDeclaration<UniqueSelectionDispatcher>;
279
336
  }
280
337
 
281
- export declare type UniqueSelectionDispatcherListener = (id: string, name: string) => void;
282
-
283
- /**
284
- * Injection token for {@link _ViewRepeater}. This token is for use by Angular Material only.
285
- * @docs-private
286
- */
287
- export declare const _VIEW_REPEATER_STRATEGY: InjectionToken<_ViewRepeater<unknown, unknown, _ViewRepeaterItemContext<unknown>>>;
288
-
289
- /**
290
- * Describes a strategy for rendering items in a {@link ViewContainerRef}.
291
- *
292
- * @template T The type for the embedded view's $implicit property.
293
- * @template R The type for the item in each IterableDiffer change record.
294
- * @template C The type for the context passed to each embedded view.
295
- */
296
- export declare interface _ViewRepeater<T, R, C extends _ViewRepeaterItemContext<T>> {
297
- applyChanges(changes: IterableChanges<R>, viewContainerRef: ViewContainerRef, itemContextFactory: _ViewRepeaterItemContextFactory<T, R, C>, itemValueResolver: _ViewRepeaterItemValueResolver<T, R>, itemViewChanged?: _ViewRepeaterItemChanged<R, C>): void;
298
- detach(): void;
299
- }
300
-
301
- /**
302
- * Meta data describing the state of a view after it was updated by a
303
- * {@link _ViewRepeater}.
304
- *
305
- * @template R The type for the item in each IterableDiffer change record.
306
- * @template C The type for the context passed to each embedded view.
307
- */
308
- export declare interface _ViewRepeaterItemChange<R, C> {
309
- /** The view's context after it was changed. */
310
- context?: C;
311
- /** Indicates how the view was changed. */
312
- operation: _ViewRepeaterOperation;
313
- /** The view's corresponding change record. */
314
- record: IterableChangeRecord<R>;
315
- }
316
-
317
- /**
318
- * Type for a callback to be executed after a view has changed.
319
- *
320
- * @template R The type for the item in each IterableDiffer change record.
321
- * @template C The type for the context passed to each embedded view.
322
- */
323
- export declare type _ViewRepeaterItemChanged<R, C> = (change: _ViewRepeaterItemChange<R, C>) => void;
324
-
325
- /**
326
- * The context for an embedded view in the repeater's view container.
327
- *
328
- * @template T The type for the embedded view's $implicit property.
329
- */
330
- export declare interface _ViewRepeaterItemContext<T> {
331
- $implicit?: T;
332
- }
333
-
334
- /**
335
- * A factory that derives the embedded view context for an item in a view
336
- * container.
337
- *
338
- * @template T The type for the embedded view's $implicit property.
339
- * @template R The type for the item in each IterableDiffer change record.
340
- * @template C The type for the context passed to each embedded view.
341
- */
342
- export declare type _ViewRepeaterItemContextFactory<T, R, C extends _ViewRepeaterItemContext<T>> = (record: IterableChangeRecord<R>, adjustedPreviousIndex: number | null, currentIndex: number | null) => _ViewRepeaterItemInsertArgs<C>;
343
-
344
- /**
345
- * The arguments needed to construct an embedded view for an item in a view
346
- * container.
347
- *
348
- * @template C The type for the context passed to each embedded view.
349
- */
350
- export declare interface _ViewRepeaterItemInsertArgs<C> {
351
- templateRef: TemplateRef<C>;
352
- context?: C;
353
- index?: number;
354
- }
355
-
356
338
  /**
357
- * Extracts the value of an item from an {@link IterableChangeRecord}.
358
- *
359
- * @template T The type for the embedded view's $implicit property.
360
- * @template R The type for the item in each IterableDiffer change record.
339
+ * Interface for a class that can flatten hierarchical structured data and re-expand the flattened
340
+ * data back into its original structure. Should be used in conjunction with the cdk-tree.
361
341
  */
362
- export declare type _ViewRepeaterItemValueResolver<T, R> = (record: IterableChangeRecord<R>) => T;
363
-
364
- /** Indicates how a view was changed by a {@link _ViewRepeater}. */
365
- export declare enum _ViewRepeaterOperation {
366
- /** The content of an existing view was replaced with another item. */
367
- REPLACED = 0,
368
- /** A new view was created with `createEmbeddedView`. */
369
- INSERTED = 1,
370
- /** The position of a view changed, but the content remains the same. */
371
- MOVED = 2,
372
- /** A view was detached from the view container. */
373
- REMOVED = 3
342
+ interface TreeDataNodeFlattener<T> {
343
+ /** Transforms a set of hierarchical structured data into a flattened data array. */
344
+ flattenNodes(structuredData: any[]): T[];
345
+ /**
346
+ * Expands a flattened array of data into its hierarchical form using the provided expansion
347
+ * model.
348
+ */
349
+ expandFlattenedNodes(nodes: T[], expansionModel: SelectionModel<T>): T[];
350
+ /**
351
+ * Put node descendants of node in array.
352
+ * If `onlyExpandable` is true, then only process expandable descendants.
353
+ */
354
+ nodeDescendents(node: T, nodes: T[], onlyExpandable: boolean): void;
374
355
  }
375
356
 
376
- export { }
357
+ export { ArrayDataSource, type CollectionViewer, DataSource, type ListRange, type SelectionChange, SelectionModel, type TreeDataNodeFlattener, UniqueSelectionDispatcher, type UniqueSelectionDispatcherListener, _DisposeViewRepeaterStrategy, _RecycleViewRepeaterStrategy, _VIEW_REPEATER_STRATEGY, type _ViewRepeater, type _ViewRepeaterItemChange, type _ViewRepeaterItemChanged, type _ViewRepeaterItemContext, type _ViewRepeaterItemContextFactory, type _ViewRepeaterItemInsertArgs, type _ViewRepeaterItemValueResolver, _ViewRepeaterOperation, getMultipleValuesInSingleSelectionError, isDataSource };