1 | import { PureComponent } from "react";
|
2 | import { RenderedSection } from "./Grid";
|
3 |
|
4 | export type OnSectionRenderedParams = RenderedSection;
|
5 |
|
6 | export type ChildProps = {
|
7 | onSectionRendered: (params: RenderedSection) => void;
|
8 | scrollToColumn: number;
|
9 | scrollToRow: number;
|
10 | };
|
11 |
|
12 |
|
13 |
|
14 | export type ArrowKeyStepperProps = {
|
15 | children: (props: ChildProps) => React.ReactNode;
|
16 | className?: string | undefined;
|
17 | columnCount: number;
|
18 | rowCount: number;
|
19 | mode?: "edges" | "cells" | undefined;
|
20 | disabled?: boolean | undefined;
|
21 | isControlled?: boolean | undefined;
|
22 | onScrollToChange?: ((params: ScrollIndices) => void) | undefined;
|
23 | scrollToColumn?: number | undefined;
|
24 | scrollToRow?: number | undefined;
|
25 | /**
|
26 | * PLEASE NOTE
|
27 | * The [key: string]: any; line is here on purpose
|
28 | * This is due to the need of force re-render of PureComponent
|
29 | * Check the following link if you want to know more
|
30 | * https://github.com/bvaughn/react-virtualized#pass-thru-props
|
31 | */
|
32 | [key: string]: any;
|
33 | };
|
34 | export type ScrollIndices = {
|
35 | scrollToRow: number;
|
36 | scrollToColumn: number;
|
37 | };
|
38 |
|
39 | export type ScrollIndexes = ScrollIndices;
|
40 |
|
41 | export class ArrowKeyStepper extends PureComponent<ArrowKeyStepperProps, ScrollIndices> {
|
42 | static defaultProps: {
|
43 | disabled: false;
|
44 | isControlled: false;
|
45 | mode: "edges";
|
46 | scrollToColumn: 0;
|
47 | scrollToRow: 0;
|
48 | };
|
49 | }
|
50 |
|
51 | export default ArrowKeyStepper;
|
52 |
|
\ | No newline at end of file |