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