Skip to content

Commit 3a5176d

Browse files
committed
Nuke Viewport file
1 parent 08f462b commit 3a5176d

File tree

5 files changed

+12
-50
lines changed

5 files changed

+12
-50
lines changed

packages/react-data-grid/src/Canvas.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import * as rowUtils from './RowUtils';
99
import { getColumnScrollPosition, isPositionStickySupported } from './utils';
1010
import { EventTypes, SCROLL_DIRECTION } from './common/enums';
1111
import { CalculatedColumn, Position, ScrollPosition, SubRowDetails, RowRenderer, RowRendererProps, RowData } from './common/types';
12-
import { ViewportProps } from './Viewport';
12+
import { GridProps } from './Grid';
1313
import { getScrollDirection, getVerticalRangeToRender, getHorizontalRangeToRender } from './utils/viewportUtils';
1414

15-
type SharedViewportProps<R> = Pick<ViewportProps<R>,
15+
type SharedViewportProps<R> = Pick<GridProps<R>,
1616
| 'rowKey'
1717
| 'rowGetter'
1818
| 'rowsCount'

packages/react-data-grid/src/Grid.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { isValidElementType } from 'react-is';
33

44
import Header, { HeaderHandle, HeaderProps } from './Header';
55
import Canvas from './Canvas';
6-
import { ScrollState } from './Viewport';
7-
import { HeaderRowData, CellMetaData, RowSelection, InteractionMasksMetaData, SelectedRow, ColumnMetrics } from './common/types';
6+
import { HeaderRowData, CellMetaData, RowSelection, InteractionMasksMetaData, SelectedRow, ColumnMetrics, ScrollState } from './common/types';
87
import { DEFINE_SORT } from './common/enums';
98
import { ReactDataGridProps } from './ReactDataGrid';
109
import { EventBus } from './masks';

packages/react-data-grid/src/ReactDataGrid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { SelectAll } from './formatters';
1515
import * as rowUtils from './RowUtils';
1616
import KeyCodes from './KeyCodes';
1717
import { getColumnMetrics } from './ColumnMetrics';
18-
import { ScrollState } from './Viewport';
1918
import { RowsContainerProps } from './RowsContainer';
2019
import { EventBus } from './masks';
2120
import { CellNavigationMode, EventTypes, UpdateActions, HeaderRowType, DEFINE_SORT } from './common/enums';
@@ -41,7 +40,8 @@ import {
4140
SubRowDetails,
4241
SubRowOptions,
4342
SelectedRow,
44-
RowRendererProps
43+
RowRendererProps,
44+
ScrollState
4545
} from './common/types';
4646

4747
export interface ReactDataGridProps<R extends {}> {

packages/react-data-grid/src/Viewport.tsx

Lines changed: 0 additions & 43 deletions
This file was deleted.

packages/react-data-grid/src/common/types.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import { KeyboardEvent, ReactNode } from 'react';
33
import { List } from 'immutable';
4-
import { HeaderRowType, UpdateActions } from './enums';
4+
import { HeaderRowType, UpdateActions, SCROLL_DIRECTION } from './enums';
55

66
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
77

@@ -243,6 +243,12 @@ export interface RowRenderer<TRow> {
243243
getDecoratedComponentInstance?(idx: number): { row: RowRenderer<TRow> & React.Component<RowRendererProps<TRow>> } | undefined;
244244
}
245245

246+
export interface ScrollState {
247+
scrollTop: number;
248+
scrollLeft: number;
249+
scrollDirection: SCROLL_DIRECTION;
250+
}
251+
246252
export interface ScrollPosition {
247253
scrollLeft: number;
248254
scrollTop: number;

0 commit comments

Comments
 (0)