react-virtuoso 4.10.1 → 4.10.3
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/dist/index.cjs +1 -1
- package/dist/index.d.ts +62 -62
- package/dist/index.mjs +168 -148
- package/package.json +7 -7
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as default_2 } from 'react';
|
|
2
2
|
|
|
3
3
|
export declare type CalculateViewLocation = (params: CalculateViewLocationParams) => IndexLocationWithAlign | number | null;
|
|
4
4
|
|
|
@@ -26,63 +26,63 @@ export declare interface Components<Data = unknown, Context = unknown> {
|
|
|
26
26
|
*
|
|
27
27
|
* The header remains above the top items and does not remain sticky.
|
|
28
28
|
*/
|
|
29
|
-
Header?:
|
|
29
|
+
Header?: default_2.ComponentType<{
|
|
30
30
|
context?: Context;
|
|
31
31
|
}>;
|
|
32
32
|
/**
|
|
33
33
|
* Set to render a component at the bottom of the list.
|
|
34
34
|
*/
|
|
35
|
-
Footer?:
|
|
35
|
+
Footer?: default_2.ComponentType<{
|
|
36
36
|
context?: Context;
|
|
37
37
|
}>;
|
|
38
38
|
/**
|
|
39
39
|
* Set to customize the item wrapping element. Use only if you would like to render list from elements different than a `div`.
|
|
40
40
|
*/
|
|
41
|
-
Item?:
|
|
41
|
+
Item?: default_2.ComponentType<ItemProps<Data> & {
|
|
42
42
|
context?: Context;
|
|
43
43
|
}>;
|
|
44
44
|
/**
|
|
45
45
|
* Set to customize the group item wrapping element. Use only if you would like to render list from elements different than a `div`.
|
|
46
46
|
*/
|
|
47
|
-
Group?:
|
|
47
|
+
Group?: default_2.ComponentType<GroupProps & {
|
|
48
48
|
context?: Context;
|
|
49
49
|
}>;
|
|
50
50
|
/**
|
|
51
51
|
* Set to customize the top list item wrapping element. Use if you would like to render list from elements different than a `div`
|
|
52
52
|
* or you want to set a custom z-index for the sticky position.
|
|
53
53
|
*/
|
|
54
|
-
TopItemList?:
|
|
54
|
+
TopItemList?: default_2.ComponentType<TopItemListProps & {
|
|
55
55
|
context?: Context;
|
|
56
56
|
}>;
|
|
57
57
|
/**
|
|
58
58
|
* Set to customize the outermost scrollable element. This should not be necessary in general,
|
|
59
59
|
* as the component passes its HTML attribute props to it.
|
|
60
60
|
*/
|
|
61
|
-
Scroller?:
|
|
61
|
+
Scroller?: default_2.ComponentType<ScrollerProps & {
|
|
62
62
|
context?: Context;
|
|
63
63
|
}>;
|
|
64
64
|
/**
|
|
65
65
|
* Set to customize the items wrapper. Use only if you would like to render list from elements different than a `div`.
|
|
66
66
|
*/
|
|
67
|
-
List?:
|
|
67
|
+
List?: default_2.ComponentType<ListProps & {
|
|
68
68
|
context?: Context;
|
|
69
69
|
}>;
|
|
70
70
|
/**
|
|
71
71
|
* Set to render a custom UI when the list is empty.
|
|
72
72
|
*/
|
|
73
|
-
EmptyPlaceholder?:
|
|
73
|
+
EmptyPlaceholder?: default_2.ComponentType<{
|
|
74
74
|
context?: Context;
|
|
75
75
|
}>;
|
|
76
76
|
/**
|
|
77
77
|
* Set to render an item placeholder when the user scrolls fast. See the `scrollSeek` property for more details.
|
|
78
78
|
*/
|
|
79
|
-
ScrollSeekPlaceholder?:
|
|
79
|
+
ScrollSeekPlaceholder?: default_2.ComponentType<ScrollSeekPlaceholderProps & {
|
|
80
80
|
context?: Context;
|
|
81
81
|
}>;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
export declare interface ComputeItemKey<D, C> {
|
|
85
|
-
(index: number, item: D, context: C):
|
|
85
|
+
(index: number, item: D, context: C): default_2.Key;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
export declare interface ElementDimensions {
|
|
@@ -97,9 +97,9 @@ export declare interface FillerRowProps {
|
|
|
97
97
|
height: number;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export declare type FixedFooterContent = (() =>
|
|
100
|
+
export declare type FixedFooterContent = (() => default_2.ReactNode) | null;
|
|
101
101
|
|
|
102
|
-
export declare type FixedHeaderContent = (() =>
|
|
102
|
+
export declare type FixedHeaderContent = (() => default_2.ReactNode) | null;
|
|
103
103
|
|
|
104
104
|
export declare interface FlatIndexLocationWithAlign extends LocationOptions {
|
|
105
105
|
/**
|
|
@@ -127,20 +127,20 @@ export declare interface GridComponents<Context = any> {
|
|
|
127
127
|
/**
|
|
128
128
|
* Set to customize the item wrapping element. Use only if you would like to render list from elements different than a `div`.
|
|
129
129
|
*/
|
|
130
|
-
Item?:
|
|
130
|
+
Item?: default_2.ComponentType<GridItemProps & {
|
|
131
131
|
context?: Context;
|
|
132
132
|
}>;
|
|
133
133
|
/**
|
|
134
134
|
* Set to customize the outermost scrollable element. This should not be necessary in general,
|
|
135
135
|
* as the component passes its HTML attribute props to it.
|
|
136
136
|
*/
|
|
137
|
-
Scroller?:
|
|
137
|
+
Scroller?: default_2.ComponentType<ScrollerProps & {
|
|
138
138
|
context?: Context;
|
|
139
139
|
}>;
|
|
140
140
|
/**
|
|
141
141
|
* Set to customize the items wrapper. Use only if you would like to render list from elements different than a `div`.
|
|
142
142
|
*/
|
|
143
|
-
List?:
|
|
143
|
+
List?: default_2.ComponentType<GridListProps & {
|
|
144
144
|
context?: Context;
|
|
145
145
|
}>;
|
|
146
146
|
/**
|
|
@@ -148,26 +148,26 @@ export declare interface GridComponents<Context = any> {
|
|
|
148
148
|
*
|
|
149
149
|
* The header remains above the top items and does not remain sticky.
|
|
150
150
|
*/
|
|
151
|
-
Header?:
|
|
151
|
+
Header?: default_2.ComponentType<{
|
|
152
152
|
context?: Context;
|
|
153
153
|
}>;
|
|
154
154
|
/**
|
|
155
155
|
* Set to render a component at the bottom of the list.
|
|
156
156
|
*/
|
|
157
|
-
Footer?:
|
|
157
|
+
Footer?: default_2.ComponentType<{
|
|
158
158
|
context?: Context;
|
|
159
159
|
}>;
|
|
160
160
|
/**
|
|
161
161
|
* Set to render an item placeholder when the user scrolls fast.
|
|
162
162
|
* See the `scrollSeekConfiguration` property for more details.
|
|
163
163
|
*/
|
|
164
|
-
ScrollSeekPlaceholder?:
|
|
164
|
+
ScrollSeekPlaceholder?: default_2.ComponentType<GridScrollSeekPlaceholderProps & {
|
|
165
165
|
context?: Context;
|
|
166
166
|
}>;
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
export declare interface GridComputeItemKey<D, C> {
|
|
170
|
-
(index: number, item: D, context: C):
|
|
170
|
+
(index: number, item: D, context: C): default_2.Key;
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
export declare type GridIndexLocation = FlatIndexLocationWithAlign | number;
|
|
@@ -178,24 +178,24 @@ export declare interface GridItem<D> {
|
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
export declare interface GridItemContent<D, C> {
|
|
181
|
-
(index: number, data: D, context: C):
|
|
181
|
+
(index: number, data: D, context: C): default_2.ReactNode;
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
/**
|
|
185
185
|
* Passed to the Components.Item custom component
|
|
186
186
|
*/
|
|
187
|
-
export declare type GridItemProps = Pick<
|
|
187
|
+
export declare type GridItemProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children' | 'className'> & {
|
|
188
188
|
'data-index': number;
|
|
189
|
-
} &
|
|
189
|
+
} & default_2.RefAttributes<HTMLDivElement>;
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Passed to the Components.List custom component
|
|
193
193
|
*/
|
|
194
|
-
export declare type GridListProps = Pick<
|
|
194
|
+
export declare type GridListProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children' | 'className'> & {
|
|
195
195
|
'data-testid': string;
|
|
196
|
-
} &
|
|
196
|
+
} & default_2.RefAttributes<HTMLDivElement>;
|
|
197
197
|
|
|
198
|
-
export declare type GridRootProps = Omit<
|
|
198
|
+
export declare type GridRootProps = Omit<default_2.HTMLProps<HTMLDivElement>, 'ref' | 'data'>;
|
|
199
199
|
|
|
200
200
|
/**
|
|
201
201
|
* Passed to the GridComponents.ScrollSeekPlaceholder custom component
|
|
@@ -214,7 +214,7 @@ export declare interface GridStateSnapshot {
|
|
|
214
214
|
}
|
|
215
215
|
|
|
216
216
|
export declare interface GroupContent<C> {
|
|
217
|
-
(index: number, context: C):
|
|
217
|
+
(index: number, context: C): default_2.ReactNode;
|
|
218
218
|
}
|
|
219
219
|
|
|
220
220
|
export declare interface GroupedScrollIntoViewLocation extends ScrollIntoViewLocationOptions {
|
|
@@ -222,8 +222,8 @@ export declare interface GroupedScrollIntoViewLocation extends ScrollIntoViewLoc
|
|
|
222
222
|
}
|
|
223
223
|
|
|
224
224
|
export declare const GroupedVirtuoso: <ItemData = any, Context = any>(props: GroupedVirtuosoProps<ItemData, Context> & {
|
|
225
|
-
ref?:
|
|
226
|
-
}) =>
|
|
225
|
+
ref?: default_2.Ref<GroupedVirtuosoHandle> | undefined;
|
|
226
|
+
}) => default_2.ReactElement;
|
|
227
227
|
|
|
228
228
|
export declare interface GroupedVirtuosoHandle {
|
|
229
229
|
scrollToIndex(location: number | IndexLocationWithAlign): void;
|
|
@@ -280,10 +280,10 @@ export declare interface GroupItem<D> extends Item<D> {
|
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
export declare interface GroupItemContent<D, C> {
|
|
283
|
-
(index: number, groupIndex: number, data: D, context: C):
|
|
283
|
+
(index: number, groupIndex: number, data: D, context: C): default_2.ReactNode;
|
|
284
284
|
}
|
|
285
285
|
|
|
286
|
-
export declare type GroupProps = Pick<
|
|
286
|
+
export declare type GroupProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children'> & {
|
|
287
287
|
'data-index': number;
|
|
288
288
|
'data-item-index': number;
|
|
289
289
|
'data-known-size': number;
|
|
@@ -299,10 +299,10 @@ export declare interface Item<D> {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
export declare interface ItemContent<D, C> {
|
|
302
|
-
(index: number, data: D, context: C):
|
|
302
|
+
(index: number, data: D, context: C): default_2.ReactNode;
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
export declare type ItemProps<D> = Pick<
|
|
305
|
+
export declare type ItemProps<D> = Pick<default_2.ComponentProps<'div'>, 'style' | 'children'> & {
|
|
306
306
|
'data-index': number;
|
|
307
307
|
'data-item-index': number;
|
|
308
308
|
'data-item-group-index'?: number;
|
|
@@ -315,16 +315,16 @@ export declare type ListItem<D> = RecordItem<D> | GroupItem<D>;
|
|
|
315
315
|
/**
|
|
316
316
|
* Passed to the Components.List custom component
|
|
317
317
|
*/
|
|
318
|
-
export declare type ListProps = Pick<
|
|
318
|
+
export declare type ListProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children'> & {
|
|
319
319
|
'data-testid': string;
|
|
320
|
-
} &
|
|
320
|
+
} & default_2.RefAttributes<HTMLDivElement>;
|
|
321
321
|
|
|
322
322
|
export declare interface ListRange {
|
|
323
323
|
startIndex: number;
|
|
324
324
|
endIndex: number;
|
|
325
325
|
}
|
|
326
326
|
|
|
327
|
-
export declare type ListRootProps = Omit<
|
|
327
|
+
export declare type ListRootProps = Omit<default_2.HTMLProps<HTMLDivElement>, 'ref' | 'data'>;
|
|
328
328
|
|
|
329
329
|
export declare interface LocationOptions {
|
|
330
330
|
/**
|
|
@@ -364,10 +364,10 @@ export declare interface ScrollContainerState {
|
|
|
364
364
|
/**
|
|
365
365
|
* Passed to the Components.Scroller custom component
|
|
366
366
|
*/
|
|
367
|
-
export declare type ScrollerProps = Pick<
|
|
367
|
+
export declare type ScrollerProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children' | 'tabIndex'> & {
|
|
368
368
|
'data-testid'?: string;
|
|
369
369
|
'data-virtuoso-scroller'?: boolean;
|
|
370
|
-
} &
|
|
370
|
+
} & default_2.RefAttributes<HTMLDivElement>;
|
|
371
371
|
|
|
372
372
|
export declare type ScrollIntoViewLocation = FlatScrollIntoViewLocation | GroupedScrollIntoViewLocation;
|
|
373
373
|
|
|
@@ -452,9 +452,9 @@ export declare interface StateSnapshot {
|
|
|
452
452
|
/**
|
|
453
453
|
* Passed to the Components.TableBody custom component
|
|
454
454
|
*/
|
|
455
|
-
export declare type TableBodyProps = Pick<
|
|
455
|
+
export declare type TableBodyProps = Pick<default_2.ComponentProps<'tbody'>, 'style' | 'children' | 'className'> & {
|
|
456
456
|
'data-testid': string;
|
|
457
|
-
} &
|
|
457
|
+
} & default_2.RefAttributes<HTMLTableSectionElement>;
|
|
458
458
|
|
|
459
459
|
/**
|
|
460
460
|
* Customize the TableVirtuoso rendering by passing a set of custom components.
|
|
@@ -464,68 +464,68 @@ export declare interface TableComponents<Data = unknown, Context = unknown> {
|
|
|
464
464
|
* Set to customize the wrapping `table` element.
|
|
465
465
|
*
|
|
466
466
|
*/
|
|
467
|
-
Table?:
|
|
467
|
+
Table?: default_2.ComponentType<TableProps & {
|
|
468
468
|
context?: Context;
|
|
469
469
|
}>;
|
|
470
470
|
/**
|
|
471
471
|
* Set to render a fixed header at the top of the table (`thead`). use [[fixedHeaderContent]] to set the contents
|
|
472
472
|
*
|
|
473
473
|
*/
|
|
474
|
-
TableHead?:
|
|
474
|
+
TableHead?: default_2.ComponentType<Pick<default_2.ComponentProps<'thead'>, 'style' | 'children'> & {
|
|
475
475
|
context?: Context;
|
|
476
|
-
} &
|
|
476
|
+
} & default_2.RefAttributes<HTMLTableSectionElement>>;
|
|
477
477
|
/**
|
|
478
478
|
* Set to render a fixed footer at the bottom of the table (`tfoot`). use [[fixedFooterContent]] to set the contents
|
|
479
479
|
*/
|
|
480
|
-
TableFoot?:
|
|
480
|
+
TableFoot?: default_2.ComponentType<Pick<default_2.ComponentProps<'tfoot'>, 'style' | 'children'> & {
|
|
481
481
|
context?: Context;
|
|
482
|
-
} &
|
|
482
|
+
} & default_2.RefAttributes<HTMLTableSectionElement>>;
|
|
483
483
|
/**
|
|
484
484
|
* Set to customize the item wrapping element. Default is `tr`.
|
|
485
485
|
*/
|
|
486
|
-
TableRow?:
|
|
486
|
+
TableRow?: default_2.ComponentType<ItemProps<Data> & {
|
|
487
487
|
context?: Context;
|
|
488
488
|
}>;
|
|
489
489
|
/**
|
|
490
490
|
* Set to customize the outermost scrollable element. This should not be necessary in general,
|
|
491
491
|
* as the component passes its HTML attribute props to it.
|
|
492
492
|
*/
|
|
493
|
-
Scroller?:
|
|
493
|
+
Scroller?: default_2.ComponentType<ScrollerProps & {
|
|
494
494
|
context?: Context;
|
|
495
495
|
}>;
|
|
496
496
|
/**
|
|
497
497
|
* Set to customize the items wrapper. Default is `tbody`.
|
|
498
498
|
*/
|
|
499
|
-
TableBody?:
|
|
499
|
+
TableBody?: default_2.ComponentType<TableBodyProps & {
|
|
500
500
|
context?: Context;
|
|
501
501
|
}>;
|
|
502
502
|
/**
|
|
503
503
|
* Set to render a custom UI when the list is empty.
|
|
504
504
|
*/
|
|
505
|
-
EmptyPlaceholder?:
|
|
505
|
+
EmptyPlaceholder?: default_2.ComponentType<{
|
|
506
506
|
context?: Context;
|
|
507
507
|
}>;
|
|
508
508
|
/**
|
|
509
509
|
* Set to render an item placeholder when the user scrolls fast. See the `scrollSeek` property for more details.
|
|
510
510
|
*/
|
|
511
|
-
ScrollSeekPlaceholder?:
|
|
511
|
+
ScrollSeekPlaceholder?: default_2.ComponentType<ScrollSeekPlaceholderProps & {
|
|
512
512
|
context?: Context;
|
|
513
513
|
}>;
|
|
514
514
|
/**
|
|
515
515
|
* Set to render an empty item placeholder.
|
|
516
516
|
*/
|
|
517
|
-
FillerRow?:
|
|
517
|
+
FillerRow?: default_2.ComponentType<FillerRowProps & {
|
|
518
518
|
context?: Context;
|
|
519
519
|
}>;
|
|
520
520
|
}
|
|
521
521
|
|
|
522
|
-
export declare type TableProps = Pick<
|
|
522
|
+
export declare type TableProps = Pick<default_2.ComponentProps<'table'>, 'style' | 'children'>;
|
|
523
523
|
|
|
524
|
-
export declare type TableRootProps = Omit<
|
|
524
|
+
export declare type TableRootProps = Omit<default_2.HTMLProps<HTMLTableElement>, 'ref' | 'data'>;
|
|
525
525
|
|
|
526
526
|
export declare const TableVirtuoso: <ItemData = any, Context = any>(props: TableVirtuosoProps<ItemData, Context> & {
|
|
527
|
-
ref?:
|
|
528
|
-
}) =>
|
|
527
|
+
ref?: default_2.Ref<TableVirtuosoHandle> | undefined;
|
|
528
|
+
}) => default_2.ReactElement;
|
|
529
529
|
|
|
530
530
|
export declare interface TableVirtuosoHandle {
|
|
531
531
|
scrollIntoView(location: number | FlatScrollIntoViewLocation): void;
|
|
@@ -722,15 +722,15 @@ export declare interface TableVirtuosoProps<D, C> extends Omit<VirtuosoProps<D,
|
|
|
722
722
|
restoreStateFrom?: StateSnapshot;
|
|
723
723
|
}
|
|
724
724
|
|
|
725
|
-
export declare type TopItemListProps = Pick<
|
|
725
|
+
export declare type TopItemListProps = Pick<default_2.ComponentProps<'div'>, 'style' | 'children'>;
|
|
726
726
|
|
|
727
727
|
export declare const Virtuoso: <ItemData = any, Context = any>(props: VirtuosoProps<ItemData, Context> & {
|
|
728
|
-
ref?:
|
|
729
|
-
}) =>
|
|
728
|
+
ref?: default_2.Ref<VirtuosoHandle> | undefined;
|
|
729
|
+
}) => default_2.ReactElement;
|
|
730
730
|
|
|
731
731
|
export declare const VirtuosoGrid: <ItemData = any, Context = any>(props: VirtuosoGridProps<ItemData, Context> & {
|
|
732
|
-
ref?:
|
|
733
|
-
}) =>
|
|
732
|
+
ref?: default_2.Ref<VirtuosoGridHandle> | undefined;
|
|
733
|
+
}) => default_2.ReactElement;
|
|
734
734
|
|
|
735
735
|
export declare interface VirtuosoGridHandle {
|
|
736
736
|
scrollToIndex(location: GridIndexLocation): void;
|
|
@@ -738,7 +738,7 @@ export declare interface VirtuosoGridHandle {
|
|
|
738
738
|
scrollBy(location: ScrollToOptions): void;
|
|
739
739
|
}
|
|
740
740
|
|
|
741
|
-
export declare const VirtuosoGridMockContext:
|
|
741
|
+
export declare const VirtuosoGridMockContext: default_2.Context<VirtuosoGridMockContextValue | undefined>;
|
|
742
742
|
|
|
743
743
|
export declare interface VirtuosoGridMockContextValue {
|
|
744
744
|
viewportHeight: number;
|
|
@@ -883,7 +883,7 @@ export declare interface VirtuosoHandle {
|
|
|
883
883
|
getState(stateCb: StateCallback): void;
|
|
884
884
|
}
|
|
885
885
|
|
|
886
|
-
export declare const VirtuosoMockContext:
|
|
886
|
+
export declare const VirtuosoMockContext: default_2.Context<VirtuosoMockContextValue | undefined>;
|
|
887
887
|
|
|
888
888
|
export declare interface VirtuosoMockContextValue {
|
|
889
889
|
viewportHeight: number;
|