@candidstartup/react-virtual-scroll 0.8.0 → 0.10.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 -1
- package/dist/index.d.ts +74 -60
- package/dist/index.js +16 -10
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
|
+
[](https://github.com/TheCandidStartup/infinisheet/blob/main/README.md#typescript-semantic-versioning)
|
|
2
3
|
[](https://www.npmjs.com/package/@candidstartup/react-virtual-scroll)
|
|
3
4
|
[](https://www.npmjs.com/package/@candidstartup/react-virtual-scroll)
|
|
4
5
|
[](https://github.com/TheCandidStartup/infinisheet/actions/workflows/build.yml)
|
package/dist/index.d.ts
CHANGED
|
@@ -23,13 +23,13 @@ type VirtualContainerRenderProps = React$1.ComponentPropsWithoutRef<'div'>;
|
|
|
23
23
|
* )
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
type VirtualContainerRender = (props: VirtualContainerRenderProps, ref?: React$1.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
26
|
+
type VirtualContainerRender = (props: VirtualContainerRenderProps, ref?: React$1.ForwardedRef<HTMLDivElement>) => React$1.JSX.Element;
|
|
27
27
|
/**
|
|
28
28
|
* Props that {@link VirtualContainer} accepts.
|
|
29
29
|
*/
|
|
30
30
|
interface VirtualContainerComponentProps extends VirtualContainerRenderProps {
|
|
31
31
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualContainer}. */
|
|
32
|
-
render?: VirtualContainerRender;
|
|
32
|
+
render?: VirtualContainerRender | undefined;
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Wrapper around a div used by other components in {@link @candidstartup/react-virtual-scroll!}. Most props are passed through to the div. Use the
|
|
@@ -61,7 +61,7 @@ interface AutoSizerRenderProps {
|
|
|
61
61
|
* )
|
|
62
62
|
* ```
|
|
63
63
|
*/
|
|
64
|
-
type AutoSizerRender = (props: AutoSizerRenderProps) => JSX.Element;
|
|
64
|
+
type AutoSizerRender = (props: AutoSizerRenderProps) => React$1.JSX.Element;
|
|
65
65
|
/**
|
|
66
66
|
* Props accepted by {@link AutoSizer}
|
|
67
67
|
*/
|
|
@@ -69,9 +69,9 @@ interface AutoSizerProps {
|
|
|
69
69
|
/** Function implementing {@link AutoSizerRender} that renders the content that needs explicit sizing */
|
|
70
70
|
children: AutoSizerRender;
|
|
71
71
|
/** The `className` applied to the container element */
|
|
72
|
-
className?: string;
|
|
72
|
+
className?: string | undefined;
|
|
73
73
|
/** Inline style to apply to the container element */
|
|
74
|
-
style?: React$1.CSSProperties;
|
|
74
|
+
style?: React$1.CSSProperties | undefined;
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* HOC that calculates the size available to it and makes the computed size available to children.
|
|
@@ -95,7 +95,7 @@ interface DisplayBaseItemProps {
|
|
|
95
95
|
*
|
|
96
96
|
* Value passed through from {@link DisplayBaseProps.isScrolling}.
|
|
97
97
|
* */
|
|
98
|
-
isScrolling?: boolean;
|
|
98
|
+
isScrolling?: boolean | undefined;
|
|
99
99
|
/** Style that should be applied to each item rendered. Positions the item within the inner container. */
|
|
100
100
|
style: React$1.CSSProperties;
|
|
101
101
|
}
|
|
@@ -104,9 +104,9 @@ interface DisplayBaseItemProps {
|
|
|
104
104
|
*/
|
|
105
105
|
interface ComponentProps {
|
|
106
106
|
/** The `className` applied to the outer container element. Use when styling the entire component. */
|
|
107
|
-
className?: string;
|
|
107
|
+
className?: string | undefined;
|
|
108
108
|
/** The `className` applied to the inner container element. Use for special cases when styling only the inner container and items. */
|
|
109
|
-
innerClassName?: string;
|
|
109
|
+
innerClassName?: string | undefined;
|
|
110
110
|
/** Component height */
|
|
111
111
|
height: number;
|
|
112
112
|
/** Component width */
|
|
@@ -123,19 +123,19 @@ interface DisplayBaseProps extends ComponentProps {
|
|
|
123
123
|
* Provided as a convenience when combining display components with {@link VirtualScroll}
|
|
124
124
|
* Not interpreted by the display component itself
|
|
125
125
|
*/
|
|
126
|
-
isScrolling?: boolean;
|
|
126
|
+
isScrolling?: boolean | undefined;
|
|
127
127
|
/**
|
|
128
128
|
* Renders the outer viewport div which provides a window onto the inner grid div
|
|
129
129
|
*
|
|
130
130
|
* Render prop implementing {@link VirtualContainerRender}. Used to customize display component outer container.
|
|
131
131
|
*/
|
|
132
|
-
outerRender?: VirtualContainerRender;
|
|
132
|
+
outerRender?: VirtualContainerRender | undefined;
|
|
133
133
|
/**
|
|
134
134
|
* Renders the inner grid div containing all the list items
|
|
135
135
|
*
|
|
136
136
|
* Render prop implementing {@link VirtualContainerRender}. Used to customize display component inner container.
|
|
137
137
|
*/
|
|
138
|
-
innerRender?: VirtualContainerRender;
|
|
138
|
+
innerRender?: VirtualContainerRender | undefined;
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
141
141
|
* Common props for all virtual scrollable components
|
|
@@ -147,21 +147,21 @@ interface VirtualScrollableProps extends ComponentProps {
|
|
|
147
147
|
*
|
|
148
148
|
* @defaultValue false
|
|
149
149
|
* */
|
|
150
|
-
useIsScrolling?: boolean;
|
|
150
|
+
useIsScrolling?: boolean | undefined;
|
|
151
151
|
/**
|
|
152
152
|
* Maximum size for CSS element beyond which layout breaks. You should never normally need to change this.
|
|
153
153
|
* The default value is compatible with all major browsers.
|
|
154
154
|
*
|
|
155
155
|
* @defaultValue 6000000
|
|
156
156
|
* */
|
|
157
|
-
maxCssSize?: number;
|
|
157
|
+
maxCssSize?: number | undefined;
|
|
158
158
|
/**
|
|
159
159
|
* The minimum number of virtual pages to use when inner container would otherwise be more than {@link VirtualScrollableProps.maxCssSize} big.
|
|
160
160
|
* You should never normally need to change this.
|
|
161
161
|
*
|
|
162
162
|
* @defaultValue 100
|
|
163
163
|
*/
|
|
164
|
-
minNumPages?: number;
|
|
164
|
+
minNumPages?: number | undefined;
|
|
165
165
|
}
|
|
166
166
|
/**
|
|
167
167
|
* Common props for {@link VirtualList} and {@link VirtualGrid}
|
|
@@ -249,7 +249,7 @@ interface VirtualContentProps {
|
|
|
249
249
|
*
|
|
250
250
|
* Only defined if {@link VirtualScrollableProps.useIsScrolling} is true.
|
|
251
251
|
* */
|
|
252
|
-
isScrolling?: boolean;
|
|
252
|
+
isScrolling?: boolean | undefined;
|
|
253
253
|
/** Current scroll position vertical offset */
|
|
254
254
|
verticalOffset: number;
|
|
255
255
|
/** Current scroll position horizontal offset */
|
|
@@ -272,7 +272,15 @@ interface VirtualContentProps {
|
|
|
272
272
|
* )
|
|
273
273
|
* ```
|
|
274
274
|
*/
|
|
275
|
-
type VirtualContentRender = (props: VirtualContentProps, ref?: React$1.ForwardedRef<HTMLDivElement>) => JSX.Element;
|
|
275
|
+
type VirtualContentRender = (props: VirtualContentProps, ref?: React$1.ForwardedRef<HTMLDivElement>) => React$1.JSX.Element;
|
|
276
|
+
/**
|
|
277
|
+
* Callback after a scroll event has been processed and state updated but before rendering
|
|
278
|
+
* @param verticalOffset - Resulting overall vertical offset.
|
|
279
|
+
* @param horizontalOffset - Resulting overall horizontal offset.
|
|
280
|
+
* @param newVerticalScrollState - New vertical {@link ScrollState} that will be used for rendering.
|
|
281
|
+
* @param newHorizontalScrollState - New horizontal {@link ScrollState} that will be used for rendering.
|
|
282
|
+
*/
|
|
283
|
+
type VirtualScrollHandler = (verticalOffset: number, horizontalOffset: number, newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void;
|
|
276
284
|
/**
|
|
277
285
|
* Props accepted by {@link VirtualScroll}
|
|
278
286
|
*/
|
|
@@ -284,13 +292,13 @@ interface VirtualScrollProps extends VirtualScrollableProps {
|
|
|
284
292
|
*
|
|
285
293
|
* @defaultValue 0
|
|
286
294
|
*/
|
|
287
|
-
scrollHeight?: number;
|
|
295
|
+
scrollHeight?: number | undefined;
|
|
288
296
|
/**
|
|
289
297
|
* Width of area to scroll over
|
|
290
298
|
*
|
|
291
299
|
* @defaultValue 0
|
|
292
300
|
*/
|
|
293
|
-
scrollWidth?: number;
|
|
301
|
+
scrollWidth?: number | undefined;
|
|
294
302
|
/**
|
|
295
303
|
* Determines whether the component should pass {@link VirtualContentProps.verticalOffset|verticalOffset} and
|
|
296
304
|
* {@link VirtualContentProps.horizontalOffset|horizontalOffset} to children when rendering.
|
|
@@ -299,19 +307,13 @@ interface VirtualScrollProps extends VirtualScrollableProps {
|
|
|
299
307
|
*
|
|
300
308
|
* @defaultValue true
|
|
301
309
|
* */
|
|
302
|
-
useOffsets?: boolean;
|
|
303
|
-
/**
|
|
304
|
-
|
|
305
|
-
* @param verticalOffset - Resulting overall vertical offset.
|
|
306
|
-
* @param horizontalOffset - Resulting overall horizontal offset.
|
|
307
|
-
* @param newVerticalScrollState - New vertical {@link ScrollState} that will be used for rendering.
|
|
308
|
-
* @param newHorizontalScrollState - New horizontal {@link ScrollState} that will be used for rendering.
|
|
309
|
-
*/
|
|
310
|
-
onScroll?: (verticalOffset: number, horizontalOffset: number, newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void;
|
|
310
|
+
useOffsets?: boolean | undefined;
|
|
311
|
+
/** Scroll handler implementing {@link VirtualScrollHandler} called after a scroll event has been processed and state updated. */
|
|
312
|
+
onScroll?: VirtualScrollHandler | undefined;
|
|
311
313
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} outer container. */
|
|
312
|
-
outerRender?: VirtualContainerRender;
|
|
314
|
+
outerRender?: VirtualContainerRender | undefined;
|
|
313
315
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} inner container. */
|
|
314
|
-
innerRender?: VirtualContainerRender;
|
|
316
|
+
innerRender?: VirtualContainerRender | undefined;
|
|
315
317
|
}
|
|
316
318
|
/**
|
|
317
319
|
* Customizable Virtual Scrolling Component
|
|
@@ -349,6 +351,10 @@ interface DisplayListItemProps extends DisplayBaseItemProps {
|
|
|
349
351
|
* ```
|
|
350
352
|
*/
|
|
351
353
|
type DisplayListItem = React$1.ComponentType<DisplayListItemProps>;
|
|
354
|
+
/**
|
|
355
|
+
* Function that defines the key to use for each item given item index and value of {@link DisplayBaseProps.itemData}.
|
|
356
|
+
*/
|
|
357
|
+
type ListItemKey = (index: number, data: unknown) => React$1.Key;
|
|
352
358
|
/**
|
|
353
359
|
* Props accepted by {@link DisplayList}
|
|
354
360
|
*/
|
|
@@ -367,15 +373,15 @@ interface DisplayListProps extends DisplayBaseProps {
|
|
|
367
373
|
*/
|
|
368
374
|
itemOffsetMapping: ItemOffsetMapping;
|
|
369
375
|
/**
|
|
370
|
-
* Function that defines the key to use for each item
|
|
376
|
+
* Function implementing {@link ListItemKey} that defines the key to use for each item.
|
|
371
377
|
* @defaultValue `(index, _data) => index`
|
|
372
378
|
*/
|
|
373
|
-
itemKey?:
|
|
379
|
+
itemKey?: ListItemKey | undefined;
|
|
374
380
|
/**
|
|
375
381
|
* Choice of 'vertical' or 'horizontal' layouts
|
|
376
382
|
* @defaultValue 'vertical'
|
|
377
383
|
*/
|
|
378
|
-
layout?: ScrollLayout;
|
|
384
|
+
layout?: ScrollLayout | undefined;
|
|
379
385
|
}
|
|
380
386
|
/**
|
|
381
387
|
* Displays a window onto the contents of a virtualized list starting from `offset`.
|
|
@@ -412,6 +418,10 @@ interface DisplayGridItemProps extends DisplayBaseItemProps {
|
|
|
412
418
|
* ```
|
|
413
419
|
*/
|
|
414
420
|
type DisplayGridItem = React$1.ComponentType<DisplayGridItemProps>;
|
|
421
|
+
/**
|
|
422
|
+
* Function that defines the key to use for each item given row and column index and value of {@link DisplayBaseProps.itemData}.
|
|
423
|
+
*/
|
|
424
|
+
type GridItemKey = (rowIndex: number, columnIndex: number, data: unknown) => React$1.Key;
|
|
415
425
|
/**
|
|
416
426
|
* Props accepted by {@link DisplayGrid}
|
|
417
427
|
*/
|
|
@@ -441,10 +451,10 @@ interface DisplayGridProps extends DisplayBaseProps {
|
|
|
441
451
|
/** Horizontal offset to start of displayed content */
|
|
442
452
|
columnOffset: number;
|
|
443
453
|
/**
|
|
444
|
-
* Function that defines the key to use for each item
|
|
454
|
+
* Function implementing {@link GridItemKey} that defines the key to use for each item.
|
|
445
455
|
* @defaultValue `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`
|
|
446
456
|
*/
|
|
447
|
-
itemKey?:
|
|
457
|
+
itemKey?: GridItemKey | undefined;
|
|
448
458
|
}
|
|
449
459
|
/**
|
|
450
460
|
* Displays a window onto the contents of a virtualized grid starting from `rowOffset`, `columnOffset`.
|
|
@@ -496,8 +506,16 @@ declare function getRangeToScroll(index: number | undefined, mapping: ItemOffset
|
|
|
496
506
|
* You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayGrid} for
|
|
497
507
|
* advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.
|
|
498
508
|
*/
|
|
499
|
-
declare function virtualGridScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy>, rowOffsetMapping: ItemOffsetMapping, columnOffsetMapping: ItemOffsetMapping, rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void;
|
|
509
|
+
declare function virtualGridScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy | null>, rowOffsetMapping: ItemOffsetMapping, columnOffsetMapping: ItemOffsetMapping, rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void;
|
|
500
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Callback after a scroll event has been processed and state updated but before rendering
|
|
513
|
+
* @param rowOffset - Resulting overall row offset. Can be passed to {@link ItemOffsetMapping} to determine first row.
|
|
514
|
+
* @param columnOffset - Resulting overall column offset. Can be passed to {@link ItemOffsetMapping} to determine first column.
|
|
515
|
+
* @param newRowScrollState - New {@link ScrollState} for rows that will be used for rendering.
|
|
516
|
+
* @param newColumnScrollState - New {@link ScrollState} for columns that will be used for rendering.
|
|
517
|
+
*/
|
|
518
|
+
type VirtualGridScrollHandler = (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;
|
|
501
519
|
/**
|
|
502
520
|
* Props accepted by {@link VirtualGrid}
|
|
503
521
|
*/
|
|
@@ -523,22 +541,16 @@ interface VirtualGridProps extends VirtualBaseProps {
|
|
|
523
541
|
*/
|
|
524
542
|
columnOffsetMapping: ItemOffsetMapping;
|
|
525
543
|
/**
|
|
526
|
-
* Function that defines the key to use for each item
|
|
544
|
+
* Function implementing {@link GridItemKey} that defines the key to use for each item.
|
|
527
545
|
* @defaultValue `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`
|
|
528
546
|
*/
|
|
529
|
-
itemKey?:
|
|
530
|
-
/**
|
|
531
|
-
|
|
532
|
-
* @param rowOffset - Resulting overall row offset. Can be passed to {@link ItemOffsetMapping} to determine first row.
|
|
533
|
-
* @param columnOffset - Resulting overall column offset. Can be passed to {@link ItemOffsetMapping} to determine first column.
|
|
534
|
-
* @param newRowScrollState - New {@link ScrollState} for rows that will be used for rendering.
|
|
535
|
-
* @param newColumnScrollState - New {@link ScrollState} for columns that will be used for rendering.
|
|
536
|
-
*/
|
|
537
|
-
onScroll?: (rowOffset: number, columnOffset: number, newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;
|
|
547
|
+
itemKey?: GridItemKey | undefined;
|
|
548
|
+
/** Scroll handler implementing {@link VirtualGridScrollHandler} called after a scroll event has been processed and state updated. */
|
|
549
|
+
onScroll?: VirtualGridScrollHandler | undefined;
|
|
538
550
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualGrid} outer container. */
|
|
539
|
-
outerRender?: VirtualContainerRender;
|
|
551
|
+
outerRender?: VirtualContainerRender | undefined;
|
|
540
552
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayGrid} within {@link VirtualGrid} inner container. */
|
|
541
|
-
innerRender?: VirtualContainerRender;
|
|
553
|
+
innerRender?: VirtualContainerRender | undefined;
|
|
542
554
|
}
|
|
543
555
|
/**
|
|
544
556
|
* Virtual Scrolling Grid
|
|
@@ -576,8 +588,14 @@ interface VirtualListProxy {
|
|
|
576
588
|
* You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayList} for
|
|
577
589
|
* advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.
|
|
578
590
|
*/
|
|
579
|
-
declare function virtualListScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy>, itemOffsetMapping: ItemOffsetMapping, isVertical: boolean, index: number, option?: ScrollToOption): void;
|
|
591
|
+
declare function virtualListScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy | null>, itemOffsetMapping: ItemOffsetMapping, isVertical: boolean, index: number, option?: ScrollToOption): void;
|
|
580
592
|
|
|
593
|
+
/**
|
|
594
|
+
* Callback after a scroll event has been processed and state updated but before rendering
|
|
595
|
+
* @param offset - Resulting overall offset. Can be passed to {@link ItemOffsetMapping} to determine top item.
|
|
596
|
+
* @param newScrollState - New {@link ScrollState} that will be used for rendering.
|
|
597
|
+
*/
|
|
598
|
+
type VirtualListScrollHandler = (offset: number, newScrollState: ScrollState) => void;
|
|
581
599
|
/**
|
|
582
600
|
* Props accepted by {@link VirtualList}
|
|
583
601
|
*/
|
|
@@ -594,25 +612,21 @@ interface VirtualListProps extends VirtualBaseProps {
|
|
|
594
612
|
*/
|
|
595
613
|
itemOffsetMapping: ItemOffsetMapping;
|
|
596
614
|
/**
|
|
597
|
-
* Function that defines the key to use for each item
|
|
615
|
+
* Function implementing {@link ListItemKey} that defines the key to use for each item.
|
|
598
616
|
* @defaultValue `(index, _data) => index`
|
|
599
617
|
*/
|
|
600
|
-
itemKey?:
|
|
618
|
+
itemKey?: ListItemKey | undefined;
|
|
601
619
|
/**
|
|
602
620
|
* Choice of 'vertical' or 'horizontal' layouts
|
|
603
621
|
* @defaultValue 'vertical'
|
|
604
622
|
*/
|
|
605
|
-
layout?: ScrollLayout;
|
|
606
|
-
/**
|
|
607
|
-
|
|
608
|
-
* @param offset - Resulting overall offset. Can be passed to {@link ItemOffsetMapping} to determine top item.
|
|
609
|
-
* @param newScrollState - New {@link ScrollState} that will be used for rendering.
|
|
610
|
-
*/
|
|
611
|
-
onScroll?: (offset: number, newScrollState: ScrollState) => void;
|
|
623
|
+
layout?: ScrollLayout | undefined;
|
|
624
|
+
/** Scroll handler implementing {@link VirtualListScrollHandler} called after a scroll event has been processed and state updated. */
|
|
625
|
+
onScroll?: VirtualListScrollHandler | undefined;
|
|
612
626
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualList} outer container. */
|
|
613
|
-
outerRender?: VirtualContainerRender;
|
|
627
|
+
outerRender?: VirtualContainerRender | undefined;
|
|
614
628
|
/** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayList} within {@link VirtualList} inner container. */
|
|
615
|
-
innerRender?: VirtualContainerRender;
|
|
629
|
+
innerRender?: VirtualContainerRender | undefined;
|
|
616
630
|
}
|
|
617
631
|
/**
|
|
618
632
|
* Virtual Scrolling List
|
|
@@ -640,4 +654,4 @@ declare function useFixedSizeItemOffsetMapping(itemSize: number): ItemOffsetMapp
|
|
|
640
654
|
*/
|
|
641
655
|
declare function useVariableSizeItemOffsetMapping(defaultItemSize: number, sizes?: number[]): ItemOffsetMapping;
|
|
642
656
|
|
|
643
|
-
export { AutoSizer, type AutoSizerProps, type AutoSizerRender, type AutoSizerRenderProps, type ComponentProps, type DisplayBaseItemProps, type DisplayBaseProps, DisplayGrid, type DisplayGridItem, type DisplayGridItemProps, type DisplayGridProps, DisplayList, type DisplayListItem, type DisplayListItemProps, type DisplayListProps, type ScrollDirection, type ScrollEvent, type ScrollLayout, type ScrollRange, type ScrollState, type ScrollToOption, type VirtualBaseProps, VirtualContainer, type VirtualContainerComponentProps, type VirtualContainerRender, type VirtualContainerRenderProps, type VirtualContentProps, type VirtualContentRender, VirtualGrid, type VirtualGridProps, type VirtualGridProxy, VirtualList, type VirtualListProps, type VirtualListProxy, VirtualScroll, type VirtualScrollProps, type VirtualScrollProxy, type VirtualScrollableProps, getOffsetToScrollRange, getRangeToScroll, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping, virtualGridScrollToItem, virtualListScrollToItem };
|
|
657
|
+
export { AutoSizer, type AutoSizerProps, type AutoSizerRender, type AutoSizerRenderProps, type ComponentProps, type DisplayBaseItemProps, type DisplayBaseProps, DisplayGrid, type DisplayGridItem, type DisplayGridItemProps, type DisplayGridProps, DisplayList, type DisplayListItem, type DisplayListItemProps, type DisplayListProps, type GridItemKey, type ListItemKey, type ScrollDirection, type ScrollEvent, type ScrollLayout, type ScrollRange, type ScrollState, type ScrollToOption, type VirtualBaseProps, VirtualContainer, type VirtualContainerComponentProps, type VirtualContainerRender, type VirtualContainerRenderProps, type VirtualContentProps, type VirtualContentRender, VirtualGrid, type VirtualGridProps, type VirtualGridProxy, type VirtualGridScrollHandler, VirtualList, type VirtualListProps, type VirtualListProxy, type VirtualListScrollHandler, VirtualScroll, type VirtualScrollHandler, type VirtualScrollProps, type VirtualScrollProxy, type VirtualScrollableProps, getOffsetToScrollRange, getRangeToScroll, useFixedSizeItemOffsetMapping, useVariableSizeItemOffsetMapping, virtualGridScrollToItem, virtualListScrollToItem };
|
package/dist/index.js
CHANGED
|
@@ -33,13 +33,15 @@ function AutoSizer(props) {
|
|
|
33
33
|
// creating and disconnecting resize observers.
|
|
34
34
|
const resizeCallback = React.useCallback((entries) => {
|
|
35
35
|
entries.forEach(entry => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
if (entry?.contentBoxSize[0]) {
|
|
37
|
+
// Context box sizes can contain fractional values while clientWidth
|
|
38
|
+
// and clientHeight properties are always rounded to nearest integer.
|
|
39
|
+
// Always use integer values to avoid confusion.
|
|
40
|
+
const newWidth = Math.round(entry.contentBoxSize[0].inlineSize);
|
|
41
|
+
setWidth(newWidth);
|
|
42
|
+
const newHeight = Math.round(entry.contentBoxSize[0].blockSize);
|
|
43
|
+
setHeight(newHeight);
|
|
44
|
+
}
|
|
43
45
|
});
|
|
44
46
|
}, []);
|
|
45
47
|
// Expect effect to run only on initial mount
|
|
@@ -175,7 +177,7 @@ function isListener(element) {
|
|
|
175
177
|
return element.addEventListener !== undefined;
|
|
176
178
|
}
|
|
177
179
|
function useEventListener(eventName, handler, element = window, options = {}) {
|
|
178
|
-
const savedHandler = useRef();
|
|
180
|
+
const savedHandler = useRef(undefined);
|
|
179
181
|
const { capture, passive, once } = options;
|
|
180
182
|
useEffect(() => {
|
|
181
183
|
savedHandler.current = handler;
|
|
@@ -187,7 +189,11 @@ function useEventListener(eventName, handler, element = window, options = {}) {
|
|
|
187
189
|
if (!el)
|
|
188
190
|
return;
|
|
189
191
|
const eventListener = (event) => savedHandler.current?.(event);
|
|
190
|
-
const opts = {
|
|
192
|
+
const opts = {
|
|
193
|
+
...(capture !== undefined ? { capture } : {}),
|
|
194
|
+
...(passive !== undefined ? { passive } : {}),
|
|
195
|
+
...(once !== undefined ? { once } : {})
|
|
196
|
+
};
|
|
191
197
|
el.addEventListener(eventName, eventListener, opts);
|
|
192
198
|
return () => {
|
|
193
199
|
el.removeEventListener(eventName, eventListener, opts);
|
|
@@ -212,7 +218,7 @@ if (import.meta.vitest) {
|
|
|
212
218
|
// Equivalent functionality to a useTimeout hook but based on requestAnimationFrame instead of setTimeout. Use
|
|
213
219
|
// when making frequent requests for short duration timeouts where browser may throttle setTimeout.
|
|
214
220
|
function useAnimationTimeout(callback, delay, key) {
|
|
215
|
-
const requestRef = useRef();
|
|
221
|
+
const requestRef = useRef(undefined);
|
|
216
222
|
const savedCallback = useRef(callback);
|
|
217
223
|
// Remember the latest callback
|
|
218
224
|
useEffect(() => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/VirtualContainer.tsx","../src/AutoSizer.tsx","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualScrollProxy.ts","../src/VirtualScroll.tsx","../src/VirtualCommon.ts","../src/DisplayList.tsx","../src/DisplayGrid.tsx","../src/VirtualGridProxy.ts","../src/VirtualGrid.tsx","../src/VirtualListProxy.ts","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["import React from \"react\";\n\n/**\n * Props that an implementation of {@link VirtualContainerRender} must accept.\n * \n * Includes all the props that a {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement | HTMLDivElement} would accept.\n */\nexport type VirtualContainerRenderProps = React.ComponentPropsWithoutRef<'div'>;\n\n/**\n * Render prop for a {@link VirtualContainer}\n *\n * Can be passed to {@link VirtualContainer} to replace default implementation. \n * Function must render a div and forward {@link VirtualContainerRenderProps}\n * and any `ref` to it. \n * \n * @example Minimal compliant implementation\n * ```\n * const containerRender: VirtualContainerRender = ({...rest}, ref) => (\n * <div ref={ref} {...rest} />\n * )\n * ```\n */\nexport type VirtualContainerRender = (props: VirtualContainerRenderProps, ref?: React.ForwardedRef<HTMLDivElement>) => JSX.Element;\n\n/**\n * Props that {@link VirtualContainer} accepts.\n */\nexport interface VirtualContainerComponentProps extends VirtualContainerRenderProps {\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualContainer}. */\n render?: VirtualContainerRender;\n}\n\nconst defaultContainerRender: VirtualContainerRender = ({...rest}, ref) => (\n <div ref={ref} {...rest} />\n)\n\n/**\n * Wrapper around a div used by other components in {@link @candidstartup/react-virtual-scroll!}. Most props are passed through to the div. Use the\n * {@link VirtualContainerComponentProps.render} prop to override the default behavior. \n * \n * @group Components\n */\nexport const VirtualContainer = React.forwardRef<HTMLDivElement, VirtualContainerComponentProps >(\n function VirtualContainer({render = defaultContainerRender, ...rest}, ref) {\n return render(rest, ref)\n})\n","import React from \"react\";\n\n/**\n * Props that an implementation of {@link AutoSizerRender} must accept.\n */\nexport interface AutoSizerRenderProps {\n /** Computed height */\n height: number,\n\n /** Computed width */\n width: number,\n}\n\n/**\n * Render prop for content in an {@link AutoSizer}\n *\n * Function renders content and forwards `width` and `height`\n * to whatever needs it.\n * \n * @example Simple implementation\n * ```\n * const autoSizeRender: AutoSizeRender = ({width, height}) => (\n * <VirtualList width={width} height={height} {...props} />\n * )\n * ```\n */\nexport type AutoSizerRender = (props: AutoSizerRenderProps) => JSX.Element;\n\n/**\n * Props accepted by {@link AutoSizer}\n */\nexport interface AutoSizerProps {\n /** Function implementing {@link AutoSizerRender} that renders the content that needs explicit sizing */\n children: AutoSizerRender\n\n /** The `className` applied to the container element */\n className?: string,\n\n /** Inline style to apply to the container element */\n style?: React.CSSProperties;\n}\n\n/**\n * HOC that calculates the size available to it and makes the computed size available to children.\n * The size available depends on DOM layout and style applied wherever the AutoSizer finds itself.\n * You will probably want to pass something appropriate via the `className` or `style` props.\n * \n * Accepts props defined by {@link AutoSizerProps}. \n * You must pass a single instance of {@link AutoSizerRender} as a child.\n * @group Components\n */\nexport function AutoSizer(props: AutoSizerProps) {\n const { children, className, style } = props;\n\n // Using separate primitive states rather than one composite so that React\n // can detect duplicates values and bail out of redundant renders.\n const [width, setWidth] = React.useState<number>(0);\n const [height, setHeight] = React.useState<number>(0);\n const ref = React.useRef<HTMLDivElement>(null);\n\n // Make sure resize callback is a stable value so we're not constantly\n // creating and disconnecting resize observers.\n const resizeCallback: ResizeObserverCallback = React.useCallback((entries) => {\n entries.forEach(entry => {\n // Context box sizes can contain fractional values while clientWidth\n // and clientHeight properties are always rounded to nearest integer.\n // Always use integer values to avoid confusion.\n const newWidth = Math.round(entry.contentBoxSize[0].inlineSize);\n setWidth(newWidth);\n const newHeight = Math.round(entry.borderBoxSize[0].blockSize);\n setHeight(newHeight);\n })\n }, []);\n\n // Expect effect to run only on initial mount\n React.useLayoutEffect(() => {\n const div = ref.current;\n /* istanbul ignore if*/\n if (!div)\n return;\n\n // Size on initial mount\n setHeight(div.clientHeight);\n setWidth(div.clientWidth);\n\n // Updates size on any subsequent resize. Only available in browser\n // environment so avoid crashing out when server side rendering, or\n // running unit test without ResizeObserver being mocked. \n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(resizeCallback);\n resizeObserver.observe(div);\n return () => { resizeObserver.disconnect() }\n }\n }, [resizeCallback])\n\n // No point rendering children until we've measured size and found a usable area\n const renderChildren = height > 0 && width > 0;\n\n // Ensure that size is driven only by parent. Wrapping child in a zero sized inner div\n // which it can overflow stops child's size having any impact on size of outer div. \n // Otherwise can end up in infinite loop if child makes itself bigger than the \n // actual width and height we pass to it. That could be because child has \n // padding/borders/margins or because child renders itself bigger than size it's given.\n return (\n <div ref={ref} className={className} style={style}>\n <div style={{ overflow: 'visible', width: 0, height: 0 }}>\n {renderChildren && children({height, width})}\n </div>\n </div>\n );\n}\n\nexport default AutoSizer;\n","import { useState, useRef, RefObject } 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. Total 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 VirtualScrollState {\n /** Snapshot of overall offset at last render */\n totalOffset: number;\n\n /** Physical size of scrollable area */\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(this: void, 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(this: void, offset: number, clientExtent: number): number;\n\n // Returns current overall offset (NOT a snapshot)\n getCurrentOffset(this: void): number;\n\n // Internal scroll state. Most scenarios will never need to access this. Mainly here for unit test.\n scrollState: RefObject<ScrollState>;\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\n/** Custom hook that implements logic for paged virtual scrolling in a single dimension */\nexport function useVirtualScroll(totalSize: number, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES, \n useTotalOffset = true): VirtualScrollState {\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 [totalOffset, setTotalOffset] = useState<number>(0);\n const scrollState = useRef(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState] {\n const currState = scrollState.current;\n if (currState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return [scrollOffset, currState];\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 = currState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - currState.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 + currState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != currState.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 + currState.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 scrollState.current = newScrollState;\n if (useTotalOffset)\n setTotalOffset(newOffset + newRenderOffset);\n return [retScrollOffset, newScrollState];\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const currState = scrollState.current;\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (currState.scrollOffset + currState.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 scrollState.current = { scrollOffset, renderOffset, page, scrollDirection };\n if (useTotalOffset)\n setTotalOffset(scrollOffset + renderOffset);\n return scrollOffset;\n }\n\n function getCurrentOffset() {\n const currState = scrollState.current;\n return currState.scrollOffset + currState.renderOffset;\n }\n\n return {totalOffset, renderSize, onScroll, doScrollTo, getCurrentOffset, scrollState} 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 { ScrollToOption } from './VirtualBase';\n\n/**\n * Custom ref handle returned by {@link VirtualScroll} that exposes imperative methods\n * \n * Use `React.useRef<VirtualScrollProxy>(null)` to create a ref.\n */\nexport interface VirtualScrollProxy {\n /**\n * Scrolls to the specified vertical and horizontal offset in pixels\n * Either offset can be left undefined to scroll in one dimension only\n * @param verticalOffset - Offset to scroll to vertically\n * @param horizontalOffset - Offset to scroll to horizontally\n */\n scrollTo(verticalOffset?: number, horizontalOffset?: number): void;\n\n /**\n * Scrolls to the specified area\n * Either offset/size pair can be left undefined to scroll in one dimension only\n * @param verticalOffset - Offset to scroll to vertically\n * @param verticalSize - Size of target area vertically\n * @param horizontalOffset - Offset to scroll to horizontally\n * @param horizontalSize - Size of target area horizontally\n * @param option - Where to {@link ScrollToOption | position} the area within the viewport\n */\n scrollToArea(verticalOffset?: number, verticalSize?: number, horizontalOffset?: number, horizontalSize?: number, option?: ScrollToOption): void;\n\n /** Exposes DOM clientWidth property */\n get clientWidth(): number;\n\n /** Exposes DOM clientHeight property */\n get clientHeight(): number;\n\n /** Current vertical position of scroll bar */\n get verticalOffset(): number;\n\n /** Current horizontal position of scroll bar */\n get horizontalOffset(): number;\n}\n\n/**\n * Returns the offset needed to scroll in one dimension for a specified range\n * \n * Used internally to implement {@link VirtualScrollProxy.scrollToArea}. Can be used directly for \n * advanced customization scenarios.\n */\nexport function getOffsetToScrollRange(offset: number | undefined, size: number | undefined, \n clientExtent: number, scrollOffset: number, option?: ScrollToOption): number | undefined\n{\n if (offset === undefined)\n return undefined;\n\n if (option != 'visible')\n return offset;\n\n // Start of item offscreen before start of viewport?\n if (offset < scrollOffset)\n return offset;\n\n size = size || 0;\n\n // Already completely visible?\n const endOffset = offset + size;\n const endViewport = scrollOffset + clientExtent;\n if (endOffset <= endViewport)\n return undefined;\n\n // Item offscreen past end of viewport\n\n // Item bigger than viewport? Make sure start is in view\n if (size > clientExtent)\n return offset;\n\n // Scroll so end of item aligns with end of viewport\n return offset - clientExtent + size;\n }\n","import React from \"react\";\nimport { VirtualContainer, VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScrollableProps, ScrollEvent, ScrollToOption } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\nimport { getOffsetToScrollRange, VirtualScrollProxy } from './VirtualScrollProxy';\n\n/**\n * Props that an implementation of {@link VirtualContentRender} must accept.\n */\nexport interface VirtualContentProps {\n /** \n * Is the owning component being actively scrolled? Used to change how the content is rendered depending on scroll state.\n * \n * Only defined if {@link VirtualScrollableProps.useIsScrolling} is true. \n * */\n isScrolling?: boolean,\n\n /** Current scroll position vertical offset */\n verticalOffset: number,\n\n /** Current scroll position horizontal offset */\n horizontalOffset: number\n}\n\n/**\n * Render prop for content in {@link VirtualScroll}\n *\n * Pass as child to {@link VirtualScroll} to render content and forward {@link VirtualContentProps}\n * to whatever needs them. \n * \n * @example Simple implementation\n * ```\n * const contentRender: VirtualContentRender = ({isScrolling, verticalOffset, horizontalOffset}) => (\n * <DisplayGrid\n * isScrolling={isScrolling}\n * rowOffset={verticalOffset}\n * columnOffset={horizontalOffset}\n * {...rest}/>\n * )\n * ```\n */\nexport type VirtualContentRender = (props: VirtualContentProps, ref?: React.ForwardedRef<HTMLDivElement>) => JSX.Element;\n\n/**\n * Props accepted by {@link VirtualScroll}\n */\nexport interface VirtualScrollProps extends VirtualScrollableProps {\n /** Function implementing {@link VirtualContentRender} that renders the content that needs to respond to scrolling */\n children: VirtualContentRender\n\n /** \n * Height of area to scroll over \n * \n * @defaultValue 0\n */\n scrollHeight?: number,\n\n /** \n * Width of area to scroll over \n * \n * @defaultValue 0\n */\n scrollWidth?: number,\n\n /** \n * Determines whether the component should pass {@link VirtualContentProps.verticalOffset|verticalOffset} and \n * {@link VirtualContentProps.horizontalOffset|horizontalOffset} to children when rendering.\n * \n * Can reduce the number of renders needed if these props aren't used\n * \n * @defaultValue true\n * */\n useOffsets?: boolean,\n\n /**\n * Callback after a scroll event has been processed and state updated but before rendering\n * @param verticalOffset - Resulting overall vertical offset. \n * @param horizontalOffset - Resulting overall horizontal offset.\n * @param newVerticalScrollState - New vertical {@link ScrollState} that will be used for rendering.\n * @param newHorizontalScrollState - New horizontal {@link ScrollState} that will be used for rendering.\n */\n onScroll?: (verticalOffset: number, horizontalOffset: number, newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} outer container. */\n outerRender?: VirtualContainerRender;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} inner container. */\n innerRender?: VirtualContainerRender;\n}\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\n/**\n * Customizable Virtual Scrolling Component\n * \n * Allows user to scroll over a virtual area `scrollHeight` x `scrollWidth` pixels. \n * Use `onScroll` to track scroll state and {@link VirtualContentRender} to render scroll state specific content into the viewport\n * \n * Accepts props defined by {@link VirtualScrollProps}. \n * Refs are forwarded to {@link VirtualScrollProxy}. \n * @group Components\n */\nexport const VirtualScroll = React.forwardRef<VirtualScrollProxy, VirtualScrollProps>(function VirtualScroll(props, ref) {\n const { width, height, scrollWidth = 0, scrollHeight = 0, className, innerClassName, children,\n onScroll: onScrollCallback, useIsScrolling = false, useOffsets = true, innerRender, outerRender } = props;\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { totalOffset: currentVerticalOffset, renderSize: renderRowSize, onScroll: onScrollRow,\n doScrollTo: doScrollToRow, getCurrentOffset: getVerticalOffset } = useVirtualScroll(scrollHeight, props.maxCssSize, props.minNumPages, useOffsets);\n const { totalOffset: currentHorizontalOffset, renderSize: renderColumnSize, onScroll: onScrollColumn,\n doScrollTo: doScrollToColumn, getCurrentOffset: getHorizontalOffset} = useVirtualScroll(scrollWidth, props.maxCssSize, props.minNumPages, useOffsets);\n const isActuallyScrolling = useIsScrollingHook(outerRef);\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset?: number, columnOffset?: number): void {\n if (rowOffset === undefined && columnOffset === undefined)\n return;\n\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 scrollToArea(verticalOffset?: number, verticalSize?: number, horizontalOffset?: number, horizontalSize?: number, option?: ScrollToOption) {\n const outer = outerRef.current;\n /* istanbul ignore if*/\n if (!outer)\n return;\n\n const rowOffset = getOffsetToScrollRange(verticalOffset, verticalSize, outer.clientHeight, currentVerticalOffset, option);\n const colOffset = getOffsetToScrollRange(horizontalOffset, horizontalSize, outer.clientWidth, currentHorizontalOffset, option);\n this.scrollTo(rowOffset, colOffset);\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 get verticalOffset(): number { return getVerticalOffset(); },\n\n get horizontalOffset(): number { return getHorizontalOffset(); }\n }\n }, [ doScrollToRow, doScrollToColumn, currentVerticalOffset, currentHorizontalOffset, getVerticalOffset, getHorizontalOffset ]);\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 isScrolling = useIsScrolling ? isActuallyScrolling : undefined;\n const verticalOffset = currentVerticalOffset;\n const horizontalOffset = currentHorizontalOffset;\n\n return (\n <VirtualContainer className={className} render={outerRender} onScroll={onScroll} ref={outerRef} \n style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender} \n style={{ zIndex: 1, position: 'sticky', top: 0, left: 0, width: '100%', height: '100%' }}>\n {children({isScrolling, verticalOffset, horizontalOffset})}\n </VirtualContainer>\n <div style={{ position: 'absolute', top: 0, left: 0, \n height: scrollHeight ? renderRowSize : '100%', \n width: scrollWidth ? renderColumnSize : '100%'}}/>\n </VirtualContainer>\n );\n});\n\nexport default VirtualScroll;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n totalSize: 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, 0, []];\n }\n\n // Negative offset equivalent to reducing the size of the window (possibly down to nothing)\n if (scrollOffset < 0) {\n clientExtent += scrollOffset;\n scrollOffset = 0;\n }\n\n if (clientExtent <= 0) {\n return [0, 0, 0, []];\n }\n\n const [baseIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n if (baseIndex >= itemCount) {\n return [0, 0, 0, []];\n }\n\n let itemIndex = Math.max(0, Math.min(itemCount - 1, baseIndex));\n const endOffset = scrollOffset + clientExtent;\n\n const startIndex = itemIndex;\n let offset = startOffset;\n const sizes: number[] = [];\n let totalSize = 0;\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n totalSize += size;\n offset += size;\n itemIndex ++;\n }\n\n return [startIndex, startOffset, totalSize, sizes];\n}\n\nfunction formatRepeat(repeat: number, size: number): string {\n return (repeat == 1) ? `${size}px` : `repeat(${repeat},${size}px)`;\n}\n\nfunction join(a: string|undefined, s: string) {\n return a ? a + ' ' + s : s;\n}\n\nexport function getGridTemplate(sizes: number[]): string | undefined {\n const count = sizes.length;\n if (count == 0)\n return undefined;\n\n let ret = undefined;\n let lastSize = sizes[0];\n let repeat = 1;\n\n for (let i = 1; i < count; i ++) {\n const size = sizes[i];\n if (size == lastSize) {\n repeat ++;\n } else {\n const s = formatRepeat(repeat, lastSize);\n ret = join(ret,s);\n lastSize = size;\n repeat = 1;\n }\n }\n\n const s = formatRepeat(repeat, lastSize);\n return join(ret,s);\n}\n\n\n","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollLayout, DisplayBaseItemProps, DisplayBaseProps } from './VirtualBase';\nimport { getRangeToRender, getGridTemplate } from './VirtualCommon';\nimport { VirtualContainer } from './VirtualContainer';\n\n/**\n * Props accepted by {@link DisplayListItem}\n */\nexport interface DisplayListItemProps extends DisplayBaseItemProps {\n /** Index of item in the list being rendered */\n index: number,\n}\n\n/**\n * Type of item in a {@link DisplayList}\n *\n * Must be passed as a child to {@link DisplayList}. \n * Accepts props defined by {@link DisplayListItemProps}.\n * Component must pass {@link DisplayBaseItemProps.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 DisplayListItem = React.ComponentType<DisplayListItemProps>;\n\n/**\n * Props accepted by {@link DisplayList}\n */\nexport interface DisplayListProps extends DisplayBaseProps {\n /** Component used as a template to render items in the list. Must implement {@link DisplayListItem} interface. */\n children: DisplayListItem,\n\n /** Number of items in the list */\n itemCount: number,\n\n /** Offset to start of displayed content */\n offset: 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 DisplayBaseProps.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\nconst defaultItemKey = (index: number, _data: unknown) => index;\n\nconst boxStyle: React.CSSProperties = { boxSizing: 'border-box' };\n\n/**\n * Displays a window onto the contents of a virtualized list starting from `offset`.\n * \n * Accepts props defined by {@link DisplayListProps}. \n * You must pass a single instance of {@link DisplayListItem} as a child.\n * @group Components\n */\nexport function DisplayList(props: DisplayListProps) {\n const { width, height, itemCount, itemOffsetMapping, className, innerClassName, offset: renderOffset, children,\n itemData, itemKey = defaultItemKey, layout = 'vertical', outerRender, innerRender, isScrolling } = props;\n\n const isVertical = layout === 'vertical';\n\n const [startIndex, startOffset, renderSize, sizes] = getRangeToRender(itemCount, itemOffsetMapping, \n isVertical ? height : width, renderOffset);\n const template = getGridTemplate(sizes);\n const offset = startOffset - 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 return (\n <VirtualContainer className={className} render={outerRender}\n style={{ position: \"relative\", height, width, overflow: \"hidden\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender}\n style={{ position: 'absolute',\n display: 'grid',\n gridTemplateColumns: isVertical ? undefined : template,\n gridTemplateRows: isVertical ? template : undefined,\n top: isVertical ? offset : 0, \n left: isVertical ? 0 : offset, \n height: isVertical ? renderSize : \"100%\", \n width: isVertical ? \"100%\" : renderSize }}>\n {sizes.map((_size, arrayIndex) => (\n <ChildVar data={itemData} isScrolling={isScrolling} \n key={itemKey(startIndex + arrayIndex, itemData)} index={startIndex + arrayIndex} style={boxStyle}/>\n ))}\n </VirtualContainer>\n </VirtualContainer>\n );\n}\n\nexport default DisplayList;\n","import React, { Fragment } from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { DisplayBaseItemProps, DisplayBaseProps } from './VirtualBase';\nimport { getRangeToRender, getGridTemplate } from './VirtualCommon';\nimport { VirtualContainer } from './VirtualContainer';\n\n/**\n * Props accepted by {@link DisplayGridItem}\n */\nexport interface DisplayGridItemProps extends DisplayBaseItemProps {\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 DisplayGrid}\n *\n * Must be passed as a child to {@link DisplayGrid}. \n * Accepts props defined by {@link DisplayGridItemProps}.\n * Component must pass {@link DisplayBaseItemProps.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 DisplayGridItem = React.ComponentType<DisplayGridItemProps>;\n\n/**\n * Props accepted by {@link DisplayGrid}\n */\nexport interface DisplayGridProps extends DisplayBaseProps {\n /** Component used as a template to render items in the list. Must implement {@link DisplayGridItem} interface. */\n children: DisplayGridItem,\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 /** Vertical offset to start of displayed content */\n rowOffset: number,\n\n /** Horizontal offset to start of displayed content */\n columnOffset: number,\n\n /**\n * Function that defines the key to use for each item given row and column index and value of {@link DisplayBaseProps.itemData}.\n * @defaultValue `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`\n */\n itemKey?: (rowIndex: number, columnIndex: number, data: unknown) => React.Key,\n}\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: unknown) => `${rowIndex}:${columnIndex}`;\n\nconst boxStyle: React.CSSProperties = { boxSizing: 'border-box' };\n\n/**\n * Displays a window onto the contents of a virtualized grid starting from `rowOffset`, `columnOffset`.\n * \n * Accepts props defined by {@link DisplayGridProps}. \n * You must pass a single instance of {@link DisplayGridItem} as a child.\n * @group Components\n */\nexport function DisplayGrid(props: DisplayGridProps) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, className, innerClassName, \n rowOffset: rowRenderOffset, columnOffset: colRenderOffset, children,\n itemData, itemKey = defaultItemKey, outerRender, innerRender, isScrolling } = props;\n\n const [rowStartIndex, rowStartOffset, rowRenderSize, rowSizes] = getRangeToRender(rowCount, rowOffsetMapping, height, rowRenderOffset);\n const rowTemplate = getGridTemplate(rowSizes);\n\n const [colStartIndex, colStartOffset, colRenderSize, colSizes] = getRangeToRender(columnCount, columnOffsetMapping, width, colRenderOffset);\n const colTemplate = getGridTemplate(colSizes);\n\n const rowOffset = rowStartOffset - rowRenderOffset;\n const colOffset = colStartOffset - colRenderOffset;\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 return (\n <VirtualContainer className={className} render={outerRender}\n style={{ position: \"relative\", height, width, overflow: \"hidden\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender}\n style={{ position: 'absolute',\n display: 'grid',\n gridTemplateColumns: colTemplate,\n gridTemplateRows: rowTemplate,\n top: rowOffset, \n left: colOffset, \n height: rowRenderSize, \n width: colRenderSize }}>\n {rowSizes.map((_rowSize, rowIndex) => (\n <Fragment key={itemKey(rowStartIndex + rowIndex, 0, itemData)}>\n {colSizes.map((_size, colIndex) => (\n <ChildVar data={itemData} isScrolling={isScrolling} \n key={itemKey(rowStartIndex + rowIndex, colStartIndex + colIndex, itemData)} \n rowIndex={rowStartIndex + rowIndex} columnIndex={colStartIndex + colIndex} style={boxStyle}/>\n ))}\n </Fragment>\n ))}\n </VirtualContainer>\n </VirtualContainer>\n );\n}\n\nexport default DisplayGrid;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollToOption } from './VirtualBase';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\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 * @param option - Where to {@link ScrollToOption | position} the item within the viewport\n */\n scrollToItem(rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void;\n\n /** Exposes DOM clientWidth property */\n get clientWidth(): number;\n\n /** Exposes DOM clientHeight property */\n get clientHeight(): number;\n\n /** Current vertical position of scroll bar */\n get verticalOffset(): number;\n\n /** Current horizontal position of scroll bar */\n get horizontalOffset(): number;\n}\n\n/** Range to scroll to in one dimension specified as (offset,size). May be undefined if no need to scroll. */\nexport type ScrollRange = [ offset: number|undefined, size: number|undefined ];\n\n/**\n * Returns the {@link ScrollRange} corresponding to a specified item.\n * \n * Used internally to implement {@link VirtualGridProxy.scrollToItem}. Can be used directly for \n * advanced customization scenarios.\n */\nexport function getRangeToScroll(index: number | undefined, mapping: ItemOffsetMapping): ScrollRange {\n if (index === undefined)\n return [undefined, undefined];\n\n return [mapping.itemOffset(index), mapping.itemSize(index)];\n}\n\n/**\n * Same logic as {@link VirtualGridProxy.scrollToItem} usable with your own {@link VirtualScroll}\n * \n * You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayGrid} for\n * advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.\n */\nexport function virtualGridScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy>, rowOffsetMapping: ItemOffsetMapping, \n columnOffsetMapping: ItemOffsetMapping, rowIndex?: number, columnIndex?: number, option?: ScrollToOption) {\n\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n const [rowOffset, rowSize] = getRangeToScroll(rowIndex, rowOffsetMapping);\n const [colOffset, colSize] = getRangeToScroll(columnIndex, columnOffsetMapping);\n\n scroll.scrollToArea(rowOffset, rowSize, colOffset, colSize, option);\n}\n","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { VirtualBaseProps, ScrollToOption } from './VirtualBase';\nimport { DisplayGrid, DisplayGridItem } from './DisplayGrid';\nimport { VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScroll } from './VirtualScroll';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\nimport { virtualGridScrollToItem, VirtualGridProxy } from './VirtualGridProxy';\nimport { AutoSizer } from './AutoSizer';\nimport { ScrollState } from './useVirtualScroll';\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 DisplayGridItem} interface. */\n children: DisplayGridItem,\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 `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`\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 VirtualContainerRender}. Used to customize {@link VirtualGrid} outer container. */\n outerRender?: VirtualContainerRender;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayGrid} within {@link VirtualGrid} inner container. */\n innerRender?: VirtualContainerRender;\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 DisplayGridItem} as a child.\n * @group Components\n */\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, \n innerClassName, innerRender, itemData, itemKey, onScroll: onScrollCallback, ...scrollProps } = 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 scrollRef = React.useRef<VirtualScrollProxy>(null);\n\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset?: number, columnOffset?: number): void {\n const scroll = scrollRef.current;\n /* istanbul ignore else */\n if (scroll)\n scroll.scrollTo(rowOffset, columnOffset);\n },\n\n scrollToItem(rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void {\n virtualGridScrollToItem(scrollRef, rowOffsetMapping, columnOffsetMapping, rowIndex, columnIndex, option);\n },\n\n get clientWidth(): number {\n return scrollRef.current ? scrollRef.current.clientWidth : /* istanbul ignore next */ 0;\n },\n\n get clientHeight(): number {\n return scrollRef.current ? scrollRef.current.clientHeight : /* istanbul ignore next */ 0;\n },\n\n get verticalOffset(): number {\n return scrollRef.current ? scrollRef.current.verticalOffset : /* istanbul ignore next */ 0;\n },\n\n get horizontalOffset(): number {\n return scrollRef.current ? scrollRef.current.horizontalOffset : /* istanbul ignore next */ 0;\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping ]);\n\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 return (\n <VirtualScroll\n ref={scrollRef}\n {...scrollProps}\n scrollHeight={totalRowSize}\n scrollWidth={totalColumnSize}\n onScroll={(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState) => {\n if (onScrollCallback)\n onScrollCallback(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState);\n }}>\n {({ isScrolling, verticalOffset, horizontalOffset }) => (\n <AutoSizer style={{ height: '100%', width: '100%' }}>\n {({height,width}) => (\n <DisplayGrid\n innerClassName={innerClassName}\n innerRender={innerRender}\n rowOffset={verticalOffset}\n columnOffset={horizontalOffset}\n height={height}\n rowCount={rowCount}\n columnCount={columnCount}\n itemData={itemData}\n itemKey={itemKey}\n isScrolling={isScrolling}\n rowOffsetMapping={rowOffsetMapping}\n columnOffsetMapping={columnOffsetMapping}\n width={width}>\n {ChildVar}\n </DisplayGrid>\n )}\n </AutoSizer>\n )}\n </VirtualScroll>\n );\n});\n\nexport default VirtualGrid;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollToOption } from './VirtualBase';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\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 * @param option - Where to {@link ScrollToOption | position} the item within the viewport\n */\n scrollToItem(index: number, option?: ScrollToOption): void;\n\n /** Current scroll position */\n get offset(): number;\n}\n\n/**\n * Same logic as {@link VirtualListProxy.scrollToItem} usable with your own {@link VirtualScroll}\n * \n * You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayList} for\n * advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.\n */\nexport function virtualListScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy>, itemOffsetMapping: ItemOffsetMapping, isVertical: boolean,\n index: number, option?: ScrollToOption) {\n\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n const itemOffset = itemOffsetMapping.itemOffset(index);\n const itemSize = itemOffsetMapping.itemSize(index);\n\n if (isVertical)\n scroll.scrollToArea(itemOffset, itemSize, undefined, undefined, option);\n else\n scroll.scrollToArea(undefined, undefined, itemOffset, itemSize, option);\n}","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { VirtualBaseProps, ScrollToOption, ScrollLayout } from './VirtualBase';\nimport { DisplayList, DisplayListItem } from './DisplayList';\nimport { VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScroll } from './VirtualScroll';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\nimport { virtualListScrollToItem, VirtualListProxy } from './VirtualListProxy';\nimport { AutoSizer } from './AutoSizer';\nimport { ScrollState } from './useVirtualScroll';\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 DisplayListItem} interface. */\n children: DisplayListItem,\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 VirtualContainerRender}. Used to customize {@link VirtualList} outer container. */\n outerRender?: VirtualContainerRender;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayList} within {@link VirtualList} inner container. */\n innerRender?: VirtualContainerRender;\n}\n\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 DisplayListItem} as a child.\n * @group Components\n */\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { itemCount, itemOffsetMapping, children, layout = 'vertical', onScroll: onScrollCallback,\n innerClassName, innerRender, itemData, itemKey, ...scrollProps } = props;\n\n // Total size is same as offset to item one off the end\n const renderSize = itemOffsetMapping.itemOffset(itemCount);\n\n const scrollRef = React.useRef<VirtualScrollProxy>(null);\n const isVertical = layout === 'vertical';\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n if (isVertical)\n scroll.scrollTo(offset, undefined);\n else\n scroll.scrollTo(undefined, offset);\n },\n\n scrollToItem(index: number, option?: ScrollToOption): void {\n virtualListScrollToItem(scrollRef, itemOffsetMapping, isVertical, index, option);\n },\n\n get offset(): number {\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return 0;\n\n return isVertical ? scroll.verticalOffset : scroll.horizontalOffset;\n }\n }\n }, [ itemOffsetMapping, isVertical ]);\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 return (\n <VirtualScroll\n ref={scrollRef}\n {...scrollProps}\n scrollHeight={isVertical ? renderSize : undefined}\n scrollWidth={isVertical ? undefined : renderSize}\n onScroll={(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState) => {\n const newOffset = isVertical ? verticalOffset : horizontalOffset;\n if (onScrollCallback)\n onScrollCallback(newOffset, isVertical ? verticalScrollState : horizontalScrollState);\n }}>\n {({ isScrolling, verticalOffset, horizontalOffset }) => (\n <AutoSizer style={{ height: '100%', width: '100%' }}>\n {({height,width}) => (\n <DisplayList\n innerClassName={innerClassName}\n innerRender={innerRender}\n layout={layout}\n offset={isVertical ? verticalOffset : horizontalOffset}\n height={height}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={itemKey}\n isScrolling={isScrolling}\n itemOffsetMapping={itemOffsetMapping}\n width={width}>\n {ChildVar}\n </DisplayList>\n )}\n </AutoSizer>\n )}\n </VirtualScroll>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping, FixedSizeItemOffsetMapping } from '@candidstartup/infinisheet-types';\nexport type { ItemOffsetMapping } from '@candidstartup/infinisheet-types';\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, VariableSizeItemOffsetMapping } from '@candidstartup/infinisheet-types';\nexport type { ItemOffsetMapping } from '@candidstartup/infinisheet-types';\n\n/**\n * Returns an instance of {@link ItemOffsetMapping}\n * 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;\n"],"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AAG,cAAc,GAAG,gBAAgB;AAChE,YAAA,IAAI,gBAAgB;AAClB,gBAAA,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,mBAAmB,GAAG,qBAAqB,CAAC;SACxF,EAAA,QAAA,EACA,CAAC,EAAE,WAAW,EAAE,cAAc,EAAE,gBAAgB,EAAE,MACjDA,GAAA,CAAC,SAAS,EAAC,EAAA,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAClD,CAAC,EAAC,MAAM,EAAC,KAAK,EAAC,MACdA,GAAC,CAAA,WAAW,IACV,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,gBAAgB,EACtD,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,KAAK,YACX,QAAQ,EAAA,CACC,CACf,EACW,CAAA,CACX,EACa,CAAA;AAEpB,CAAC;;AC3ID;;;;AAIG;AACG,SAAU,6BAA6B,CAAC,QAAgB,EAAA;AAC5D,IAAA,OAAO,IAAI,0BAA0B,CAAC,QAAQ,CAAC;AACjD;;ACPA;;;;;;AAMG;AACa,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC;AACxE;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/VirtualContainer.tsx","../src/AutoSizer.tsx","../src/useVirtualScroll.ts","../src/useEventListener.ts","../src/useAnimationTimeout.ts","../src/useIsScrolling.ts","../src/VirtualScrollProxy.ts","../src/VirtualScroll.tsx","../src/VirtualCommon.ts","../src/DisplayList.tsx","../src/DisplayGrid.tsx","../src/VirtualGridProxy.ts","../src/VirtualGrid.tsx","../src/VirtualListProxy.ts","../src/VirtualList.tsx","../src/useFixedSizeItemOffsetMapping.ts","../src/useVariableSizeItemOffsetMapping.ts"],"sourcesContent":["import React from \"react\";\n\n/**\n * Props that an implementation of {@link VirtualContainerRender} must accept.\n * \n * Includes all the props that a {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLDivElement | HTMLDivElement} would accept.\n */\nexport type VirtualContainerRenderProps = React.ComponentPropsWithoutRef<'div'>;\n\n/**\n * Render prop for a {@link VirtualContainer}\n *\n * Can be passed to {@link VirtualContainer} to replace default implementation. \n * Function must render a div and forward {@link VirtualContainerRenderProps}\n * and any `ref` to it. \n * \n * @example Minimal compliant implementation\n * ```\n * const containerRender: VirtualContainerRender = ({...rest}, ref) => (\n * <div ref={ref} {...rest} />\n * )\n * ```\n */\nexport type VirtualContainerRender = (props: VirtualContainerRenderProps, ref?: React.ForwardedRef<HTMLDivElement>) => React.JSX.Element;\n\n/**\n * Props that {@link VirtualContainer} accepts.\n */\nexport interface VirtualContainerComponentProps extends VirtualContainerRenderProps {\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualContainer}. */\n render?: VirtualContainerRender | undefined;\n}\n\nconst defaultContainerRender: VirtualContainerRender = ({...rest}, ref) => (\n <div ref={ref} {...rest} />\n)\n\n/**\n * Wrapper around a div used by other components in {@link @candidstartup/react-virtual-scroll!}. Most props are passed through to the div. Use the\n * {@link VirtualContainerComponentProps.render} prop to override the default behavior. \n * \n * @group Components\n */\nexport const VirtualContainer = React.forwardRef<HTMLDivElement, VirtualContainerComponentProps >(\n function VirtualContainer({render = defaultContainerRender, ...rest}, ref) {\n return render(rest, ref)\n})\n","import React from \"react\";\n\n/**\n * Props that an implementation of {@link AutoSizerRender} must accept.\n */\nexport interface AutoSizerRenderProps {\n /** Computed height */\n height: number,\n\n /** Computed width */\n width: number,\n}\n\n/**\n * Render prop for content in an {@link AutoSizer}\n *\n * Function renders content and forwards `width` and `height`\n * to whatever needs it.\n * \n * @example Simple implementation\n * ```\n * const autoSizeRender: AutoSizeRender = ({width, height}) => (\n * <VirtualList width={width} height={height} {...props} />\n * )\n * ```\n */\nexport type AutoSizerRender = (props: AutoSizerRenderProps) => React.JSX.Element;\n\n/**\n * Props accepted by {@link AutoSizer}\n */\nexport interface AutoSizerProps {\n /** Function implementing {@link AutoSizerRender} that renders the content that needs explicit sizing */\n children: AutoSizerRender\n\n /** The `className` applied to the container element */\n className?: string | undefined,\n\n /** Inline style to apply to the container element */\n style?: React.CSSProperties | undefined;\n}\n\n/**\n * HOC that calculates the size available to it and makes the computed size available to children.\n * The size available depends on DOM layout and style applied wherever the AutoSizer finds itself.\n * You will probably want to pass something appropriate via the `className` or `style` props.\n * \n * Accepts props defined by {@link AutoSizerProps}. \n * You must pass a single instance of {@link AutoSizerRender} as a child.\n * @group Components\n */\nexport function AutoSizer(props: AutoSizerProps) {\n const { children, className, style } = props;\n\n // Using separate primitive states rather than one composite so that React\n // can detect duplicates values and bail out of redundant renders.\n const [width, setWidth] = React.useState<number>(0);\n const [height, setHeight] = React.useState<number>(0);\n const ref = React.useRef<HTMLDivElement>(null);\n\n // Make sure resize callback is a stable value so we're not constantly\n // creating and disconnecting resize observers.\n const resizeCallback: ResizeObserverCallback = React.useCallback((entries) => {\n entries.forEach(entry => {\n if (entry?.contentBoxSize[0]) {\n // Context box sizes can contain fractional values while clientWidth\n // and clientHeight properties are always rounded to nearest integer.\n // Always use integer values to avoid confusion.\n const newWidth = Math.round(entry.contentBoxSize[0].inlineSize);\n setWidth(newWidth);\n const newHeight = Math.round(entry.contentBoxSize[0].blockSize);\n setHeight(newHeight);\n }\n })\n }, []);\n\n // Expect effect to run only on initial mount\n React.useLayoutEffect(() => {\n const div = ref.current;\n /* istanbul ignore if*/\n if (!div)\n return;\n\n // Size on initial mount\n setHeight(div.clientHeight);\n setWidth(div.clientWidth);\n\n // Updates size on any subsequent resize. Only available in browser\n // environment so avoid crashing out when server side rendering, or\n // running unit test without ResizeObserver being mocked. \n if (typeof ResizeObserver !== 'undefined') {\n const resizeObserver = new ResizeObserver(resizeCallback);\n resizeObserver.observe(div);\n return () => { resizeObserver.disconnect() }\n }\n }, [resizeCallback])\n\n // No point rendering children until we've measured size and found a usable area\n const renderChildren = height > 0 && width > 0;\n\n // Ensure that size is driven only by parent. Wrapping child in a zero sized inner div\n // which it can overflow stops child's size having any impact on size of outer div. \n // Otherwise can end up in infinite loop if child makes itself bigger than the \n // actual width and height we pass to it. That could be because child has \n // padding/borders/margins or because child renders itself bigger than size it's given.\n return (\n <div ref={ref} className={className} style={style}>\n <div style={{ overflow: 'visible', width: 0, height: 0 }}>\n {renderChildren && children({height, width})}\n </div>\n </div>\n );\n}\n\nexport default AutoSizer;\n","import { useState, useRef, RefObject } 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. Total 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 VirtualScrollState {\n /** Snapshot of overall offset at last render */\n totalOffset: number;\n\n /** Physical size of scrollable area */\n renderSize: number;\n\n // Returns updated scrollOffset. Caller should update scroll bar position if different from value passed in. \n onScroll(this: void, 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(this: void, offset: number, clientExtent: number): number;\n\n // Returns current overall offset (NOT a snapshot)\n getCurrentOffset(this: void): number;\n\n // Internal scroll state. Most scenarios will never need to access this. Mainly here for unit test.\n // scrollState.current is never null but needed to add \"|null\" to type to maintain backwards compatibility\n // with React 18. Can remove when we drop React 18 support.\n scrollState: RefObject<ScrollState|null>;\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\n/** Custom hook that implements logic for paged virtual scrolling in a single dimension */\nexport function useVirtualScroll(totalSize: number, maxCssSize = MAX_SUPPORTED_CSS_SIZE, minNumberPages = MIN_NUMBER_PAGES, \n useTotalOffset = true): VirtualScrollState {\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 [totalOffset, setTotalOffset] = useState<number>(0);\n const scrollState = useRef(initValue);\n\n function onScroll(clientExtent: number, scrollExtent: number, scrollOffset: number): [number, ScrollState] {\n const currState = scrollState.current;\n if (currState.scrollOffset == scrollOffset) {\n // No need to change state if scroll position unchanged\n return [scrollOffset, currState];\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 = currState.scrollOffset <= newOffset ? 'forward' : 'backward';\n\n // Switch pages if needed\n let newPage, newRenderOffset;\n let retScrollOffset = scrollOffset;\n const scrollDist = Math.abs(newOffset - currState.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 + currState.renderOffset) / pageSize));\n newRenderOffset = pageToRenderOffset(newPage);\n if (newPage != currState.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 + currState.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 scrollState.current = newScrollState;\n if (useTotalOffset)\n setTotalOffset(newOffset + newRenderOffset);\n return [retScrollOffset, newScrollState];\n }\n\n function doScrollTo(offset: number, clientExtent: number) {\n const currState = scrollState.current;\n const safeOffset = Math.min(totalSize - clientExtent, Math.max(offset, 0));\n const scrollDirection = (currState.scrollOffset + currState.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 scrollState.current = { scrollOffset, renderOffset, page, scrollDirection };\n if (useTotalOffset)\n setTotalOffset(scrollOffset + renderOffset);\n return scrollOffset;\n }\n\n function getCurrentOffset() {\n const currState = scrollState.current;\n return currState.scrollOffset + currState.renderOffset;\n }\n\n return {totalOffset, renderSize, onScroll, doScrollTo, getCurrentOffset, scrollState} 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 | undefined\n once?: boolean | undefined\n passive?: boolean | undefined\n}\n\ntype Listener = Window | Document | HTMLElement;\n\nfunction isListener(element: Listener | RefObject<HTMLElement|null>): 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> | null = window, \n options: Options = {}) {\n const savedHandler = useRef<EventHandler>(undefined);\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 = { \n ...(capture !== undefined ? { capture } : {}), \n ...(passive !== undefined ? { passive } : {}), \n ...(once !== undefined ? { once } : {})\n };\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>(undefined);\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> | 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 { ScrollToOption } from './VirtualBase';\n\n/**\n * Custom ref handle returned by {@link VirtualScroll} that exposes imperative methods\n * \n * Use `React.useRef<VirtualScrollProxy>(null)` to create a ref.\n */\nexport interface VirtualScrollProxy {\n /**\n * Scrolls to the specified vertical and horizontal offset in pixels\n * Either offset can be left undefined to scroll in one dimension only\n * @param verticalOffset - Offset to scroll to vertically\n * @param horizontalOffset - Offset to scroll to horizontally\n */\n scrollTo(verticalOffset?: number, horizontalOffset?: number): void;\n\n /**\n * Scrolls to the specified area\n * Either offset/size pair can be left undefined to scroll in one dimension only\n * @param verticalOffset - Offset to scroll to vertically\n * @param verticalSize - Size of target area vertically\n * @param horizontalOffset - Offset to scroll to horizontally\n * @param horizontalSize - Size of target area horizontally\n * @param option - Where to {@link ScrollToOption | position} the area within the viewport\n */\n scrollToArea(verticalOffset?: number, verticalSize?: number, horizontalOffset?: number, horizontalSize?: number, option?: ScrollToOption): void;\n\n /** Exposes DOM clientWidth property */\n get clientWidth(): number;\n\n /** Exposes DOM clientHeight property */\n get clientHeight(): number;\n\n /** Current vertical position of scroll bar */\n get verticalOffset(): number;\n\n /** Current horizontal position of scroll bar */\n get horizontalOffset(): number;\n}\n\n/**\n * Returns the offset needed to scroll in one dimension for a specified range\n * \n * Used internally to implement {@link VirtualScrollProxy.scrollToArea}. Can be used directly for \n * advanced customization scenarios.\n */\nexport function getOffsetToScrollRange(offset: number | undefined, size: number | undefined, \n clientExtent: number, scrollOffset: number, option?: ScrollToOption): number | undefined\n{\n if (offset === undefined)\n return undefined;\n\n if (option != 'visible')\n return offset;\n\n // Start of item offscreen before start of viewport?\n if (offset < scrollOffset)\n return offset;\n\n size = size || 0;\n\n // Already completely visible?\n const endOffset = offset + size;\n const endViewport = scrollOffset + clientExtent;\n if (endOffset <= endViewport)\n return undefined;\n\n // Item offscreen past end of viewport\n\n // Item bigger than viewport? Make sure start is in view\n if (size > clientExtent)\n return offset;\n\n // Scroll so end of item aligns with end of viewport\n return offset - clientExtent + size;\n }\n","import React from \"react\";\nimport { VirtualContainer, VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScrollableProps, ScrollEvent, ScrollToOption } from './VirtualBase';\nimport { useVirtualScroll, ScrollState } from './useVirtualScroll';\nimport { useIsScrolling as useIsScrollingHook} from './useIsScrolling';\nimport { getOffsetToScrollRange, VirtualScrollProxy } from './VirtualScrollProxy';\n\n/**\n * Props that an implementation of {@link VirtualContentRender} must accept.\n */\nexport interface VirtualContentProps {\n /** \n * Is the owning component being actively scrolled? Used to change how the content is rendered depending on scroll state.\n * \n * Only defined if {@link VirtualScrollableProps.useIsScrolling} is true. \n * */\n isScrolling?: boolean | undefined,\n\n /** Current scroll position vertical offset */\n verticalOffset: number,\n\n /** Current scroll position horizontal offset */\n horizontalOffset: number\n}\n\n/**\n * Render prop for content in {@link VirtualScroll}\n *\n * Pass as child to {@link VirtualScroll} to render content and forward {@link VirtualContentProps}\n * to whatever needs them. \n * \n * @example Simple implementation\n * ```\n * const contentRender: VirtualContentRender = ({isScrolling, verticalOffset, horizontalOffset}) => (\n * <DisplayGrid\n * isScrolling={isScrolling}\n * rowOffset={verticalOffset}\n * columnOffset={horizontalOffset}\n * {...rest}/>\n * )\n * ```\n */\nexport type VirtualContentRender = (props: VirtualContentProps, ref?: React.ForwardedRef<HTMLDivElement>) => React.JSX.Element;\n\n/**\n * Callback after a scroll event has been processed and state updated but before rendering\n * @param verticalOffset - Resulting overall vertical offset. \n * @param horizontalOffset - Resulting overall horizontal offset.\n * @param newVerticalScrollState - New vertical {@link ScrollState} that will be used for rendering.\n * @param newHorizontalScrollState - New horizontal {@link ScrollState} that will be used for rendering.\n */\nexport type VirtualScrollHandler = (verticalOffset: number, horizontalOffset: number, \n newVerticalScrollState: ScrollState, newHorizontalScrollState: ScrollState) => void\n\n/**\n * Props accepted by {@link VirtualScroll}\n */\nexport interface VirtualScrollProps extends VirtualScrollableProps {\n /** Function implementing {@link VirtualContentRender} that renders the content that needs to respond to scrolling */\n children: VirtualContentRender\n\n /** \n * Height of area to scroll over \n * \n * @defaultValue 0\n */\n scrollHeight?: number | undefined,\n\n /** \n * Width of area to scroll over \n * \n * @defaultValue 0\n */\n scrollWidth?: number | undefined,\n\n /** \n * Determines whether the component should pass {@link VirtualContentProps.verticalOffset|verticalOffset} and \n * {@link VirtualContentProps.horizontalOffset|horizontalOffset} to children when rendering.\n * \n * Can reduce the number of renders needed if these props aren't used\n * \n * @defaultValue true\n * */\n useOffsets?: boolean | undefined,\n\n /** Scroll handler implementing {@link VirtualScrollHandler} called after a scroll event has been processed and state updated. */\n onScroll?: VirtualScrollHandler | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} outer container. */\n outerRender?: VirtualContainerRender | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualScroll} inner container. */\n innerRender?: VirtualContainerRender | undefined;\n}\n\n// Using a named function rather than => so that the name shows up in React Developer Tools\n/**\n * Customizable Virtual Scrolling Component\n * \n * Allows user to scroll over a virtual area `scrollHeight` x `scrollWidth` pixels. \n * Use `onScroll` to track scroll state and {@link VirtualContentRender} to render scroll state specific content into the viewport\n * \n * Accepts props defined by {@link VirtualScrollProps}. \n * Refs are forwarded to {@link VirtualScrollProxy}. \n * @group Components\n */\nexport const VirtualScroll = React.forwardRef<VirtualScrollProxy, VirtualScrollProps>(function VirtualScroll(props, ref) {\n const { width, height, scrollWidth = 0, scrollHeight = 0, className, innerClassName, children,\n onScroll: onScrollCallback, useIsScrolling = false, useOffsets = true, innerRender, outerRender } = props;\n\n const outerRef = React.useRef<HTMLDivElement>(null);\n const { totalOffset: currentVerticalOffset, renderSize: renderRowSize, onScroll: onScrollRow,\n doScrollTo: doScrollToRow, getCurrentOffset: getVerticalOffset } = useVirtualScroll(scrollHeight, props.maxCssSize, props.minNumPages, useOffsets);\n const { totalOffset: currentHorizontalOffset, renderSize: renderColumnSize, onScroll: onScrollColumn,\n doScrollTo: doScrollToColumn, getCurrentOffset: getHorizontalOffset} = useVirtualScroll(scrollWidth, props.maxCssSize, props.minNumPages, useOffsets);\n const isActuallyScrolling = useIsScrollingHook(outerRef);\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset?: number, columnOffset?: number): void {\n if (rowOffset === undefined && columnOffset === undefined)\n return;\n\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 scrollToArea(verticalOffset?: number, verticalSize?: number, horizontalOffset?: number, horizontalSize?: number, option?: ScrollToOption) {\n const outer = outerRef.current;\n /* istanbul ignore if*/\n if (!outer)\n return;\n\n const rowOffset = getOffsetToScrollRange(verticalOffset, verticalSize, outer.clientHeight, currentVerticalOffset, option);\n const colOffset = getOffsetToScrollRange(horizontalOffset, horizontalSize, outer.clientWidth, currentHorizontalOffset, option);\n this.scrollTo(rowOffset, colOffset);\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 get verticalOffset(): number { return getVerticalOffset(); },\n\n get horizontalOffset(): number { return getHorizontalOffset(); }\n }\n }, [ doScrollToRow, doScrollToColumn, currentVerticalOffset, currentHorizontalOffset, getVerticalOffset, getHorizontalOffset ]);\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 isScrolling = useIsScrolling ? isActuallyScrolling : undefined;\n const verticalOffset = currentVerticalOffset;\n const horizontalOffset = currentHorizontalOffset;\n\n return (\n <VirtualContainer className={className} render={outerRender} onScroll={onScroll} ref={outerRef} \n style={{ position: \"relative\", height, width, overflow: \"auto\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender} \n style={{ zIndex: 1, position: 'sticky', top: 0, left: 0, width: '100%', height: '100%' }}>\n {children({isScrolling, verticalOffset, horizontalOffset})}\n </VirtualContainer>\n <div style={{ position: 'absolute', top: 0, left: 0, \n height: scrollHeight ? renderRowSize : '100%', \n width: scrollWidth ? renderColumnSize : '100%'}}/>\n </VirtualContainer>\n );\n});\n\nexport default VirtualScroll;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\n\ntype RangeToRender = [\n startIndex: number,\n startOffset: number,\n totalSize: 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, 0, []];\n }\n\n // Negative offset equivalent to reducing the size of the window (possibly down to nothing)\n if (scrollOffset < 0) {\n clientExtent += scrollOffset;\n scrollOffset = 0;\n }\n\n if (clientExtent <= 0) {\n return [0, 0, 0, []];\n }\n\n const [baseIndex, startOffset] = itemOffsetMapping.offsetToItem(scrollOffset);\n if (baseIndex >= itemCount) {\n return [0, 0, 0, []];\n }\n\n let itemIndex = Math.max(0, Math.min(itemCount - 1, baseIndex));\n const endOffset = scrollOffset + clientExtent;\n\n const startIndex = itemIndex;\n let offset = startOffset;\n const sizes: number[] = [];\n let totalSize = 0;\n\n while (offset < endOffset && itemIndex < itemCount) {\n const size = itemOffsetMapping.itemSize(itemIndex);\n sizes.push(size);\n totalSize += size;\n offset += size;\n itemIndex ++;\n }\n\n return [startIndex, startOffset, totalSize, sizes];\n}\n\nfunction formatRepeat(repeat: number, size: number): string {\n return (repeat == 1) ? `${size}px` : `repeat(${repeat},${size}px)`;\n}\n\nfunction join(a: string|undefined, s: string) {\n return a ? a + ' ' + s : s;\n}\n\nexport function getGridTemplate(sizes: number[]): string | undefined {\n const count = sizes.length;\n if (count == 0)\n return undefined;\n\n let ret = undefined;\n let lastSize = sizes[0]!;\n let repeat = 1;\n\n for (let i = 1; i < count; i ++) {\n const size = sizes[i]!;\n if (size == lastSize) {\n repeat ++;\n } else {\n const s = formatRepeat(repeat, lastSize);\n ret = join(ret,s);\n lastSize = size;\n repeat = 1;\n }\n }\n\n const s = formatRepeat(repeat, lastSize);\n return join(ret,s);\n}\n\n\n","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollLayout, DisplayBaseItemProps, DisplayBaseProps } from './VirtualBase';\nimport { getRangeToRender, getGridTemplate } from './VirtualCommon';\nimport { VirtualContainer } from './VirtualContainer';\n\n/**\n * Props accepted by {@link DisplayListItem}\n */\nexport interface DisplayListItemProps extends DisplayBaseItemProps {\n /** Index of item in the list being rendered */\n index: number,\n}\n\n/**\n * Type of item in a {@link DisplayList}\n *\n * Must be passed as a child to {@link DisplayList}. \n * Accepts props defined by {@link DisplayListItemProps}.\n * Component must pass {@link DisplayBaseItemProps.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 DisplayListItem = React.ComponentType<DisplayListItemProps>;\n\n/** \n * Function that defines the key to use for each item given item index and value of {@link DisplayBaseProps.itemData}.\n */\nexport type ListItemKey = (index: number, data: unknown) => React.Key;\n\n/**\n * Props accepted by {@link DisplayList}\n */\nexport interface DisplayListProps extends DisplayBaseProps {\n /** Component used as a template to render items in the list. Must implement {@link DisplayListItem} interface. */\n children: DisplayListItem,\n\n /** Number of items in the list */\n itemCount: number,\n\n /** Offset to start of displayed content */\n offset: 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 implementing {@link ListItemKey} that defines the key to use for each item.\n * @defaultValue `(index, _data) => index`\n */\n itemKey?: ListItemKey | undefined,\n\n /**\n * Choice of 'vertical' or 'horizontal' layouts\n * @defaultValue 'vertical'\n */\n layout?: ScrollLayout | undefined,\n}\n\nconst defaultItemKey = (index: number, _data: unknown) => index;\n\nconst boxStyle: React.CSSProperties = { boxSizing: 'border-box' };\n\n/**\n * Displays a window onto the contents of a virtualized list starting from `offset`.\n * \n * Accepts props defined by {@link DisplayListProps}. \n * You must pass a single instance of {@link DisplayListItem} as a child.\n * @group Components\n */\nexport function DisplayList(props: DisplayListProps) {\n const { width, height, itemCount, itemOffsetMapping, className, innerClassName, offset: renderOffset, children,\n itemData, itemKey = defaultItemKey, layout = 'vertical', outerRender, innerRender, isScrolling } = props;\n\n const isVertical = layout === 'vertical';\n\n const [startIndex, startOffset, renderSize, sizes] = getRangeToRender(itemCount, itemOffsetMapping, \n isVertical ? height : width, renderOffset);\n const template = getGridTemplate(sizes);\n const offset = startOffset - 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 return (\n <VirtualContainer className={className} render={outerRender}\n style={{ position: \"relative\", height, width, overflow: \"hidden\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender}\n style={{ position: 'absolute',\n display: 'grid',\n gridTemplateColumns: isVertical ? undefined : template,\n gridTemplateRows: isVertical ? template : undefined,\n top: isVertical ? offset : 0, \n left: isVertical ? 0 : offset, \n height: isVertical ? renderSize : \"100%\", \n width: isVertical ? \"100%\" : renderSize }}>\n {sizes.map((_size, arrayIndex) => (\n <ChildVar data={itemData} isScrolling={isScrolling} \n key={itemKey(startIndex + arrayIndex, itemData)} index={startIndex + arrayIndex} style={boxStyle}/>\n ))}\n </VirtualContainer>\n </VirtualContainer>\n );\n}\n\nexport default DisplayList;\n","import React, { Fragment } from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { DisplayBaseItemProps, DisplayBaseProps } from './VirtualBase';\nimport { getRangeToRender, getGridTemplate } from './VirtualCommon';\nimport { VirtualContainer } from './VirtualContainer';\n\n/**\n * Props accepted by {@link DisplayGridItem}\n */\nexport interface DisplayGridItemProps extends DisplayBaseItemProps {\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 DisplayGrid}\n *\n * Must be passed as a child to {@link DisplayGrid}. \n * Accepts props defined by {@link DisplayGridItemProps}.\n * Component must pass {@link DisplayBaseItemProps.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 DisplayGridItem = React.ComponentType<DisplayGridItemProps>;\n\n/**\n * Function that defines the key to use for each item given row and column index and value of {@link DisplayBaseProps.itemData}.\n */\nexport type GridItemKey = (rowIndex: number, columnIndex: number, data: unknown) => React.Key;\n\n/**\n * Props accepted by {@link DisplayGrid}\n */\nexport interface DisplayGridProps extends DisplayBaseProps {\n /** Component used as a template to render items in the list. Must implement {@link DisplayGridItem} interface. */\n children: DisplayGridItem,\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 /** Vertical offset to start of displayed content */\n rowOffset: number,\n\n /** Horizontal offset to start of displayed content */\n columnOffset: number,\n\n /**\n * Function implementing {@link GridItemKey} that defines the key to use for each item.\n * @defaultValue `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`\n */\n itemKey?: GridItemKey | undefined,\n}\n\nconst defaultItemKey = (rowIndex: number, columnIndex: number, _data: unknown) => `${rowIndex}:${columnIndex}`;\n\nconst boxStyle: React.CSSProperties = { boxSizing: 'border-box' };\n\n/**\n * Displays a window onto the contents of a virtualized grid starting from `rowOffset`, `columnOffset`.\n * \n * Accepts props defined by {@link DisplayGridProps}. \n * You must pass a single instance of {@link DisplayGridItem} as a child.\n * @group Components\n */\nexport function DisplayGrid(props: DisplayGridProps) {\n const { width, height, rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, className, innerClassName, \n rowOffset: rowRenderOffset, columnOffset: colRenderOffset, children,\n itemData, itemKey = defaultItemKey, outerRender, innerRender, isScrolling } = props;\n\n const [rowStartIndex, rowStartOffset, rowRenderSize, rowSizes] = getRangeToRender(rowCount, rowOffsetMapping, height, rowRenderOffset);\n const rowTemplate = getGridTemplate(rowSizes);\n\n const [colStartIndex, colStartOffset, colRenderSize, colSizes] = getRangeToRender(columnCount, columnOffsetMapping, width, colRenderOffset);\n const colTemplate = getGridTemplate(colSizes);\n\n const rowOffset = rowStartOffset - rowRenderOffset;\n const colOffset = colStartOffset - colRenderOffset;\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 return (\n <VirtualContainer className={className} render={outerRender}\n style={{ position: \"relative\", height, width, overflow: \"hidden\", willChange: \"transform\" }}>\n <VirtualContainer className={innerClassName} render={innerRender}\n style={{ position: 'absolute',\n display: 'grid',\n gridTemplateColumns: colTemplate,\n gridTemplateRows: rowTemplate,\n top: rowOffset, \n left: colOffset, \n height: rowRenderSize, \n width: colRenderSize }}>\n {rowSizes.map((_rowSize, rowIndex) => (\n <Fragment key={itemKey(rowStartIndex + rowIndex, 0, itemData)}>\n {colSizes.map((_size, colIndex) => (\n <ChildVar data={itemData} isScrolling={isScrolling} \n key={itemKey(rowStartIndex + rowIndex, colStartIndex + colIndex, itemData)} \n rowIndex={rowStartIndex + rowIndex} columnIndex={colStartIndex + colIndex} style={boxStyle}/>\n ))}\n </Fragment>\n ))}\n </VirtualContainer>\n </VirtualContainer>\n );\n}\n\nexport default DisplayGrid;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollToOption } from './VirtualBase';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\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 * @param option - Where to {@link ScrollToOption | position} the item within the viewport\n */\n scrollToItem(rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void;\n\n /** Exposes DOM clientWidth property */\n get clientWidth(): number;\n\n /** Exposes DOM clientHeight property */\n get clientHeight(): number;\n\n /** Current vertical position of scroll bar */\n get verticalOffset(): number;\n\n /** Current horizontal position of scroll bar */\n get horizontalOffset(): number;\n}\n\n/** Range to scroll to in one dimension specified as (offset,size). May be undefined if no need to scroll. */\nexport type ScrollRange = [ offset: number|undefined, size: number|undefined ];\n\n/**\n * Returns the {@link ScrollRange} corresponding to a specified item.\n * \n * Used internally to implement {@link VirtualGridProxy.scrollToItem}. Can be used directly for \n * advanced customization scenarios.\n */\nexport function getRangeToScroll(index: number | undefined, mapping: ItemOffsetMapping): ScrollRange {\n if (index === undefined)\n return [undefined, undefined];\n\n return [mapping.itemOffset(index), mapping.itemSize(index)];\n}\n\n/**\n * Same logic as {@link VirtualGridProxy.scrollToItem} usable with your own {@link VirtualScroll}\n * \n * You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayGrid} for\n * advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.\n */\nexport function virtualGridScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy|null>, rowOffsetMapping: ItemOffsetMapping, \n columnOffsetMapping: ItemOffsetMapping, rowIndex?: number, columnIndex?: number, option?: ScrollToOption) {\n\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n const [rowOffset, rowSize] = getRangeToScroll(rowIndex, rowOffsetMapping);\n const [colOffset, colSize] = getRangeToScroll(columnIndex, columnOffsetMapping);\n\n scroll.scrollToArea(rowOffset, rowSize, colOffset, colSize, option);\n}\n","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { VirtualBaseProps, ScrollToOption } from './VirtualBase';\nimport { DisplayGrid, DisplayGridItem, GridItemKey } from './DisplayGrid';\nimport { VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScroll } from './VirtualScroll';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\nimport { virtualGridScrollToItem, VirtualGridProxy } from './VirtualGridProxy';\nimport { AutoSizer } from './AutoSizer';\nimport { ScrollState } from './useVirtualScroll';\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 */\nexport type VirtualGridScrollHandler = (rowOffset: number, columnOffset: number, \n newRowScrollState: ScrollState, newColumnScrollState: ScrollState) => void;\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 DisplayGridItem} interface. */\n children: DisplayGridItem,\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 implementing {@link GridItemKey} that defines the key to use for each item.\n * @defaultValue `(rowIndex, columnIndex, _data) => '${rowIndex}:${columnIndex}'`\n */\n itemKey?: GridItemKey | undefined,\n\n /** Scroll handler implementing {@link VirtualGridScrollHandler} called after a scroll event has been processed and state updated. */\n onScroll?: VirtualGridScrollHandler | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualGrid} outer container. */\n outerRender?: VirtualContainerRender | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayGrid} within {@link VirtualGrid} inner container. */\n innerRender?: VirtualContainerRender | undefined;\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 DisplayGridItem} as a child.\n * @group Components\n */\nexport const VirtualGrid = React.forwardRef<VirtualGridProxy, VirtualGridProps>(function VirtualGrid(props, ref) {\n const { rowCount, rowOffsetMapping, columnCount, columnOffsetMapping, children, \n innerClassName, innerRender, itemData, itemKey, onScroll: onScrollCallback, ...scrollProps } = 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 scrollRef = React.useRef<VirtualScrollProxy>(null);\n\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(rowOffset?: number, columnOffset?: number): void {\n const scroll = scrollRef.current;\n /* istanbul ignore else */\n if (scroll)\n scroll.scrollTo(rowOffset, columnOffset);\n },\n\n scrollToItem(rowIndex?: number, columnIndex?: number, option?: ScrollToOption): void {\n virtualGridScrollToItem(scrollRef, rowOffsetMapping, columnOffsetMapping, rowIndex, columnIndex, option);\n },\n\n get clientWidth(): number {\n return scrollRef.current ? scrollRef.current.clientWidth : /* istanbul ignore next */ 0;\n },\n\n get clientHeight(): number {\n return scrollRef.current ? scrollRef.current.clientHeight : /* istanbul ignore next */ 0;\n },\n\n get verticalOffset(): number {\n return scrollRef.current ? scrollRef.current.verticalOffset : /* istanbul ignore next */ 0;\n },\n\n get horizontalOffset(): number {\n return scrollRef.current ? scrollRef.current.horizontalOffset : /* istanbul ignore next */ 0;\n }\n }\n }, [ rowOffsetMapping, columnOffsetMapping ]);\n\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 return (\n <VirtualScroll\n ref={scrollRef}\n {...scrollProps}\n scrollHeight={totalRowSize}\n scrollWidth={totalColumnSize}\n onScroll={(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState) => {\n if (onScrollCallback)\n onScrollCallback(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState);\n }}>\n {({ isScrolling, verticalOffset, horizontalOffset }) => (\n <AutoSizer style={{ height: '100%', width: '100%' }}>\n {({height,width}) => (\n <DisplayGrid\n innerClassName={innerClassName}\n innerRender={innerRender}\n rowOffset={verticalOffset}\n columnOffset={horizontalOffset}\n height={height}\n rowCount={rowCount}\n columnCount={columnCount}\n itemData={itemData}\n itemKey={itemKey}\n isScrolling={isScrolling}\n rowOffsetMapping={rowOffsetMapping}\n columnOffsetMapping={columnOffsetMapping}\n width={width}>\n {ChildVar}\n </DisplayGrid>\n )}\n </AutoSizer>\n )}\n </VirtualScroll>\n );\n});\n\nexport default VirtualGrid;\n","import type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { ScrollToOption } from './VirtualBase';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\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 * @param option - Where to {@link ScrollToOption | position} the item within the viewport\n */\n scrollToItem(index: number, option?: ScrollToOption): void;\n\n /** Current scroll position */\n get offset(): number;\n}\n\n/**\n * Same logic as {@link VirtualListProxy.scrollToItem} usable with your own {@link VirtualScroll}\n * \n * You're encouraged to put together your own combination of {@link VirtualScroll} and {@link DisplayList} for\n * advanced customization scenarios. This function provides `ScrollToItem` functionality for use with your own {@link VirtualScroll}.\n */\nexport function virtualListScrollToItem(scrollRef: React.RefObject<VirtualScrollProxy|null>, itemOffsetMapping: ItemOffsetMapping, isVertical: boolean,\n index: number, option?: ScrollToOption) {\n\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n const itemOffset = itemOffsetMapping.itemOffset(index);\n const itemSize = itemOffsetMapping.itemSize(index);\n\n if (isVertical)\n scroll.scrollToArea(itemOffset, itemSize, undefined, undefined, option);\n else\n scroll.scrollToArea(undefined, undefined, itemOffset, itemSize, option);\n}","import React from \"react\";\nimport type { ItemOffsetMapping } from \"@candidstartup/infinisheet-types\";\nimport { VirtualBaseProps, ScrollToOption, ScrollLayout } from './VirtualBase';\nimport { DisplayList, DisplayListItem, ListItemKey } from './DisplayList';\nimport { VirtualContainerRender } from './VirtualContainer';\nimport { VirtualScroll } from './VirtualScroll';\nimport { VirtualScrollProxy } from './VirtualScrollProxy';\nimport { virtualListScrollToItem, VirtualListProxy } from './VirtualListProxy';\nimport { AutoSizer } from './AutoSizer';\nimport { ScrollState } from './useVirtualScroll';\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 */\nexport type VirtualListScrollHandler = (offset: number, newScrollState: ScrollState) => void;\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 DisplayListItem} interface. */\n children: DisplayListItem,\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 implementing {@link ListItemKey} that defines the key to use for each item.\n * @defaultValue `(index, _data) => index`\n */\n itemKey?: ListItemKey | undefined,\n\n /**\n * Choice of 'vertical' or 'horizontal' layouts\n * @defaultValue 'vertical'\n */\n layout?: ScrollLayout | undefined,\n\n /** Scroll handler implementing {@link VirtualListScrollHandler} called after a scroll event has been processed and state updated. */\n onScroll?: VirtualListScrollHandler | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link VirtualList} outer container. */\n outerRender?: VirtualContainerRender | undefined;\n\n /** Render prop implementing {@link VirtualContainerRender}. Used to customize {@link DisplayList} within {@link VirtualList} inner container. */\n innerRender?: VirtualContainerRender | undefined;\n}\n\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 DisplayListItem} as a child.\n * @group Components\n */\nexport const VirtualList = React.forwardRef<VirtualListProxy, VirtualListProps>(function VirtualList(props, ref) {\n const { itemCount, itemOffsetMapping, children, layout = 'vertical', onScroll: onScrollCallback,\n innerClassName, innerRender, itemData, itemKey, ...scrollProps } = props;\n\n // Total size is same as offset to item one off the end\n const renderSize = itemOffsetMapping.itemOffset(itemCount);\n\n const scrollRef = React.useRef<VirtualScrollProxy>(null);\n const isVertical = layout === 'vertical';\n\n React.useImperativeHandle(ref, () => {\n return {\n scrollTo(offset: number): void {\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return;\n\n if (isVertical)\n scroll.scrollTo(offset, undefined);\n else\n scroll.scrollTo(undefined, offset);\n },\n\n scrollToItem(index: number, option?: ScrollToOption): void {\n virtualListScrollToItem(scrollRef, itemOffsetMapping, isVertical, index, option);\n },\n\n get offset(): number {\n const scroll = scrollRef.current;\n /* istanbul ignore if */\n if (!scroll)\n return 0;\n\n return isVertical ? scroll.verticalOffset : scroll.horizontalOffset;\n }\n }\n }, [ itemOffsetMapping, isVertical ]);\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 return (\n <VirtualScroll\n ref={scrollRef}\n {...scrollProps}\n scrollHeight={isVertical ? renderSize : undefined}\n scrollWidth={isVertical ? undefined : renderSize}\n onScroll={(verticalOffset, horizontalOffset, verticalScrollState, horizontalScrollState) => {\n const newOffset = isVertical ? verticalOffset : horizontalOffset;\n if (onScrollCallback)\n onScrollCallback(newOffset, isVertical ? verticalScrollState : horizontalScrollState);\n }}>\n {({ isScrolling, verticalOffset, horizontalOffset }) => (\n <AutoSizer style={{ height: '100%', width: '100%' }}>\n {({height,width}) => (\n <DisplayList\n innerClassName={innerClassName}\n innerRender={innerRender}\n layout={layout}\n offset={isVertical ? verticalOffset : horizontalOffset}\n height={height}\n itemCount={itemCount}\n itemData={itemData}\n itemKey={itemKey}\n isScrolling={isScrolling}\n itemOffsetMapping={itemOffsetMapping}\n width={width}>\n {ChildVar}\n </DisplayList>\n )}\n </AutoSizer>\n )}\n </VirtualScroll>\n );\n});\n\nexport default VirtualList;\n","import { ItemOffsetMapping, FixedSizeItemOffsetMapping } from '@candidstartup/infinisheet-types';\nexport type { ItemOffsetMapping } from '@candidstartup/infinisheet-types';\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, VariableSizeItemOffsetMapping } from '@candidstartup/infinisheet-types';\nexport type { ItemOffsetMapping } from '@candidstartup/infinisheet-types';\n\n/**\n * Returns an instance of {@link ItemOffsetMapping}\n * 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;\n"],"names":["_jsx","useIsScrolling","useIsScrollingHook","_jsxs","defaultItemKey","boxStyle"],"mappings":";;;;AAiCA,MAAM,sBAAsB,GAA2B,CAAC,EAAC,GAAG,IAAI,EAAC,EAAE,GAAG,MACpEA,aAAK,GAAG,EAAE,GAAG,EAAM,GAAA,IAAI,EAAI,CAAA,CAC5B;AAED;;;;;AAKG;MACU,gBAAgB,GAAG,KAAK,CAAC,UAAU,CAC9C,SAAS,gBAAgB,CAAC,EAAC,MAAM,GAAG,sBAAsB,EAAE,GAAG,IAAI,EAAC,EAAE,GAAG,EAAA;AACvE,IAAA,OAAO,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;AAC5B,CAAC;;ACJD;;;;;;;;AAQG;AACG,SAAU,SAAS,CAAC,KAAqB,EAAA;IAC7C,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK;;;AAI5C,IAAA,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAS,CAAC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ACdA,GAAC,CAAA,WAAW,IACV,cAAc,EAAE,cAAc,EAC9B,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,gBAAgB,EACtD,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,KAAK,YACX,QAAQ,EAAA,CACC,CACf,EACW,CAAA,CACX,EACa,CAAA;AAEpB,CAAC;;AC9ID;;;;AAIG;AACG,SAAU,6BAA6B,CAAC,QAAgB,EAAA;AAC5D,IAAA,OAAO,IAAI,0BAA0B,CAAC,QAAQ,CAAC;AACjD;;ACPA;;;;;;AAMG;AACa,SAAA,gCAAgC,CAAC,eAAuB,EAAE,KAAgB,EAAA;IACxF,OAAO,IAAI,6BAA6B,CAAC,eAAe,EAAE,KAAK,IAAI,EAAE,CAAC;AACxE;;;;"}
|
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.10.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",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"test": "vitest"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"react": "
|
|
62
|
+
"react": "18 - 19"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@candidstartup/infinisheet-types": "^0.
|
|
65
|
+
"@candidstartup/infinisheet-types": "^0.10.0"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "948f593793c217bd5b49aea712d3d700702ca120"
|
|
68
68
|
}
|