@swan-io/lake 8.18.0 → 8.18.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/package.json
CHANGED
|
@@ -39,17 +39,19 @@ export type VirtualizedListProps<T, ExtraInfo> = {
|
|
|
39
39
|
onEndReachedThreshold?: number;
|
|
40
40
|
getRowLink?: (config: LinkConfig<T, ExtraInfo>) => ReactElement | undefined;
|
|
41
41
|
renderEmptyList?: () => ReactNode;
|
|
42
|
+
marginHorizontal?: string;
|
|
42
43
|
loading?: {
|
|
43
44
|
isLoading: boolean;
|
|
44
45
|
count: number;
|
|
45
46
|
};
|
|
46
47
|
};
|
|
47
|
-
export declare const VirtualizedList: <T, ExtraInfo>({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold, onEndReached, onEndReachedThreshold, loading, extraInfo, keyExtractor, }: VirtualizedListProps<T, ExtraInfo>) => import("react/jsx-runtime").JSX.Element;
|
|
48
|
+
export declare const VirtualizedList: <T, ExtraInfo>({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold, onEndReached, onEndReachedThreshold, loading, extraInfo, keyExtractor, marginHorizontal, }: VirtualizedListProps<T, ExtraInfo>) => import("react/jsx-runtime").JSX.Element;
|
|
48
49
|
type VirtualizedListPlaceholderProps = {
|
|
49
50
|
count: number;
|
|
50
51
|
rowHeight: number;
|
|
51
52
|
groupHeaderHeight?: number;
|
|
52
53
|
headerHeight?: number;
|
|
54
|
+
marginHorizontal?: string;
|
|
53
55
|
};
|
|
54
|
-
export declare const VirtualizedListPlaceholder: ({ count, rowHeight, groupHeaderHeight, headerHeight, }: VirtualizedListPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare const VirtualizedListPlaceholder: ({ count, rowHeight, groupHeaderHeight, headerHeight, marginHorizontal, }: VirtualizedListPlaceholderProps) => import("react/jsx-runtime").JSX.Element;
|
|
55
57
|
export {};
|
|
@@ -10,6 +10,7 @@ import { Space } from "./Space";
|
|
|
10
10
|
const styles = StyleSheet.create({
|
|
11
11
|
container: {
|
|
12
12
|
...commonStyles.fill,
|
|
13
|
+
height: 1,
|
|
13
14
|
alignSelf: "stretch",
|
|
14
15
|
},
|
|
15
16
|
headerRow: {
|
|
@@ -141,7 +142,7 @@ const styles = StyleSheet.create({
|
|
|
141
142
|
width: "10%",
|
|
142
143
|
},
|
|
143
144
|
});
|
|
144
|
-
export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold = 1000, onEndReached, onEndReachedThreshold = 200, loading, extraInfo, keyExtractor, }) => {
|
|
145
|
+
export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns, stickedToEndColumns, headerHeight, rowHeight, renderThreshold = 1000, onEndReached, onEndReachedThreshold = 200, loading, extraInfo, keyExtractor, marginHorizontal, }) => {
|
|
145
146
|
// Used for unique IDs generation (usefull for header IDs and cells aria-describedBy pointing to them)
|
|
146
147
|
const viewId = useId();
|
|
147
148
|
const scrollViewRef = useRef(null);
|
|
@@ -316,7 +317,7 @@ export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns,
|
|
|
316
317
|
},
|
|
317
318
|
] }));
|
|
318
319
|
}, [stickedToEndColumnsWidth, horizontalScrollPosition]);
|
|
319
|
-
return (_jsxs(ScrollView, { ref: scrollViewRef, both: true, style: styles.container, onScroll: onScroll, scrollEventThrottle: 32, contentContainerStyle: {
|
|
320
|
+
return (_jsxs(ScrollView, { ref: scrollViewRef, both: true, style: [styles.container, { marginHorizontal }], onScroll: onScroll, scrollEventThrottle: 32, contentContainerStyle: {
|
|
320
321
|
height: containerContainerHeight,
|
|
321
322
|
width: contentContainerWidth,
|
|
322
323
|
}, children: [header, rowsToRender
|
|
@@ -418,8 +419,8 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
|
|
|
418
419
|
});
|
|
419
420
|
};
|
|
420
421
|
const VirtualizedRow = memo(RawVirtualizedRow);
|
|
421
|
-
export const VirtualizedListPlaceholder = ({ count, rowHeight, groupHeaderHeight, headerHeight, }) => {
|
|
422
|
-
return (_jsxs(View, { style: styles.container, children: [headerHeight != null ? _jsx(View, { style: { height: headerHeight } }) : null, groupHeaderHeight != groupHeaderHeight ? _jsx(View, { style: { height: headerHeight } }) : null, _jsx(View, { children: Array.from({ length: count }, (_, index) => {
|
|
422
|
+
export const VirtualizedListPlaceholder = ({ count, rowHeight, groupHeaderHeight, headerHeight, marginHorizontal, }) => {
|
|
423
|
+
return (_jsxs(View, { style: [styles.container, { marginHorizontal }], children: [headerHeight != null ? _jsx(View, { style: { height: headerHeight } }) : null, groupHeaderHeight != groupHeaderHeight ? _jsx(View, { style: { height: headerHeight } }) : null, _jsx(View, { children: Array.from({ length: count }, (_, index) => {
|
|
423
424
|
const top = index * rowHeight;
|
|
424
425
|
return (_jsx(View, { style: [styles.placeholderRowContainer, { height: rowHeight, top }], children: _jsxs(View, { style: styles.placeholderRowContents, children: [_jsx(View, { style: styles.placeholderRow }), _jsx(Space, { width: 32 }), _jsx(View, { style: [styles.placeholderRow, styles.smallPlaceholderRow] }), _jsx(Space, { width: 32 }), _jsx(View, { style: styles.placeholderRowEnd, children: _jsx(View, { style: [styles.placeholderRow, styles.smallPlaceholderRow] }) })] }) }, String(index)));
|
|
425
426
|
}) })] }));
|