@fluentui/react-virtualizer 9.0.0-alpha.83 → 9.0.0-alpha.85
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.
- package/CHANGELOG.md +22 -2
- package/dist/index.d.ts +78 -5
- package/lib/components/Virtualizer/Virtualizer.types.js.map +1 -1
- package/lib/components/Virtualizer/useVirtualizer.js +208 -143
- package/lib/components/Virtualizer/useVirtualizer.js.map +1 -1
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js +3 -3
- package/lib/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
- package/lib/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
- package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +11 -9
- package/lib/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
- package/lib/hooks/hooks.types.js.map +1 -1
- package/lib/hooks/index.js +1 -0
- package/lib/hooks/index.js.map +1 -1
- package/lib/hooks/useDynamicVirtualizerMeasure.js +63 -45
- package/lib/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
- package/lib/hooks/useMeasureList.js +14 -2
- package/lib/hooks/useMeasureList.js.map +1 -1
- package/lib/hooks/useResizeObserverRef.js +11 -1
- package/lib/hooks/useResizeObserverRef.js.map +1 -1
- package/lib/hooks/useVirtualizerMeasure.js +31 -15
- package/lib/hooks/useVirtualizerMeasure.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/utilities/VirtualizerContext/VirtualizerContext.js +12 -14
- package/lib/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
- package/lib/utilities/VirtualizerContext/types.js +1 -3
- package/lib/utilities/VirtualizerContext/types.js.map +1 -1
- package/lib-commonjs/components/Virtualizer/Virtualizer.types.js.map +1 -1
- package/lib-commonjs/components/Virtualizer/useVirtualizer.js +206 -141
- package/lib-commonjs/components/Virtualizer/useVirtualizer.js.map +1 -1
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js +3 -3
- package/lib-commonjs/components/VirtualizerScrollView/useVirtualizerScrollView.js.map +1 -1
- package/lib-commonjs/components/VirtualizerScrollViewDynamic/VirtualizerScrollViewDynamic.types.js.map +1 -1
- package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js +11 -9
- package/lib-commonjs/components/VirtualizerScrollViewDynamic/useVirtualizerScrollViewDynamic.js.map +1 -1
- package/lib-commonjs/hooks/hooks.types.js.map +1 -1
- package/lib-commonjs/hooks/index.js +1 -0
- package/lib-commonjs/hooks/index.js.map +1 -1
- package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js +62 -44
- package/lib-commonjs/hooks/useDynamicVirtualizerMeasure.js.map +1 -1
- package/lib-commonjs/hooks/useMeasureList.js +14 -2
- package/lib-commonjs/hooks/useMeasureList.js.map +1 -1
- package/lib-commonjs/hooks/useResizeObserverRef.js +11 -1
- package/lib-commonjs/hooks/useResizeObserverRef.js.map +1 -1
- package/lib-commonjs/hooks/useVirtualizerMeasure.js +31 -15
- package/lib-commonjs/hooks/useVirtualizerMeasure.js.map +1 -1
- package/lib-commonjs/index.js +3 -0
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js +11 -13
- package/lib-commonjs/utilities/VirtualizerContext/VirtualizerContext.js.map +1 -1
- package/lib-commonjs/utilities/VirtualizerContext/types.js +3 -3
- package/lib-commonjs/utilities/VirtualizerContext/types.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,12 +1,32 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-virtualizer
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Thu, 26 Sep 2024 14:14:12 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
+
## [9.0.0-alpha.85](https://github.com/microsoft/fluentui/tree/@fluentui/react-virtualizer_v9.0.0-alpha.85)
|
|
8
|
+
|
|
9
|
+
Thu, 26 Sep 2024 14:14:12 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-virtualizer_v9.0.0-alpha.84..@fluentui/react-virtualizer_v9.0.0-alpha.85)
|
|
11
|
+
|
|
12
|
+
### Changes
|
|
13
|
+
|
|
14
|
+
- BREAKING CHANGE (useVirtualizerDynamicMeasure): optimized with scrollPos state and children height reference, updated algorithm to be more accurate, and exported measurement hook ([PR #32375](https://github.com/microsoft/fluentui/pull/32375) by mifraser@microsoft.com)
|
|
15
|
+
|
|
16
|
+
## [9.0.0-alpha.84](https://github.com/microsoft/fluentui/tree/@fluentui/react-virtualizer_v9.0.0-alpha.84)
|
|
17
|
+
|
|
18
|
+
Mon, 23 Sep 2024 12:40:17 GMT
|
|
19
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-virtualizer_v9.0.0-alpha.83..@fluentui/react-virtualizer_v9.0.0-alpha.84)
|
|
20
|
+
|
|
21
|
+
### Changes
|
|
22
|
+
|
|
23
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.44 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
|
|
24
|
+
- Bump @fluentui/react-utilities to v9.18.15 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
|
|
25
|
+
- Bump @fluentui/react-shared-contexts to v9.20.1 ([PR #32840](https://github.com/microsoft/fluentui/pull/32840) by beachball)
|
|
26
|
+
|
|
7
27
|
## [9.0.0-alpha.83](https://github.com/microsoft/fluentui/tree/@fluentui/react-virtualizer_v9.0.0-alpha.83)
|
|
8
28
|
|
|
9
|
-
Tue, 10 Sep 2024 10:
|
|
29
|
+
Tue, 10 Sep 2024 10:19:12 GMT
|
|
10
30
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-virtualizer_v9.0.0-alpha.82..@fluentui/react-virtualizer_v9.0.0-alpha.83)
|
|
11
31
|
|
|
12
32
|
### Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,15 @@ import type { SetStateAction } from 'react';
|
|
|
9
9
|
import type { Slot } from '@fluentui/react-utilities';
|
|
10
10
|
import type { SlotClassNames } from '@fluentui/react-utilities';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Some props are optional on static virtualizer, but required for dynamic.
|
|
14
|
+
*/
|
|
15
|
+
export declare type DynamicVirtualizerContextProps = Required<VirtualizerContextProps>;
|
|
16
|
+
|
|
17
|
+
export declare interface IndexedResizeCallbackElement {
|
|
18
|
+
handleResize: () => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
export declare const renderVirtualizer_unstable: (state: VirtualizerState) => JSX.Element;
|
|
13
22
|
|
|
14
23
|
export declare const renderVirtualizerScrollView_unstable: (state: VirtualizerScrollViewState) => JSX.Element;
|
|
@@ -61,6 +70,7 @@ export declare const useDynamicVirtualizerMeasure: <TElement extends HTMLElement
|
|
|
61
70
|
bufferItems: number;
|
|
62
71
|
bufferSize: number;
|
|
63
72
|
scrollRef: (instance: TElement | null) => void;
|
|
73
|
+
containerSizeRef: React_2.RefObject<number>;
|
|
64
74
|
};
|
|
65
75
|
|
|
66
76
|
/**
|
|
@@ -78,6 +88,21 @@ export declare const useIntersectionObserver: (callback: IntersectionObserverCal
|
|
|
78
88
|
observer: MutableRefObject<IntersectionObserver | undefined>;
|
|
79
89
|
};
|
|
80
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Provides a way of automating size in the virtualizer
|
|
93
|
+
* Returns
|
|
94
|
+
* `width` - element width ref (0 by default),
|
|
95
|
+
* `height` - element height ref (0 by default),
|
|
96
|
+
* `measureElementRef` - a ref function to be passed as `ref` to the element you want to measure
|
|
97
|
+
*/
|
|
98
|
+
export declare function useMeasureList<TElement extends HTMLElement & IndexedResizeCallbackElement = HTMLElement & IndexedResizeCallbackElement>(currentIndex: number, refLength: number, totalLength: number, defaultItemSize: number): {
|
|
99
|
+
widthArray: React_2.MutableRefObject<any[]>;
|
|
100
|
+
heightArray: React_2.MutableRefObject<any[]>;
|
|
101
|
+
createIndexedRef: (index: number) => (el: TElement) => void;
|
|
102
|
+
refArray: React_2.MutableRefObject<(TElement | null | undefined)[]>;
|
|
103
|
+
sizeUpdateCount: number;
|
|
104
|
+
};
|
|
105
|
+
|
|
81
106
|
/**
|
|
82
107
|
* useResizeObserverRef_unstable simplifies resize observer connection and ensures debounce/cleanup
|
|
83
108
|
*/
|
|
@@ -91,6 +116,7 @@ export declare const useStaticVirtualizerMeasure: <TElement extends HTMLElement>
|
|
|
91
116
|
bufferItems: number;
|
|
92
117
|
bufferSize: number;
|
|
93
118
|
scrollRef: (instance: TElement | null) => void;
|
|
119
|
+
containerSizeRef: React_2.MutableRefObject<number>;
|
|
94
120
|
};
|
|
95
121
|
|
|
96
122
|
export declare function useVirtualizer_unstable(props: VirtualizerProps): VirtualizerState;
|
|
@@ -123,6 +149,10 @@ export declare const useVirtualizerStyles_unstable: (state: VirtualizerState) =>
|
|
|
123
149
|
*/
|
|
124
150
|
export declare const Virtualizer: FC<VirtualizerProps>;
|
|
125
151
|
|
|
152
|
+
/**
|
|
153
|
+
* The main child render method of Virtualization
|
|
154
|
+
* isScrolling will only be enabled when enableScrollLoad is set to true.
|
|
155
|
+
*/
|
|
126
156
|
export declare type VirtualizerChildRenderFunction = (index: number, isScrolling: boolean) => React_2.ReactNode;
|
|
127
157
|
|
|
128
158
|
export declare const virtualizerClassNames: SlotClassNames<VirtualizerSlots>;
|
|
@@ -152,15 +182,18 @@ declare type VirtualizerConfigProps = {
|
|
|
152
182
|
*/
|
|
153
183
|
virtualizerLength: number;
|
|
154
184
|
/**
|
|
155
|
-
* Defaults to 1/4th of virtualizerLength.
|
|
185
|
+
* Defaults to 1/4th (or 1/3rd for dynamic items) of virtualizerLength.
|
|
186
|
+
* RECOMMEND: Override this with a consistent value if using a dynamic virtualizer.
|
|
187
|
+
*
|
|
156
188
|
* Controls the number of elements rendered before the current index entering the virtualized viewport.
|
|
157
189
|
* Constraints:
|
|
158
190
|
* - Large enough to cover bufferSize (prevents buffers intersecting into the viewport during rest state).
|
|
159
|
-
* - Small enough that the
|
|
191
|
+
* - Small enough that the virtualizer only renders a few items outside of view.
|
|
160
192
|
*/
|
|
161
193
|
bufferItems?: number;
|
|
162
194
|
/**
|
|
163
|
-
* Defaults to half of bufferItems size (in pixels).
|
|
195
|
+
* Defaults to half of bufferItems * itemSize size (in pixels).
|
|
196
|
+
* RECOMMEND: Override this with a consistent minimum item size value if using a dynamic virtualizer.
|
|
164
197
|
* The length (in pixels) before the end/start DOM index where the virtualizer recalculation will be triggered.
|
|
165
198
|
* Increasing this reduces whitespace on ultra-fast scroll, as additional elements
|
|
166
199
|
* are buffered to appear while virtualization recalculates.
|
|
@@ -171,6 +204,8 @@ declare type VirtualizerConfigProps = {
|
|
|
171
204
|
bufferSize?: number;
|
|
172
205
|
/**
|
|
173
206
|
* Enables users to override the intersectionObserverRoot.
|
|
207
|
+
* RECOMMEND: DO NOT PASS THIS IN, as it can cause side effects
|
|
208
|
+
* when overlapping with other scroll views
|
|
174
209
|
*/
|
|
175
210
|
scrollViewRef?: React_2.MutableRefObject<HTMLElement | null>;
|
|
176
211
|
/**
|
|
@@ -183,6 +218,11 @@ declare type VirtualizerConfigProps = {
|
|
|
183
218
|
* This value should be flipped in RTL implementation (TBD whether automate RTL).
|
|
184
219
|
*/
|
|
185
220
|
reversed?: boolean;
|
|
221
|
+
/**
|
|
222
|
+
* Enables the isScrolling property in the child render function
|
|
223
|
+
* Default: false - to prevent nessecary render function calls
|
|
224
|
+
*/
|
|
225
|
+
enableScrollLoad?: boolean;
|
|
186
226
|
/**
|
|
187
227
|
* Callback for acquiring size of individual items
|
|
188
228
|
* @param index - the index of the requested size's child
|
|
@@ -201,6 +241,11 @@ declare type VirtualizerConfigProps = {
|
|
|
201
241
|
* Imperative ref contains our scrollTo index functionality for user control.
|
|
202
242
|
*/
|
|
203
243
|
imperativeVirtualizerRef?: RefObject<VirtualizerDataRef>;
|
|
244
|
+
/**
|
|
245
|
+
* A ref that provides the size of container (vertical - height, horizontal - width), set by a resize observer.
|
|
246
|
+
* Virtualizer Measure hooks provide a suitable reference.
|
|
247
|
+
*/
|
|
248
|
+
containerSizeRef: RefObject<number>;
|
|
204
249
|
};
|
|
205
250
|
|
|
206
251
|
declare type VirtualizerConfigState = {
|
|
@@ -233,6 +278,11 @@ declare type VirtualizerConfigState = {
|
|
|
233
278
|
* Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)
|
|
234
279
|
*/
|
|
235
280
|
reversed?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Enables the isScrolling property in the child render function
|
|
283
|
+
* Default: false - to prevent nessecary render function calls
|
|
284
|
+
*/
|
|
285
|
+
enableScrollLoad?: boolean;
|
|
236
286
|
/**
|
|
237
287
|
* Pixel size of intersection observers and how much they 'cross over' into the bufferItems index.
|
|
238
288
|
* Minimum 1px.
|
|
@@ -254,6 +304,9 @@ declare type VirtualizerConfigState = {
|
|
|
254
304
|
export declare type VirtualizerContextProps = {
|
|
255
305
|
contextIndex: number;
|
|
256
306
|
setContextIndex: (index: number) => void;
|
|
307
|
+
contextPosition?: number;
|
|
308
|
+
setContextPosition?: (index: number) => void;
|
|
309
|
+
childProgressiveSizes?: React_2.MutableRefObject<number[]>;
|
|
257
310
|
};
|
|
258
311
|
|
|
259
312
|
export declare const VirtualizerContextProvider: React_2.Provider<VirtualizerContextProps>;
|
|
@@ -267,15 +320,31 @@ export declare type VirtualizerDataRef = {
|
|
|
267
320
|
|
|
268
321
|
export declare type VirtualizerMeasureDynamicProps = {
|
|
269
322
|
defaultItemSize: number;
|
|
270
|
-
|
|
323
|
+
virtualizerContext: DynamicVirtualizerContextProps;
|
|
271
324
|
numItems: number;
|
|
272
325
|
getItemSize: (index: number) => number;
|
|
273
326
|
direction?: 'vertical' | 'horizontal';
|
|
327
|
+
/**
|
|
328
|
+
* Override recommended number of buffer items
|
|
329
|
+
*/
|
|
330
|
+
bufferItems?: number;
|
|
331
|
+
/**
|
|
332
|
+
* Override recommended buffer size (px)
|
|
333
|
+
*/
|
|
334
|
+
bufferSize?: number;
|
|
274
335
|
};
|
|
275
336
|
|
|
276
337
|
export declare type VirtualizerMeasureProps = {
|
|
277
338
|
defaultItemSize: number;
|
|
278
339
|
direction?: 'vertical' | 'horizontal';
|
|
340
|
+
/**
|
|
341
|
+
* Override recommended number of buffer items
|
|
342
|
+
*/
|
|
343
|
+
bufferItems?: number;
|
|
344
|
+
/**
|
|
345
|
+
* Override recommended buffer size (px)
|
|
346
|
+
*/
|
|
347
|
+
bufferSize?: number;
|
|
279
348
|
};
|
|
280
349
|
|
|
281
350
|
export declare type VirtualizerProps = ComponentProps<Partial<VirtualizerSlots>> & VirtualizerConfigProps;
|
|
@@ -294,7 +363,7 @@ export declare const VirtualizerScrollViewDynamic: React_2.FC<VirtualizerScrollV
|
|
|
294
363
|
|
|
295
364
|
export declare const virtualizerScrollViewDynamicClassNames: SlotClassNames<VirtualizerScrollViewDynamicSlots>;
|
|
296
365
|
|
|
297
|
-
export declare type VirtualizerScrollViewDynamicProps = ComponentProps<Partial<VirtualizerScrollViewDynamicSlots>> & Partial<Omit<VirtualizerConfigProps, 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex'>> & {
|
|
366
|
+
export declare type VirtualizerScrollViewDynamicProps = ComponentProps<Partial<VirtualizerScrollViewDynamicSlots>> & Partial<Omit<VirtualizerConfigProps, 'itemSize' | 'numItems' | 'getItemSize' | 'children' | 'flagIndex' | 'virtualizerContext'>> & {
|
|
298
367
|
/**
|
|
299
368
|
* Set as the minimum item size.
|
|
300
369
|
* Axis: 'vertical' = Height
|
|
@@ -325,6 +394,10 @@ export declare type VirtualizerScrollViewDynamicProps = ComponentProps<Partial<V
|
|
|
325
394
|
* Imperative ref contains our scrollTo index functionality for user control.
|
|
326
395
|
*/
|
|
327
396
|
enablePagination?: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Enables override of dynamic virtualizer context if required.
|
|
399
|
+
*/
|
|
400
|
+
virtualizerContext?: DynamicVirtualizerContextProps;
|
|
328
401
|
};
|
|
329
402
|
|
|
330
403
|
export declare type VirtualizerScrollViewDynamicSlots = VirtualizerScrollViewSlots;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Virtualizer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { VirtualizerContextProps } from '../../Utilities';\nimport type { RefObject, MutableRefObject } from 'react';\n\nexport type VirtualizerSlots = {\n /**\n * The intersection observed 'before' element will detect when scrolling towards the beginning.\n */\n before: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace at the beginning of current DOM children.\n */\n beforeContainer: NonNullable<Slot<'div', 'tr'>>;\n /**\n * The intersection observed 'after' element will detect when scrolling towards the end.\n */\n after: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace after the end of current DOM children.\n */\n afterContainer: NonNullable<Slot<'div', 'tr'>>;\n};\n\nexport type VirtualizerConfigState = {\n /**\n * The current virtualized array of children to show in the DOM.\n */\n virtualizedChildren: React.ReactNode[];\n /**\n * The current start index for the virtualizer, all previous index's will be removed from DOM.\n */\n virtualizerStartIndex: number;\n /**\n * Current buffer height required at beginning of array.\n */\n afterBufferHeight: number;\n /**\n * Current buffer height required at end of array.\n */\n beforeBufferHeight: number;\n /**\n * The total current height of the scrollView/child content.\n */\n totalVirtualizerHeight: number;\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n */\n reversed?: boolean;\n /**\n * Pixel size of intersection observers and how much they 'cross over' into the bufferItems index.\n * Minimum 1px.\n */\n bufferSize: number;\n /**\n * Ref for access to internal size knowledge, can be used to measure updates\n */\n childSizes: React.MutableRefObject<number[]>;\n /**\n * Ref for access to internal progressive size knowledge, can be used to measure updates\n */\n childProgressiveSizes: React.MutableRefObject<number[]>;\n};\n\nexport type VirtualizerState = ComponentState<VirtualizerSlots> & VirtualizerConfigState;\n\n
|
|
1
|
+
{"version":3,"sources":["Virtualizer.types.ts"],"sourcesContent":["import * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { VirtualizerContextProps } from '../../Utilities';\nimport type { RefObject, MutableRefObject } from 'react';\n\nexport type VirtualizerSlots = {\n /**\n * The intersection observed 'before' element will detect when scrolling towards the beginning.\n */\n before: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace at the beginning of current DOM children.\n */\n beforeContainer: NonNullable<Slot<'div', 'tr'>>;\n /**\n * The intersection observed 'after' element will detect when scrolling towards the end.\n */\n after: NonNullable<Slot<'div', 'td'>>;\n /**\n * A block place holding whitespace after the end of current DOM children.\n */\n afterContainer: NonNullable<Slot<'div', 'tr'>>;\n};\n\nexport type VirtualizerConfigState = {\n /**\n * The current virtualized array of children to show in the DOM.\n */\n virtualizedChildren: React.ReactNode[];\n /**\n * The current start index for the virtualizer, all previous index's will be removed from DOM.\n */\n virtualizerStartIndex: number;\n /**\n * Current buffer height required at beginning of array.\n */\n afterBufferHeight: number;\n /**\n * Current buffer height required at end of array.\n */\n beforeBufferHeight: number;\n /**\n * The total current height of the scrollView/child content.\n */\n totalVirtualizerHeight: number;\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n */\n reversed?: boolean;\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n /**\n * Pixel size of intersection observers and how much they 'cross over' into the bufferItems index.\n * Minimum 1px.\n */\n bufferSize: number;\n /**\n * Ref for access to internal size knowledge, can be used to measure updates\n */\n childSizes: React.MutableRefObject<number[]>;\n /**\n * Ref for access to internal progressive size knowledge, can be used to measure updates\n */\n childProgressiveSizes: React.MutableRefObject<number[]>;\n};\n\nexport type VirtualizerState = ComponentState<VirtualizerSlots> & VirtualizerConfigState;\n\n/**\n * The main child render method of Virtualization\n * isScrolling will only be enabled when enableScrollLoad is set to true.\n */\nexport type VirtualizerChildRenderFunction = (index: number, isScrolling: boolean) => React.ReactNode;\n\nexport type VirtualizerDataRef = {\n progressiveSizes: RefObject<number[]>;\n nodeSizes: RefObject<number[]>;\n setFlaggedIndex: (index: number | null) => void;\n currentIndex: RefObject<number>;\n};\n\nexport type VirtualizerConfigProps = {\n /**\n * Child render function.\n * Iteratively called to return current virtualizer DOM children.\n * Will act as a row or column indexer depending on Virtualizer settings.\n * Can be used dynamically.\n */\n children: VirtualizerChildRenderFunction;\n\n /**\n * Default cell size to use if no custom callback provided.\n * If implementing `getItemSize` this should be the initial and ideally minimum cell size.\n */\n itemSize: number;\n\n /**\n * The total number of items to be virtualized.\n */\n numItems: number;\n\n /**\n * Number of children to render in the DOM during virtualization.\n * Constraints:\n * - Large enough that the items rendered in DOM cover the viewport\n * and intersection observer buffers (buffersize) at both ends.\n */\n virtualizerLength: number;\n\n /**\n * Defaults to 1/4th (or 1/3rd for dynamic items) of virtualizerLength.\n * RECOMMEND: Override this with a consistent value if using a dynamic virtualizer.\n *\n * Controls the number of elements rendered before the current index entering the virtualized viewport.\n * Constraints:\n * - Large enough to cover bufferSize (prevents buffers intersecting into the viewport during rest state).\n * - Small enough that the virtualizer only renders a few items outside of view.\n */\n bufferItems?: number;\n\n /**\n * Defaults to half of bufferItems * itemSize size (in pixels).\n * RECOMMEND: Override this with a consistent minimum item size value if using a dynamic virtualizer.\n * The length (in pixels) before the end/start DOM index where the virtualizer recalculation will be triggered.\n * Increasing this reduces whitespace on ultra-fast scroll, as additional elements\n * are buffered to appear while virtualization recalculates.\n * Constraints:\n * - At least 1px - although this will only trigger the recalculation after bookends (whitespace) enter viewport.\n * - BufferSize must be smaller than bufferItems pixel size, as it prevents bookends entering viewport at rest.\n */\n bufferSize?: number;\n\n /**\n * Enables users to override the intersectionObserverRoot.\n * RECOMMEND: DO NOT PASS THIS IN, as it can cause side effects\n * when overlapping with other scroll views\n */\n scrollViewRef?: React.MutableRefObject<HTMLElement | null>;\n\n /**\n * The scroll direction\n * @default vertical\n */\n axis?: 'vertical' | 'horizontal';\n\n /**\n * Tells the virtualizer to measure in the reverse direction (for column-reverse order etc.)\n * This value should be flipped in RTL implementation (TBD whether automate RTL).\n */\n reversed?: boolean;\n\n /**\n * Enables the isScrolling property in the child render function\n * Default: false - to prevent nessecary render function calls\n */\n enableScrollLoad?: boolean;\n\n /**\n * Callback for acquiring size of individual items\n * @param index - the index of the requested size's child\n */\n getItemSize?: (index: number) => number;\n\n /**\n * Virtualizer context can be passed as a prop for extended class use\n */\n virtualizerContext?: VirtualizerContextProps;\n\n /**\n * Callback for notifying when a flagged index has been rendered\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onRenderedFlaggedIndex?: (index: number) => void;\n\n /*\n * Callback for notifying when a flagged index has been rendered\n */\n flaggedIndex?: MutableRefObject<number | null>;\n\n /**\n * Imperative ref contains our scrollTo index functionality for user control.\n */\n imperativeVirtualizerRef?: RefObject<VirtualizerDataRef>;\n\n /**\n * A ref that provides the size of container (vertical - height, horizontal - width), set by a resize observer.\n * Virtualizer Measure hooks provide a suitable reference.\n */\n containerSizeRef: RefObject<number>;\n};\n\nexport type VirtualizerProps = ComponentProps<Partial<VirtualizerSlots>> & VirtualizerConfigProps;\n"],"names":["React"],"rangeMappings":"","mappings":"AAAA,YAAYA,WAAW,QAAQ"}
|