@ringcentral/juno 2.40.0 → 2.41.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/components/Downshift/SuggestionList/SuggestionList.d.ts +3 -3
- package/components/Downshift/utils/useDownshift.d.ts +1 -1
- package/components/Tooltip/Tooltip.js +20 -2
- package/components/Virtuoso/index.d.ts +1 -1
- package/components/Virtuoso/index.js +1 -1
- package/components/Virtuoso/react-virtuoso/AATree.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/AATree.js +60 -48
- package/components/Virtuoso/react-virtuoso/TableVirtuoso.d.ts +5 -0
- package/components/Virtuoso/react-virtuoso/TableVirtuoso.js +217 -0
- package/components/Virtuoso/react-virtuoso/Virtuoso.d.ts +7696 -0
- package/components/Virtuoso/react-virtuoso/Virtuoso.js +317 -0
- package/components/Virtuoso/react-virtuoso/{Grid.d.ts → VirtuosoGrid.d.ts} +170 -72
- package/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +199 -0
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.d.ts +119 -65
- package/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
- package/components/Virtuoso/react-virtuoso/comparators.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/comparators.js +1 -3
- package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.d.ts +194 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +2 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.d.ts +274 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +2 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.d.ts +125 -0
- package/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +2 -0
- package/components/Virtuoso/react-virtuoso/domIOSystem.d.ts +3 -2
- package/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
- package/components/Virtuoso/react-virtuoso/followOutputSystem.d.ts +80 -43
- package/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
- package/components/Virtuoso/react-virtuoso/gridSystem.d.ts +57 -31
- package/components/Virtuoso/react-virtuoso/gridSystem.js +173 -86
- package/components/Virtuoso/react-virtuoso/groupedListSystem.d.ts +76 -67
- package/components/Virtuoso/react-virtuoso/groupedListSystem.js +12 -12
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.d.ts +6 -3
- package/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +36 -17
- package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.d.ts +2 -2
- package/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +3 -2
- package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.d.ts +2 -0
- package/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +5 -0
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.d.ts +2 -3
- package/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +36 -51
- package/components/Virtuoso/react-virtuoso/hooks/useSize.d.ts +2 -3
- package/components/Virtuoso/react-virtuoso/hooks/useSize.js +13 -13
- package/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +17 -15
- package/components/Virtuoso/react-virtuoso/index.d.ts +7 -1
- package/components/Virtuoso/react-virtuoso/index.js +8 -1
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.d.ts +304 -68
- package/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +9 -31
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.d.ts +127 -109
- package/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.d.ts +38 -22
- package/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
- package/components/Virtuoso/react-virtuoso/interfaces.d.ts +150 -51
- package/components/Virtuoso/react-virtuoso/listStateSystem.d.ts +109 -59
- package/components/Virtuoso/react-virtuoso/listStateSystem.js +100 -52
- package/components/Virtuoso/react-virtuoso/listSystem.d.ts +1691 -693
- package/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
- package/components/Virtuoso/react-virtuoso/loggerSystem.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
- package/components/Virtuoso/react-virtuoso/propsReadySystem.d.ts +1 -1
- package/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
- package/components/Virtuoso/react-virtuoso/react-urx/index.d.ts +110 -0
- package/components/Virtuoso/react-virtuoso/react-urx/index.js +200 -0
- package/components/Virtuoso/react-virtuoso/react-urx/package.json +5 -0
- package/components/Virtuoso/react-virtuoso/recalcSystem.d.ts +4 -0
- package/components/Virtuoso/react-virtuoso/recalcSystem.js +8 -0
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.d.ts +144 -78
- package/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +33 -21
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.d.ts +12 -7
- package/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.d.ts +19 -11
- package/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.d.ts +7 -6
- package/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +15 -27
- package/components/Virtuoso/react-virtuoso/sizeSystem.d.ts +20 -11
- package/components/Virtuoso/react-virtuoso/sizeSystem.js +182 -52
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.d.ts +8 -5
- package/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
- package/components/Virtuoso/react-virtuoso/stateLoadSystem.d.ts +318 -0
- package/components/Virtuoso/react-virtuoso/stateLoadSystem.js +41 -0
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.d.ts +518 -467
- package/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.d.ts +115 -63
- package/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.d.ts +139 -73
- package/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +74 -31
- package/components/Virtuoso/react-virtuoso/urx/actions.d.ts +127 -0
- package/components/Virtuoso/react-virtuoso/urx/actions.js +98 -0
- package/components/Virtuoso/react-virtuoso/urx/constants.d.ts +8 -0
- package/components/Virtuoso/react-virtuoso/urx/constants.js +6 -0
- package/components/Virtuoso/react-virtuoso/urx/index.d.ts +6 -0
- package/components/Virtuoso/react-virtuoso/urx/index.js +9 -0
- package/components/Virtuoso/react-virtuoso/urx/package.json +5 -0
- package/components/Virtuoso/react-virtuoso/urx/pipe.d.ts +220 -0
- package/components/Virtuoso/react-virtuoso/urx/pipe.js +279 -0
- package/components/Virtuoso/react-virtuoso/urx/streams.d.ts +143 -0
- package/components/Virtuoso/react-virtuoso/urx/streams.js +227 -0
- package/components/Virtuoso/react-virtuoso/urx/system.d.ts +148 -0
- package/components/Virtuoso/react-virtuoso/urx/system.js +106 -0
- package/components/Virtuoso/react-virtuoso/urx/transformers.d.ts +71 -0
- package/components/Virtuoso/react-virtuoso/urx/transformers.js +106 -0
- package/components/Virtuoso/react-virtuoso/urx/utils.d.ts +57 -0
- package/components/Virtuoso/react-virtuoso/urx/utils.js +102 -0
- package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +6 -0
- package/components/Virtuoso/react-virtuoso/utils/context.d.ts +13 -0
- package/components/Virtuoso/react-virtuoso/utils/context.js +6 -0
- package/components/Virtuoso/react-virtuoso/utils/skipFrames.d.ts +1 -0
- package/components/Virtuoso/react-virtuoso/utils/skipFrames.js +11 -0
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.d.ts +6 -4
- package/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
- package/components/Virtuoso/utils/isOutOfRange.d.ts +1 -1
- package/components/Virtuoso/utils/useHighlightScroll.d.ts +2 -2
- package/es6/components/Tooltip/Tooltip.js +21 -3
- package/es6/components/Virtuoso/index.js +1 -1
- package/es6/components/Virtuoso/react-virtuoso/AATree.js +60 -48
- package/es6/components/Virtuoso/react-virtuoso/{Table.js → TableVirtuoso.js} +73 -52
- package/es6/components/Virtuoso/react-virtuoso/{List.js → Virtuoso.js} +85 -161
- package/es6/components/Virtuoso/react-virtuoso/VirtuosoGrid.js +198 -0
- package/es6/components/Virtuoso/react-virtuoso/alignToBottomSystem.js +3 -3
- package/es6/components/Virtuoso/react-virtuoso/comparators.js +1 -3
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/TableVirtuoso.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/Virtuoso.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/component-interfaces/VirtuosoGrid.js +0 -0
- package/es6/components/Virtuoso/react-virtuoso/domIOSystem.js +5 -3
- package/es6/components/Virtuoso/react-virtuoso/followOutputSystem.js +21 -19
- package/es6/components/Virtuoso/react-virtuoso/gridSystem.js +173 -87
- package/es6/components/Virtuoso/react-virtuoso/groupedListSystem.js +13 -13
- package/es6/components/Virtuoso/react-virtuoso/hooks/useChangedChildSizes.js +35 -16
- package/es6/components/Virtuoso/react-virtuoso/hooks/useIsomorphicLayoutEffect.js +2 -2
- package/es6/components/Virtuoso/react-virtuoso/hooks/useRcPortalWindowContext.js +2 -0
- package/es6/components/Virtuoso/react-virtuoso/hooks/useScrollTop.js +35 -50
- package/es6/components/Virtuoso/react-virtuoso/hooks/useSize.js +11 -12
- package/es6/components/Virtuoso/react-virtuoso/hooks/useWindowViewportRect.js +15 -14
- package/es6/components/Virtuoso/react-virtuoso/index.js +4 -1
- package/es6/components/Virtuoso/react-virtuoso/initialItemCountSystem.js +11 -33
- package/es6/components/Virtuoso/react-virtuoso/initialScrollTopSystem.js +7 -7
- package/es6/components/Virtuoso/react-virtuoso/initialTopMostItemIndexSystem.js +13 -20
- package/es6/components/Virtuoso/react-virtuoso/listStateSystem.js +101 -54
- package/es6/components/Virtuoso/react-virtuoso/listSystem.js +15 -16
- package/es6/components/Virtuoso/react-virtuoso/loggerSystem.js +2 -4
- package/es6/components/Virtuoso/react-virtuoso/propsReadySystem.js +3 -4
- package/es6/components/Virtuoso/react-virtuoso/react-urx/index.js +197 -0
- package/es6/components/Virtuoso/react-virtuoso/recalcSystem.js +5 -0
- package/es6/components/Virtuoso/react-virtuoso/scrollIntoViewSystem.js +34 -22
- package/es6/components/Virtuoso/react-virtuoso/scrollSeekSystem.js +7 -10
- package/es6/components/Virtuoso/react-virtuoso/scrollToIndexSystem.js +11 -23
- package/es6/components/Virtuoso/react-virtuoso/sizeRangeSystem.js +16 -28
- package/es6/components/Virtuoso/react-virtuoso/sizeSystem.js +180 -53
- package/es6/components/Virtuoso/react-virtuoso/stateFlagsSystem.js +32 -23
- package/es6/components/Virtuoso/react-virtuoso/stateLoadSystem.js +39 -0
- package/es6/components/Virtuoso/react-virtuoso/topItemCountSystem.js +5 -5
- package/es6/components/Virtuoso/react-virtuoso/totalListHeightSystem.js +6 -13
- package/es6/components/Virtuoso/react-virtuoso/upwardScrollFixSystem.js +75 -32
- package/es6/components/Virtuoso/react-virtuoso/urx/actions.js +90 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/constants.js +4 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/index.js +6 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/pipe.js +266 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/streams.js +220 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/system.js +102 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/transformers.js +101 -0
- package/es6/components/Virtuoso/react-virtuoso/urx/utils.js +88 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/approximatelyEqual.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/context.js +3 -0
- package/es6/components/Virtuoso/react-virtuoso/utils/skipFrames.js +8 -0
- package/es6/components/Virtuoso/react-virtuoso/windowScrollerSystem.js +1 -1
- package/es6/foundation/hooks/useForkRef/useForkRef.js +2 -1
- package/foundation/hooks/useForkRef/useForkRef.d.ts +2 -1
- package/foundation/hooks/useForkRef/useForkRef.js +1 -0
- package/package.json +2 -2
- package/components/Virtuoso/Virtuoso.d.ts +0 -1
- package/components/Virtuoso/Virtuoso.js +0 -4
- package/components/Virtuoso/react-virtuoso/Grid.js +0 -168
- package/components/Virtuoso/react-virtuoso/List.d.ts +0 -6749
- package/components/Virtuoso/react-virtuoso/List.js +0 -393
- package/components/Virtuoso/react-virtuoso/Table.d.ts +0 -6515
- package/components/Virtuoso/react-virtuoso/Table.js +0 -196
- package/components/Virtuoso/react-virtuoso/components.d.ts +0 -505
- package/components/Virtuoso/react-virtuoso/components.js +0 -9
- package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.d.ts +0 -1
- package/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -11
- package/es6/components/Virtuoso/Virtuoso.js +0 -1
- package/es6/components/Virtuoso/react-virtuoso/Grid.js +0 -166
- package/es6/components/Virtuoso/react-virtuoso/components.js +0 -7
- package/es6/components/Virtuoso/react-virtuoso/utils/conditionalFlushSync.js +0 -8
|
@@ -1,505 +0,0 @@
|
|
|
1
|
-
/// <reference types="styled-jsx" />
|
|
2
|
-
import { ReactElement } from 'react';
|
|
3
|
-
import { Components, ComputeItemKey, FixedHeaderContent, FollowOutput, GridComponents, GridComputeItemKey, GridItemContent, GridRootProps, GroupContent, GroupItemContent, IndexLocationWithAlign, ItemContent, ListItem, ListRange, ListRootProps, ScrollIntoViewLocation, ScrollSeekConfiguration, TableComponents } from './interfaces';
|
|
4
|
-
export interface VirtuosoProps<D, C> extends ListRootProps {
|
|
5
|
-
/**
|
|
6
|
-
* The total amount of items to be rendered.
|
|
7
|
-
*/
|
|
8
|
-
totalCount?: number;
|
|
9
|
-
/**
|
|
10
|
-
* The data items to be rendered. If data is set, the total count will be inferred from the length of the array.
|
|
11
|
-
*/
|
|
12
|
-
data?: readonly D[];
|
|
13
|
-
/**
|
|
14
|
-
* Additional context available in the custom components and content callbacks
|
|
15
|
-
*/
|
|
16
|
-
context?: C;
|
|
17
|
-
/**
|
|
18
|
-
* *The property accepts pixel values.*
|
|
19
|
-
*
|
|
20
|
-
* Set the overscan property to make the component "chunk" the rendering of new items on scroll.
|
|
21
|
-
* The property causes the component to render more items than the necessary, but reduces the re-renders on scroll.
|
|
22
|
-
* Setting `{ main: number, reverse: number }` lets you extend the list in both the main and the reverse scrollable directions.
|
|
23
|
-
* See the `increaseViewportBy` property for a similar behavior (equivalent to the `overscan` in react-window).
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
26
|
-
overscan?: number | {
|
|
27
|
-
main: number;
|
|
28
|
-
reverse: number;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* *The property accepts pixel values.*
|
|
33
|
-
*
|
|
34
|
-
* Set the increaseViewportBy property to artificially increase the viewport size, causing items to be rendered before outside of the viewport.
|
|
35
|
-
* The property causes the component to render more items than the necessary, but can help with slow loading content.
|
|
36
|
-
* Using `{ top?: number, bottom?: number }` lets you set the increase for each end separately.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
39
|
-
increaseViewportBy?: number | {
|
|
40
|
-
top: number;
|
|
41
|
-
bottom: number;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Set the amount of items to remain fixed at the top of the list.
|
|
45
|
-
*
|
|
46
|
-
* For a header that scrolls away when scrolling, check the `components.Header` property.
|
|
47
|
-
*/
|
|
48
|
-
topItemCount?: number;
|
|
49
|
-
/**
|
|
50
|
-
* Set to a value between 0 and totalCount - 1 to make the list start scrolled to that item.
|
|
51
|
-
* Pass in an object to achieve additional effects similar to `scrollToIndex`.
|
|
52
|
-
*/
|
|
53
|
-
initialTopMostItemIndex?: number | IndexLocationWithAlign;
|
|
54
|
-
/**
|
|
55
|
-
* Set this value to offset the initial location of the list.
|
|
56
|
-
* Warning: using this property will still run a render cycle at the scrollTop: 0 list window.
|
|
57
|
-
* If possible, avoid using it and stick to `initialTopMostItemIndex` instead.
|
|
58
|
-
*/
|
|
59
|
-
initialScrollTop?: number;
|
|
60
|
-
/**
|
|
61
|
-
* Use for server-side rendering - if set, the list will render the specified amount of items
|
|
62
|
-
* regardless of the container / item size.
|
|
63
|
-
*/
|
|
64
|
-
initialItemCount?: number;
|
|
65
|
-
/**
|
|
66
|
-
* Use the `components` property for advanced customization of the elements rendered by the list.
|
|
67
|
-
*/
|
|
68
|
-
components?: Components<C>;
|
|
69
|
-
/**
|
|
70
|
-
* Set the callback to specify the contents of the item.
|
|
71
|
-
*/
|
|
72
|
-
itemContent?: ItemContent<D, C>;
|
|
73
|
-
/**
|
|
74
|
-
* If specified, the component will use the function to generate the `key` property for each list item.
|
|
75
|
-
*/
|
|
76
|
-
computeItemKey?: ComputeItemKey<D, C>;
|
|
77
|
-
/**
|
|
78
|
-
* By default, the component assumes the default item height from the first rendered item (rendering it as a "probe").
|
|
79
|
-
*
|
|
80
|
-
* If the first item turns out to be an outlier (very short or tall), the rest of the rendering will be slower,
|
|
81
|
-
* as multiple passes of rendering should happen for the list to fill the viewport.
|
|
82
|
-
*
|
|
83
|
-
* Setting `defaultItemHeight` causes the component to skip the "probe" rendering and use the property
|
|
84
|
-
* value as default height instead.
|
|
85
|
-
*/
|
|
86
|
-
defaultItemHeight?: number;
|
|
87
|
-
/**
|
|
88
|
-
* Allows customizing the height/width calculation of `Item` elements.
|
|
89
|
-
*
|
|
90
|
-
* The default implementation reads `el.getBoundingClientRect().height` and `el.getBoundingClientRect().width`.
|
|
91
|
-
*/
|
|
92
|
-
itemSize?: (el: HTMLElement, field: 'offsetHeight' | 'offsetWidth') => number;
|
|
93
|
-
/**
|
|
94
|
-
* Can be used to improve performance if the rendered items are of known size.
|
|
95
|
-
* Setting it causes the component to skip item measurements.
|
|
96
|
-
*/
|
|
97
|
-
fixedItemHeight?: number;
|
|
98
|
-
/**
|
|
99
|
-
* Use to display placeholders if the user scrolls fast through the list.
|
|
100
|
-
*
|
|
101
|
-
* Set `components.ScrollSeekPlaceholder` to change the placeholder content.
|
|
102
|
-
*/
|
|
103
|
-
scrollSeekConfiguration?: ScrollSeekConfiguration | false;
|
|
104
|
-
/**
|
|
105
|
-
* If set to `true`, the list automatically scrolls to bottom if the total count is changed.
|
|
106
|
-
* Set to `"smooth"` for an animated scrolling.
|
|
107
|
-
*
|
|
108
|
-
* By default, `followOutput` scrolls down only if the list is already at the bottom.
|
|
109
|
-
* To implement an arbitrary logic behind that, pass a function:
|
|
110
|
-
*
|
|
111
|
-
* ```tsx
|
|
112
|
-
* <Virtuoso
|
|
113
|
-
* followOutput={(isAtBottom: boolean) => {
|
|
114
|
-
* if (expression) {
|
|
115
|
-
* return 'smooth' // can be 'auto' or false to avoid scrolling
|
|
116
|
-
* } else {
|
|
117
|
-
* return false
|
|
118
|
-
* }
|
|
119
|
-
* }} />
|
|
120
|
-
* ```
|
|
121
|
-
*/
|
|
122
|
-
followOutput?: FollowOutput;
|
|
123
|
-
/**
|
|
124
|
-
* Set to customize the wrapper tag for the header and footer components (default is `div`).
|
|
125
|
-
*/
|
|
126
|
-
headerFooterTag?: string;
|
|
127
|
-
/**
|
|
128
|
-
* Use when implementing inverse infinite scrolling - decrease the value this property
|
|
129
|
-
* in combination with `data` or `totalCount` to prepend items to the top of the list.
|
|
130
|
-
*
|
|
131
|
-
* Warning: the firstItemIndex should **be a positive number**, based on the total amount of items to be displayed.
|
|
132
|
-
*/
|
|
133
|
-
firstItemIndex?: number;
|
|
134
|
-
/**
|
|
135
|
-
* Called when the list starts/stops scrolling.
|
|
136
|
-
*/
|
|
137
|
-
isScrolling?: (isScrolling: boolean) => void;
|
|
138
|
-
/**
|
|
139
|
-
* Gets called when the user scrolls to the end of the list.
|
|
140
|
-
* Receives the last item index as an argument. Can be used to implement endless scrolling.
|
|
141
|
-
*/
|
|
142
|
-
endReached?: (index: number) => void;
|
|
143
|
-
/**
|
|
144
|
-
* Called when the user scrolls to the start of the list.
|
|
145
|
-
*/
|
|
146
|
-
startReached?: (index: number) => void;
|
|
147
|
-
/**
|
|
148
|
-
* Called with the new set of items each time the list items are rendered due to scrolling.
|
|
149
|
-
*/
|
|
150
|
-
rangeChanged?: (range: ListRange) => void;
|
|
151
|
-
/**
|
|
152
|
-
* Called with true / false when the list has reached the bottom / gets scrolled up.
|
|
153
|
-
* Can be used to load newer items, like `tail -f`.
|
|
154
|
-
*/
|
|
155
|
-
atBottomStateChange?: (atBottom: boolean) => void;
|
|
156
|
-
/**
|
|
157
|
-
* Called with `true` / `false` when the list has reached the top / gets scrolled down.
|
|
158
|
-
*/
|
|
159
|
-
atTopStateChange?: (atTop: boolean) => void;
|
|
160
|
-
/**
|
|
161
|
-
* Called when the total list height is changed due to new items or viewport resize.
|
|
162
|
-
*/
|
|
163
|
-
totalListHeightChanged?: (height: number) => void;
|
|
164
|
-
/**
|
|
165
|
-
* Called with the new set of items each time the list items are rendered due to scrolling.
|
|
166
|
-
*/
|
|
167
|
-
itemsRendered?: (items: ListItem<D>[]) => void;
|
|
168
|
-
/**
|
|
169
|
-
* Setting `alignToBottom` to `true` aligns the items to the bottom of the list if the list is shorter than the viewport.
|
|
170
|
-
* Use `followOutput` property to keep the list aligned when new items are appended.
|
|
171
|
-
*/
|
|
172
|
-
alignToBottom?: boolean;
|
|
173
|
-
/**
|
|
174
|
-
* Uses the document scroller rather than wrapping the list in its own.
|
|
175
|
-
*/
|
|
176
|
-
useWindowScroll?: boolean;
|
|
177
|
-
/**
|
|
178
|
-
* Pass a reference to a scrollable parent element, so that the list won't wrap in its own.
|
|
179
|
-
*/
|
|
180
|
-
customScrollParent?: HTMLElement;
|
|
181
|
-
/**
|
|
182
|
-
* Provides access to the root DOM element
|
|
183
|
-
*/
|
|
184
|
-
scrollerRef?: (ref: HTMLElement | Window | null) => any;
|
|
185
|
-
/**
|
|
186
|
-
* By default `4`. Redefine to change how much away from the bottom the scroller can be before the list is not considered not at bottom.
|
|
187
|
-
*/
|
|
188
|
-
atBottomThreshold?: number;
|
|
189
|
-
/**
|
|
190
|
-
* Reduces an edge case blinking visible in React18 by enabling flushSync in certain changes.
|
|
191
|
-
*/
|
|
192
|
-
react18ConcurrentRendering?: boolean;
|
|
193
|
-
}
|
|
194
|
-
export interface GroupedVirtuosoProps<D, C> extends Omit<VirtuosoProps<D, C>, 'totalCount' | 'itemContent'> {
|
|
195
|
-
/**
|
|
196
|
-
* Specifies the amount of items in each group (and, actually, how many groups are there).
|
|
197
|
-
* For example, passing [20, 30] will display 2 groups with 20 and 30 items each.
|
|
198
|
-
*/
|
|
199
|
-
groupCounts?: number[];
|
|
200
|
-
/**
|
|
201
|
-
* Specifies how each each group header gets rendered. The callback receives the zero-based index of the group.
|
|
202
|
-
*/
|
|
203
|
-
groupContent?: GroupContent;
|
|
204
|
-
/**
|
|
205
|
-
* Specifies how each each item gets rendered.
|
|
206
|
-
*/
|
|
207
|
-
itemContent?: GroupItemContent<D, C>;
|
|
208
|
-
}
|
|
209
|
-
export interface TableVirtuosoProps<D, C> extends Omit<VirtuosoProps<D, C>, 'components' | 'headerFooterTag' | 'topItemCount'> {
|
|
210
|
-
/**
|
|
211
|
-
* Use the `components` property for advanced customization of the elements rendered by the table.
|
|
212
|
-
*/
|
|
213
|
-
components?: TableComponents<C>;
|
|
214
|
-
/**
|
|
215
|
-
* Set the contents of the table header.
|
|
216
|
-
*/
|
|
217
|
-
fixedHeaderContent?: FixedHeaderContent;
|
|
218
|
-
/**
|
|
219
|
-
* The total amount of items to be rendered.
|
|
220
|
-
*/
|
|
221
|
-
totalCount?: number;
|
|
222
|
-
/**
|
|
223
|
-
* The data items to be rendered. If data is set, the total count will be inferred from the length of the array.
|
|
224
|
-
*/
|
|
225
|
-
data?: readonly D[];
|
|
226
|
-
/**
|
|
227
|
-
* Set the overscan property to make the component "chunk" the rendering of new items on scroll.
|
|
228
|
-
* The property causes the component to render more items than the necessary, but reduces the re-renders on scroll.
|
|
229
|
-
* Setting `{ main: number, reverse: number }` lets you extend the list in both the main and the reverse scrollable directions.
|
|
230
|
-
* See the `increaseViewportBy` property for a similar behavior (equivalent to the `overscan` in `react-window`).
|
|
231
|
-
*/
|
|
232
|
-
overscan?: number | {
|
|
233
|
-
main: number;
|
|
234
|
-
reverse: number;
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* Set the increaseViewportBy property to artificially increase the viewport size, causing items to be rendered before outside of the viewport.
|
|
238
|
-
* The property causes the component to render more items than the necessary, but can help with slow loading content.
|
|
239
|
-
* Using `{ top?: number, bottom?: number }` lets you set the increase for each end separately.
|
|
240
|
-
*/
|
|
241
|
-
increaseViewportBy?: number | {
|
|
242
|
-
top: number;
|
|
243
|
-
bottom: number;
|
|
244
|
-
};
|
|
245
|
-
/**
|
|
246
|
-
* Set to a value between 0 and totalCount - 1 to make the list start scrolled to that item.
|
|
247
|
-
*/
|
|
248
|
-
initialTopMostItemIndex?: number;
|
|
249
|
-
/**
|
|
250
|
-
* Set this value to offset the initial location of the list.
|
|
251
|
-
* Warning: using this property will still run a render cycle at the scrollTop: 0 list window.
|
|
252
|
-
* If possible, avoid using it and stick to `initialTopMostItemIndex` instead.
|
|
253
|
-
*/
|
|
254
|
-
initialScrollTop?: number;
|
|
255
|
-
/**
|
|
256
|
-
* Use for server-side rendering - if set, the list will render the specified amount of items
|
|
257
|
-
* regardless of the container / item size.
|
|
258
|
-
*/
|
|
259
|
-
initialItemCount?: number;
|
|
260
|
-
/**
|
|
261
|
-
* Set the callback to specify the contents of the item.
|
|
262
|
-
*/
|
|
263
|
-
itemContent?: ItemContent<D, C>;
|
|
264
|
-
/**
|
|
265
|
-
* If specified, the component will use the function to generate the `key` property for each list item.
|
|
266
|
-
*/
|
|
267
|
-
computeItemKey?: ComputeItemKey<D, C>;
|
|
268
|
-
/**
|
|
269
|
-
* By default, the component assumes the default item height from the first rendered item (rendering it as a "probe").
|
|
270
|
-
*
|
|
271
|
-
* If the first item turns out to be an outlier (very short or tall), the rest of the rendering will be slower,
|
|
272
|
-
* as multiple passes of rendering should happen for the list to fill the viewport.
|
|
273
|
-
*
|
|
274
|
-
* Setting `defaultItemHeight` causes the component to skip the "probe" rendering and use the property
|
|
275
|
-
* value as default height instead.
|
|
276
|
-
*/
|
|
277
|
-
defaultItemHeight?: number;
|
|
278
|
-
/**
|
|
279
|
-
* Allows customizing the height/width calculation of `Item` elements.
|
|
280
|
-
*
|
|
281
|
-
* The default implementation reads `el.getBoundingClientRect().height` and `el.getBoundingClientRect().width`.
|
|
282
|
-
*/
|
|
283
|
-
itemSize?: (el: HTMLElement, field: 'offsetHeight' | 'offsetWidth') => number;
|
|
284
|
-
/**
|
|
285
|
-
* Can be used to improve performance if the rendered items are of known size.
|
|
286
|
-
* Setting it causes the component to skip item measurements.
|
|
287
|
-
*/
|
|
288
|
-
fixedItemHeight?: number;
|
|
289
|
-
/**
|
|
290
|
-
* Use to display placeholders if the user scrolls fast through the list.
|
|
291
|
-
*
|
|
292
|
-
* Set `components.ScrollSeekPlaceholder` to change the placeholder content.
|
|
293
|
-
*/
|
|
294
|
-
scrollSeekConfiguration?: ScrollSeekConfiguration | false;
|
|
295
|
-
/**
|
|
296
|
-
* If set to `true`, the list automatically scrolls to bottom if the total count is changed.
|
|
297
|
-
* Set to `"smooth"` for an animated scrolling.
|
|
298
|
-
*
|
|
299
|
-
* By default, `followOutput` scrolls down only if the list is already at the bottom.
|
|
300
|
-
* To implement an arbitrary logic behind that, pass a function:
|
|
301
|
-
*
|
|
302
|
-
* ```tsx
|
|
303
|
-
* <Virtuoso
|
|
304
|
-
* followOutput={(isAtBottom: boolean) => {
|
|
305
|
-
* if (expression) {
|
|
306
|
-
* return 'smooth' // can be 'auto' or false to avoid scrolling
|
|
307
|
-
* } else {
|
|
308
|
-
* return false
|
|
309
|
-
* }
|
|
310
|
-
* }} />
|
|
311
|
-
* ```
|
|
312
|
-
*/
|
|
313
|
-
followOutput?: FollowOutput;
|
|
314
|
-
/**
|
|
315
|
-
* Use when implementing inverse infinite scrolling - decrease the value this property
|
|
316
|
-
* in combination with `data` or `totalCount` to prepend items to the top of the list.
|
|
317
|
-
*
|
|
318
|
-
* Warning: the firstItemIndex should **be a positive number**, based on the total amount of items to be displayed.
|
|
319
|
-
*/
|
|
320
|
-
firstItemIndex?: number;
|
|
321
|
-
/**
|
|
322
|
-
* Called when the list starts/stops scrolling.
|
|
323
|
-
*/
|
|
324
|
-
isScrolling?: (isScrolling: boolean) => void;
|
|
325
|
-
/**
|
|
326
|
-
* Gets called when the user scrolls to the end of the list.
|
|
327
|
-
* Receives the last item index as an argument. Can be used to implement endless scrolling.
|
|
328
|
-
*/
|
|
329
|
-
endReached?: (index: number) => void;
|
|
330
|
-
/**
|
|
331
|
-
* Called when the user scrolls to the start of the list.
|
|
332
|
-
*/
|
|
333
|
-
startReached?: (index: number) => void;
|
|
334
|
-
/**
|
|
335
|
-
* Called with the new set of items each time the list items are rendered due to scrolling.
|
|
336
|
-
*/
|
|
337
|
-
rangeChanged?: (range: ListRange) => void;
|
|
338
|
-
/**
|
|
339
|
-
* Called with true / false when the list has reached the bottom / gets scrolled up.
|
|
340
|
-
* Can be used to load newer items, like `tail -f`.
|
|
341
|
-
*/
|
|
342
|
-
atBottomStateChange?: (atBottom: boolean) => void;
|
|
343
|
-
/**
|
|
344
|
-
* Called with `true` / `false` when the list has reached the top / gets scrolled down.
|
|
345
|
-
*/
|
|
346
|
-
atTopStateChange?: (atTop: boolean) => void;
|
|
347
|
-
/**
|
|
348
|
-
* Called when the total list height is changed due to new items or viewport resize.
|
|
349
|
-
*/
|
|
350
|
-
totalListHeightChanged?: (height: number) => void;
|
|
351
|
-
/**
|
|
352
|
-
* Called with the new set of items each time the list items are rendered due to scrolling.
|
|
353
|
-
*/
|
|
354
|
-
itemsRendered?: (items: ListItem<D>[]) => void;
|
|
355
|
-
/**
|
|
356
|
-
* Setting `alignToBottom` to `true` aligns the items to the bottom of the list if the list is shorter than the viewport.
|
|
357
|
-
* Use `followOutput` property to keep the list aligned when new items are appended.
|
|
358
|
-
*/
|
|
359
|
-
alignToBottom?: boolean;
|
|
360
|
-
/**
|
|
361
|
-
* Uses the document scroller rather than wrapping the list in its own.
|
|
362
|
-
*/
|
|
363
|
-
useWindowScroll?: boolean;
|
|
364
|
-
/**
|
|
365
|
-
* Pass a reference to a scrollable parent element, so that the table won't wrap in its own.
|
|
366
|
-
*/
|
|
367
|
-
customScrollParent?: HTMLElement;
|
|
368
|
-
/**
|
|
369
|
-
* Provides access to the root DOM element
|
|
370
|
-
*/
|
|
371
|
-
scrollerRef?: (ref: HTMLElement | Window | null) => any;
|
|
372
|
-
/**
|
|
373
|
-
* By default `4`. Redefine to change how much away from the bottom the scroller can be before the list is not considered not at bottom.
|
|
374
|
-
*/
|
|
375
|
-
atBottomThreshold?: number;
|
|
376
|
-
/**
|
|
377
|
-
* Reduces an edge case blinking visible in React18 by enabling flushSync in certain changes.
|
|
378
|
-
*/
|
|
379
|
-
react18ConcurrentRendering?: boolean;
|
|
380
|
-
}
|
|
381
|
-
export interface VirtuosoGridProps<C extends unknown = unknown> extends GridRootProps {
|
|
382
|
-
/**
|
|
383
|
-
* The total amount of items to be rendered.
|
|
384
|
-
*/
|
|
385
|
-
totalCount: number;
|
|
386
|
-
/**
|
|
387
|
-
* Set the callback to specify the contents of the item.
|
|
388
|
-
*/
|
|
389
|
-
itemContent?: GridItemContent<C>;
|
|
390
|
-
/**
|
|
391
|
-
* Use the `components` property for advanced customization of the elements rendered by the list.
|
|
392
|
-
*/
|
|
393
|
-
components?: GridComponents<C>;
|
|
394
|
-
/**
|
|
395
|
-
* Set the overscan property to make the component "chunk" the rendering of new items on scroll.
|
|
396
|
-
* The property causes the component to render more items than the necessary, but reduces the re-renders on scroll.
|
|
397
|
-
* Setting `{ main: number, reverse: number }` lets you extend the list in both the main and the reverse scrollable directions.
|
|
398
|
-
*/
|
|
399
|
-
overscan?: number | {
|
|
400
|
-
main: number;
|
|
401
|
-
reverse: number;
|
|
402
|
-
};
|
|
403
|
-
/**
|
|
404
|
-
* If specified, the component will use the function to generate the `key` property for each list item.
|
|
405
|
-
*/
|
|
406
|
-
computeItemKey?: GridComputeItemKey;
|
|
407
|
-
/**
|
|
408
|
-
* Use to display placeholders if the user scrolls fast through the list.
|
|
409
|
-
*
|
|
410
|
-
* Set `components.ScrollSeekPlaceholder` to change the placeholder content.
|
|
411
|
-
*/
|
|
412
|
-
scrollSeekConfiguration?: ScrollSeekConfiguration | false;
|
|
413
|
-
/**
|
|
414
|
-
* Called when the list starts/stops scrolling.
|
|
415
|
-
*/
|
|
416
|
-
isScrolling?: (isScrolling: boolean) => void;
|
|
417
|
-
/**
|
|
418
|
-
* Gets called when the user scrolls to the end of the list.
|
|
419
|
-
* Receives the last item index as an argument. Can be used to implement endless scrolling.
|
|
420
|
-
*/
|
|
421
|
-
endReached?: (index: number) => void;
|
|
422
|
-
/**
|
|
423
|
-
* Called when the user scrolls to the start of the list.
|
|
424
|
-
*/
|
|
425
|
-
startReached?: (index: number) => void;
|
|
426
|
-
/**
|
|
427
|
-
* Called with the new set of items each time the list items are rendered due to scrolling.
|
|
428
|
-
*/
|
|
429
|
-
rangeChanged?: (range: ListRange) => void;
|
|
430
|
-
/**
|
|
431
|
-
* Called with true / false when the list has reached the bottom / gets scrolled up.
|
|
432
|
-
* Can be used to load newer items, like `tail -f`.
|
|
433
|
-
*/
|
|
434
|
-
atBottomStateChange?: (atBottom: boolean) => void;
|
|
435
|
-
/**
|
|
436
|
-
* Called with `true` / `false` when the list has reached the top / gets scrolled down.
|
|
437
|
-
*/
|
|
438
|
-
atTopStateChange?: (atTop: boolean) => void;
|
|
439
|
-
/**
|
|
440
|
-
* Provides access to the root DOM element
|
|
441
|
-
*/
|
|
442
|
-
scrollerRef?: (ref: HTMLElement | null) => any;
|
|
443
|
-
/**
|
|
444
|
-
* Sets the className for the list DOM element
|
|
445
|
-
*/
|
|
446
|
-
listClassName?: string;
|
|
447
|
-
/**
|
|
448
|
-
* Sets the grid items' className
|
|
449
|
-
*/
|
|
450
|
-
itemClassName?: string;
|
|
451
|
-
/**
|
|
452
|
-
* Uses the document scroller rather than wrapping the grid in its own.
|
|
453
|
-
*/
|
|
454
|
-
useWindowScroll?: boolean;
|
|
455
|
-
/**
|
|
456
|
-
* Pass a reference to a scrollable parent element, so that the grid won't wrap in its own.
|
|
457
|
-
*/
|
|
458
|
-
customScrollParent?: HTMLElement;
|
|
459
|
-
}
|
|
460
|
-
export interface VirtuosoHandle {
|
|
461
|
-
/**
|
|
462
|
-
* Scrolls the component to the specified item index. See {@link IndexLocationWithAlign} for more options.
|
|
463
|
-
*/
|
|
464
|
-
scrollToIndex(location: number | IndexLocationWithAlign): void;
|
|
465
|
-
/**
|
|
466
|
-
* Scrolls the item into view if necessary. See [the website example](http://virtuoso.dev/keyboard-navigation/) for an implementation.
|
|
467
|
-
*/
|
|
468
|
-
scrollIntoView(location: ScrollIntoViewLocation): void;
|
|
469
|
-
/**
|
|
470
|
-
* Scrolls the component to the specified location. See [ScrollToOptions (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions)
|
|
471
|
-
*/
|
|
472
|
-
scrollTo(location: ScrollToOptions): void;
|
|
473
|
-
/**
|
|
474
|
-
* Scrolls the component with the specified amount. See [ScrollToOptions (MDN)](https://developer.mozilla.org/en-US/docs/Web/API/ScrollToOptions)
|
|
475
|
-
*/
|
|
476
|
-
scrollBy(location: ScrollToOptions): void;
|
|
477
|
-
}
|
|
478
|
-
export interface GroupedVirtuosoHandle {
|
|
479
|
-
scrollToIndex(location: number | IndexLocationWithAlign): void;
|
|
480
|
-
scrollTo(location: ScrollToOptions): void;
|
|
481
|
-
scrollBy(location: ScrollToOptions): void;
|
|
482
|
-
}
|
|
483
|
-
export interface VirtuosoGridHandle {
|
|
484
|
-
scrollToIndex(location: number | IndexLocationWithAlign): void;
|
|
485
|
-
scrollTo(location: ScrollToOptions): void;
|
|
486
|
-
scrollBy(location: ScrollToOptions): void;
|
|
487
|
-
}
|
|
488
|
-
export interface TableVirtuosoHandle {
|
|
489
|
-
scrollIntoView(location: ScrollIntoViewLocation): void;
|
|
490
|
-
scrollToIndex(location: number | IndexLocationWithAlign): void;
|
|
491
|
-
scrollTo(location: ScrollToOptions): void;
|
|
492
|
-
scrollBy(location: ScrollToOptions): void;
|
|
493
|
-
}
|
|
494
|
-
export declare const Virtuoso: <ItemData extends unknown = any, Context extends unknown = any>(props: VirtuosoProps<ItemData, Context> & {
|
|
495
|
-
ref?: ((instance: VirtuosoHandle | null) => void) | import("react").RefObject<VirtuosoHandle> | null | undefined;
|
|
496
|
-
}) => ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
497
|
-
export declare const GroupedVirtuoso: <ItemData extends unknown = any, Context extends unknown = any>(props: GroupedVirtuosoProps<ItemData, Context> & {
|
|
498
|
-
ref?: ((instance: GroupedVirtuosoHandle | null) => void) | import("react").RefObject<GroupedVirtuosoHandle> | null | undefined;
|
|
499
|
-
}) => ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
500
|
-
export declare const TableVirtuoso: <ItemData extends unknown = any, Context extends unknown = any>(props: TableVirtuosoProps<ItemData, Context> & {
|
|
501
|
-
ref?: ((instance: TableVirtuosoHandle | null) => void) | import("react").RefObject<TableVirtuosoHandle> | null | undefined;
|
|
502
|
-
}) => ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
503
|
-
export declare const VirtuosoGrid: <Context extends unknown = any>(props: VirtuosoGridProps<Context> & {
|
|
504
|
-
ref?: ((instance: VirtuosoGridHandle | null) => void) | import("react").RefObject<VirtuosoGridHandle> | null | undefined;
|
|
505
|
-
}) => ReactElement<any, string | ((props: any) => ReactElement<any, any> | null) | (new (props: any) => import("react").Component<any, any, any>)>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
var Grid_1 = require("./Grid");
|
|
4
|
-
var List_1 = require("./List");
|
|
5
|
-
var Table_1 = require("./Table");
|
|
6
|
-
exports.Virtuoso = List_1.List;
|
|
7
|
-
exports.GroupedVirtuoso = List_1.List;
|
|
8
|
-
exports.TableVirtuoso = Table_1.Table;
|
|
9
|
-
exports.VirtuosoGrid = Grid_1.Grid;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function conditionalFlushSync(flag: boolean): (cb: () => void) => void;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// TODO: framer still not have flushSync in there framer version, skip that temporarily
|
|
3
|
-
// import { flushSync } from 'react-dom';
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
function conditionalFlushSync(
|
|
6
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
|
-
flag) {
|
|
8
|
-
// return flag ? flushSync : (cb: () => void) => cb();
|
|
9
|
-
return function (cb) { return cb(); };
|
|
10
|
-
}
|
|
11
|
-
exports.default = conditionalFlushSync;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './react-virtuoso';
|