-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed debouncing on recomputing and made it instantly Added a debugger for column grid
- Loading branch information
Showing
11 changed files
with
200 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,123 @@ | ||
import { DisableSortFilterParam, GridWrapperCommonProps } from './gridWrapper' | ||
import { DisableSortFilter, ICellChangeEvent, OutsideClickDeselect } from './gridWrapper' | ||
import { GridContainerCommonProps } from './gridContainer' | ||
import { GridTheme, Row, StretchMode } from './types' | ||
import { KeyDownEventParams, NavigationCoords } from './keyboard' | ||
import { SelectionProps } from './rowSelection' | ||
import { ApiRef } from './api' | ||
import { NestedRowsProps } from './nestedRows' | ||
import { Column, NestedHeader } from './columnGrid' | ||
import { MergeCell } from './mergeCells' | ||
import { Alignment } from 'react-virtualized' | ||
|
||
export interface ApolloSpreadsheetProps | ||
extends GridWrapperCommonProps, | ||
GridContainerCommonProps, | ||
NestedRowsProps { | ||
theme?: GridTheme | ||
/** @default { rowIndex: 0, colIndex: 0} **/ | ||
defaultCoords?: NavigationCoords | ||
/** | ||
* Main grid body (rows and cells) class name | ||
*/ | ||
className?: string | ||
rows: Row[] | ||
export interface ApolloCrudProps { | ||
onCreateRow?: (coords: NavigationCoords) => void | ||
onCellChange?: ICellChangeEvent<any> | ||
} | ||
|
||
export interface ApolloColumnRowSizeProps { | ||
/** @default 50 **/ | ||
minRowHeight?: number | ||
/** @default 50 **/ | ||
minColumnHeight?: number | ||
/** @default 30 **/ | ||
minColumnWidth?: number | ||
/** @default StretchMode.None */ | ||
stretchMode?: StretchMode | ||
/** | ||
* Whether CellMeasurer will set a fixed or dynamic width | ||
* By enabling this, CellMeasurer will be ignored therefore it results in faster performance | ||
* when you can predict a fixed size | ||
* @default true | ||
*/ | ||
fixedRowWidth?: boolean | ||
/** | ||
* Whether CellMeasurer will set a fixed or dynamic row height | ||
* By enabling this, CellMeasurer will be ignored therefore it results in faster performance | ||
* when you can predict a fixed size | ||
* @default false | ||
*/ | ||
fixedRowHeight?: boolean | ||
/** | ||
* Provides a constant row height or conditionally | ||
* @description This requires fixedRowHeight to be enabled and set to true. This is preferable when you can predict | ||
* the size therefore it would result in faster measurements | ||
* @default dynamic | ||
*/ | ||
rowHeight?: number | ||
} | ||
|
||
export interface ApolloDataProps { | ||
rows: Row[] | ||
columns: Column[] | ||
nestedHeaders?: Array<NestedHeader[]> | ||
mergeCells?: MergeCell[] | ||
} | ||
|
||
export interface ApolloNavigationProps { | ||
/** @default { rowIndex: 0, colIndex: 0} **/ | ||
defaultCoords?: NavigationCoords | ||
onKeyDown?: (params: KeyDownEventParams) => void | ||
selection?: SelectionProps | ||
onCreateRow?: (coords: NavigationCoords) => void | ||
/** @default false **/ | ||
suppressNavigation?: boolean | ||
} | ||
|
||
export interface ApolloSortProps { | ||
/** | ||
* Indicates if the sort is disabled globally or on a specific column | ||
* @default true **/ | ||
disableSort?: boolean | DisableSortFilterParam | ||
disableSort?: DisableSortFilter | ||
} | ||
|
||
export interface ApolloLayoutProps { | ||
/** @default StretchMode.None */ | ||
stretchMode?: StretchMode | ||
theme?: GridTheme | ||
/** | ||
* Border for highlighted cell | ||
*/ | ||
highlightBorderColor?: string | ||
/** | ||
* Main grid body (rows and cells) class name | ||
*/ | ||
className?: string | ||
selection?: SelectionProps | ||
/** @default false **/ | ||
outsideClickDeselects?: OutsideClickDeselect | ||
/** | ||
* Controls scroll-to-cell behavior of the Grid. | ||
* The default ("auto") scrolls the least amount possible to ensure that the specified cell is fully visible. | ||
* Use "start" to align cells to the top/left of the Grid and "end" to align bottom/right. | ||
*/ | ||
scrollToAlignment?: Alignment | ||
} | ||
|
||
export interface ApolloCoreProps { | ||
/** | ||
* Providing a custom ApiRef will override internal ref by allowing the exposure of grid methods | ||
*/ | ||
apiRef?: ApiRef | ||
} | ||
|
||
export interface ApolloVirtualizedProps { | ||
/** | ||
* Overscan count buffer for react-virtualized | ||
* @description Keep in mind a lower value | ||
* @default 2 | ||
*/ | ||
overscanRowCount?: number | ||
/** | ||
* Overscan count buffer for react-virtualized | ||
* @description Keep in mind a lower value | ||
* @default 2 | ||
*/ | ||
overscanColumnCount?: number | ||
} | ||
|
||
export type ApolloSpreadsheetProps = ApolloCoreProps & | ||
GridContainerCommonProps & | ||
NestedRowsProps & | ||
ApolloCrudProps & | ||
ApolloColumnRowSizeProps & | ||
ApolloSortProps & | ||
ApolloNavigationProps & | ||
ApolloLayoutProps & | ||
ApolloDataProps & | ||
ApolloVirtualizedProps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,27 @@ | ||
import { StretchMode } from '../types' | ||
import { GridHeader, Column, NestedHeader } from './types' | ||
import { NavigationCoords } from '../keyboard/types' | ||
import { DisableSortFilterParam } from '../gridWrapper' | ||
import { ApiRef } from '../api' | ||
import { GridHeader } from './types' | ||
import { NavigationCoords } from '../keyboard' | ||
import { SortState } from '../sort/useSort' | ||
import { | ||
ApolloColumnRowSizeProps, | ||
ApolloCoreProps, | ||
ApolloDataProps, | ||
ApolloLayoutProps, | ||
ApolloSortProps, | ||
ApolloVirtualizedProps, | ||
} from '../ApolloSpreadsheetProps' | ||
|
||
export interface ColumnGridProps { | ||
/** | ||
* Indicates if the sort is disabled globally or on a specific column | ||
* @default true **/ | ||
disableSort?: boolean | DisableSortFilterParam | ||
apiRef: ApiRef | ||
export interface ColumnGridProps | ||
extends ApolloVirtualizedProps, | ||
Pick<ApolloLayoutProps, 'stretchMode'>, | ||
Pick<ApolloDataProps, 'columns' | 'nestedHeaders'>, | ||
ApolloSortProps, | ||
Required<ApolloCoreProps>, | ||
Pick<ApolloColumnRowSizeProps, 'minRowHeight' | 'minColumnWidth'> { | ||
data: Array<GridHeader[]> | ||
columns: Column[] | ||
nestedHeaders?: Array<NestedHeader[]> | ||
minRowHeight: number | ||
coords: NavigationCoords | ||
defaultColumnWidth: number | ||
getColumnWidth: ({ index }: { index: number }) => number | ||
sort: SortState | null | ||
width: number | ||
scrollLeft: number | ||
/** @default StretchMode.None */ | ||
stretchMode?: StretchMode | ||
/** | ||
* Overscan count buffer for react-virtualized | ||
* @description Keep in mind a lower value | ||
* @default 2 | ||
*/ | ||
overscanRowCount?: number | ||
/** | ||
* Overscan count buffer for react-virtualized | ||
* @description Keep in mind a lower value | ||
* @default 2 | ||
*/ | ||
overscanColumnCount?: number | ||
nestedRowsEnabled: boolean | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.