1 | import { PureComponent, Requireable, Validator } from "react";
|
2 | import { CellPosition } from "./CellMeasurer";
|
3 | import { GridProps } from "./Grid";
|
4 |
|
5 | export type MultiGridProps = {
|
6 | classNameBottomLeftGrid?: string | undefined;
|
7 | classNameBottomRightGrid?: string | undefined;
|
8 | classNameTopLeftGrid?: string | undefined;
|
9 | classNameTopRightGrid?: string | undefined;
|
10 | enableFixedColumnScroll?: boolean | undefined;
|
11 | enableFixedRowScroll?: boolean | undefined;
|
12 | fixedColumnCount?: number | undefined;
|
13 | fixedRowCount?: number | undefined;
|
14 | style?: React.CSSProperties | undefined;
|
15 | styleBottomLeftGrid?: React.CSSProperties | undefined;
|
16 | styleBottomRightGrid?: React.CSSProperties | undefined;
|
17 | styleTopLeftGrid?: React.CSSProperties | undefined;
|
18 | styleTopRightGrid?: React.CSSProperties | undefined;
|
19 | } & GridProps;
|
20 |
|
21 | export type MultiGridState = {
|
22 | scrollLeft: number;
|
23 | scrollTop: number;
|
24 | };
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | export class MultiGrid extends PureComponent<MultiGridProps, MultiGridState> {
|
34 | static propTypes: {
|
35 | classNameBottomLeftGrid: Validator<string>;
|
36 | classNameBottomRightGrid: Validator<string>;
|
37 | classNameTopLeftGrid: Validator<string>;
|
38 | classNameTopRightGrid: Validator<string>;
|
39 | enableFixedColumnScroll: Validator<boolean>;
|
40 | enableFixedRowScroll: Validator<boolean>;
|
41 | fixedColumnCount: Validator<number>;
|
42 | fixedRowCount: Validator<number>;
|
43 | style: Validator<React.CSSProperties>;
|
44 | styleBottomLeftGrid: Validator<React.CSSProperties>;
|
45 | styleBottomRightGrid: Validator<React.CSSProperties>;
|
46 | styleTopLeftGrid: Validator<React.CSSProperties>;
|
47 | styleTopRightGrid: Validator<React.CSSProperties>;
|
48 | };
|
49 |
|
50 | static defaultProps: {
|
51 | classNameBottomLeftGrid: "";
|
52 | classNameBottomRightGrid: "";
|
53 | classNameTopLeftGrid: "";
|
54 | classNameTopRightGrid: "";
|
55 | enableFixedColumnScroll: false;
|
56 | enableFixedRowScroll: false;
|
57 | fixedColumnCount: 0;
|
58 | fixedRowCount: 0;
|
59 | scrollToColumn: -1;
|
60 | scrollToRow: -1;
|
61 | style: {};
|
62 | styleBottomLeftGrid: {};
|
63 | styleBottomRightGrid: {};
|
64 | styleTopLeftGrid: {};
|
65 | styleTopRightGrid: {};
|
66 | };
|
67 |
|
68 | forceUpdateGrids(): void;
|
69 |
|
70 |
|
71 | invalidateCellSizeAfterRender(params?: Partial<CellPosition>): void;
|
72 |
|
73 |
|
74 | measureAllCells(): void;
|
75 |
|
76 |
|
77 | recomputeGridSize(params?: { columnIndex?: number | undefined; rowIndex?: number | undefined }): void;
|
78 | static getDerivedStateFromProps(nextProps: MultiGridProps, prevState: MultiGridState): MultiGridState | null;
|
79 | }
|
80 |
|
81 | export default MultiGrid;
|