@swan-io/lake 8.18.1 → 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/lake",
3
- "version": "8.18.1",
3
+ "version": "8.18.2",
4
4
  "engines": {
5
5
  "node": ">=20.9.0",
6
6
  "yarn": "^1.22.0"
@@ -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 {};
@@ -142,7 +142,7 @@ const styles = StyleSheet.create({
142
142
  width: "10%",
143
143
  },
144
144
  });
145
- 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, }) => {
146
146
  // Used for unique IDs generation (usefull for header IDs and cells aria-describedBy pointing to them)
147
147
  const viewId = useId();
148
148
  const scrollViewRef = useRef(null);
@@ -317,7 +317,7 @@ export const VirtualizedList = ({ variant, data, stickedToStartColumns, columns,
317
317
  },
318
318
  ] }));
319
319
  }, [stickedToEndColumnsWidth, horizontalScrollPosition]);
320
- 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: {
321
321
  height: containerContainerHeight,
322
322
  width: contentContainerWidth,
323
323
  }, children: [header, rowsToRender
@@ -419,8 +419,8 @@ const RawVirtualizedRow = ({ viewId, rowHeight, absoluteIndex, variant, stickedT
419
419
  });
420
420
  };
421
421
  const VirtualizedRow = memo(RawVirtualizedRow);
422
- export const VirtualizedListPlaceholder = ({ count, rowHeight, groupHeaderHeight, headerHeight, }) => {
423
- 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) => {
424
424
  const top = index * rowHeight;
425
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)));
426
426
  }) })] }));