@legendapp/list 3.0.0-beta.13 → 3.0.0-beta.15
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 +19 -0
- package/README.md +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +57 -29
- package/index.mjs +57 -29
- package/index.native.d.mts +2 -2
- package/index.native.d.ts +2 -2
- package/index.native.js +92 -42
- package/index.native.mjs +92 -42
- package/package.json +1 -1
- package/reanimated.js +2 -2
- package/reanimated.mjs +2 -2
- package/section-list.d.mts +1 -1
- package/section-list.d.ts +1 -1
- package/section-list.js +57 -29
- package/section-list.mjs +57 -29
- package/section-list.native.d.mts +1 -1
- package/section-list.native.d.ts +1 -1
- package/section-list.native.js +92 -42
- package/section-list.native.mjs +92 -42
- package/{types-BSoW8ni4.d.mts → types-Dj2MEm9V.d.mts} +25 -7
- package/{types-BSoW8ni4.d.ts → types-Dj2MEm9V.d.ts} +25 -7
|
@@ -76,7 +76,7 @@ declare class ScrollAdjustHandler {
|
|
|
76
76
|
constructor(ctx: StateContext);
|
|
77
77
|
requestAdjust(add: number): void;
|
|
78
78
|
getAdjust(): number;
|
|
79
|
-
commitPendingAdjust(): void;
|
|
79
|
+
commitPendingAdjust(scrollTarget: ScrollTarget): void;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
type BaseSharedValue<T = number> = {
|
|
@@ -223,7 +223,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
223
223
|
/**
|
|
224
224
|
* Maintains visibility of content.
|
|
225
225
|
* - scroll (default: true) stabilizes during size/layout changes while scrolling.
|
|
226
|
-
* -
|
|
226
|
+
* - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
|
|
227
227
|
* - undefined (default) enables scroll stabilization but skips data-change anchoring.
|
|
228
228
|
* - true enables both behaviors; false disables both.
|
|
229
229
|
*/
|
|
@@ -340,18 +340,36 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
340
340
|
* @deprecated Use stickyHeaderIndices instead for parity with React Native.
|
|
341
341
|
*/
|
|
342
342
|
stickyIndices?: number[];
|
|
343
|
+
/**
|
|
344
|
+
* Configuration for sticky headers.
|
|
345
|
+
* @default undefined
|
|
346
|
+
*/
|
|
347
|
+
stickyHeaderConfig?: StickyHeaderConfig;
|
|
343
348
|
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
344
349
|
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
|
|
345
350
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
346
351
|
}
|
|
347
352
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
348
353
|
interface MaintainVisibleContentPositionConfig {
|
|
349
|
-
|
|
350
|
-
|
|
354
|
+
data?: boolean;
|
|
355
|
+
size?: boolean;
|
|
351
356
|
}
|
|
352
357
|
interface MaintainVisibleContentPositionNormalized {
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
data: boolean;
|
|
359
|
+
size: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface StickyHeaderConfig {
|
|
362
|
+
/**
|
|
363
|
+
* Specifies how far from the top edge sticky headers should start sticking.
|
|
364
|
+
* Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
|
|
365
|
+
* @default 0
|
|
366
|
+
*/
|
|
367
|
+
offset?: number;
|
|
368
|
+
/**
|
|
369
|
+
* Component to render as a backdrop behind the sticky header.
|
|
370
|
+
* @default undefined
|
|
371
|
+
*/
|
|
372
|
+
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
355
373
|
}
|
|
356
374
|
interface MaintainScrollAtEndOptions {
|
|
357
375
|
onLayout?: boolean;
|
|
@@ -731,4 +749,4 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
731
749
|
};
|
|
732
750
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
733
751
|
|
|
734
|
-
export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type
|
|
752
|
+
export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type StickyHeaderConfig as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ScrollTarget as g, type ViewableRange as h, type LegendListRenderItemProps as i, type LegendListState as j, type ViewToken as k, type ViewAmountToken as l, type ViewabilityConfigCallbackPair as m, type ViewabilityConfigCallbackPairs as n, type ViewabilityConfig as o, type TypedForwardRef as p, type TypedMemo as q, typedMemo as r, type ScrollIndexWithOffset as s, typedForwardRef as t, type ScrollIndexWithOffsetPosition as u, type ScrollIndexWithOffsetAndContentOffset as v, type InitialScrollAnchor as w, type GetRenderedItem as x };
|
|
@@ -76,7 +76,7 @@ declare class ScrollAdjustHandler {
|
|
|
76
76
|
constructor(ctx: StateContext);
|
|
77
77
|
requestAdjust(add: number): void;
|
|
78
78
|
getAdjust(): number;
|
|
79
|
-
commitPendingAdjust(): void;
|
|
79
|
+
commitPendingAdjust(scrollTarget: ScrollTarget): void;
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
type BaseSharedValue<T = number> = {
|
|
@@ -223,7 +223,7 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
223
223
|
/**
|
|
224
224
|
* Maintains visibility of content.
|
|
225
225
|
* - scroll (default: true) stabilizes during size/layout changes while scrolling.
|
|
226
|
-
* -
|
|
226
|
+
* - data (default: false) stabilizes when the data array changes; passing true also sets the RN maintainVisibleContentPosition prop.
|
|
227
227
|
* - undefined (default) enables scroll stabilization but skips data-change anchoring.
|
|
228
228
|
* - true enables both behaviors; false disables both.
|
|
229
229
|
*/
|
|
@@ -340,18 +340,36 @@ interface LegendListSpecificProps<ItemT, TItemType extends string | undefined> {
|
|
|
340
340
|
* @deprecated Use stickyHeaderIndices instead for parity with React Native.
|
|
341
341
|
*/
|
|
342
342
|
stickyIndices?: number[];
|
|
343
|
+
/**
|
|
344
|
+
* Configuration for sticky headers.
|
|
345
|
+
* @default undefined
|
|
346
|
+
*/
|
|
347
|
+
stickyHeaderConfig?: StickyHeaderConfig;
|
|
343
348
|
getItemType?: (item: ItemT, index: number) => TItemType;
|
|
344
349
|
getFixedItemSize?: (index: number, item: ItemT, type: TItemType) => number | undefined;
|
|
345
350
|
itemsAreEqual?: (itemPrevious: ItemT, item: ItemT, index: number, data: readonly ItemT[]) => boolean;
|
|
346
351
|
}
|
|
347
352
|
type LegendListPropsBase<ItemT, TScrollView extends ComponentProps<typeof ScrollView> | ComponentProps<typeof Animated.ScrollView> | ComponentProps<typeof Reanimated.ScrollView>, TItemType extends string | undefined = string | undefined> = BaseScrollViewProps<TScrollView> & LegendListSpecificProps<ItemT, TItemType> & (DataModeProps<ItemT, TItemType> | ChildrenModeProps);
|
|
348
353
|
interface MaintainVisibleContentPositionConfig {
|
|
349
|
-
|
|
350
|
-
|
|
354
|
+
data?: boolean;
|
|
355
|
+
size?: boolean;
|
|
351
356
|
}
|
|
352
357
|
interface MaintainVisibleContentPositionNormalized {
|
|
353
|
-
|
|
354
|
-
|
|
358
|
+
data: boolean;
|
|
359
|
+
size: boolean;
|
|
360
|
+
}
|
|
361
|
+
interface StickyHeaderConfig {
|
|
362
|
+
/**
|
|
363
|
+
* Specifies how far from the top edge sticky headers should start sticking.
|
|
364
|
+
* Useful for scenarios with a fixed navbar or header, where sticky elements pin below it..
|
|
365
|
+
* @default 0
|
|
366
|
+
*/
|
|
367
|
+
offset?: number;
|
|
368
|
+
/**
|
|
369
|
+
* Component to render as a backdrop behind the sticky header.
|
|
370
|
+
* @default undefined
|
|
371
|
+
*/
|
|
372
|
+
backdropComponent?: React.ComponentType<any> | React.ReactElement | null | undefined;
|
|
355
373
|
}
|
|
356
374
|
interface MaintainScrollAtEndOptions {
|
|
357
375
|
onLayout?: boolean;
|
|
@@ -731,4 +749,4 @@ type GetRenderedItemResult<ItemT> = {
|
|
|
731
749
|
};
|
|
732
750
|
type GetRenderedItem = (key: string) => GetRenderedItemResult<any> | null;
|
|
733
751
|
|
|
734
|
-
export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type
|
|
752
|
+
export { type ColumnWrapperStyle as C, type GetRenderedItemResult as G, type InternalState as I, type LegendListProps as L, type MaintainVisibleContentPositionConfig as M, type OnViewableItemsChanged as O, type StickyHeaderConfig as S, type ThresholdSnapshot as T, type ViewabilityCallback as V, type LegendListRef as a, type ViewabilityAmountCallback as b, type LegendListRecyclingState as c, type LegendListPropsBase as d, type MaintainVisibleContentPositionNormalized as e, type MaintainScrollAtEndOptions as f, type ScrollTarget as g, type ViewableRange as h, type LegendListRenderItemProps as i, type LegendListState as j, type ViewToken as k, type ViewAmountToken as l, type ViewabilityConfigCallbackPair as m, type ViewabilityConfigCallbackPairs as n, type ViewabilityConfig as o, type TypedForwardRef as p, type TypedMemo as q, typedMemo as r, type ScrollIndexWithOffset as s, typedForwardRef as t, type ScrollIndexWithOffsetPosition as u, type ScrollIndexWithOffsetAndContentOffset as v, type InitialScrollAnchor as w, type GetRenderedItem as x };
|