@candidstartup/react-virtual-scroll 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +287 -25
- package/dist/index.js +84 -15
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ Most of the logic is implemented by custom hooks that are used by both `VirtualL
|
|
|
23
23
|
import { VirtualList, useVariableSizeItemOffsetMapping } from '@candidstartup/react-virtual-scroll';
|
|
24
24
|
|
|
25
25
|
const mapping = useVariableSizeItemOffsetMapping(30, [50]);
|
|
26
|
-
const list = React.
|
|
26
|
+
const list = React.useRef(null);
|
|
27
27
|
|
|
28
28
|
...
|
|
29
29
|
|
|
@@ -46,7 +46,7 @@ import { VirtualList, useVariableSizeItemOffsetMapping, useFixedSizeItemOffsetMa
|
|
|
46
46
|
|
|
47
47
|
const rowMapping = useVariableSizeItemOffsetMapping(30, [50]);
|
|
48
48
|
const columnMapping = useFixedSizeItemOffsetMapping(280);
|
|
49
|
-
const grid = React.
|
|
49
|
+
const grid = React.useRef(null);
|
|
50
50
|
|
|
51
51
|
...
|
|
52
52
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,88 +1,350 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Common props for {@link VirtualListItem} and {@link VirtualGridItem}
|
|
5
|
+
*/
|
|
3
6
|
interface VirtualBaseItemProps {
|
|
4
|
-
|
|
7
|
+
/** Value of {@link VirtualBaseProps.itemData} from owning component */
|
|
8
|
+
data: unknown;
|
|
9
|
+
/**
|
|
10
|
+
* Is the owning component being actively scrolled? Used to change how the item is rendered depending on scroll state.
|
|
11
|
+
*
|
|
12
|
+
* Only defined if {@link VirtualBaseProps.useIsScrolling} is true.
|
|
13
|
+
* */
|
|
5
14
|
isScrolling?: boolean;
|
|
6
|
-
|
|
15
|
+
/** Style that should be applied to each item rendered. Positions the item within the inner container. */
|
|
16
|
+
style: React.CSSProperties;
|
|
7
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Common props for {@link VirtualList} and {@link VirtualGrid}
|
|
20
|
+
*/
|
|
8
21
|
interface VirtualBaseProps {
|
|
22
|
+
/** The `className` applied to the outer container element. Use when styling the entire component. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** The `className` applied to the inner container element. Use for special cases when styling only the inner container and items. */
|
|
25
|
+
innerClassName?: string;
|
|
26
|
+
/** Component height */
|
|
9
27
|
height: number;
|
|
28
|
+
/** Component width */
|
|
10
29
|
width: number;
|
|
11
|
-
|
|
30
|
+
/** Passed as {@link VirtualBaseItemProps.data} to each child item */
|
|
31
|
+
itemData?: unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Determines whether the component should track whether it's being actively scrolled
|
|
34
|
+
* and pass to child items as {@link VirtualBaseItemProps.isScrolling}.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue false
|
|
37
|
+
* */
|
|
12
38
|
useIsScrolling?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Maximum size for CSS element beyond which layout breaks. You should never normally need to change this.
|
|
41
|
+
* The default value is compatible with all major browsers.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue 6000000
|
|
44
|
+
* */
|
|
13
45
|
maxCssSize?: number;
|
|
46
|
+
/**
|
|
47
|
+
* The minimum number of virtual pages to use when inner container would otherwise be more than {@link VirtualBaseProps.maxCssSize} big.
|
|
48
|
+
* You should never normally need to change this.
|
|
49
|
+
*
|
|
50
|
+
* @defaultValue 100
|
|
51
|
+
*/
|
|
14
52
|
minNumPages?: number;
|
|
15
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Props that an implementation of {@link VirtualInnerRender} must accept.
|
|
56
|
+
*/
|
|
57
|
+
interface VirtualInnerProps {
|
|
58
|
+
/** The `className` to apply to the inner container div. Passed through from {@link VirtualBaseProps.innerClassName} */
|
|
59
|
+
className: string | undefined;
|
|
60
|
+
/** The visible child items rendered into the inner container div */
|
|
61
|
+
children: React.ReactNode;
|
|
62
|
+
/** Style to apply to the inner container div */
|
|
63
|
+
style: React.CSSProperties;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Render prop for inner container in a virtual scrolling component
|
|
67
|
+
*
|
|
68
|
+
* Can be passed to {@link VirtualList} or {@link VirtualGrid} to replace default
|
|
69
|
+
* implementation. Function must render a div and forward {@link VirtualInnerProps}
|
|
70
|
+
* and any `ref` to it.
|
|
71
|
+
*
|
|
72
|
+
* @example Minimal compliant implementation
|
|
73
|
+
* ```
|
|
74
|
+
* const innerRender: VirtualInnerRender = ({...rest}, ref) => (
|
|
75
|
+
* <div ref={ref} {...rest} />
|
|
76
|
+
* )
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
type VirtualInnerRender = (props: VirtualInnerProps, ref?: React.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
80
|
+
/**
|
|
81
|
+
* Props that an implementation of {@link VirtualOuterRender} must accept.
|
|
82
|
+
*/
|
|
83
|
+
interface VirtualOuterProps {
|
|
84
|
+
/** The `className` to apply to the outer container div. Passed through from {@link VirtualBaseProps.className} */
|
|
85
|
+
className: string | undefined;
|
|
86
|
+
/** The child inner container rendered into the outer container div */
|
|
87
|
+
children: React.ReactNode;
|
|
88
|
+
/** Style to apply to the outer container div */
|
|
89
|
+
style: React.CSSProperties;
|
|
90
|
+
/** Scroll callback that should be applied to the outer container div */
|
|
91
|
+
onScroll: (event: ScrollEvent) => void;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Render prop for outer container in a virtual scrolling component
|
|
95
|
+
*
|
|
96
|
+
* Can be passed to {@link VirtualList} or {@link VirtualGrid} to replace default
|
|
97
|
+
* implementation. Function must render a div and forward {@link VirtualOuterProps}
|
|
98
|
+
* and any `ref` to it.
|
|
99
|
+
*
|
|
100
|
+
* @example Minimal compliant implementation
|
|
101
|
+
* ```
|
|
102
|
+
* const outerRender: VirtualOuterRender = ({style, ...rest}, ref) => (
|
|
103
|
+
* <div ref={ref} {...rest} />
|
|
104
|
+
* )
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
type VirtualOuterRender = (props: VirtualOuterProps, ref?: React.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
108
|
+
/**
|
|
109
|
+
* Interface that {@link VirtualList} and {@link VirtualGrid} use to determine size and
|
|
110
|
+
* positioning offset for items in a single dimension.
|
|
111
|
+
*/
|
|
16
112
|
interface ItemOffsetMapping {
|
|
113
|
+
/** Size of item with given index */
|
|
17
114
|
itemSize(itemIndex: number): number;
|
|
115
|
+
/** Offset from start of container to specified item
|
|
116
|
+
*
|
|
117
|
+
* `itemOffset(n)` should be equal to `Sum{i:0->n-1}(itemSize(i))`
|
|
118
|
+
*
|
|
119
|
+
* To efficiently support large containers, cost should be `O(logn)` or better.
|
|
120
|
+
*/
|
|
18
121
|
itemOffset(itemIndex: number): number;
|
|
122
|
+
/** Given an offset, return the index of the item that intersects that offset, together with the start offset of that item */
|
|
19
123
|
offsetToItem(offset: number): [itemIndex: number, startOffset: number];
|
|
20
124
|
}
|
|
125
|
+
/** Alias for type of event that React passes to a `div` element's `OnScroll` handler. */
|
|
126
|
+
type ScrollEvent = React.SyntheticEvent<HTMLDivElement>;
|
|
21
127
|
|
|
128
|
+
/** Direction of scrolling */
|
|
22
129
|
type ScrollDirection = "forward" | "backward";
|
|
130
|
+
/**
|
|
131
|
+
* Overall scroll state for a single dimension.
|
|
132
|
+
*/
|
|
23
133
|
interface ScrollState {
|
|
134
|
+
/** Scroll bar offset. Equal to outer container's `scrollTop` or `scrollLeft` depending on dimension. */
|
|
24
135
|
scrollOffset: number;
|
|
136
|
+
/** Offset used to position current page of items in virtual space. Overall offset is `scrollOffset+renderOffset`. */
|
|
25
137
|
renderOffset: number;
|
|
138
|
+
/** Index of current page. */
|
|
26
139
|
page: number;
|
|
140
|
+
/** Current scrolling direction. Calculated by comparing current overall offset to that when last rendered. */
|
|
27
141
|
scrollDirection: ScrollDirection;
|
|
28
142
|
}
|
|
29
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Props accepted by {@link VirtualGridItem}
|
|
146
|
+
*/
|
|
30
147
|
interface VirtualGridItemProps extends VirtualBaseItemProps {
|
|
148
|
+
/** Row index of item in the grid being rendered */
|
|
31
149
|
rowIndex: number;
|
|
150
|
+
/** Column index of item in the grid being rendered */
|
|
32
151
|
columnIndex: number;
|
|
33
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Type of item in a {@link VirtualGrid}
|
|
155
|
+
*
|
|
156
|
+
* Must be passed as a child to {@link VirtualGrid}.
|
|
157
|
+
* Accepts props defined by {@link VirtualGridItemProps}.
|
|
158
|
+
* Component must pass {@link VirtualBaseItemProps.style} to whatever it renders.
|
|
159
|
+
*
|
|
160
|
+
* @example Basic implementation
|
|
161
|
+
* ```
|
|
162
|
+
* const Cell = ({ rowIndex, columnIndex, style }: { rowIndex: number, columnIndex: number, style: React.CSSProperties }) => (
|
|
163
|
+
* <div className="cell" style={style}>
|
|
164
|
+
* { `${rowIndex}:${columnIndex}` }
|
|
165
|
+
* </div>
|
|
166
|
+
* );
|
|
167
|
+
* ```
|
|
168
|
+
*/
|
|
34
169
|
type VirtualGridItem = React.ComponentType<VirtualGridItemProps>;
|
|
170
|
+
/**
|
|
171
|
+
* Props accepted by {@link VirtualGrid}
|
|
172
|
+
*/
|
|
35
173
|
interface VirtualGridProps extends VirtualBaseProps {
|
|
174
|
+
/** Component used as a template to render items in the grid. Must implement {@link VirtualGridItem} interface. */
|
|
36
175
|
children: VirtualGridItem;
|
|
176
|
+
/** Number of rows in the grid */
|
|
37
177
|
rowCount: number;
|
|
178
|
+
/**
|
|
179
|
+
* Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each row in the grid
|
|
180
|
+
*
|
|
181
|
+
* Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations
|
|
182
|
+
* for common cases.
|
|
183
|
+
*/
|
|
38
184
|
rowOffsetMapping: ItemOffsetMapping;
|
|
185
|
+
/** Number of columns in the grid */
|
|
39
186
|
columnCount: number;
|
|
187
|
+
/**
|
|
188
|
+
* Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each column in the grid
|
|
189
|
+
*
|
|
190
|
+
* Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations
|
|
191
|
+
* for common cases.
|
|
192
|
+
*/
|
|
40
193
|
columnOffsetMapping: ItemOffsetMapping;
|
|
41
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Function that defines the key to use for each item given row and column index and value of {@link VirtualBaseProps.itemData}.
|
|
196
|
+
* @defaultValue
|
|
197
|
+
* ```ts
|
|
198
|
+
* (rowIndex, columnIndex, _data) => `${rowIndex}:${columnIndex}`
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
itemKey?: (rowIndex: number, columnIndex: number, data: unknown) => React.Key;
|
|
202
|
+
/**
|
|
203
|
+
* Callback after a scroll event has been processed and state updated but before rendering
|
|
204
|
+
* @param rowOffset - Resulting overall row offset. Can be passed to {@link ItemOffsetMapping} to determine first row.
|
|
205
|
+
* @param columnOffset - Resulting overall column offset. Can be passed to {@link ItemOffsetMapping} to determine first column.
|
|
206
|
+
* @param newRowScrollState - New {@link ScrollState} for rows that will be used for rendering.
|
|
207
|
+
* @param newColumnScrollState - New {@link ScrollState} for columns that will be used for rendering.
|
|
208
|
+
*/
|
|
42
209
|
onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;
|
|
210
|
+
/** Render prop implementing {@link VirtualOuterRender}. Used to customize {@link VirtualGrid}. */
|
|
211
|
+
outerRender?: VirtualOuterRender;
|
|
212
|
+
/** Render prop implementing {@link VirtualInnerRender}. Used to customize {@link VirtualGrid}. */
|
|
213
|
+
innerRender?: VirtualInnerRender;
|
|
43
214
|
}
|
|
215
|
+
/**
|
|
216
|
+
* Custom ref handle returned by {@link VirtualGrid} that exposes imperative methods
|
|
217
|
+
*
|
|
218
|
+
* Use `React.useRef<VirtualGridProxy>(null)` to create a ref.
|
|
219
|
+
*/
|
|
44
220
|
interface VirtualGridProxy {
|
|
45
|
-
|
|
46
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Scrolls the list to the specified row and column in pixels
|
|
223
|
+
*/
|
|
224
|
+
scrollTo(rowOffset?: number, columnOffset?: number): void;
|
|
225
|
+
/**
|
|
226
|
+
* Scrolls the list so that the specified item is visible
|
|
227
|
+
* @param rowIndex - Row of item to scroll to
|
|
228
|
+
* @param columnIndex - Column of item to scroll to
|
|
229
|
+
*/
|
|
230
|
+
scrollToItem(rowIndex?: number, columnIndex?: number): void;
|
|
231
|
+
/** Exposes DOM clientWidth property */
|
|
232
|
+
get clientWidth(): number;
|
|
233
|
+
/** Exposes DOM clientHeight property */
|
|
234
|
+
get clientHeight(): number;
|
|
47
235
|
}
|
|
236
|
+
/**
|
|
237
|
+
* Virtual Scrolling Grid
|
|
238
|
+
*
|
|
239
|
+
* Accepts props defined by {@link VirtualGridProps}.
|
|
240
|
+
* Refs are forwarded to {@link VirtualGridProxy}.
|
|
241
|
+
* You must pass a single instance of {@link VirtualGridItem} as a child.
|
|
242
|
+
* @group Components
|
|
243
|
+
*/
|
|
48
244
|
declare const VirtualGrid: React.ForwardRefExoticComponent<VirtualGridProps & React.RefAttributes<VirtualGridProxy>>;
|
|
49
245
|
|
|
246
|
+
/** Specifies the direction over which the list should implement virtual scrolling */
|
|
50
247
|
type ScrollLayout = "horizontal" | "vertical";
|
|
248
|
+
/**
|
|
249
|
+
* Props accepted by {@link VirtualListItem}
|
|
250
|
+
*/
|
|
51
251
|
interface VirtualListItemProps extends VirtualBaseItemProps {
|
|
252
|
+
/** Index of item in the list being rendered */
|
|
52
253
|
index: number;
|
|
53
254
|
}
|
|
255
|
+
/**
|
|
256
|
+
* Type of item in a {@link VirtualList}
|
|
257
|
+
*
|
|
258
|
+
* Must be passed as a child to {@link VirtualList}.
|
|
259
|
+
* Accepts props defined by {@link VirtualListItemProps}.
|
|
260
|
+
* Component must pass {@link VirtualBaseItemProps.style} to whatever it renders.
|
|
261
|
+
*
|
|
262
|
+
* @example Basic implementation
|
|
263
|
+
* ```
|
|
264
|
+
* const Row = ({ index, style }: { index: number, style: React.CSSProperties }) => (
|
|
265
|
+
* <div className="row" style={style}>
|
|
266
|
+
* { index }
|
|
267
|
+
* </div>
|
|
268
|
+
* );
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
54
271
|
type VirtualListItem = React.ComponentType<VirtualListItemProps>;
|
|
272
|
+
/**
|
|
273
|
+
* Props accepted by {@link VirtualList}
|
|
274
|
+
*/
|
|
55
275
|
interface VirtualListProps extends VirtualBaseProps {
|
|
276
|
+
/** Component used as a template to render items in the list. Must implement {@link VirtualListItem} interface. */
|
|
56
277
|
children: VirtualListItem;
|
|
278
|
+
/** Number of items in the list */
|
|
57
279
|
itemCount: number;
|
|
280
|
+
/**
|
|
281
|
+
* Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each item in the list
|
|
282
|
+
*
|
|
283
|
+
* Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations
|
|
284
|
+
* for common cases.
|
|
285
|
+
*/
|
|
58
286
|
itemOffsetMapping: ItemOffsetMapping;
|
|
59
|
-
|
|
287
|
+
/**
|
|
288
|
+
* Function that defines the key to use for each item given item index and value of {@link VirtualBaseProps.itemData}.
|
|
289
|
+
* @defaultValue `(index, _data) => index`
|
|
290
|
+
*/
|
|
291
|
+
itemKey?: (index: number, data: unknown) => React.Key;
|
|
292
|
+
/**
|
|
293
|
+
* Choice of 'vertical' or 'horizontal' layouts
|
|
294
|
+
* @defaultValue 'vertical'
|
|
295
|
+
*/
|
|
60
296
|
layout?: ScrollLayout;
|
|
297
|
+
/**
|
|
298
|
+
* Callback after a scroll event has been processed and state updated but before rendering
|
|
299
|
+
* @param offset - Resulting overall offset. Can be passed to {@link ItemOffsetMapping} to determine top item.
|
|
300
|
+
* @param newScrollState - New {@link ScrollState} that will be used for rendering.
|
|
301
|
+
*/
|
|
61
302
|
onScroll?: (offset: number, newScrollState: ScrollState) => void;
|
|
303
|
+
/** Render prop implementing {@link VirtualOuterRender}. Used to customize {@link VirtualList}. */
|
|
304
|
+
outerRender?: VirtualOuterRender;
|
|
305
|
+
/** Render prop implementing {@link VirtualInnerRender}. Used to customize {@link VirtualList}. */
|
|
306
|
+
innerRender?: VirtualInnerRender;
|
|
62
307
|
}
|
|
308
|
+
/**
|
|
309
|
+
* Custom ref handle returned by {@link VirtualList} that exposes imperative methods
|
|
310
|
+
*
|
|
311
|
+
* Use `React.useRef<VirtualListProxy>(null)` to create a ref.
|
|
312
|
+
*/
|
|
63
313
|
interface VirtualListProxy {
|
|
314
|
+
/**
|
|
315
|
+
* Scrolls the list to the specified offset in pixels
|
|
316
|
+
* @param offset - Offset to scroll to
|
|
317
|
+
*/
|
|
64
318
|
scrollTo(offset: number): void;
|
|
319
|
+
/**
|
|
320
|
+
* Scrolls the list so that the specified item is visible
|
|
321
|
+
* @param index - Index of item to scroll to
|
|
322
|
+
*/
|
|
65
323
|
scrollToItem(index: number): void;
|
|
66
324
|
}
|
|
325
|
+
/**
|
|
326
|
+
* Virtual Scrolling List
|
|
327
|
+
*
|
|
328
|
+
* Accepts props defined by {@link VirtualListProps}.
|
|
329
|
+
* Refs are forwarded to {@link VirtualListProxy}.
|
|
330
|
+
* You must pass a single instance of {@link VirtualListItem} as a child.
|
|
331
|
+
* @group Components
|
|
332
|
+
*/
|
|
67
333
|
declare const VirtualList: React.ForwardRefExoticComponent<VirtualListProps & React.RefAttributes<VirtualListProxy>>;
|
|
68
334
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
declare function useFixedSizeItemOffsetMapping(itemSize: number): FixedSizeItemOffsetMapping;
|
|
335
|
+
/**
|
|
336
|
+
* Returns an instance of {@link ItemOffsetMapping} suitable for use when all items have a fixed size.
|
|
337
|
+
*
|
|
338
|
+
* @param itemSize - Size to use for all items
|
|
339
|
+
*/
|
|
340
|
+
declare function useFixedSizeItemOffsetMapping(itemSize: number): ItemOffsetMapping;
|
|
77
341
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
declare function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]): VariableSizeItemOffsetMapping;
|
|
342
|
+
/**
|
|
343
|
+
* Returns an instance of {@link ItemOffsetMapping} suitable for use when initial items have variable sizes.
|
|
344
|
+
*
|
|
345
|
+
* @param defaultItemSize - Size to use for all other items
|
|
346
|
+
* @param sizes - Array of sizes to use for the initial items, one size per item
|
|
347
|
+
*/
|
|
348
|
+
declare function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]): ItemOffsetMapping;
|
|
87
349
|
|
|
88
|
-
export { type ScrollLayout, type ScrollState, VirtualGrid, type VirtualGridItemProps, type VirtualGridProps, type VirtualGridProxy, VirtualList, type VirtualListItemProps, type VirtualListProps, type VirtualListProxy, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping };
|
|
350
|
+
export { type ItemOffsetMapping, type ScrollDirection, type ScrollEvent, type ScrollLayout, type ScrollState, type VirtualBaseItemProps, type VirtualBaseProps, VirtualGrid, type VirtualGridItem, type VirtualGridItemProps, type VirtualGridProps, type VirtualGridProxy, type VirtualInnerProps, type VirtualInnerRender, VirtualList, type VirtualListItem, type VirtualListItemProps, type VirtualListProps, type VirtualListProxy, type VirtualOuterProps, type VirtualOuterRender, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping };
|
package/dist/index.js
CHANGED
|
@@ -5,9 +5,9 @@ function getRangeToRender(itemCount, itemOffsetMapping, clientExtent, scrollOffs
|
|
|
5
5
|
if (itemCount == 0) {
|
|
6
6
|
return [0, 0, []];
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
let [itemIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);
|
|
9
9
|
itemIndex = Math.max(0, Math.min(itemCount - 1, itemIndex));
|
|
10
|
-
|
|
10
|
+
const endOffset = scrollOffset + clientExtent;
|
|
11
11
|
const overscanBackward = 1;
|
|
12
12
|
const overscanForward = 1;
|
|
13
13
|
for (let step = 0; step < overscanBackward && itemIndex > 0; step++) {
|
|
@@ -15,7 +15,7 @@ function getRangeToRender(itemCount, itemOffsetMapping, clientExtent, scrollOffs
|
|
|
15
15
|
startOffset -= itemOffsetMapping.itemSize(itemIndex);
|
|
16
16
|
}
|
|
17
17
|
const startIndex = itemIndex;
|
|
18
|
-
|
|
18
|
+
let offset = startOffset;
|
|
19
19
|
const sizes = [];
|
|
20
20
|
while (offset < endOffset && itemIndex < itemCount) {
|
|
21
21
|
const size = itemOffsetMapping.itemSize(itemIndex);
|
|
@@ -135,7 +135,7 @@ function useEventListener(eventName, handler, element = window, options = {}) {
|
|
|
135
135
|
const el = isListener(element) ? element : element.current;
|
|
136
136
|
if (!el)
|
|
137
137
|
return;
|
|
138
|
-
const eventListener = (event) => savedHandler.current(event);
|
|
138
|
+
const eventListener = (event) => savedHandler.current?.(event);
|
|
139
139
|
const opts = { capture, passive, once };
|
|
140
140
|
el.addEventListener(eventName, eventListener, opts);
|
|
141
141
|
return () => {
|
|
@@ -187,7 +187,7 @@ function useAnimationTimeout(callback, delay, key) {
|
|
|
187
187
|
requestRef.current = undefined;
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
|
-
}, [delay, key]);
|
|
190
|
+
}, [start, delay, key]);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
const DEBOUNCE_INTERVAL = 150;
|
|
@@ -207,9 +207,29 @@ function useIsScrolling(element = window) {
|
|
|
207
207
|
}
|
|
208
208
|
|
|
209
209
|
const defaultItemKey$1 = (rowIndex, columnIndex, _data) => `${rowIndex}:${columnIndex}`;
|
|
210
|
+
const Inner$1 = React.forwardRef(function VirtualGridInner({ render, ...rest }, ref) {
|
|
211
|
+
return render(rest, ref);
|
|
212
|
+
});
|
|
213
|
+
function defaultInnerRender$1({ ...rest }, ref) {
|
|
214
|
+
return jsx("div", { ref: ref, ...rest });
|
|
215
|
+
}
|
|
216
|
+
const Outer$1 = React.forwardRef(function VirtualGridOuter({ render, ...rest }, ref) {
|
|
217
|
+
return render(rest, ref);
|
|
218
|
+
});
|
|
219
|
+
function defaultOuterRender$1({ ...rest }, ref) {
|
|
220
|
+
return jsx("div", { ref: ref, ...rest });
|
|
221
|
+
}
|
|
210
222
|
// Using a named function rather than => so that the name shows up in React Developer Tools
|
|
223
|
+
/**
|
|
224
|
+
* Virtual Scrolling Grid
|
|
225
|
+
*
|
|
226
|
+
* Accepts props defined by {@link VirtualGridProps}.
|
|
227
|
+
* Refs are forwarded to {@link VirtualGridProxy}.
|
|
228
|
+
* You must pass a single instance of {@link VirtualGridItem} as a child.
|
|
229
|
+
* @group Components
|
|
230
|
+
*/
|
|
211
231
|
const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
|
|
212
|
-
const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey$1, onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
|
|
232
|
+
const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, className, innerClassName, itemData = undefined, itemKey = defaultItemKey$1, onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
|
|
213
233
|
// Total size is same as offset to item one off the end
|
|
214
234
|
const totalRowSize = rowOffsetMapping.itemOffset(rowCount);
|
|
215
235
|
const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);
|
|
@@ -222,11 +242,25 @@ const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
|
|
|
222
242
|
scrollTo(rowOffset, columnOffset) {
|
|
223
243
|
const outer = outerRef.current;
|
|
224
244
|
/* istanbul ignore else */
|
|
225
|
-
if (outer)
|
|
226
|
-
|
|
245
|
+
if (outer) {
|
|
246
|
+
const options = {};
|
|
247
|
+
if (rowOffset != undefined)
|
|
248
|
+
options.top = doScrollToRow(rowOffset, outer.clientHeight);
|
|
249
|
+
if (columnOffset != undefined)
|
|
250
|
+
options.left = doScrollToColumn(columnOffset, outer.clientWidth);
|
|
251
|
+
outer.scrollTo(options);
|
|
252
|
+
}
|
|
227
253
|
},
|
|
228
254
|
scrollToItem(rowIndex, columnIndex) {
|
|
229
|
-
|
|
255
|
+
const rowOffset = (rowIndex != undefined) ? rowOffsetMapping.itemOffset(rowIndex) : undefined;
|
|
256
|
+
const columnOffset = (columnIndex != undefined) ? columnOffsetMapping.itemOffset(columnIndex) : undefined;
|
|
257
|
+
this.scrollTo(rowOffset, columnOffset);
|
|
258
|
+
},
|
|
259
|
+
get clientWidth() {
|
|
260
|
+
return outerRef.current ? outerRef.current.clientWidth : /* istanbul ignore next */ 0;
|
|
261
|
+
},
|
|
262
|
+
get clientHeight() {
|
|
263
|
+
return outerRef.current ? outerRef.current.clientHeight : /* istanbul ignore next */ 0;
|
|
230
264
|
}
|
|
231
265
|
};
|
|
232
266
|
}, [rowOffsetMapping, columnOffsetMapping, doScrollToRow, doScrollToColumn]);
|
|
@@ -243,13 +277,15 @@ const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
|
|
|
243
277
|
// We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized
|
|
244
278
|
// naming convention as components do.
|
|
245
279
|
const ChildVar = children;
|
|
280
|
+
const outerRender = props.outerRender || defaultOuterRender$1;
|
|
281
|
+
const innerRender = props.innerRender || defaultInnerRender$1;
|
|
246
282
|
// Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator.
|
|
247
283
|
// You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator
|
|
248
284
|
// returns the result of the final statement which makes the iteration a little clumsier.
|
|
249
285
|
let nextRowOffset = startRowOffset - renderRowOffset;
|
|
250
286
|
let rowIndex = 0, rowOffset = 0;
|
|
251
287
|
let nextColumnOffset = 0, columnIndex = 0, columnOffset = 0;
|
|
252
|
-
return (jsx(
|
|
288
|
+
return (jsx(Outer$1, { className: className, render: outerRender, onScroll: onScroll, ref: outerRef, style: { position: "relative", height, width, overflow: "auto", willChange: "transform" }, children: jsx(Inner$1, { className: innerClassName, render: innerRender, style: { height: renderRowSize, width: renderColumnSize }, children: rowSizes.map((rowSize, rowArrayIndex) => (rowOffset = nextRowOffset,
|
|
253
289
|
nextRowOffset += rowSize,
|
|
254
290
|
rowIndex = startRowIndex + rowArrayIndex,
|
|
255
291
|
nextColumnOffset = startColumnOffset - renderColumnOffset,
|
|
@@ -260,9 +296,29 @@ const VirtualGrid = React.forwardRef(function VirtualGrid(props, ref) {
|
|
|
260
296
|
});
|
|
261
297
|
|
|
262
298
|
const defaultItemKey = (index, _data) => index;
|
|
299
|
+
const Inner = React.forwardRef(function VirtualListInner({ render, ...rest }, ref) {
|
|
300
|
+
return render(rest, ref);
|
|
301
|
+
});
|
|
302
|
+
function defaultInnerRender({ ...rest }, ref) {
|
|
303
|
+
return jsx("div", { ref: ref, ...rest });
|
|
304
|
+
}
|
|
305
|
+
const Outer = React.forwardRef(function VirtualListOuter({ render, ...rest }, ref) {
|
|
306
|
+
return render(rest, ref);
|
|
307
|
+
});
|
|
308
|
+
function defaultOuterRender({ ...rest }, ref) {
|
|
309
|
+
return jsx("div", { ref: ref, ...rest });
|
|
310
|
+
}
|
|
263
311
|
// Using a named function rather than => so that the name shows up in React Developer Tools
|
|
312
|
+
/**
|
|
313
|
+
* Virtual Scrolling List
|
|
314
|
+
*
|
|
315
|
+
* Accepts props defined by {@link VirtualListProps}.
|
|
316
|
+
* Refs are forwarded to {@link VirtualListProxy}.
|
|
317
|
+
* You must pass a single instance of {@link VirtualListItem} as a child.
|
|
318
|
+
* @group Components
|
|
319
|
+
*/
|
|
264
320
|
const VirtualList = React.forwardRef(function VirtualList(props, ref) {
|
|
265
|
-
const { width, height, itemCount, itemOffsetMapping, children, itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
|
|
321
|
+
const { width, height, itemCount, itemOffsetMapping, children, className, innerClassName, itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling: useIsScrolling$1 = false } = props;
|
|
266
322
|
// Total size is same as offset to item one off the end
|
|
267
323
|
const totalSize = itemOffsetMapping.itemOffset(itemCount);
|
|
268
324
|
const outerRef = React.useRef(null);
|
|
@@ -304,14 +360,16 @@ const VirtualList = React.forwardRef(function VirtualList(props, ref) {
|
|
|
304
360
|
}
|
|
305
361
|
const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, isVertical ? height : width, scrollOffset + renderOffset);
|
|
306
362
|
// We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized
|
|
307
|
-
// naming convention as components do.
|
|
363
|
+
// naming convention as components do.
|
|
308
364
|
const ChildVar = children;
|
|
365
|
+
const outerRender = props.outerRender || defaultOuterRender;
|
|
366
|
+
const innerRender = props.innerRender || defaultInnerRender;
|
|
309
367
|
// Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator.
|
|
310
368
|
// You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator
|
|
311
369
|
// returns the result of the final statement which makes the iteration a little clumsier.
|
|
312
370
|
let nextOffset = startOffset - renderOffset;
|
|
313
371
|
let index, offset;
|
|
314
|
-
return (jsx(
|
|
372
|
+
return (jsx(Outer, { className: className, render: outerRender, onScroll: onScroll, ref: outerRef, style: { position: "relative", height, width, overflow: "auto", willChange: "transform" }, children: jsx(Inner, { className: innerClassName, render: innerRender, style: { height: isVertical ? renderSize : "100%", width: isVertical ? "100%" : renderSize }, children: sizes.map((size, arrayIndex) => (offset = nextOffset,
|
|
315
373
|
nextOffset += size,
|
|
316
374
|
index = startIndex + arrayIndex,
|
|
317
375
|
jsx(ChildVar, { data: itemData, index: index, isScrolling: useIsScrolling$1 ? isScrolling : undefined, style: {
|
|
@@ -345,6 +403,11 @@ class FixedSizeItemOffsetMapping {
|
|
|
345
403
|
return [itemIndex, startOffset];
|
|
346
404
|
}
|
|
347
405
|
}
|
|
406
|
+
/**
|
|
407
|
+
* Returns an instance of {@link ItemOffsetMapping} suitable for use when all items have a fixed size.
|
|
408
|
+
*
|
|
409
|
+
* @param itemSize - Size to use for all items
|
|
410
|
+
*/
|
|
348
411
|
function useFixedSizeItemOffsetMapping(itemSize) {
|
|
349
412
|
return new FixedSizeItemOffsetMapping(itemSize);
|
|
350
413
|
}
|
|
@@ -370,7 +433,7 @@ class VariableSizeItemOffsetMapping {
|
|
|
370
433
|
return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;
|
|
371
434
|
}
|
|
372
435
|
itemOffset(itemIndex) {
|
|
373
|
-
|
|
436
|
+
let offset = 0;
|
|
374
437
|
let length = this.sizes.length;
|
|
375
438
|
if (itemIndex > length) {
|
|
376
439
|
const numDefaultSize = itemIndex - length;
|
|
@@ -385,7 +448,7 @@ class VariableSizeItemOffsetMapping {
|
|
|
385
448
|
return offset;
|
|
386
449
|
}
|
|
387
450
|
offsetToItem(offset) {
|
|
388
|
-
|
|
451
|
+
let startOffset = 0;
|
|
389
452
|
const length = this.sizes.length;
|
|
390
453
|
for (let i = 0; i < length; i++) {
|
|
391
454
|
const size = this.sizes[i];
|
|
@@ -399,6 +462,12 @@ class VariableSizeItemOffsetMapping {
|
|
|
399
462
|
return [itemIndex + length, startOffset];
|
|
400
463
|
}
|
|
401
464
|
}
|
|
465
|
+
/**
|
|
466
|
+
* Returns an instance of {@link ItemOffsetMapping} suitable for use when initial items have variable sizes.
|
|
467
|
+
*
|
|
468
|
+
* @param defaultItemSize - Size to use for all other items
|
|
469
|
+
* @param sizes - Array of sizes to use for the initial items, one size per item
|
|
470
|
+
*/
|
|
402
471
|
function useVariableSizeItemOffsetMapping(defaultItemSize, sizes) {
|
|
403
472
|
return new VariableSizeItemOffsetMapping(defaultItemSize, sizes || []);
|
|
404
473
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/VirtualBase.ts","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualGrid.tsx","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["\nexport interface VirtualBaseItemProps {\n data: any,\n isScrolling?: boolean,\n style: Object,\n};\n\nexport interface VirtualBaseProps {\n height: number,\n width: number,\n itemData?: any,\n useIsScrolling?: boolean,\n maxCssSize?: number,\n minNumPages?: number\n};\n\nexport interface ItemOffsetMapping {\n itemSize(itemIndex: number): number;\n itemOffset(itemIndex: number): number;\n offsetToItem(offset: number): [itemIndex: number, startOffset: number];\n};\n\nexport type ScrollEvent = React.SyntheticEvent<HTMLDivElement>;\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n sizes: number[]\n];\n\nexport function getRangeToRender(itemCount: number, itemOffsetMapping: ItemOffsetMapping, clientExtent: number, scrollOffset: number): RangeToRender {\n if (itemCount == 0) {\n return [0, 0, []];\n }\n\n var [itemIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n itemIndex = Math.max(0, Math.min(itemCount - 1, itemIndex));\n var endOffset = scrollOffset + clientExtent;\n\n const overscanBackward = 1;\n const overscanForward = 1;\n\n for (let step = 0; step < overscanBackward && itemIndex > 0; step ++) {\n itemIndex --;\n startOffset -= itemOffsetMapping.itemSize(itemIndex);\n }\n\n const startIndex = itemIndex;\n var offset = startOffset;\n const sizes: number[] = [];\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n offset += size;\n itemIndex ++;\n }\n\n for (let step = 0; step < overscanForward && itemIndex < itemCount; step ++) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n itemIndex ++;\n }\n\n return [startIndex, startOffset, sizes];\n}\n","import { useState } from \"react\";\n\nexport type ScrollDirection = \"forward\" | \"backward\";\nexport interface ScrollState { \n scrollOffset: number, \n renderOffset: number,\n page: number, \n scrollDirection: ScrollDirection, \n};\n\nexport interface VirtualScroll extends ScrollState {\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState];\n\n // Scroll to offset in logical space returning offset to update scroll bar position to\n doScrollTo(offset: number, clientExtent: number): number;\n};\n\n// Max size that is safe across all browsers (Firefox is the limiting factor)\n// SlickGrid tries to dynamically determine limit on other browsers (Chrome will do 30M) but\n// I prefer simplicity of same behavior across all browsers.\nconst MAX_SUPPORTED_CSS_SIZE = 6000000;\nconst MIN_NUMBER_PAGES = 100;\n\nexport function useVirtualScroll(totalSize: number, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES): VirtualScroll {\n let renderSize=0, pageSize=0, numPages=0;\n if (totalSize < maxCssSize) {\n // No paging needed\n renderSize = pageSize = totalSize;\n numPages = 1;\n } else {\n // Break into pages\n renderSize = maxCssSize;\n pageSize = renderSize / minNumberPages;\n numPages = Math.floor(totalSize / pageSize);\n }\n\n function pageToRenderOffset(page: number): number {\n if (page <= 0)\n return 0;\n\n if (page >= numPages-1)\n return totalSize - renderSize;\n\n return Math.round((page-1) * (totalSize - renderSize) / (numPages - 3));\n }\n\n const initValue: ScrollState = { \n scrollOffset: 0, \n renderOffset: 0,\n page: 0,\n scrollDirection: \"forward\",\n };\n const [scrollState, setScrollState] = useState(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState] {\n if (scrollState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return [scrollOffset, scrollState];\n }\n\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n let newOffset = Math.max(0, Math.min(scrollOffset, scrollExtent - clientExtent));\n const newScrollDirection = scrollState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - scrollState.scrollOffset);\n if (scrollDist < clientExtent) {\n // Scrolling part of visible window, don't want to skip items, so can't scale up movement\n // If we cross page boundary we need to reset scroll bar position back to where it should be at start of page\n newPage = Math.min(numPages - 1, Math.floor((scrollOffset + scrollState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != scrollState.page) {\n // Be very intentional about when we ask caller to reset scroll bar\n // Don't want to trigger event loops\n newOffset = scrollOffset + scrollState.renderOffset - newRenderOffset;\n retScrollOffset = newOffset;\n }\n } else {\n // Large scale scrolling, choosing page from a rolodex\n // First and last page are mapped 1:1 between grid and container\n if (newOffset < pageSize) {\n newPage = 0;\n } else if (newOffset >= renderSize - pageSize) {\n newPage = numPages - 1;\n } else {\n const scaleFactor = (totalSize - pageSize*2) / (renderSize - pageSize*2);\n newPage = Math.min(numPages - 3, Math.floor((newOffset - pageSize) * scaleFactor / pageSize)) + 1;\n }\n newRenderOffset = pageToRenderOffset(newPage);\n }\n\n const newScrollState: ScrollState = \n { scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection };\n setScrollState(newScrollState);\n return [retScrollOffset, newScrollState];\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (scrollState.scrollOffset + scrollState.renderOffset) <= safeOffset ? 'forward' : 'backward';\n const page = Math.min(numPages - 1, Math.floor(safeOffset / pageSize));\n const renderOffset = pageToRenderOffset(page);\n const scrollOffset = safeOffset - renderOffset;\n\n setScrollState({ scrollOffset, renderOffset, page, scrollDirection });\n return scrollOffset;\n }\n\n return {...scrollState, renderSize, onScroll, doScrollTo} as const;\n}\n\nexport default useVirtualScroll;\n","// Based on https://github.com/realwugang/use-event-listener\n// and https://github.com/donavon/use-event-listener/blob/develop/src/index.js\n\nimport { useRef, useEffect, RefObject, createRef } from 'react';\n\ninterface Options {\n capture?: boolean\n once?: boolean\n passive?: boolean\n};\n\ntype Listener = Window | Document | HTMLElement;\n\nfunction isListener(element: Listener | RefObject<HTMLElement>): element is Listener {\n return (element as Listener).addEventListener !== undefined;\n}\n\nexport function useEventListener (eventName: string, \n handler: (event: Event) => void, \n element: Listener | RefObject<HTMLElement> | null = window, \n options: Options = {}) {\n const savedHandler = useRef<any>();\n const { capture, passive, once } = options;\n\n useEffect(() => {\n savedHandler.current = handler\n }, [handler])\n\n useEffect(() => {\n if (!element)\n return;\n\n const el = isListener(element) ? element : element.current;\n if (!el)\n return;\n\n const eventListener = (event: Event) => savedHandler.current(event);\n const opts = { capture, passive, once };\n el.addEventListener(eventName, eventListener, opts);\n return () => {\n el.removeEventListener(eventName, eventListener, opts);\n };\n }, [eventName, element, capture, passive, once]);\n}\n\nexport default useEventListener;\n\n// In-source testing for private helper functions\nif (import.meta.vitest) {\n const { it, expect } = import.meta.vitest\n it('isListener', () => {\n expect(isListener(window)).toBe(true)\n expect(isListener(document)).toBe(true)\n expect(isListener(document.createElement(\"div\"))).toBe(true)\n expect(isListener(createRef())).toBe(false)\n })\n}","// Based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n// and https://www.joshwcomeau.com/snippets/react-hooks/use-timeout/\n// and https://github.com/bvaughn/react-window/blob/master/src/timer.js\n//\n// Equivalent functionality to a useTimeout hook but based on requestAnimationFrame instead of setTimeout. Use\n// when making frequent requests for short duration timeouts where browser may throttle setTimeout.\nimport { useEffect, useRef } from 'react';\n\ntype Callback = () => void;\n\nexport function useAnimationTimeout(callback: Callback, delay: number | null, key?: unknown) {\n const requestRef = useRef<number>();\n const savedCallback = useRef<Callback>(callback);\n\n // Remember the latest callback\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n \n const start = performance.now();\n \n useEffect(() => {\n function tick() {\n requestRef.current = undefined;\n if (delay === null)\n return;\n\n if (performance.now() - start >= delay) {\n savedCallback.current();\n } else {\n requestRef.current = requestAnimationFrame(tick);\n }\n }\n\n tick();\n\n return () => {\n if (typeof requestRef.current === 'number') {\n cancelAnimationFrame(requestRef.current);\n requestRef.current = undefined;\n }\n }\n }, [delay, key]);\n}\n\nexport default useAnimationTimeout;","import { useState, RefObject } from \"react\";\nimport { useEventListener } from './useEventListener';\nimport { useAnimationTimeout } from './useAnimationTimeout';\n\nconst DEBOUNCE_INTERVAL = 150;\nconst FALLBACK_INTERVAL = 500;\n\nexport function useIsScrolling(element: Window | HTMLElement | RefObject<HTMLElement> | null = window): boolean {\n const [scrollCount, setScrollCount] = useState(0);\n\n // scrollend implementations in both Chrome and Firefox are buggy with missing scrollend events\n // in some circumstances (using keyboard to scroll past end in Chrome, intermittently when using mouse wheel in Firefox)\n // Use a timeout even when scrollend is supported to handle missing events. In this case we use a longer interval as\n // don't want it to be over sensitive. \n const supportsScrollEnd = ('onscrollend' in window);\n const delay = supportsScrollEnd ? FALLBACK_INTERVAL : DEBOUNCE_INTERVAL;\n\n useEventListener(\"scroll\", () => setScrollCount(c => c + 1), element);\n useEventListener(\"scrollend\", () => setScrollCount(0), supportsScrollEnd ? element : null);\n useAnimationTimeout(() => setScrollCount(0), (scrollCount == 0) ? null : delay, scrollCount);\n\n return scrollCount > 0;\n}\n\nexport default useIsScrolling;","import React from \"react\";\nimport { Fragment } from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nexport type { ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport interface VirtualGridItemProps extends VirtualBaseItemProps {\n rowIndex: number,\n columnIndex: number,\n};\n\ntype VirtualGridItem = React.ComponentType<VirtualGridItemProps>;\n\nexport interface VirtualGridProps extends VirtualBaseProps {\n children: VirtualGridItem,\n rowCount: number,\n rowOffsetMapping: ItemOffsetMapping,\n columnCount: number,\n columnOffsetMapping: ItemOffsetMapping,\n itemKey?: (rowIndex: number, columnIndex: number, data: any) => any,\n onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;\n};\n\nexport interface VirtualGridProxy {\n scrollTo(rowOffset: number, columnOffset: number): void;\n scrollToItem(rowIndex: number, columnIndex: number): void;\n};\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: any) => `${rowIndex}:${columnIndex}`;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalRowSize = rowOffsetMapping.itemOffset(rowCount);\n const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize,\n onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize, props.maxCssSize, props.minNumPages);\n const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize,\n onScroll: onScrollColumn, doScrollTo: doScrollToColumn} = useVirtualScroll(totalColumnSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset: number, columnOffset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer)\n outer.scrollTo(doScrollToColumn(columnOffset, outer.clientWidth), doScrollToRow(rowOffset, outer.clientHeight));\n },\n\n scrollToItem(rowIndex: number, columnIndex: number): void {\n this.scrollTo(rowOffsetMapping.itemOffset(rowIndex), columnOffsetMapping.itemOffset(columnIndex));\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping, doScrollToRow, doScrollToColumn ]);\n\n\n function onScroll(event: ScrollEvent) {\n const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = event.currentTarget;\n const [newScrollTop, newRowScrollState] = onScrollRow(clientHeight, scrollHeight, scrollTop);\n const [newScrollLeft, newColumnScrollState] = onScrollColumn(clientWidth, scrollWidth, scrollLeft);\n if (outerRef.current && (newScrollTop != scrollTop || newScrollLeft != scrollLeft ))\n outerRef.current.scrollTo(newScrollLeft, newScrollTop);\n onScrollCallback?.(newRowScrollState.scrollOffset+newRowScrollState.renderOffset, \n newColumnScrollState.scrollOffset+newColumnScrollState.renderOffset, newRowScrollState, newColumnScrollState);\n }\n\n const [startRowIndex, startRowOffset, rowSizes] = \n getRangeToRender(rowCount, rowOffsetMapping, height, scrollRowOffset + renderRowOffset);\n const [startColumnIndex, startColumnOffset, columnSizes] = \n getRangeToRender(columnCount, columnOffsetMapping, width, scrollColumnOffset + renderColumnOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextRowOffset = startRowOffset - renderRowOffset;\n let rowIndex=0, rowOffset=0;\n let nextColumnOffset=0, columnIndex=0, columnOffset=0;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: renderRowSize, width: renderColumnSize }}>\n {rowSizes.map((rowSize, rowArrayIndex) => (\n rowOffset = nextRowOffset,\n nextRowOffset += rowSize,\n rowIndex = startRowIndex + rowArrayIndex,\n nextColumnOffset = startColumnOffset - renderColumnOffset,\n <Fragment key={itemKey(rowIndex, 0, itemData)}>\n {columnSizes.map((columnSize, columnArrayIndex) => (\n columnOffset = nextColumnOffset,\n nextColumnOffset += columnSize,\n columnIndex = startColumnIndex + columnArrayIndex,\n <ChildVar data={itemData} key={itemKey(rowIndex, columnIndex, itemData)}\n rowIndex={rowIndex} columnIndex={columnIndex}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ position: \"absolute\", top: rowOffset, height: rowSize, left: columnOffset, width: columnSize }}/>\n ))}\n </Fragment>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualGrid;\n","import React from \"react\";\nimport { ItemOffsetMapping, getRangeToRender, VirtualBaseItemProps, VirtualBaseProps, ScrollEvent } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nexport type { ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\nexport type ScrollLayout = \"horizontal\" | \"vertical\";\n\nexport interface VirtualListItemProps extends VirtualBaseItemProps {\n index: number,\n};\n\ntype VirtualListItem = React.ComponentType<VirtualListItemProps>;\n\nexport interface VirtualListProps extends VirtualBaseProps {\n children: VirtualListItem,\n itemCount: number,\n itemOffsetMapping: ItemOffsetMapping,\n itemKey?: (index: number, data: any) => any,\n layout?: ScrollLayout,\n onScroll?: (offset: number, newScrollState: ScrollState) => void;\n};\n\nexport interface VirtualListProxy {\n scrollTo(offset: number): void;\n scrollToItem(index: number): void;\n};\n\nconst defaultItemKey = (index: number, _data: any) => index;\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { width, height, itemCount, itemOffsetMapping, children, \n itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalSize = itemOffsetMapping.itemOffset(itemCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = \n useVirtualScroll(totalSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n const isVertical = layout === 'vertical';\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer) {\n if (isVertical)\n outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));\n else\n outer.scrollTo(doScrollTo(offset, outer.clientWidth), 0);\n }\n },\n\n scrollToItem(index: number): void {\n this.scrollTo(itemOffsetMapping.itemOffset(index));\n }\n }\n }, [ itemOffsetMapping, isVertical, doScrollTo ]);\n\n function onScroll(event: ScrollEvent) {\n if (isVertical) {\n const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollTop, newScrollState] = onScrollExtent(clientHeight, scrollHeight, scrollTop);\n if (newScrollTop != scrollTop && outerRef.current)\n outerRef.current.scrollTo(scrollLeft, newScrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n } else {\n const { clientWidth, scrollWidth, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollLeft, newScrollState] = onScrollExtent(clientWidth, scrollWidth, scrollLeft);\n if (newScrollLeft != scrollLeft && outerRef.current)\n outerRef.current.scrollTo(newScrollLeft, scrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n }\n }\n\n const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, \n isVertical ? height : width, scrollOffset+renderOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextOffset = startOffset - renderOffset;\n let index, offset;\n\n return (\n <div onScroll={onScroll} ref={outerRef} style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <div style={{ height: isVertical ? renderSize : \"100%\", width: isVertical ? \"100%\" : renderSize }}>\n {sizes.map((size, arrayIndex) => (\n offset = nextOffset,\n nextOffset += size,\n index = startIndex + arrayIndex,\n <ChildVar data={itemData} key={itemKey(index, itemData)} index={index}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ \n position: \"absolute\", \n top: isVertical ? offset : undefined, \n left: isVertical ? undefined : offset,\n height: isVertical ? size : \"100%\", \n width: isVertical ? \"100%\" : size, \n }}/>\n ))}\n </div>\n </div>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (itemSize: number) {\n this.fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.fixedItemSize);\n const startOffset = itemIndex * this.fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n fixedItemSize: number;\n};\n\nexport function useFixedSizeItemOffsetMapping(itemSize: number) {\n return new FixedSizeItemOffsetMapping(itemSize);\n};\n\nexport default useFixedSizeItemOffsetMapping;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (defaultItemSize: number, sizes: number[]) {\n this.defaultItemSize = defaultItemSize;\n this.sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n var offset = 0;\n let length = this.sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.sizes[i];\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n var startOffset = 0;\n const length = this.sizes.length;\n for (let i = 0; i < length; i ++) {\n const size = this.sizes[i];\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);\n startOffset += itemIndex * this.defaultItemSize;\n\n return [itemIndex+length, startOffset];\n }\n\n defaultItemSize: number;\n sizes: number[];\n};\n\nexport function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]) {\n return new VariableSizeItemOffsetMapping(defaultItemSize, sizes || []);\n};\n\nexport default useVariableSizeItemOffsetMapping;"],"names":["defaultItemKey","useIsScrolling","useIsScrollingHook","_jsx"],"mappings":";;;AA8BM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,iBAAoC,EAAE,YAAoB,EAAE,YAAoB,EAAA;AAClI,IAAA,IAAI,SAAS,IAAI,CAAC,EAAE;AAClB,QAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;KACnB;AAED,IAAA,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5E,IAAA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,SAAS,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;AAC5D,IAAA,IAAI,SAAS,GAAG,YAAY,GAAG,YAAY,CAAC;IAE5C,MAAM,gBAAgB,GAAG,CAAC,CAAC;IAC3B,MAAM,eAAe,GAAG,CAAC,CAAC;AAE1B,IAAA,KAAK,IAAI,IAAI,GAAG,C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C,CAAC;AAC3B,YAAA,IAAI,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE;AAC/B,gBAAA,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;aACzB;YACD,WAAW,IAAI,IAAI,CAAC;SACrB;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;AAC5E,QAAA,WAAW,IAAI,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;AAEhD,QAAA,OAAO,CAAC,SAAS,GAAC,MAAM,EAAE,WAAW,CAAC,CAAC;KACxC;AAIF,CAAA;AAEe,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AACzE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/VirtualCommon.ts","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualGrid.tsx","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["import type { ItemOffsetMapping } from \"./VirtualBase\";\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n sizes: number[]\n];\n\nexport function getRangeToRender(itemCount: number, itemOffsetMapping: ItemOffsetMapping, clientExtent: number, scrollOffset: number): RangeToRender {\n if (itemCount == 0) {\n return [0, 0, []];\n }\n\n let [itemIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n itemIndex = Math.max(0, Math.min(itemCount - 1, itemIndex));\n const endOffset = scrollOffset + clientExtent;\n\n const overscanBackward = 1;\n const overscanForward = 1;\n\n for (let step = 0; step < overscanBackward && itemIndex > 0; step ++) {\n itemIndex --;\n startOffset -= itemOffsetMapping.itemSize(itemIndex);\n }\n\n const startIndex = itemIndex;\n let offset = startOffset;\n const sizes: number[] = [];\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n offset += size;\n itemIndex ++;\n }\n\n for (let step = 0; step < overscanForward && itemIndex < itemCount; step ++) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n itemIndex ++;\n }\n\n return [startIndex, startOffset, sizes];\n}\n","import { useState } from \"react\";\n\n/** Direction of scrolling */\nexport type ScrollDirection = \"forward\" | \"backward\";\n\n/**\n * Overall scroll state for a single dimension.\n */\nexport interface ScrollState { \n /** Scroll bar offset. Equal to outer container's `scrollTop` or `scrollLeft` depending on dimension. */\n scrollOffset: number, \n\n /** Offset used to position current page of items in virtual space. Overall offset is `scrollOffset+renderOffset`. */\n renderOffset: number,\n\n /** Index of current page. */\n page: number, \n\n /** Current scrolling direction. Calculated by comparing current overall offset to that when last rendered. */\n scrollDirection: ScrollDirection, \n}\n\nexport interface VirtualScroll extends ScrollState {\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState];\n\n // Scroll to offset in logical space returning offset to update scroll bar position to\n doScrollTo(offset: number, clientExtent: number): number;\n}\n\n// Max size that is safe across all browsers (Firefox is the limiting factor)\n// SlickGrid tries to dynamically determine limit on other browsers (Chrome will do 30M) but\n// I prefer simplicity of same behavior across all browsers.\nconst MAX_SUPPORTED_CSS_SIZE = 6000000;\nconst MIN_NUMBER_PAGES = 100;\n\nexport function useVirtualScroll(totalSize: number, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES): VirtualScroll {\n let renderSize=0, pageSize=0, numPages=0;\n if (totalSize < maxCssSize) {\n // No paging needed\n renderSize = pageSize = totalSize;\n numPages = 1;\n } else {\n // Break into pages\n renderSize = maxCssSize;\n pageSize = renderSize / minNumberPages;\n numPages = Math.floor(totalSize / pageSize);\n }\n\n function pageToRenderOffset(page: number): number {\n if (page <= 0)\n return 0;\n\n if (page >= numPages-1)\n return totalSize - renderSize;\n\n return Math.round((page-1) * (totalSize - renderSize) / (numPages - 3));\n }\n\n const initValue: ScrollState = { \n scrollOffset: 0, \n renderOffset: 0,\n page: 0,\n scrollDirection: \"forward\",\n };\n const [scrollState, setScrollState] = useState(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState] {\n if (scrollState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return [scrollOffset, scrollState];\n }\n\n // Prevent Safari's elastic scrolling from causing visual shaking when scrolling past bounds.\n let newOffset = Math.max(0, Math.min(scrollOffset, scrollExtent - clientExtent));\n const newScrollDirection = scrollState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - scrollState.scrollOffset);\n if (scrollDist < clientExtent) {\n // Scrolling part of visible window, don't want to skip items, so can't scale up movement\n // If we cross page boundary we need to reset scroll bar position back to where it should be at start of page\n newPage = Math.min(numPages - 1, Math.floor((scrollOffset + scrollState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != scrollState.page) {\n // Be very intentional about when we ask caller to reset scroll bar\n // Don't want to trigger event loops\n newOffset = scrollOffset + scrollState.renderOffset - newRenderOffset;\n retScrollOffset = newOffset;\n }\n } else {\n // Large scale scrolling, choosing page from a rolodex\n // First and last page are mapped 1:1 between grid and container\n if (newOffset < pageSize) {\n newPage = 0;\n } else if (newOffset >= renderSize - pageSize) {\n newPage = numPages - 1;\n } else {\n const scaleFactor = (totalSize - pageSize*2) / (renderSize - pageSize*2);\n newPage = Math.min(numPages - 3, Math.floor((newOffset - pageSize) * scaleFactor / pageSize)) + 1;\n }\n newRenderOffset = pageToRenderOffset(newPage);\n }\n\n const newScrollState: ScrollState = \n { scrollOffset: newOffset, renderOffset: newRenderOffset, page: newPage, scrollDirection: newScrollDirection };\n setScrollState(newScrollState);\n return [retScrollOffset, newScrollState];\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (scrollState.scrollOffset + scrollState.renderOffset) <= safeOffset ? 'forward' : 'backward';\n const page = Math.min(numPages - 1, Math.floor(safeOffset / pageSize));\n const renderOffset = pageToRenderOffset(page);\n const scrollOffset = safeOffset - renderOffset;\n\n setScrollState({ scrollOffset, renderOffset, page, scrollDirection });\n return scrollOffset;\n }\n\n return {...scrollState, renderSize, onScroll, doScrollTo} as const;\n}\n\nexport default useVirtualScroll;\n","// Based on https://github.com/realwugang/use-event-listener\n// and https://github.com/donavon/use-event-listener/blob/develop/src/index.js\n\nimport { useRef, useEffect, RefObject, createRef } from 'react';\n\ninterface Options {\n capture?: boolean\n once?: boolean\n passive?: boolean\n}\n\ntype Listener = Window | Document | HTMLElement;\n\nfunction isListener(element: Listener | RefObject<HTMLElement>): element is Listener {\n return (element as Listener).addEventListener !== undefined;\n}\n\ntype EventHandler = (event: Event) => void;\n\nexport function useEventListener (eventName: string, \n handler: EventHandler, \n element: Listener | RefObject<HTMLElement> | null = window, \n options: Options = {}) {\n const savedHandler = useRef<EventHandler>();\n const { capture, passive, once } = options;\n\n useEffect(() => {\n savedHandler.current = handler\n }, [handler])\n\n useEffect(() => {\n if (!element)\n return;\n\n const el = isListener(element) ? element : element.current;\n if (!el)\n return;\n\n const eventListener = (event: Event) => savedHandler.current?.(event);\n const opts = { capture, passive, once };\n el.addEventListener(eventName, eventListener, opts);\n return () => {\n el.removeEventListener(eventName, eventListener, opts);\n };\n }, [eventName, element, capture, passive, once]);\n}\n\nexport default useEventListener;\n\n// In-source testing for private helper functions\nif (import.meta.vitest) {\n const { it, expect } = import.meta.vitest\n it('isListener', () => {\n expect(isListener(window)).toBe(true)\n expect(isListener(document)).toBe(true)\n expect(isListener(document.createElement(\"div\"))).toBe(true)\n expect(isListener(createRef())).toBe(false)\n })\n}","// Based on https://overreacted.io/making-setinterval-declarative-with-react-hooks/\n// and https://www.joshwcomeau.com/snippets/react-hooks/use-timeout/\n// and https://github.com/bvaughn/react-window/blob/master/src/timer.js\n//\n// Equivalent functionality to a useTimeout hook but based on requestAnimationFrame instead of setTimeout. Use\n// when making frequent requests for short duration timeouts where browser may throttle setTimeout.\nimport { useEffect, useRef } from 'react';\n\ntype Callback = () => void;\n\nexport function useAnimationTimeout(callback: Callback, delay: number | null, key?: unknown) {\n const requestRef = useRef<number>();\n const savedCallback = useRef<Callback>(callback);\n\n // Remember the latest callback\n useEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n \n const start = performance.now();\n \n useEffect(() => {\n function tick() {\n requestRef.current = undefined;\n if (delay === null)\n return;\n\n if (performance.now() - start >= delay) {\n savedCallback.current();\n } else {\n requestRef.current = requestAnimationFrame(tick);\n }\n }\n\n tick();\n\n return () => {\n if (typeof requestRef.current === 'number') {\n cancelAnimationFrame(requestRef.current);\n requestRef.current = undefined;\n }\n }\n }, [start, delay, key]);\n}\n\nexport default useAnimationTimeout;","import { useState, RefObject } from \"react\";\nimport { useEventListener } from './useEventListener';\nimport { useAnimationTimeout } from './useAnimationTimeout';\n\nconst DEBOUNCE_INTERVAL = 150;\nconst FALLBACK_INTERVAL = 500;\n\nexport function useIsScrolling(element: Window | HTMLElement | RefObject<HTMLElement> | null = window): boolean {\n const [scrollCount, setScrollCount] = useState(0);\n\n // scrollend implementations in both Chrome and Firefox are buggy with missing scrollend events\n // in some circumstances (using keyboard to scroll past end in Chrome, intermittently when using mouse wheel in Firefox)\n // Use a timeout even when scrollend is supported to handle missing events. In this case we use a longer interval as\n // don't want it to be over sensitive. \n const supportsScrollEnd = ('onscrollend' in window);\n const delay = supportsScrollEnd ? FALLBACK_INTERVAL : DEBOUNCE_INTERVAL;\n\n useEventListener(\"scroll\", () => setScrollCount(c => c + 1), element);\n useEventListener(\"scrollend\", () => setScrollCount(0), supportsScrollEnd ? element : null);\n useAnimationTimeout(() => setScrollCount(0), (scrollCount == 0) ? null : delay, scrollCount);\n\n return scrollCount > 0;\n}\n\nexport default useIsScrolling;","import React from \"react\";\nimport { Fragment } from \"react\";\nimport { ItemOffsetMapping, VirtualBaseItemProps, VirtualBaseProps, \n VirtualInnerRender, VirtualInnerProps, VirtualOuterRender, VirtualOuterProps, ScrollEvent } from './VirtualBase';\nimport { getRangeToRender } from './VirtualCommon';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\n/**\n * Props accepted by {@link VirtualGridItem}\n */\nexport interface VirtualGridItemProps extends VirtualBaseItemProps {\n /** Row index of item in the grid being rendered */\n rowIndex: number,\n\n /** Column index of item in the grid being rendered */\n columnIndex: number,\n}\n\n/**\n * Type of item in a {@link VirtualGrid}\n *\n * Must be passed as a child to {@link VirtualGrid}. \n * Accepts props defined by {@link VirtualGridItemProps}.\n * Component must pass {@link VirtualBaseItemProps.style} to whatever it renders. \n * \n * @example Basic implementation\n * ```\n * const Cell = ({ rowIndex, columnIndex, style }: { rowIndex: number, columnIndex: number, style: React.CSSProperties }) => (\n * <div className=\"cell\" style={style}>\n * { `${rowIndex}:${columnIndex}` }\n * </div>\n * );\n * ```\n */\nexport type VirtualGridItem = React.ComponentType<VirtualGridItemProps>;\n\n/**\n * Props accepted by {@link VirtualGrid}\n */\nexport interface VirtualGridProps extends VirtualBaseProps {\n /** Component used as a template to render items in the grid. Must implement {@link VirtualGridItem} interface. */\n children: VirtualGridItem,\n\n /** Number of rows in the grid */\n rowCount: number,\n\n /** \n * Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each row in the grid\n * \n * Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations\n * for common cases.\n */\n rowOffsetMapping: ItemOffsetMapping,\n\n /** Number of columns in the grid */\n columnCount: number,\n\n /** \n * Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each column in the grid\n * \n * Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations\n * for common cases.\n */\n columnOffsetMapping: ItemOffsetMapping,\n\n /**\n * Function that defines the key to use for each item given row and column index and value of {@link VirtualBaseProps.itemData}.\n * @defaultValue\n * ```ts\n * (rowIndex, columnIndex, _data) => `${rowIndex}:${columnIndex}`\n * ```\n */\n itemKey?: (rowIndex: number, columnIndex: number, data: unknown) => React.Key,\n\n /**\n * Callback after a scroll event has been processed and state updated but before rendering\n * @param rowOffset - Resulting overall row offset. Can be passed to {@link ItemOffsetMapping} to determine first row.\n * @param columnOffset - Resulting overall column offset. Can be passed to {@link ItemOffsetMapping} to determine first column.\n * @param newRowScrollState - New {@link ScrollState} for rows that will be used for rendering.\n * @param newColumnScrollState - New {@link ScrollState} for columns that will be used for rendering.\n */\n onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;\n\n /** Render prop implementing {@link VirtualOuterRender}. Used to customize {@link VirtualGrid}. */\n outerRender?: VirtualOuterRender;\n\n /** Render prop implementing {@link VirtualInnerRender}. Used to customize {@link VirtualGrid}. */\n innerRender?: VirtualInnerRender;\n}\n\n/**\n * Custom ref handle returned by {@link VirtualGrid} that exposes imperative methods\n * \n * Use `React.useRef<VirtualGridProxy>(null)` to create a ref.\n */\nexport interface VirtualGridProxy {\n /**\n * Scrolls the list to the specified row and column in pixels\n */\n scrollTo(rowOffset?: number, columnOffset?: number): void;\n\n /**\n * Scrolls the list so that the specified item is visible\n * @param rowIndex - Row of item to scroll to\n * @param columnIndex - Column of item to scroll to\n */\n scrollToItem(rowIndex?: number, columnIndex?: number): void;\n\n /** Exposes DOM clientWidth property */\n get clientWidth(): number;\n\n /** Exposes DOM clientHeight property */\n get clientHeight(): number;\n}\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: unknown) => `${rowIndex}:${columnIndex}`;\n\ninterface VirtualInnerComponentProps extends VirtualInnerProps {\n render: VirtualInnerRender;\n}\n\nconst Inner = React.forwardRef<HTMLDivElement, VirtualInnerComponentProps >(function VirtualGridInner({render, ...rest}, ref) {\n return render(rest, ref)\n})\n\nfunction defaultInnerRender({...rest}: VirtualInnerProps, ref?: React.ForwardedRef<HTMLDivElement>): JSX.Element {\n return <div ref={ref} {...rest} />\n}\n\ninterface VirtualOuterComponentProps extends VirtualOuterProps {\n render: VirtualOuterRender;\n}\n\nconst Outer = React.forwardRef<HTMLDivElement, VirtualOuterComponentProps >(function VirtualGridOuter({render, ...rest}, ref) {\n return render(rest, ref)\n})\n\nfunction defaultOuterRender({...rest}: VirtualOuterProps, ref?: React.ForwardedRef<HTMLDivElement>): JSX.Element {\n return <div ref={ref} {...rest} />\n}\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\n/**\n * Virtual Scrolling Grid\n * \n * Accepts props defined by {@link VirtualGridProps}. \n * Refs are forwarded to {@link VirtualGridProxy}. \n * You must pass a single instance of {@link VirtualGridItem} as a child.\n * @group Components\n */\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, className, innerClassName, \n itemData = undefined, itemKey = defaultItemKey, onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalRowSize = rowOffsetMapping.itemOffset(rowCount);\n const totalColumnSize = columnOffsetMapping.itemOffset(columnCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset: scrollRowOffset, renderOffset: renderRowOffset, renderSize: renderRowSize,\n onScroll: onScrollRow, doScrollTo: doScrollToRow } = useVirtualScroll(totalRowSize, props.maxCssSize, props.minNumPages);\n const { scrollOffset: scrollColumnOffset, renderOffset: renderColumnOffset, renderSize: renderColumnSize,\n onScroll: onScrollColumn, doScrollTo: doScrollToColumn} = useVirtualScroll(totalColumnSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset?: number, columnOffset?: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer) {\n const options: ScrollToOptions = {};\n if (rowOffset != undefined)\n options.top = doScrollToRow(rowOffset, outer.clientHeight);\n if (columnOffset != undefined)\n options.left = doScrollToColumn(columnOffset, outer.clientWidth);\n outer.scrollTo(options);\n }\n },\n\n scrollToItem(rowIndex?: number, columnIndex?: number): void {\n const rowOffset = (rowIndex != undefined) ? rowOffsetMapping.itemOffset(rowIndex) : undefined;\n const columnOffset = (columnIndex != undefined) ? columnOffsetMapping.itemOffset(columnIndex) : undefined;\n this.scrollTo(rowOffset, columnOffset);\n },\n\n get clientWidth(): number {\n return outerRef.current ? outerRef.current.clientWidth : /* istanbul ignore next */ 0;\n },\n\n get clientHeight(): number {\n return outerRef.current ? outerRef.current.clientHeight : /* istanbul ignore next */ 0;\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping, doScrollToRow, doScrollToColumn ]);\n\n\n function onScroll(event: ScrollEvent) {\n const { clientWidth, clientHeight, scrollWidth, scrollHeight, scrollLeft, scrollTop } = event.currentTarget;\n const [newScrollTop, newRowScrollState] = onScrollRow(clientHeight, scrollHeight, scrollTop);\n const [newScrollLeft, newColumnScrollState] = onScrollColumn(clientWidth, scrollWidth, scrollLeft);\n if (outerRef.current && (newScrollTop != scrollTop || newScrollLeft != scrollLeft ))\n outerRef.current.scrollTo(newScrollLeft, newScrollTop);\n onScrollCallback?.(newRowScrollState.scrollOffset+newRowScrollState.renderOffset, \n newColumnScrollState.scrollOffset+newColumnScrollState.renderOffset, newRowScrollState, newColumnScrollState);\n }\n\n const [startRowIndex, startRowOffset, rowSizes] = \n getRangeToRender(rowCount, rowOffsetMapping, height, scrollRowOffset + renderRowOffset);\n const [startColumnIndex, startColumnOffset, columnSizes] = \n getRangeToRender(columnCount, columnOffsetMapping, width, scrollColumnOffset + renderColumnOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do. \n const ChildVar = children;\n const outerRender = props.outerRender || defaultOuterRender;\n const innerRender = props.innerRender || defaultInnerRender;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextRowOffset = startRowOffset - renderRowOffset;\n let rowIndex=0, rowOffset=0;\n let nextColumnOffset=0, columnIndex=0, columnOffset=0;\n\n return (\n <Outer className={className} render={outerRender} onScroll={onScroll} ref={outerRef} \n style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <Inner className={innerClassName} render={innerRender} style={{ height: renderRowSize, width: renderColumnSize }}>\n {rowSizes.map((rowSize, rowArrayIndex) => (\n rowOffset = nextRowOffset,\n nextRowOffset += rowSize,\n rowIndex = startRowIndex + rowArrayIndex,\n nextColumnOffset = startColumnOffset - renderColumnOffset,\n <Fragment key={itemKey(rowIndex, 0, itemData)}>\n {columnSizes.map((columnSize, columnArrayIndex) => (\n columnOffset = nextColumnOffset,\n nextColumnOffset += columnSize,\n columnIndex = startColumnIndex + columnArrayIndex,\n <ChildVar data={itemData} key={itemKey(rowIndex, columnIndex, itemData)}\n rowIndex={rowIndex} columnIndex={columnIndex}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ position: \"absolute\", top: rowOffset, height: rowSize, left: columnOffset, width: columnSize }}/>\n ))}\n </Fragment>\n ))}\n </Inner>\n </Outer>\n );\n});\n\nexport default VirtualGrid;\n","import React from \"react\";\nimport { ItemOffsetMapping, VirtualBaseItemProps, VirtualBaseProps, \n VirtualInnerProps, VirtualInnerRender, VirtualOuterProps, VirtualOuterRender, ScrollEvent } from './VirtualBase';\nimport { getRangeToRender } from './VirtualCommon';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\n\n/** Specifies the direction over which the list should implement virtual scrolling */\nexport type ScrollLayout = \"horizontal\" | \"vertical\";\n\n/**\n * Props accepted by {@link VirtualListItem}\n */\nexport interface VirtualListItemProps extends VirtualBaseItemProps {\n /** Index of item in the list being rendered */\n index: number,\n}\n\n/**\n * Type of item in a {@link VirtualList}\n *\n * Must be passed as a child to {@link VirtualList}. \n * Accepts props defined by {@link VirtualListItemProps}.\n * Component must pass {@link VirtualBaseItemProps.style} to whatever it renders. \n * \n * @example Basic implementation\n * ```\n * const Row = ({ index, style }: { index: number, style: React.CSSProperties }) => (\n * <div className=\"row\" style={style}>\n * { index }\n * </div>\n * );\n * ```\n */\nexport type VirtualListItem = React.ComponentType<VirtualListItemProps>;\n\n/**\n * Props accepted by {@link VirtualList}\n */\nexport interface VirtualListProps extends VirtualBaseProps {\n /** Component used as a template to render items in the list. Must implement {@link VirtualListItem} interface. */\n children: VirtualListItem,\n\n /** Number of items in the list */\n itemCount: number,\n\n /** \n * Implementation of {@link ItemOffsetMapping} interface that defines size and offset to each item in the list\n * \n * Use {@link useFixedSizeItemOffsetMapping} or {@link useVariableSizeItemOffsetMapping} to create implementations\n * for common cases.\n */\n itemOffsetMapping: ItemOffsetMapping,\n\n /**\n * Function that defines the key to use for each item given item index and value of {@link VirtualBaseProps.itemData}.\n * @defaultValue `(index, _data) => index`\n */\n itemKey?: (index: number, data: unknown) => React.Key,\n\n /**\n * Choice of 'vertical' or 'horizontal' layouts\n * @defaultValue 'vertical'\n */\n layout?: ScrollLayout,\n\n /**\n * Callback after a scroll event has been processed and state updated but before rendering\n * @param offset - Resulting overall offset. Can be passed to {@link ItemOffsetMapping} to determine top item.\n * @param newScrollState - New {@link ScrollState} that will be used for rendering.\n */\n onScroll?: (offset: number, newScrollState: ScrollState) => void;\n\n /** Render prop implementing {@link VirtualOuterRender}. Used to customize {@link VirtualList}. */\n outerRender?: VirtualOuterRender;\n\n /** Render prop implementing {@link VirtualInnerRender}. Used to customize {@link VirtualList}. */\n innerRender?: VirtualInnerRender;\n}\n\n/**\n * Custom ref handle returned by {@link VirtualList} that exposes imperative methods\n * \n * Use `React.useRef<VirtualListProxy>(null)` to create a ref.\n */\nexport interface VirtualListProxy {\n /**\n * Scrolls the list to the specified offset in pixels\n * @param offset - Offset to scroll to\n */\n scrollTo(offset: number): void;\n\n /**\n * Scrolls the list so that the specified item is visible\n * @param index - Index of item to scroll to\n */\n scrollToItem(index: number): void;\n}\n\nconst defaultItemKey = (index: number, _data: unknown) => index;\n\ninterface VirtualInnerComponentProps extends VirtualInnerProps {\n render: VirtualInnerRender;\n}\n\nconst Inner = React.forwardRef<HTMLDivElement, VirtualInnerComponentProps >(function VirtualListInner({render, ...rest}, ref) {\n return render(rest, ref)\n})\n\nfunction defaultInnerRender({...rest}: VirtualInnerProps, ref?: React.ForwardedRef<HTMLDivElement>): JSX.Element {\n return <div ref={ref} {...rest} />\n}\n\ninterface VirtualOuterComponentProps extends VirtualOuterProps {\n render: VirtualOuterRender;\n}\n\nconst Outer = React.forwardRef<HTMLDivElement, VirtualOuterComponentProps >(function VirtualListOuter({render, ...rest}, ref) {\n return render(rest, ref)\n})\n\nfunction defaultOuterRender({...rest}: VirtualOuterProps, ref?: React.ForwardedRef<HTMLDivElement>): JSX.Element {\n return <div ref={ref} {...rest} />\n}\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\n/**\n * Virtual Scrolling List\n * \n * Accepts props defined by {@link VirtualListProps}. \n * Refs are forwarded to {@link VirtualListProxy}. \n * You must pass a single instance of {@link VirtualListItem} as a child.\n * @group Components\n */\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { width, height, itemCount, itemOffsetMapping, children, className, innerClassName,\n itemData = undefined, itemKey = defaultItemKey, layout = 'vertical', onScroll: onScrollCallback, useIsScrolling = false } = props;\n\n // Total size is same as offset to item one off the end\n const totalSize = itemOffsetMapping.itemOffset(itemCount);\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { scrollOffset, renderOffset, renderSize, onScroll: onScrollExtent, doScrollTo } = \n useVirtualScroll(totalSize, props.maxCssSize, props.minNumPages);\n const isScrolling = useIsScrollingHook(outerRef); \n const isVertical = layout === 'vertical';\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const outer = outerRef.current;\n /* istanbul ignore else */\n if (outer) {\n if (isVertical)\n outer.scrollTo(0, doScrollTo(offset, outer.clientHeight));\n else\n outer.scrollTo(doScrollTo(offset, outer.clientWidth), 0);\n }\n },\n\n scrollToItem(index: number): void {\n this.scrollTo(itemOffsetMapping.itemOffset(index));\n }\n }\n }, [ itemOffsetMapping, isVertical, doScrollTo ]);\n\n function onScroll(event: ScrollEvent) {\n if (isVertical) {\n const { clientHeight, scrollHeight, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollTop, newScrollState] = onScrollExtent(clientHeight, scrollHeight, scrollTop);\n if (newScrollTop != scrollTop && outerRef.current)\n outerRef.current.scrollTo(scrollLeft, newScrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n } else {\n const { clientWidth, scrollWidth, scrollTop, scrollLeft } = event.currentTarget;\n const [newScrollLeft, newScrollState] = onScrollExtent(clientWidth, scrollWidth, scrollLeft);\n if (newScrollLeft != scrollLeft && outerRef.current)\n outerRef.current.scrollTo(newScrollLeft, scrollTop);\n onScrollCallback?.(newScrollState.scrollOffset+newScrollState.renderOffset, newScrollState);\n }\n }\n\n const [startIndex, startOffset, sizes] = getRangeToRender(itemCount, itemOffsetMapping, \n isVertical ? height : width, scrollOffset+renderOffset);\n\n // We can decide the JSX child type at runtime as long as we use a variable that uses the same capitalized\n // naming convention as components do.\n const ChildVar = children;\n const outerRender = props.outerRender || defaultOuterRender;\n const innerRender = props.innerRender || defaultInnerRender;\n\n // Being far too clever. Implementing a complex iteration in JSX in a map expression by abusing the comma operator. \n // You can't declare local variables in an expression so they need to be hoisted out of the JSX. The comma operator\n // returns the result of the final statement which makes the iteration a little clumsier.\n let nextOffset = startOffset - renderOffset;\n let index, offset;\n\n return (\n <Outer className={className} render={outerRender} onScroll={onScroll} ref={outerRef} \n style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <Inner className={innerClassName} render={innerRender}\n style={{ height: isVertical ? renderSize : \"100%\", width: isVertical ? \"100%\" : renderSize }}>\n {sizes.map((size, arrayIndex) => (\n offset = nextOffset,\n nextOffset += size,\n index = startIndex + arrayIndex,\n <ChildVar data={itemData} key={itemKey(index, itemData)} index={index}\n isScrolling={useIsScrolling ? isScrolling : undefined}\n style={{ \n position: \"absolute\", \n top: isVertical ? offset : undefined, \n left: isVertical ? undefined : offset,\n height: isVertical ? size : \"100%\", \n width: isVertical ? \"100%\" : size, \n }}/>\n ))}\n </Inner>\n </Outer>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass FixedSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (itemSize: number) {\n this.fixedItemSize = itemSize;\n }\n\n itemSize(_itemIndex: number): number {\n return this.fixedItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n return itemIndex * this.fixedItemSize;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n const itemIndex = Math.floor(offset / this.fixedItemSize);\n const startOffset = itemIndex * this.fixedItemSize;\n\n return [itemIndex, startOffset];\n }\n\n fixedItemSize: number;\n}\n\n/**\n * Returns an instance of {@link ItemOffsetMapping} suitable for use when all items have a fixed size.\n * \n * @param itemSize - Size to use for all items\n */\nexport function useFixedSizeItemOffsetMapping(itemSize: number): ItemOffsetMapping {\n return new FixedSizeItemOffsetMapping(itemSize);\n}\n\nexport default useFixedSizeItemOffsetMapping;\n","import { ItemOffsetMapping } from './VirtualBase';\n\nclass VariableSizeItemOffsetMapping implements ItemOffsetMapping {\n constructor (defaultItemSize: number, sizes: number[]) {\n this.defaultItemSize = defaultItemSize;\n this.sizes = sizes;\n }\n\n itemSize(itemIndex: number): number {\n return (itemIndex < this.sizes.length) ? this.sizes[itemIndex] : this.defaultItemSize;\n }\n\n itemOffset(itemIndex: number): number {\n let offset = 0;\n let length = this.sizes.length;\n if (itemIndex > length) {\n const numDefaultSize = itemIndex - length;\n offset = numDefaultSize * this.defaultItemSize;\n } else {\n length = itemIndex;\n }\n \n for (let i = 0; i < length; i ++)\n {\n offset += this.sizes[i];\n }\n\n return offset;\n }\n\n offsetToItem(offset: number): [itemIndex: number, startOffset: number] {\n let startOffset = 0;\n const length = this.sizes.length;\n for (let i = 0; i < length; i ++) {\n const size = this.sizes[i];\n if (startOffset + size > offset) {\n return [i, startOffset];\n }\n startOffset += size;\n }\n\n const itemIndex = Math.floor((offset - startOffset) / this.defaultItemSize);\n startOffset += itemIndex * this.defaultItemSize;\n\n return [itemIndex+length, startOffset];\n }\n\n defaultItemSize: number;\n sizes: number[];\n}\n\n/**\n * Returns an instance of {@link ItemOffsetMapping} suitable for use when initial items have variable sizes.\n * \n * @param defaultItemSize - Size to use for all other items\n * @param sizes - Array of sizes to use for the initial items, one size per item\n */\nexport function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]): ItemOffsetMapping {\n return new VariableSizeItemOffsetMapping(defaultItemSize, sizes || []);\n}\n\nexport default useVariableSizeItemOffsetMapping;"],"names":["defaultItemKey","Inner","defaultInnerRender","_jsx","Outer","defaultOuterRender","useIsScrolling","useIsScrollingHook"],"mappings":";;;AAQM,SAAU,gBAAgB,CAAC,SAAiB,EAAE,iBAAoC,EAAE,YAAoB,EAAE,YAAoB,EAAA;AAClI,IAAA,IAAI,SAAS,IAAI,CAAC,EAAE;AAClB,QAAA,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;KACnB;AAED,IAAA,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,GAAG,iBAAiB,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;AAC5E,IAAA,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAA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AAC,GAAG,MAAM,EAAE,CAAC,EAAG,EAChC;AACE,YAAA,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACzB;AAED,QAAA,OAAO,MAAM,CAAC;KACf;AAED,IAAA,YAAY,CAAC,MAAc,EAAA;QACzB,IAAI,WAAW,GAAG,CAAC,CAAC;AACpB,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;AACjC,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,EAAE,CAAC,EAAG,EAAE;YAChC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC3B,YAAA,IAAI,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE;AAC/B,gBAAA,OAAO,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;aACzB;YACD,WAAW,IAAI,IAAI,CAAC;SACrB;AAED,QAAA,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,WAAW,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC;AAC5E,QAAA,WAAW,IAAI,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC;AAEhD,QAAA,OAAO,CAAC,SAAS,GAAC,MAAM,EAAE,WAAW,CAAC,CAAC;KACxC;AAIF,CAAA;AAED;;;;;AAKG;AACa,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;AACzE;;;;"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@candidstartup/react-virtual-scroll",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.5.0",
|
|
5
5
|
"description": "Modern React components for lists and grids that scale to trillions of rows and columns",
|
|
6
6
|
"author": "Tim Wiegand <tim.wiegand@thecandidstartup.org>",
|
|
7
7
|
"license": "BSD-3-Clause",
|
|
@@ -45,16 +45,19 @@
|
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"dev": "vite",
|
|
48
|
-
"clean": "rimraf dist",
|
|
48
|
+
"clean": "rimraf {dist,temp}",
|
|
49
49
|
"prebuild": "npm run clean",
|
|
50
50
|
"build-tsc": "tsc -p tsconfig.build.json",
|
|
51
51
|
"build-rollup": "rollup -c ../rollup.config.mjs",
|
|
52
52
|
"build": "npm run build-rollup",
|
|
53
|
-
"lint": "eslint . --
|
|
53
|
+
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
|
|
54
|
+
"devapi": "api-extractor run --local",
|
|
55
|
+
"prodapi": "api-extractor run",
|
|
56
|
+
"devbuild": "npm run build && npm run lint && npm run devapi",
|
|
54
57
|
"test": "vitest"
|
|
55
58
|
},
|
|
56
59
|
"peerDependencies": {
|
|
57
60
|
"react": "^18.2.0"
|
|
58
61
|
},
|
|
59
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "04aa6249f51b5da933813c7b17a652d4f4e2a646"
|
|
60
63
|
}
|