@angular/cdk 19.2.3 → 20.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/a11y/index.d.ts +12 -843
  2. package/a11y-module.d-7d03e079.d.ts +313 -0
  3. package/accordion/index.d.ts +1 -1
  4. package/activedescendant-key-manager.d-11921e3a.d.ts +31 -0
  5. package/bidi/index.d.ts +3 -52
  6. package/bidi-module.d-f8648621.d.ts +53 -0
  7. package/coercion/index.d.ts +2 -15
  8. package/collections/index.d.ts +10 -269
  9. package/data-source.d-7cab2c9d.d.ts +42 -0
  10. package/dialog/index.d.ts +17 -32
  11. package/drag-drop/index.d.ts +14 -18
  12. package/fesm2022/a11y-module-e6996d20.mjs +952 -0
  13. package/fesm2022/a11y-module-e6996d20.mjs.map +1 -0
  14. package/fesm2022/a11y.mjs +42 -2448
  15. package/fesm2022/a11y.mjs.map +1 -1
  16. package/fesm2022/accordion.mjs +12 -12
  17. package/fesm2022/accordion.mjs.map +1 -1
  18. package/fesm2022/activedescendant-key-manager-1351a9d3.mjs +16 -0
  19. package/fesm2022/activedescendant-key-manager-1351a9d3.mjs.map +1 -0
  20. package/fesm2022/array-ee3b4bab.mjs +6 -0
  21. package/fesm2022/array-ee3b4bab.mjs.map +1 -0
  22. package/fesm2022/backwards-compatibility-bcbe473e.mjs +25 -0
  23. package/fesm2022/backwards-compatibility-bcbe473e.mjs.map +1 -0
  24. package/fesm2022/bidi-module-0726b65c.mjs +78 -0
  25. package/fesm2022/bidi-module-0726b65c.mjs.map +1 -0
  26. package/fesm2022/bidi.mjs +4 -143
  27. package/fesm2022/bidi.mjs.map +1 -1
  28. package/fesm2022/breakpoints-observer-d4584b66.mjs +179 -0
  29. package/fesm2022/breakpoints-observer-d4584b66.mjs.map +1 -0
  30. package/fesm2022/cdk.mjs +1 -1
  31. package/fesm2022/cdk.mjs.map +1 -1
  32. package/fesm2022/clipboard.mjs +10 -10
  33. package/fesm2022/clipboard.mjs.map +1 -1
  34. package/fesm2022/coercion/private.mjs +2 -14
  35. package/fesm2022/coercion/private.mjs.map +1 -1
  36. package/fesm2022/coercion.mjs +5 -39
  37. package/fesm2022/coercion.mjs.map +1 -1
  38. package/fesm2022/collections.mjs +7 -472
  39. package/fesm2022/collections.mjs.map +1 -1
  40. package/fesm2022/css-pixel-value-286c9a60.mjs +10 -0
  41. package/fesm2022/css-pixel-value-286c9a60.mjs.map +1 -0
  42. package/fesm2022/data-source-5320b6fd.mjs +15 -0
  43. package/fesm2022/data-source-5320b6fd.mjs.map +1 -0
  44. package/fesm2022/dialog.mjs +37 -41
  45. package/fesm2022/dialog.mjs.map +1 -1
  46. package/fesm2022/directionality-7ea26429.mjs +72 -0
  47. package/fesm2022/directionality-7ea26429.mjs.map +1 -0
  48. package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs +44 -0
  49. package/fesm2022/dispose-view-repeater-strategy-b11b87ea.mjs.map +1 -0
  50. package/fesm2022/drag-drop.mjs +48 -46
  51. package/fesm2022/drag-drop.mjs.map +1 -1
  52. package/fesm2022/element-705567fe.mjs +29 -0
  53. package/fesm2022/element-705567fe.mjs.map +1 -0
  54. package/fesm2022/fake-event-detection-7055b1bd.mjs +24 -0
  55. package/fesm2022/fake-event-detection-7055b1bd.mjs.map +1 -0
  56. package/fesm2022/focus-key-manager-58d29acd.mjs +22 -0
  57. package/fesm2022/focus-key-manager-58d29acd.mjs.map +1 -0
  58. package/fesm2022/focus-monitor-cebaa0d1.mjs +629 -0
  59. package/fesm2022/focus-monitor-cebaa0d1.mjs.map +1 -0
  60. package/fesm2022/id-generator-fba495fb.mjs +37 -0
  61. package/fesm2022/id-generator-fba495fb.mjs.map +1 -0
  62. package/fesm2022/keycodes-107cd3e4.mjs +122 -0
  63. package/fesm2022/keycodes-107cd3e4.mjs.map +1 -0
  64. package/fesm2022/keycodes.mjs +2 -132
  65. package/fesm2022/keycodes.mjs.map +1 -1
  66. package/fesm2022/layout.mjs +12 -180
  67. package/fesm2022/layout.mjs.map +1 -1
  68. package/fesm2022/list-key-manager-c7b5cefb.mjs +360 -0
  69. package/fesm2022/list-key-manager-c7b5cefb.mjs.map +1 -0
  70. package/fesm2022/listbox.mjs +21 -16
  71. package/fesm2022/listbox.mjs.map +1 -1
  72. package/fesm2022/menu.mjs +76 -56
  73. package/fesm2022/menu.mjs.map +1 -1
  74. package/fesm2022/modifiers-33a5859e.mjs +13 -0
  75. package/fesm2022/modifiers-33a5859e.mjs.map +1 -0
  76. package/fesm2022/observable-97c0792c.mjs +15 -0
  77. package/fesm2022/observable-97c0792c.mjs.map +1 -0
  78. package/fesm2022/observe-content-d2a6b5a0.mjs +210 -0
  79. package/fesm2022/observe-content-d2a6b5a0.mjs.map +1 -0
  80. package/fesm2022/observers/private.mjs +3 -3
  81. package/fesm2022/observers/private.mjs.map +1 -1
  82. package/fesm2022/observers.mjs +5 -209
  83. package/fesm2022/observers.mjs.map +1 -1
  84. package/fesm2022/overlay-module-863b82c9.mjs +3029 -0
  85. package/fesm2022/overlay-module-863b82c9.mjs.map +1 -0
  86. package/fesm2022/overlay.mjs +28 -3023
  87. package/fesm2022/overlay.mjs.map +1 -1
  88. package/fesm2022/passive-listeners-c0bdc49f.mjs +31 -0
  89. package/fesm2022/passive-listeners-c0bdc49f.mjs.map +1 -0
  90. package/fesm2022/platform-1be098b0.mjs +77 -0
  91. package/fesm2022/platform-1be098b0.mjs.map +1 -0
  92. package/fesm2022/platform.mjs +13 -289
  93. package/fesm2022/platform.mjs.map +1 -1
  94. package/fesm2022/portal-directives-c88fea11.mjs +615 -0
  95. package/fesm2022/portal-directives-c88fea11.mjs.map +1 -0
  96. package/fesm2022/portal.mjs +3 -675
  97. package/fesm2022/portal.mjs.map +1 -1
  98. package/fesm2022/private.mjs +3 -59
  99. package/fesm2022/private.mjs.map +1 -1
  100. package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs +156 -0
  101. package/fesm2022/recycle-view-repeater-strategy-c1712813.mjs.map +1 -0
  102. package/fesm2022/scrolling-61955dd1.mjs +99 -0
  103. package/fesm2022/scrolling-61955dd1.mjs.map +1 -0
  104. package/fesm2022/scrolling-module-aa9eeac5.mjs +1463 -0
  105. package/fesm2022/scrolling-module-aa9eeac5.mjs.map +1 -0
  106. package/fesm2022/scrolling.mjs +12 -1459
  107. package/fesm2022/scrolling.mjs.map +1 -1
  108. package/fesm2022/selection-model-30243dba.mjs +221 -0
  109. package/fesm2022/selection-model-30243dba.mjs.map +1 -0
  110. package/fesm2022/shadow-dom-9f403d00.mjs +49 -0
  111. package/fesm2022/shadow-dom-9f403d00.mjs.map +1 -0
  112. package/fesm2022/stepper.mjs +32 -26
  113. package/fesm2022/stepper.mjs.map +1 -1
  114. package/fesm2022/style-loader-e14dc585.mjs +47 -0
  115. package/fesm2022/style-loader-e14dc585.mjs.map +1 -0
  116. package/fesm2022/table.mjs +87 -121
  117. package/fesm2022/table.mjs.map +1 -1
  118. package/fesm2022/test-environment-34eef1ee.mjs +19 -0
  119. package/fesm2022/test-environment-34eef1ee.mjs.map +1 -0
  120. package/fesm2022/testing/selenium-webdriver.mjs +2 -1
  121. package/fesm2022/testing/selenium-webdriver.mjs.map +1 -1
  122. package/fesm2022/testing/testbed.mjs +33 -34
  123. package/fesm2022/testing/testbed.mjs.map +1 -1
  124. package/fesm2022/testing.mjs +2 -697
  125. package/fesm2022/testing.mjs.map +1 -1
  126. package/fesm2022/text-field.mjs +20 -19
  127. package/fesm2022/text-field.mjs.map +1 -1
  128. package/fesm2022/text-filtering-b60ba8a2.mjs +698 -0
  129. package/fesm2022/text-filtering-b60ba8a2.mjs.map +1 -0
  130. package/fesm2022/tree-key-manager-2f20c79c.mjs +360 -0
  131. package/fesm2022/tree-key-manager-2f20c79c.mjs.map +1 -0
  132. package/fesm2022/tree.mjs +33 -29
  133. package/fesm2022/tree.mjs.map +1 -1
  134. package/fesm2022/typeahead-11ae39bd.mjs +88 -0
  135. package/fesm2022/typeahead-11ae39bd.mjs.map +1 -0
  136. package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs +49 -0
  137. package/fesm2022/unique-selection-dispatcher-1d6f91d8.mjs.map +1 -0
  138. package/fesm2022/visually-hidden-83aea4a0.mjs +18 -0
  139. package/fesm2022/visually-hidden-83aea4a0.mjs.map +1 -0
  140. package/focus-key-manager.d-415a6958.d.ts +33 -0
  141. package/focus-monitor.d-810a02e6.d.ts +209 -0
  142. package/harness-environment.d-4d615248.d.ts +619 -0
  143. package/list-key-manager.d-72e9a2e7.d.ts +164 -0
  144. package/listbox/index.d.ts +5 -4
  145. package/menu/index.d.ts +14 -6
  146. package/number-property.d-ce316715.d.ts +15 -0
  147. package/observe-content.d-c08bc882.d.ts +84 -0
  148. package/observers/index.d.ts +4 -84
  149. package/overlay/index.d.ts +16 -792
  150. package/overlay-module.d-5d06db8a.d.ts +790 -0
  151. package/package.json +3 -3
  152. package/platform/index.d.ts +2 -31
  153. package/platform.d-0a5b4792.d.ts +33 -0
  154. package/portal/index.d.ts +5 -266
  155. package/portal-directives.d-d345bd53.d.ts +210 -0
  156. package/private/index.d.ts +2 -19
  157. package/schematics/migration.json +4 -4
  158. package/schematics/ng-add/index.js +1 -1
  159. package/schematics/ng-add/index.mjs +1 -1
  160. package/schematics/ng-update/index.d.ts +2 -2
  161. package/schematics/ng-update/index.js +5 -5
  162. package/schematics/ng-update/index.mjs +5 -5
  163. package/schematics/update-tool/target-version.d.ts +1 -1
  164. package/schematics/update-tool/target-version.js +2 -2
  165. package/schematics/update-tool/target-version.mjs +2 -2
  166. package/scrolling/index.d.ts +7 -604
  167. package/scrolling-module.d-a08a462d.d.ts +551 -0
  168. package/selection-model.d-1a70542c.d.ts +111 -0
  169. package/stepper/index.d.ts +5 -3
  170. package/style-loader.d-19baab84.d.ts +21 -0
  171. package/table/index.d.ts +8 -19
  172. package/testing/index.d.ts +2 -618
  173. package/testing/selenium-webdriver/index.d.ts +1 -1
  174. package/testing/testbed/index.d.ts +1 -1
  175. package/text-field/index.d.ts +1 -1
  176. package/tree/index.d.ts +3 -2
  177. package/tree-key-manager-strategy.d-603161dd.d.ts +116 -0
  178. package/unique-selection-dispatcher.d-7993b9f5.d.ts +32 -0
  179. package/view-repeater.d-79039e1f.d.ts +88 -0
  180. package/viewport-ruler.d-f3d3e82f.d.ts +57 -0
@@ -0,0 +1,551 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnDestroy, ElementRef, OnInit, NgZone, InjectionToken, OnChanges, NgIterable, DoCheck, TrackByFunction, TemplateRef } from '@angular/core';
3
+ import { D as Directionality, B as BidiModule } from './bidi-module.d-f8648621.js';
4
+ import { Observable, Subscription, Subject } from 'rxjs';
5
+ import { L as ListRange, D as DataSource, C as CollectionViewer } from './data-source.d-7cab2c9d.js';
6
+ import { N as NumberInput } from './number-property.d-ce316715.js';
7
+
8
+ /**
9
+ * An item to be repeated by the VirtualScrollViewport
10
+ */
11
+ interface CdkVirtualScrollRepeater<T> {
12
+ readonly dataStream: Observable<readonly T[]>;
13
+ measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number;
14
+ }
15
+
16
+ /** Time in ms to throttle the scrolling events by default. */
17
+ declare const DEFAULT_SCROLL_TIME = 20;
18
+ /**
19
+ * Service contained all registered Scrollable references and emits an event when any one of the
20
+ * Scrollable references emit a scrolled event.
21
+ */
22
+ declare class ScrollDispatcher implements OnDestroy {
23
+ private _ngZone;
24
+ private _platform;
25
+ private _renderer;
26
+ private _cleanupGlobalListener;
27
+ constructor(...args: unknown[]);
28
+ /** Subject for notifying that a registered scrollable reference element has been scrolled. */
29
+ private readonly _scrolled;
30
+ /** Keeps track of the amount of subscriptions to `scrolled`. Used for cleaning up afterwards. */
31
+ private _scrolledCount;
32
+ /**
33
+ * Map of all the scrollable references that are registered with the service and their
34
+ * scroll event subscriptions.
35
+ */
36
+ scrollContainers: Map<CdkScrollable, Subscription>;
37
+ /**
38
+ * Registers a scrollable instance with the service and listens for its scrolled events. When the
39
+ * scrollable is scrolled, the service emits the event to its scrolled observable.
40
+ * @param scrollable Scrollable instance to be registered.
41
+ */
42
+ register(scrollable: CdkScrollable): void;
43
+ /**
44
+ * De-registers a Scrollable reference and unsubscribes from its scroll event observable.
45
+ * @param scrollable Scrollable instance to be deregistered.
46
+ */
47
+ deregister(scrollable: CdkScrollable): void;
48
+ /**
49
+ * Returns an observable that emits an event whenever any of the registered Scrollable
50
+ * references (or window, document, or body) fire a scrolled event. Can provide a time in ms
51
+ * to override the default "throttle" time.
52
+ *
53
+ * **Note:** in order to avoid hitting change detection for every scroll event,
54
+ * all of the events emitted from this stream will be run outside the Angular zone.
55
+ * If you need to update any data bindings as a result of a scroll event, you have
56
+ * to run the callback using `NgZone.run`.
57
+ */
58
+ scrolled(auditTimeInMs?: number): Observable<CdkScrollable | void>;
59
+ ngOnDestroy(): void;
60
+ /**
61
+ * Returns an observable that emits whenever any of the
62
+ * scrollable ancestors of an element are scrolled.
63
+ * @param elementOrElementRef Element whose ancestors to listen for.
64
+ * @param auditTimeInMs Time to throttle the scroll events.
65
+ */
66
+ ancestorScrolled(elementOrElementRef: ElementRef | HTMLElement, auditTimeInMs?: number): Observable<CdkScrollable | void>;
67
+ /** Returns all registered Scrollables that contain the provided element. */
68
+ getAncestorScrollContainers(elementOrElementRef: ElementRef | HTMLElement): CdkScrollable[];
69
+ /** Returns true if the element is contained within the provided Scrollable. */
70
+ private _scrollableContainsElement;
71
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScrollDispatcher, never>;
72
+ static ɵprov: i0.ɵɵInjectableDeclaration<ScrollDispatcher>;
73
+ }
74
+
75
+ type _Without<T> = {
76
+ [P in keyof T]?: never;
77
+ };
78
+ type _XOR<T, U> = (_Without<T> & U) | (_Without<U> & T);
79
+ type _Top = {
80
+ top?: number;
81
+ };
82
+ type _Bottom = {
83
+ bottom?: number;
84
+ };
85
+ type _Left = {
86
+ left?: number;
87
+ };
88
+ type _Right = {
89
+ right?: number;
90
+ };
91
+ type _Start = {
92
+ start?: number;
93
+ };
94
+ type _End = {
95
+ end?: number;
96
+ };
97
+ type _XAxis = _XOR<_XOR<_Left, _Right>, _XOR<_Start, _End>>;
98
+ type _YAxis = _XOR<_Top, _Bottom>;
99
+ /**
100
+ * An extended version of ScrollToOptions that allows expressing scroll offsets relative to the
101
+ * top, bottom, left, right, start, or end of the viewport rather than just the top and left.
102
+ * Please note: the top and bottom properties are mutually exclusive, as are the left, right,
103
+ * start, and end properties.
104
+ */
105
+ type ExtendedScrollToOptions = _XAxis & _YAxis & ScrollOptions;
106
+ /**
107
+ * Sends an event when the directive's element is scrolled. Registers itself with the
108
+ * ScrollDispatcher service to include itself as part of its collection of scrolling events that it
109
+ * can be listened to through the service.
110
+ */
111
+ declare class CdkScrollable implements OnInit, OnDestroy {
112
+ protected elementRef: ElementRef<HTMLElement>;
113
+ protected scrollDispatcher: ScrollDispatcher;
114
+ protected ngZone: NgZone;
115
+ protected dir?: Directionality | null | undefined;
116
+ protected _scrollElement: EventTarget;
117
+ protected readonly _destroyed: Subject<void>;
118
+ private _renderer;
119
+ private _cleanupScroll;
120
+ private _elementScrolled;
121
+ constructor(...args: unknown[]);
122
+ ngOnInit(): void;
123
+ ngOnDestroy(): void;
124
+ /** Returns observable that emits when a scroll event is fired on the host element. */
125
+ elementScrolled(): Observable<Event>;
126
+ /** Gets the ElementRef for the viewport. */
127
+ getElementRef(): ElementRef<HTMLElement>;
128
+ /**
129
+ * Scrolls to the specified offsets. This is a normalized version of the browser's native scrollTo
130
+ * method, since browsers are not consistent about what scrollLeft means in RTL. For this method
131
+ * left and right always refer to the left and right side of the scrolling container irrespective
132
+ * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
133
+ * in an RTL context.
134
+ * @param options specified the offsets to scroll to.
135
+ */
136
+ scrollTo(options: ExtendedScrollToOptions): void;
137
+ private _applyScrollToOptions;
138
+ /**
139
+ * Measures the scroll offset relative to the specified edge of the viewport. This method can be
140
+ * used instead of directly checking scrollLeft or scrollTop, since browsers are not consistent
141
+ * about what scrollLeft means in RTL. The values returned by this method are normalized such that
142
+ * left and right always refer to the left and right side of the scrolling container irrespective
143
+ * of the layout direction. start and end refer to left and right in an LTR context and vice-versa
144
+ * in an RTL context.
145
+ * @param from The edge to measure from.
146
+ */
147
+ measureScrollOffset(from: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
148
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkScrollable, never>;
149
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkScrollable, "[cdk-scrollable], [cdkScrollable]", never, {}, {}, never, never, true, never>;
150
+ }
151
+
152
+ declare const VIRTUAL_SCROLLABLE: InjectionToken<CdkVirtualScrollable>;
153
+ /**
154
+ * Extending the {@link CdkScrollable} to be used as scrolling container for virtual scrolling.
155
+ */
156
+ declare abstract class CdkVirtualScrollable extends CdkScrollable {
157
+ constructor(...args: unknown[]);
158
+ /**
159
+ * Measure the viewport size for the provided orientation.
160
+ *
161
+ * @param orientation The orientation to measure the size from.
162
+ */
163
+ measureViewportSize(orientation: 'horizontal' | 'vertical'): number;
164
+ /**
165
+ * Measure the bounding DOMRect size including the scroll offset.
166
+ *
167
+ * @param from The edge to measure from.
168
+ */
169
+ abstract measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
170
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollable, never>;
171
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollable, never, never, {}, {}, never, never, true, never>;
172
+ }
173
+
174
+ /** A viewport that virtualizes its scrolling with the help of `CdkVirtualForOf`. */
175
+ declare class CdkVirtualScrollViewport extends CdkVirtualScrollable implements OnInit, OnDestroy {
176
+ elementRef: ElementRef<HTMLElement>;
177
+ private _changeDetectorRef;
178
+ private _scrollStrategy;
179
+ scrollable: CdkVirtualScrollable;
180
+ private _platform;
181
+ /** Emits when the viewport is detached from a CdkVirtualForOf. */
182
+ private readonly _detachedSubject;
183
+ /** Emits when the rendered range changes. */
184
+ private readonly _renderedRangeSubject;
185
+ /** The direction the viewport scrolls. */
186
+ get orientation(): "horizontal" | "vertical";
187
+ set orientation(orientation: 'horizontal' | 'vertical');
188
+ private _orientation;
189
+ /**
190
+ * Whether rendered items should persist in the DOM after scrolling out of view. By default, items
191
+ * will be removed.
192
+ */
193
+ appendOnly: boolean;
194
+ /** Emits when the index of the first element visible in the viewport changes. */
195
+ readonly scrolledIndexChange: Observable<number>;
196
+ /** The element that wraps the rendered content. */
197
+ _contentWrapper: ElementRef<HTMLElement>;
198
+ /** A stream that emits whenever the rendered range changes. */
199
+ readonly renderedRangeStream: Observable<ListRange>;
200
+ /**
201
+ * The total size of all content (in pixels), including content that is not currently rendered.
202
+ */
203
+ private _totalContentSize;
204
+ /** A string representing the `style.width` property value to be used for the spacer element. */
205
+ _totalContentWidth: string;
206
+ /** A string representing the `style.height` property value to be used for the spacer element. */
207
+ _totalContentHeight: string;
208
+ /**
209
+ * The CSS transform applied to the rendered subset of items so that they appear within the bounds
210
+ * of the visible viewport.
211
+ */
212
+ private _renderedContentTransform;
213
+ /** The currently rendered range of indices. */
214
+ private _renderedRange;
215
+ /** The length of the data bound to this viewport (in number of items). */
216
+ private _dataLength;
217
+ /** The size of the viewport (in pixels). */
218
+ private _viewportSize;
219
+ /** the currently attached CdkVirtualScrollRepeater. */
220
+ private _forOf;
221
+ /** The last rendered content offset that was set. */
222
+ private _renderedContentOffset;
223
+ /**
224
+ * Whether the last rendered content offset was to the end of the content (and therefore needs to
225
+ * be rewritten as an offset to the start of the content).
226
+ */
227
+ private _renderedContentOffsetNeedsRewrite;
228
+ /** Whether there is a pending change detection cycle. */
229
+ private _isChangeDetectionPending;
230
+ /** A list of functions to run after the next change detection cycle. */
231
+ private _runAfterChangeDetection;
232
+ /** Subscription to changes in the viewport size. */
233
+ private _viewportChanges;
234
+ private _injector;
235
+ private _isDestroyed;
236
+ constructor(...args: unknown[]);
237
+ ngOnInit(): void;
238
+ ngOnDestroy(): void;
239
+ /** Attaches a `CdkVirtualScrollRepeater` to this viewport. */
240
+ attach(forOf: CdkVirtualScrollRepeater<any>): void;
241
+ /** Detaches the current `CdkVirtualForOf`. */
242
+ detach(): void;
243
+ /** Gets the length of the data bound to this viewport (in number of items). */
244
+ getDataLength(): number;
245
+ /** Gets the size of the viewport (in pixels). */
246
+ getViewportSize(): number;
247
+ /** Get the current rendered range of items. */
248
+ getRenderedRange(): ListRange;
249
+ measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
250
+ /**
251
+ * Sets the total size of all content (in pixels), including content that is not currently
252
+ * rendered.
253
+ */
254
+ setTotalContentSize(size: number): void;
255
+ /** Sets the currently rendered range of indices. */
256
+ setRenderedRange(range: ListRange): void;
257
+ /**
258
+ * Gets the offset from the start of the viewport to the start of the rendered data (in pixels).
259
+ */
260
+ getOffsetToRenderedContentStart(): number | null;
261
+ /**
262
+ * Sets the offset from the start of the viewport to either the start or end of the rendered data
263
+ * (in pixels).
264
+ */
265
+ setRenderedContentOffset(offset: number, to?: 'to-start' | 'to-end'): void;
266
+ /**
267
+ * Scrolls to the given offset from the start of the viewport. Please note that this is not always
268
+ * the same as setting `scrollTop` or `scrollLeft`. In a horizontal viewport with right-to-left
269
+ * direction, this would be the equivalent of setting a fictional `scrollRight` property.
270
+ * @param offset The offset to scroll to.
271
+ * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
272
+ */
273
+ scrollToOffset(offset: number, behavior?: ScrollBehavior): void;
274
+ /**
275
+ * Scrolls to the offset for the given index.
276
+ * @param index The index of the element to scroll to.
277
+ * @param behavior The ScrollBehavior to use when scrolling. Default is behavior is `auto`.
278
+ */
279
+ scrollToIndex(index: number, behavior?: ScrollBehavior): void;
280
+ /**
281
+ * Gets the current scroll offset from the start of the scrollable (in pixels).
282
+ * @param from The edge to measure the offset from. Defaults to 'top' in vertical mode and 'start'
283
+ * in horizontal mode.
284
+ */
285
+ measureScrollOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
286
+ /**
287
+ * Measures the offset of the viewport from the scrolling container
288
+ * @param from The edge to measure from.
289
+ */
290
+ measureViewportOffset(from?: 'top' | 'left' | 'right' | 'bottom' | 'start' | 'end'): number;
291
+ /** Measure the combined size of all of the rendered items. */
292
+ measureRenderedContentSize(): number;
293
+ /**
294
+ * Measure the total combined size of the given range. Throws if the range includes items that are
295
+ * not rendered.
296
+ */
297
+ measureRangeSize(range: ListRange): number;
298
+ /** Update the viewport dimensions and re-render. */
299
+ checkViewportSize(): void;
300
+ /** Measure the viewport size. */
301
+ private _measureViewportSize;
302
+ /** Queue up change detection to run. */
303
+ private _markChangeDetectionNeeded;
304
+ /** Run change detection. */
305
+ private _doChangeDetection;
306
+ /** Calculates the `style.width` and `style.height` for the spacer element. */
307
+ private _calculateSpacerSize;
308
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollViewport, never>;
309
+ static ɵcmp: i0.ɵɵComponentDeclaration<CdkVirtualScrollViewport, "cdk-virtual-scroll-viewport", never, { "orientation": { "alias": "orientation"; "required": false; }; "appendOnly": { "alias": "appendOnly"; "required": false; }; }, { "scrolledIndexChange": "scrolledIndexChange"; }, never, ["*"], true, never>;
310
+ static ngAcceptInputType_appendOnly: unknown;
311
+ }
312
+
313
+ /** The injection token used to specify the virtual scrolling strategy. */
314
+ declare const VIRTUAL_SCROLL_STRATEGY: InjectionToken<VirtualScrollStrategy>;
315
+ /** A strategy that dictates which items should be rendered in the viewport. */
316
+ interface VirtualScrollStrategy {
317
+ /** Emits when the index of the first element visible in the viewport changes. */
318
+ scrolledIndexChange: Observable<number>;
319
+ /**
320
+ * Attaches this scroll strategy to a viewport.
321
+ * @param viewport The viewport to attach this strategy to.
322
+ */
323
+ attach(viewport: CdkVirtualScrollViewport): void;
324
+ /** Detaches this scroll strategy from the currently attached viewport. */
325
+ detach(): void;
326
+ /** Called when the viewport is scrolled (debounced using requestAnimationFrame). */
327
+ onContentScrolled(): void;
328
+ /** Called when the length of the data changes. */
329
+ onDataLengthChanged(): void;
330
+ /** Called when the range of items rendered in the DOM has changed. */
331
+ onContentRendered(): void;
332
+ /** Called when the offset of the rendered items changed. */
333
+ onRenderedOffsetChanged(): void;
334
+ /**
335
+ * Scroll to the offset for the given index.
336
+ * @param index The index of the element to scroll to.
337
+ * @param behavior The ScrollBehavior to use when scrolling.
338
+ */
339
+ scrollToIndex(index: number, behavior: ScrollBehavior): void;
340
+ }
341
+
342
+ /** Virtual scrolling strategy for lists with items of known fixed size. */
343
+ declare class FixedSizeVirtualScrollStrategy implements VirtualScrollStrategy {
344
+ private readonly _scrolledIndexChange;
345
+ /** @docs-private Implemented as part of VirtualScrollStrategy. */
346
+ scrolledIndexChange: Observable<number>;
347
+ /** The attached viewport. */
348
+ private _viewport;
349
+ /** The size of the items in the virtually scrolling list. */
350
+ private _itemSize;
351
+ /** The minimum amount of buffer rendered beyond the viewport (in pixels). */
352
+ private _minBufferPx;
353
+ /** The number of buffer items to render beyond the edge of the viewport (in pixels). */
354
+ private _maxBufferPx;
355
+ /**
356
+ * @param itemSize The size of the items in the virtually scrolling list.
357
+ * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
358
+ * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
359
+ */
360
+ constructor(itemSize: number, minBufferPx: number, maxBufferPx: number);
361
+ /**
362
+ * Attaches this scroll strategy to a viewport.
363
+ * @param viewport The viewport to attach this strategy to.
364
+ */
365
+ attach(viewport: CdkVirtualScrollViewport): void;
366
+ /** Detaches this scroll strategy from the currently attached viewport. */
367
+ detach(): void;
368
+ /**
369
+ * Update the item size and buffer size.
370
+ * @param itemSize The size of the items in the virtually scrolling list.
371
+ * @param minBufferPx The minimum amount of buffer (in pixels) before needing to render more
372
+ * @param maxBufferPx The amount of buffer (in pixels) to render when rendering more.
373
+ */
374
+ updateItemAndBufferSize(itemSize: number, minBufferPx: number, maxBufferPx: number): void;
375
+ /** @docs-private Implemented as part of VirtualScrollStrategy. */
376
+ onContentScrolled(): void;
377
+ /** @docs-private Implemented as part of VirtualScrollStrategy. */
378
+ onDataLengthChanged(): void;
379
+ /** @docs-private Implemented as part of VirtualScrollStrategy. */
380
+ onContentRendered(): void;
381
+ /** @docs-private Implemented as part of VirtualScrollStrategy. */
382
+ onRenderedOffsetChanged(): void;
383
+ /**
384
+ * Scroll to the offset for the given index.
385
+ * @param index The index of the element to scroll to.
386
+ * @param behavior The ScrollBehavior to use when scrolling.
387
+ */
388
+ scrollToIndex(index: number, behavior: ScrollBehavior): void;
389
+ /** Update the viewport's total content size. */
390
+ private _updateTotalContentSize;
391
+ /** Update the viewport's rendered range. */
392
+ private _updateRenderedRange;
393
+ }
394
+ /**
395
+ * Provider factory for `FixedSizeVirtualScrollStrategy` that simply extracts the already created
396
+ * `FixedSizeVirtualScrollStrategy` from the given directive.
397
+ * @param fixedSizeDir The instance of `CdkFixedSizeVirtualScroll` to extract the
398
+ * `FixedSizeVirtualScrollStrategy` from.
399
+ */
400
+ declare function _fixedSizeVirtualScrollStrategyFactory(fixedSizeDir: CdkFixedSizeVirtualScroll): FixedSizeVirtualScrollStrategy;
401
+ /** A virtual scroll strategy that supports fixed-size items. */
402
+ declare class CdkFixedSizeVirtualScroll implements OnChanges {
403
+ /** The size of the items in the list (in pixels). */
404
+ get itemSize(): number;
405
+ set itemSize(value: NumberInput);
406
+ _itemSize: number;
407
+ /**
408
+ * The minimum amount of buffer rendered beyond the viewport (in pixels).
409
+ * If the amount of buffer dips below this number, more items will be rendered. Defaults to 100px.
410
+ */
411
+ get minBufferPx(): number;
412
+ set minBufferPx(value: NumberInput);
413
+ _minBufferPx: number;
414
+ /**
415
+ * The number of pixels worth of buffer to render for when rendering new items. Defaults to 200px.
416
+ */
417
+ get maxBufferPx(): number;
418
+ set maxBufferPx(value: NumberInput);
419
+ _maxBufferPx: number;
420
+ /** The scroll strategy used by this directive. */
421
+ _scrollStrategy: FixedSizeVirtualScrollStrategy;
422
+ ngOnChanges(): void;
423
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkFixedSizeVirtualScroll, never>;
424
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkFixedSizeVirtualScroll, "cdk-virtual-scroll-viewport[itemSize]", never, { "itemSize": { "alias": "itemSize"; "required": false; }; "minBufferPx": { "alias": "minBufferPx"; "required": false; }; "maxBufferPx": { "alias": "maxBufferPx"; "required": false; }; }, {}, never, never, true, never>;
425
+ }
426
+
427
+ /** The context for an item rendered by `CdkVirtualForOf` */
428
+ type CdkVirtualForOfContext<T> = {
429
+ /** The item value. */
430
+ $implicit: T;
431
+ /** The DataSource, Observable, or NgIterable that was passed to *cdkVirtualFor. */
432
+ cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T>;
433
+ /** The index of the item in the DataSource. */
434
+ index: number;
435
+ /** The number of items in the DataSource. */
436
+ count: number;
437
+ /** Whether this is the first item in the DataSource. */
438
+ first: boolean;
439
+ /** Whether this is the last item in the DataSource. */
440
+ last: boolean;
441
+ /** Whether the index is even. */
442
+ even: boolean;
443
+ /** Whether the index is odd. */
444
+ odd: boolean;
445
+ };
446
+ /**
447
+ * A directive similar to `ngForOf` to be used for rendering data inside a virtual scrolling
448
+ * container.
449
+ */
450
+ declare class CdkVirtualForOf<T> implements CdkVirtualScrollRepeater<T>, CollectionViewer, DoCheck, OnDestroy {
451
+ private _viewContainerRef;
452
+ private _template;
453
+ private _differs;
454
+ private _viewRepeater;
455
+ private _viewport;
456
+ /** Emits when the rendered view of the data changes. */
457
+ readonly viewChange: Subject<ListRange>;
458
+ /** Subject that emits when a new DataSource instance is given. */
459
+ private readonly _dataSourceChanges;
460
+ /** The DataSource to display. */
461
+ get cdkVirtualForOf(): DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;
462
+ set cdkVirtualForOf(value: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined);
463
+ _cdkVirtualForOf: DataSource<T> | Observable<T[]> | NgIterable<T> | null | undefined;
464
+ /**
465
+ * The `TrackByFunction` to use for tracking changes. The `TrackByFunction` takes the index and
466
+ * the item and produces a value to be used as the item's identity when tracking changes.
467
+ */
468
+ get cdkVirtualForTrackBy(): TrackByFunction<T> | undefined;
469
+ set cdkVirtualForTrackBy(fn: TrackByFunction<T> | undefined);
470
+ private _cdkVirtualForTrackBy;
471
+ /** The template used to stamp out new elements. */
472
+ set cdkVirtualForTemplate(value: TemplateRef<CdkVirtualForOfContext<T>>);
473
+ /**
474
+ * The size of the cache used to store templates that are not being used for re-use later.
475
+ * Setting the cache size to `0` will disable caching. Defaults to 20 templates.
476
+ */
477
+ get cdkVirtualForTemplateCacheSize(): number;
478
+ set cdkVirtualForTemplateCacheSize(size: NumberInput);
479
+ /** Emits whenever the data in the current DataSource changes. */
480
+ readonly dataStream: Observable<readonly T[]>;
481
+ /** The differ used to calculate changes to the data. */
482
+ private _differ;
483
+ /** The most recent data emitted from the DataSource. */
484
+ private _data;
485
+ /** The currently rendered items. */
486
+ private _renderedItems;
487
+ /** The currently rendered range of indices. */
488
+ private _renderedRange;
489
+ /** Whether the rendered data should be updated during the next ngDoCheck cycle. */
490
+ private _needsUpdate;
491
+ private readonly _destroyed;
492
+ constructor(...args: unknown[]);
493
+ /**
494
+ * Measures the combined size (width for horizontal orientation, height for vertical) of all items
495
+ * in the specified range. Throws an error if the range includes items that are not currently
496
+ * rendered.
497
+ */
498
+ measureRangeSize(range: ListRange, orientation: 'horizontal' | 'vertical'): number;
499
+ ngDoCheck(): void;
500
+ ngOnDestroy(): void;
501
+ /** React to scroll state changes in the viewport. */
502
+ private _onRenderedDataChange;
503
+ /** Swap out one `DataSource` for another. */
504
+ private _changeDataSource;
505
+ /** Update the `CdkVirtualForOfContext` for all views. */
506
+ private _updateContext;
507
+ /** Apply changes to the DOM. */
508
+ private _applyChanges;
509
+ /** Update the computed properties on the `CdkVirtualForOfContext`. */
510
+ private _updateComputedContextProperties;
511
+ private _getEmbeddedViewArgs;
512
+ static ngTemplateContextGuard<T>(directive: CdkVirtualForOf<T>, context: unknown): context is CdkVirtualForOfContext<T>;
513
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualForOf<any>, never>;
514
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualForOf<any>, "[cdkVirtualFor][cdkVirtualForOf]", never, { "cdkVirtualForOf": { "alias": "cdkVirtualForOf"; "required": false; }; "cdkVirtualForTrackBy": { "alias": "cdkVirtualForTrackBy"; "required": false; }; "cdkVirtualForTemplate": { "alias": "cdkVirtualForTemplate"; "required": false; }; "cdkVirtualForTemplateCacheSize": { "alias": "cdkVirtualForTemplateCacheSize"; "required": false; }; }, {}, never, never, true, never>;
515
+ }
516
+
517
+ /**
518
+ * Provides as virtual scrollable for the global / window scrollbar.
519
+ */
520
+ declare class CdkVirtualScrollableWindow extends CdkVirtualScrollable {
521
+ constructor(...args: unknown[]);
522
+ measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
523
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollableWindow, never>;
524
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollableWindow, "cdk-virtual-scroll-viewport[scrollWindow]", never, {}, {}, never, never, true, never>;
525
+ }
526
+
527
+ /**
528
+ * Provides a virtual scrollable for the element it is attached to.
529
+ */
530
+ declare class CdkVirtualScrollableElement extends CdkVirtualScrollable {
531
+ constructor(...args: unknown[]);
532
+ measureBoundingClientRectWithScrollOffset(from: 'left' | 'top' | 'right' | 'bottom'): number;
533
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkVirtualScrollableElement, never>;
534
+ static ɵdir: i0.ɵɵDirectiveDeclaration<CdkVirtualScrollableElement, "[cdkVirtualScrollingElement]", never, {}, {}, never, never, true, never>;
535
+ }
536
+
537
+ declare class CdkScrollableModule {
538
+ static ɵfac: i0.ɵɵFactoryDeclaration<CdkScrollableModule, never>;
539
+ static ɵmod: i0.ɵɵNgModuleDeclaration<CdkScrollableModule, never, [typeof CdkScrollable], [typeof CdkScrollable]>;
540
+ static ɵinj: i0.ɵɵInjectorDeclaration<CdkScrollableModule>;
541
+ }
542
+ /**
543
+ * @docs-primary-export
544
+ */
545
+ declare class ScrollingModule {
546
+ static ɵfac: i0.ɵɵFactoryDeclaration<ScrollingModule, never>;
547
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ScrollingModule, never, [typeof BidiModule, typeof CdkScrollableModule, typeof CdkVirtualScrollViewport, typeof CdkFixedSizeVirtualScroll, typeof CdkVirtualForOf, typeof CdkVirtualScrollableWindow, typeof CdkVirtualScrollableElement], [typeof BidiModule, typeof CdkScrollableModule, typeof CdkFixedSizeVirtualScroll, typeof CdkVirtualForOf, typeof CdkVirtualScrollViewport, typeof CdkVirtualScrollableWindow, typeof CdkVirtualScrollableElement]>;
548
+ static ɵinj: i0.ɵɵInjectorDeclaration<ScrollingModule>;
549
+ }
550
+
551
+ export { CdkScrollable as C, DEFAULT_SCROLL_TIME as D, type ExtendedScrollToOptions as E, FixedSizeVirtualScrollStrategy as F, ScrollingModule as S, VIRTUAL_SCROLL_STRATEGY as V, _fixedSizeVirtualScrollStrategyFactory as _, CdkScrollableModule as a, ScrollDispatcher as b, CdkFixedSizeVirtualScroll as c, type _Without as d, type _XOR as e, type _Top as f, type _Bottom as g, type _Left as h, type _Right as i, type _Start as j, type _End as k, type _XAxis as l, type _YAxis as m, type CdkVirtualForOfContext as n, CdkVirtualForOf as o, type VirtualScrollStrategy as p, CdkVirtualScrollViewport as q, type CdkVirtualScrollRepeater as r, VIRTUAL_SCROLLABLE as s, CdkVirtualScrollable as t, CdkVirtualScrollableElement as u, CdkVirtualScrollableWindow as v };
@@ -0,0 +1,111 @@
1
+ import { Subject } from 'rxjs';
2
+
3
+ /**
4
+ * Class to be used to power selecting one or more options from a list.
5
+ */
6
+ declare class SelectionModel<T> {
7
+ private _multiple;
8
+ private _emitChanges;
9
+ compareWith?: ((o1: T, o2: T) => boolean) | undefined;
10
+ /** Currently-selected values. */
11
+ private _selection;
12
+ /** Keeps track of the deselected options that haven't been emitted by the change event. */
13
+ private _deselectedToEmit;
14
+ /** Keeps track of the selected options that haven't been emitted by the change event. */
15
+ private _selectedToEmit;
16
+ /** Cache for the array value of the selected items. */
17
+ private _selected;
18
+ /** Selected values. */
19
+ get selected(): T[];
20
+ /** Event emitted when the value has changed. */
21
+ readonly changed: Subject<SelectionChange<T>>;
22
+ constructor(_multiple?: boolean, initiallySelectedValues?: T[], _emitChanges?: boolean, compareWith?: ((o1: T, o2: T) => boolean) | undefined);
23
+ /**
24
+ * Selects a value or an array of values.
25
+ * @param values The values to select
26
+ * @return Whether the selection changed as a result of this call
27
+ */
28
+ select(...values: T[]): boolean;
29
+ /**
30
+ * Deselects a value or an array of values.
31
+ * @param values The values to deselect
32
+ * @return Whether the selection changed as a result of this call
33
+ */
34
+ deselect(...values: T[]): boolean;
35
+ /**
36
+ * Sets the selected values
37
+ * @param values The new selected values
38
+ * @return Whether the selection changed as a result of this call
39
+ */
40
+ setSelection(...values: T[]): boolean;
41
+ /**
42
+ * Toggles a value between selected and deselected.
43
+ * @param value The value to toggle
44
+ * @return Whether the selection changed as a result of this call
45
+ */
46
+ toggle(value: T): boolean;
47
+ /**
48
+ * Clears all of the selected values.
49
+ * @param flushEvent Whether to flush the changes in an event.
50
+ * If false, the changes to the selection will be flushed along with the next event.
51
+ * @return Whether the selection changed as a result of this call
52
+ */
53
+ clear(flushEvent?: boolean): boolean;
54
+ /**
55
+ * Determines whether a value is selected.
56
+ */
57
+ isSelected(value: T): boolean;
58
+ /**
59
+ * Determines whether the model does not have a value.
60
+ */
61
+ isEmpty(): boolean;
62
+ /**
63
+ * Determines whether the model has a value.
64
+ */
65
+ hasValue(): boolean;
66
+ /**
67
+ * Sorts the selected values based on a predicate function.
68
+ */
69
+ sort(predicate?: (a: T, b: T) => number): void;
70
+ /**
71
+ * Gets whether multiple values can be selected.
72
+ */
73
+ isMultipleSelection(): boolean;
74
+ /** Emits a change event and clears the records of selected and deselected values. */
75
+ private _emitChangeEvent;
76
+ /** Selects a value. */
77
+ private _markSelected;
78
+ /** Deselects a value. */
79
+ private _unmarkSelected;
80
+ /** Clears out the selected values. */
81
+ private _unmarkAll;
82
+ /**
83
+ * Verifies the value assignment and throws an error if the specified value array is
84
+ * including multiple values while the selection model is not supporting multiple values.
85
+ */
86
+ private _verifyValueAssignment;
87
+ /** Whether there are queued up change to be emitted. */
88
+ private _hasQueuedChanges;
89
+ /** Returns a value that is comparable to inputValue by applying compareWith function, returns the same inputValue otherwise. */
90
+ private _getConcreteValue;
91
+ }
92
+ /**
93
+ * Event emitted when the value of a MatSelectionModel has changed.
94
+ * @docs-private
95
+ */
96
+ interface SelectionChange<T> {
97
+ /** Model that dispatched the event. */
98
+ source: SelectionModel<T>;
99
+ /** Options that were added to the model. */
100
+ added: T[];
101
+ /** Options that were removed from the model. */
102
+ removed: T[];
103
+ }
104
+ /**
105
+ * Returns an error that reports that multiple values are passed into a selection model
106
+ * with a single value.
107
+ * @docs-private
108
+ */
109
+ declare function getMultipleValuesInSingleSelectionError(): Error;
110
+
111
+ export { SelectionModel as S, type SelectionChange as a, getMultipleValuesInSingleSelectionError as g };