@legendapp/list 1.1.1 → 1.1.2
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/.DS_Store +0 -0
- package/CHANGELOG.md +3 -0
- package/animated.d.mts +2 -2
- package/animated.d.ts +2 -2
- package/index.d.mts +12 -12
- package/index.d.ts +12 -12
- package/index.js +5 -5
- package/index.mjs +5 -5
- package/package.json +1 -1
package/.DS_Store
ADDED
|
Binary file
|
package/CHANGELOG.md
CHANGED
package/animated.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { Animated } from 'react-native';
|
|
5
5
|
|
|
6
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
6
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
7
7
|
alignItemsAtEnd?: boolean;
|
|
8
8
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
9
9
|
data: readonly T[];
|
|
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
56
56
|
recycleItems?: boolean;
|
|
57
57
|
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
58
58
|
refreshing?: boolean;
|
|
59
|
-
renderItem?:
|
|
59
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
|
|
60
60
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
61
61
|
suggestEstimatedItemSize?: boolean;
|
|
62
62
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
package/animated.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as _legendapp_list from '@legendapp/list';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { Animated } from 'react-native';
|
|
5
5
|
|
|
6
|
-
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
6
|
+
declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
7
7
|
alignItemsAtEnd?: boolean;
|
|
8
8
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
9
9
|
data: readonly T[];
|
|
@@ -56,7 +56,7 @@ declare const AnimatedLegendList: Animated.AnimatedComponent<(<T>(props: Omit<Om
|
|
|
56
56
|
recycleItems?: boolean;
|
|
57
57
|
refScrollView?: React.Ref<react_native.ScrollView>;
|
|
58
58
|
refreshing?: boolean;
|
|
59
|
-
renderItem?:
|
|
59
|
+
renderItem?: ((props: _legendapp_list.LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<_legendapp_list.LegendListRenderItemProps<T>> | undefined;
|
|
60
60
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React.ReactElement<react_native.ScrollViewProps>;
|
|
61
61
|
suggestEstimatedItemSize?: boolean;
|
|
62
62
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
package/index.d.mts
CHANGED
|
@@ -3,9 +3,9 @@ import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
5
5
|
import Animated from 'react-native-reanimated';
|
|
6
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
7
6
|
import * as _legendapp_list from '@legendapp/list';
|
|
8
|
-
import { LegendListProps as LegendListProps$1,
|
|
7
|
+
import { LegendListProps as LegendListProps$1, LegendListRef as LegendListRef$1, LegendListRenderItemProps as LegendListRenderItemProps$1 } from '@legendapp/list';
|
|
8
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
9
9
|
|
|
10
10
|
declare class ScrollAdjustHandler {
|
|
11
11
|
private ctx;
|
|
@@ -499,7 +499,7 @@ type ScrollIndexWithOffsetPosition = {
|
|
|
499
499
|
viewPosition?: number;
|
|
500
500
|
};
|
|
501
501
|
|
|
502
|
-
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
502
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
503
503
|
alignItemsAtEnd?: boolean;
|
|
504
504
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
505
505
|
data: readonly T[];
|
|
@@ -552,7 +552,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
552
552
|
recycleItems?: boolean;
|
|
553
553
|
refScrollView?: React$1.Ref<ScrollView>;
|
|
554
554
|
refreshing?: boolean;
|
|
555
|
-
renderItem?:
|
|
555
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
556
556
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
557
557
|
suggestEstimatedItemSize?: boolean;
|
|
558
558
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -567,7 +567,9 @@ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT
|
|
|
567
567
|
children?: React$1.ReactNode | undefined;
|
|
568
568
|
LegendList?: ListT;
|
|
569
569
|
}
|
|
570
|
-
declare const LazyLegendList: <ItemT, ListT extends (<
|
|
570
|
+
declare const LazyLegendList: <ItemT, ListT extends (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
571
|
+
ref?: React$1.Ref<LegendListRef$1>;
|
|
572
|
+
}) => React$1.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
571
573
|
alignItemsAtEnd?: boolean;
|
|
572
574
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
573
575
|
data: readonly T[];
|
|
@@ -620,7 +622,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
620
622
|
recycleItems?: boolean;
|
|
621
623
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
622
624
|
refreshing?: boolean;
|
|
623
|
-
renderItem?:
|
|
625
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
624
626
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
625
627
|
suggestEstimatedItemSize?: boolean;
|
|
626
628
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -629,7 +631,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
629
631
|
onLoad?: (info: {
|
|
630
632
|
elapsedTimeInMs: number;
|
|
631
633
|
}) => void;
|
|
632
|
-
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
634
|
+
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
633
635
|
alignItemsAtEnd?: boolean;
|
|
634
636
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
635
637
|
data: readonly T[];
|
|
@@ -682,7 +684,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
682
684
|
recycleItems?: boolean;
|
|
683
685
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
684
686
|
refreshing?: boolean;
|
|
685
|
-
renderItem?:
|
|
687
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
686
688
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
687
689
|
suggestEstimatedItemSize?: boolean;
|
|
688
690
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -691,9 +693,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
691
693
|
onLoad?: (info: {
|
|
692
694
|
elapsedTimeInMs: number;
|
|
693
695
|
}) => void;
|
|
694
|
-
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)>
|
|
695
|
-
ref?: React$1.Ref<LegendListRef$1>;
|
|
696
|
-
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
696
|
+
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
697
697
|
alignItemsAtEnd?: boolean;
|
|
698
698
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
699
699
|
data: readonly T[];
|
|
@@ -746,7 +746,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
746
746
|
recycleItems?: boolean;
|
|
747
747
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
748
748
|
refreshing?: boolean;
|
|
749
|
-
renderItem?:
|
|
749
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
750
750
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
751
751
|
suggestEstimatedItemSize?: boolean;
|
|
752
752
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
package/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import { ComponentProps, ReactNode, Dispatch, SetStateAction } from 'react';
|
|
|
3
3
|
import * as react_native from 'react-native';
|
|
4
4
|
import { ScrollView, StyleProp, ViewStyle, ScrollViewProps, NativeSyntheticEvent, NativeScrollEvent, ScrollViewComponent, ScrollResponderMixin } from 'react-native';
|
|
5
5
|
import Animated from 'react-native-reanimated';
|
|
6
|
-
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
7
6
|
import * as _legendapp_list from '@legendapp/list';
|
|
8
|
-
import { LegendListProps as LegendListProps$1,
|
|
7
|
+
import { LegendListProps as LegendListProps$1, LegendListRef as LegendListRef$1, LegendListRenderItemProps as LegendListRenderItemProps$1 } from '@legendapp/list';
|
|
8
|
+
import * as _legendapp_list_reanimated from '@legendapp/list/reanimated';
|
|
9
9
|
|
|
10
10
|
declare class ScrollAdjustHandler {
|
|
11
11
|
private ctx;
|
|
@@ -499,7 +499,7 @@ type ScrollIndexWithOffsetPosition = {
|
|
|
499
499
|
viewPosition?: number;
|
|
500
500
|
};
|
|
501
501
|
|
|
502
|
-
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
502
|
+
declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
503
503
|
alignItemsAtEnd?: boolean;
|
|
504
504
|
columnWrapperStyle?: ColumnWrapperStyle;
|
|
505
505
|
data: readonly T[];
|
|
@@ -552,7 +552,7 @@ declare const LegendList: <T>(props: Omit<Omit<react_native.ScrollViewProps, "sc
|
|
|
552
552
|
recycleItems?: boolean;
|
|
553
553
|
refScrollView?: React$1.Ref<ScrollView>;
|
|
554
554
|
refreshing?: boolean;
|
|
555
|
-
renderItem?:
|
|
555
|
+
renderItem?: ((props: LegendListRenderItemProps<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps<T>> | undefined;
|
|
556
556
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
557
557
|
suggestEstimatedItemSize?: boolean;
|
|
558
558
|
viewabilityConfig?: ViewabilityConfig;
|
|
@@ -567,7 +567,9 @@ interface LazyLegendListProps<ItemT, ListT> extends Omit<LegendListProps$1<ItemT
|
|
|
567
567
|
children?: React$1.ReactNode | undefined;
|
|
568
568
|
LegendList?: ListT;
|
|
569
569
|
}
|
|
570
|
-
declare const LazyLegendList: <ItemT, ListT extends (<
|
|
570
|
+
declare const LazyLegendList: <ItemT, ListT extends (<ItemT_1>(props: _legendapp_list_reanimated.AnimatedLegendListProps<ItemT_1> & {
|
|
571
|
+
ref?: React$1.Ref<LegendListRef$1>;
|
|
572
|
+
}) => React$1.ReactElement | null) | (<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
571
573
|
alignItemsAtEnd?: boolean;
|
|
572
574
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
573
575
|
data: readonly T[];
|
|
@@ -620,7 +622,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
620
622
|
recycleItems?: boolean;
|
|
621
623
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
622
624
|
refreshing?: boolean;
|
|
623
|
-
renderItem?:
|
|
625
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
624
626
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
625
627
|
suggestEstimatedItemSize?: boolean;
|
|
626
628
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -629,7 +631,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
629
631
|
onLoad?: (info: {
|
|
630
632
|
elapsedTimeInMs: number;
|
|
631
633
|
}) => void;
|
|
632
|
-
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "
|
|
634
|
+
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode) | react_native.Animated.AnimatedComponent<(<T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
633
635
|
alignItemsAtEnd?: boolean;
|
|
634
636
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
635
637
|
data: readonly T[];
|
|
@@ -682,7 +684,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
682
684
|
recycleItems?: boolean;
|
|
683
685
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
684
686
|
refreshing?: boolean;
|
|
685
|
-
renderItem?:
|
|
687
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
686
688
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
687
689
|
suggestEstimatedItemSize?: boolean;
|
|
688
690
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
|
@@ -691,9 +693,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
691
693
|
onLoad?: (info: {
|
|
692
694
|
elapsedTimeInMs: number;
|
|
693
695
|
}) => void;
|
|
694
|
-
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)>
|
|
695
|
-
ref?: React$1.Ref<LegendListRef$1>;
|
|
696
|
-
}) => React$1.ReactElement | null) = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "contentOffset" | "contentInset" | "maintainVisibleContentPosition" | "stickyHeaderIndices" | "removeClippedSubviews" | "children"> & {
|
|
696
|
+
} & React$1.RefAttributes<LegendListRef$1>) => React$1.ReactNode)> = <T>(props: Omit<Omit<react_native.ScrollViewProps, "scrollEventThrottle">, "removeClippedSubviews" | "stickyHeaderIndices" | "children" | "contentInset" | "contentOffset" | "maintainVisibleContentPosition"> & {
|
|
697
697
|
alignItemsAtEnd?: boolean;
|
|
698
698
|
columnWrapperStyle?: _legendapp_list.ColumnWrapperStyle;
|
|
699
699
|
data: readonly T[];
|
|
@@ -746,7 +746,7 @@ declare const LazyLegendList: <ItemT, ListT extends (<T>(props: Omit<Omit<react_
|
|
|
746
746
|
recycleItems?: boolean;
|
|
747
747
|
refScrollView?: React$1.Ref<react_native.ScrollView>;
|
|
748
748
|
refreshing?: boolean;
|
|
749
|
-
renderItem?:
|
|
749
|
+
renderItem?: ((props: LegendListRenderItemProps$1<T>) => React$1.ReactNode) | React$1.ComponentType<LegendListRenderItemProps$1<T>> | undefined;
|
|
750
750
|
renderScrollComponent?: (props: react_native.ScrollViewProps) => React$1.ReactElement<react_native.ScrollViewProps>;
|
|
751
751
|
suggestEstimatedItemSize?: boolean;
|
|
752
752
|
viewabilityConfig?: _legendapp_list.ViewabilityConfig;
|
package/index.js
CHANGED
|
@@ -376,17 +376,18 @@ var Container = ({
|
|
|
376
376
|
const [layoutRenderCount, forceLayoutRender] = React2.useState(0);
|
|
377
377
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
378
378
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
379
|
+
const isALastItem = lastItemKeys.includes(itemKey);
|
|
379
380
|
let paddingStyles;
|
|
380
381
|
if (columnWrapperStyle) {
|
|
381
382
|
const { columnGap, rowGap, gap } = columnWrapperStyle;
|
|
382
383
|
if (horizontal) {
|
|
383
384
|
paddingStyles = {
|
|
384
|
-
paddingRight: !
|
|
385
|
+
paddingRight: !isALastItem ? columnGap || gap || void 0 : void 0,
|
|
385
386
|
paddingVertical: numColumns > 1 ? (rowGap || gap || 0) / 2 : void 0
|
|
386
387
|
};
|
|
387
388
|
} else {
|
|
388
389
|
paddingStyles = {
|
|
389
|
-
paddingBottom: !
|
|
390
|
+
paddingBottom: !isALastItem ? rowGap || gap || void 0 : void 0,
|
|
390
391
|
paddingHorizontal: numColumns > 1 ? (columnGap || gap || 0) / 2 : void 0
|
|
391
392
|
};
|
|
392
393
|
}
|
|
@@ -445,7 +446,7 @@ var Container = ({
|
|
|
445
446
|
}
|
|
446
447
|
}
|
|
447
448
|
}
|
|
448
|
-
}, [itemKey, layoutRenderCount]);
|
|
449
|
+
}, [itemKey, layoutRenderCount, isALastItem]);
|
|
449
450
|
} else {
|
|
450
451
|
React2.useEffect(() => {
|
|
451
452
|
if (!isNullOrUndefined(itemKey)) {
|
|
@@ -464,7 +465,7 @@ var Container = ({
|
|
|
464
465
|
ctx.viewRefs.set(id, ref);
|
|
465
466
|
return { containerId: id, itemKey, index, value: data, triggerLayout };
|
|
466
467
|
}, [id, itemKey, index, data]);
|
|
467
|
-
const contentFragment = /* @__PURE__ */ React2__namespace.default.createElement(React2__namespace.default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__namespace.default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !
|
|
468
|
+
const contentFragment = /* @__PURE__ */ React2__namespace.default.createElement(React2__namespace.default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__namespace.default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !isALastItem && /* @__PURE__ */ React2__namespace.default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
|
|
468
469
|
if (maintainVisibleContentPosition) {
|
|
469
470
|
const anchorStyle = horizontal ? position.type === "top" ? { position: "absolute", left: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : { position: "absolute", right: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
|
|
470
471
|
if (__DEV__ && ENABLE_DEVMODE) {
|
|
@@ -2592,7 +2593,6 @@ var LazyLegendList = typedForwardRef2(function LazyLegendList2(props, forwardedR
|
|
|
2592
2593
|
const { LegendList: LegendListProp, children, ...rest } = props;
|
|
2593
2594
|
const LegendListComponent = LegendListProp != null ? LegendListProp : list.LegendList;
|
|
2594
2595
|
const data = (isArray(children) ? children : React2__namespace.Children.toArray(children)).flat(1);
|
|
2595
|
-
console.log({ data });
|
|
2596
2596
|
return (
|
|
2597
2597
|
// @ts-expect-error TODO: Fix this type
|
|
2598
2598
|
/* @__PURE__ */ React2__namespace.createElement(LegendListComponent, { ...rest, data, renderItem, ref: forwardedRef })
|
package/index.mjs
CHANGED
|
@@ -355,17 +355,18 @@ var Container = ({
|
|
|
355
355
|
const [layoutRenderCount, forceLayoutRender] = useState(0);
|
|
356
356
|
const otherAxisPos = numColumns > 1 ? `${(column - 1) / numColumns * 100}%` : 0;
|
|
357
357
|
const otherAxisSize = numColumns > 1 ? `${1 / numColumns * 100}%` : void 0;
|
|
358
|
+
const isALastItem = lastItemKeys.includes(itemKey);
|
|
358
359
|
let paddingStyles;
|
|
359
360
|
if (columnWrapperStyle) {
|
|
360
361
|
const { columnGap, rowGap, gap } = columnWrapperStyle;
|
|
361
362
|
if (horizontal) {
|
|
362
363
|
paddingStyles = {
|
|
363
|
-
paddingRight: !
|
|
364
|
+
paddingRight: !isALastItem ? columnGap || gap || void 0 : void 0,
|
|
364
365
|
paddingVertical: numColumns > 1 ? (rowGap || gap || 0) / 2 : void 0
|
|
365
366
|
};
|
|
366
367
|
} else {
|
|
367
368
|
paddingStyles = {
|
|
368
|
-
paddingBottom: !
|
|
369
|
+
paddingBottom: !isALastItem ? rowGap || gap || void 0 : void 0,
|
|
369
370
|
paddingHorizontal: numColumns > 1 ? (columnGap || gap || 0) / 2 : void 0
|
|
370
371
|
};
|
|
371
372
|
}
|
|
@@ -424,7 +425,7 @@ var Container = ({
|
|
|
424
425
|
}
|
|
425
426
|
}
|
|
426
427
|
}
|
|
427
|
-
}, [itemKey, layoutRenderCount]);
|
|
428
|
+
}, [itemKey, layoutRenderCount, isALastItem]);
|
|
428
429
|
} else {
|
|
429
430
|
useEffect(() => {
|
|
430
431
|
if (!isNullOrUndefined(itemKey)) {
|
|
@@ -443,7 +444,7 @@ var Container = ({
|
|
|
443
444
|
ctx.viewRefs.set(id, ref);
|
|
444
445
|
return { containerId: id, itemKey, index, value: data, triggerLayout };
|
|
445
446
|
}, [id, itemKey, index, data]);
|
|
446
|
-
const contentFragment = /* @__PURE__ */ React2__default.createElement(React2__default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !
|
|
447
|
+
const contentFragment = /* @__PURE__ */ React2__default.createElement(React2__default.Fragment, { key: recycleItems ? void 0 : itemKey }, /* @__PURE__ */ React2__default.createElement(ContextContainer.Provider, { value: contextValue }, renderedItem, renderedItemInfo && ItemSeparatorComponent && !isALastItem && /* @__PURE__ */ React2__default.createElement(ItemSeparatorComponent, { leadingItem: renderedItemInfo.item })));
|
|
447
448
|
if (maintainVisibleContentPosition) {
|
|
448
449
|
const anchorStyle = horizontal ? position.type === "top" ? { position: "absolute", left: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : { position: "absolute", right: 0, top: 0, bottom: 0, flexDirection: "row", alignItems: "stretch" } : position.type === "top" ? { position: "absolute", top: 0, left: 0, right: 0 } : { position: "absolute", bottom: 0, left: 0, right: 0 };
|
|
449
450
|
if (__DEV__ && ENABLE_DEVMODE) {
|
|
@@ -2571,7 +2572,6 @@ var LazyLegendList = typedForwardRef2(function LazyLegendList2(props, forwardedR
|
|
|
2571
2572
|
const { LegendList: LegendListProp, children, ...rest } = props;
|
|
2572
2573
|
const LegendListComponent = LegendListProp != null ? LegendListProp : LegendList$1;
|
|
2573
2574
|
const data = (isArray(children) ? children : React2.Children.toArray(children)).flat(1);
|
|
2574
|
-
console.log({ data });
|
|
2575
2575
|
return (
|
|
2576
2576
|
// @ts-expect-error TODO: Fix this type
|
|
2577
2577
|
/* @__PURE__ */ React2.createElement(LegendListComponent, { ...rest, data, renderItem, ref: forwardedRef })
|
package/package.json
CHANGED