@legendapp/list 2.0.9 → 2.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/index.d.mts +10 -2
- package/index.d.ts +10 -2
- package/index.js +256 -179
- package/index.mjs +257 -180
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 2.0.11
|
|
2
|
+
- Fix: Missing React import in a file
|
|
3
|
+
|
|
4
|
+
## 2.0.10
|
|
5
|
+
- Feat: Add onStickyHeaderChange callback for sticky headers
|
|
6
|
+
- Fix: Items with a falsy value like 0 were not rendering
|
|
7
|
+
- Fix: Column positions sometimes not calculating correctly
|
|
8
|
+
- Perf: updateItemsPositions was not breaking early sometimes
|
|
9
|
+
- Perf: Changed idCache to be an array instead of a Map for better performance
|
|
10
|
+
- Perf: Speed up container reuse lookups
|
|
11
|
+
|
|
1
12
|
## 2.0.9
|
|
2
13
|
- Fix: Improve initialScrollIndex accuracy and reliability
|
|
3
14
|
|
package/index.d.mts
CHANGED
|
@@ -209,6 +209,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
209
209
|
* @default 0.5
|
|
210
210
|
*/
|
|
211
211
|
onStartReachedThreshold?: number | null | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Called when the sticky header changes.
|
|
214
|
+
*/
|
|
215
|
+
onStickyHeaderChange?: (info: {
|
|
216
|
+
index: number;
|
|
217
|
+
item: any;
|
|
218
|
+
}) => void;
|
|
212
219
|
/**
|
|
213
220
|
* Called when the viewability of items changes.
|
|
214
221
|
*/
|
|
@@ -316,7 +323,7 @@ interface InternalState {
|
|
|
316
323
|
timeoutSizeMessage: any;
|
|
317
324
|
nativeMarginTop: number;
|
|
318
325
|
indexByKey: Map<string, number>;
|
|
319
|
-
idCache:
|
|
326
|
+
idCache: string[];
|
|
320
327
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
321
328
|
scrollHistory: Array<{
|
|
322
329
|
scroll: number;
|
|
@@ -380,6 +387,7 @@ interface InternalState {
|
|
|
380
387
|
onScroll: LegendListProps["onScroll"];
|
|
381
388
|
onStartReached: LegendListProps["onStartReached"];
|
|
382
389
|
onStartReachedThreshold: number | null | undefined;
|
|
390
|
+
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
383
391
|
recycleItems: boolean;
|
|
384
392
|
suggestEstimatedItemSize: boolean;
|
|
385
393
|
stylePaddingBottom: number | undefined;
|
|
@@ -542,7 +550,7 @@ interface ViewAmountToken<ItemT = any> extends ViewToken<ItemT> {
|
|
|
542
550
|
percentOfScroller: number;
|
|
543
551
|
scrollSize: number;
|
|
544
552
|
}
|
|
545
|
-
interface ViewabilityConfigCallbackPair<ItemT> {
|
|
553
|
+
interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
546
554
|
viewabilityConfig: ViewabilityConfig;
|
|
547
555
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT>;
|
|
548
556
|
}
|
package/index.d.ts
CHANGED
|
@@ -209,6 +209,13 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
209
209
|
* @default 0.5
|
|
210
210
|
*/
|
|
211
211
|
onStartReachedThreshold?: number | null | undefined;
|
|
212
|
+
/**
|
|
213
|
+
* Called when the sticky header changes.
|
|
214
|
+
*/
|
|
215
|
+
onStickyHeaderChange?: (info: {
|
|
216
|
+
index: number;
|
|
217
|
+
item: any;
|
|
218
|
+
}) => void;
|
|
212
219
|
/**
|
|
213
220
|
* Called when the viewability of items changes.
|
|
214
221
|
*/
|
|
@@ -316,7 +323,7 @@ interface InternalState {
|
|
|
316
323
|
timeoutSizeMessage: any;
|
|
317
324
|
nativeMarginTop: number;
|
|
318
325
|
indexByKey: Map<string, number>;
|
|
319
|
-
idCache:
|
|
326
|
+
idCache: string[];
|
|
320
327
|
viewabilityConfigCallbackPairs: ViewabilityConfigCallbackPairs<any> | undefined;
|
|
321
328
|
scrollHistory: Array<{
|
|
322
329
|
scroll: number;
|
|
@@ -380,6 +387,7 @@ interface InternalState {
|
|
|
380
387
|
onScroll: LegendListProps["onScroll"];
|
|
381
388
|
onStartReached: LegendListProps["onStartReached"];
|
|
382
389
|
onStartReachedThreshold: number | null | undefined;
|
|
390
|
+
onStickyHeaderChange: LegendListProps["onStickyHeaderChange"];
|
|
383
391
|
recycleItems: boolean;
|
|
384
392
|
suggestEstimatedItemSize: boolean;
|
|
385
393
|
stylePaddingBottom: number | undefined;
|
|
@@ -542,7 +550,7 @@ interface ViewAmountToken<ItemT = any> extends ViewToken<ItemT> {
|
|
|
542
550
|
percentOfScroller: number;
|
|
543
551
|
scrollSize: number;
|
|
544
552
|
}
|
|
545
|
-
interface ViewabilityConfigCallbackPair<ItemT> {
|
|
553
|
+
interface ViewabilityConfigCallbackPair<ItemT = any> {
|
|
546
554
|
viewabilityConfig: ViewabilityConfig;
|
|
547
555
|
onViewableItemsChanged?: OnViewableItemsChanged<ItemT>;
|
|
548
556
|
}
|