react-spreadsheet
Index
Classes
Functions
Type Aliases
- CellBase
- CellComponent
- CellComponentProps
- CellDescriptor
- ColumnIndicatorComponent
- ColumnIndicatorProps
- CornerIndicatorComponent
- CornerIndicatorProps
- DataEditorComponent
- DataEditorProps
- DataViewerComponent
- DataViewerProps
- Dimensions
- HeaderRowComponent
- HeaderRowProps
- Matrix
- Mode
- Point
- Props
- RowComponent
- RowIndicatorComponent
- RowIndicatorProps
- RowProps
- SpreadsheetRef
- TableComponent
- TableProps
Type Aliases
CellBase
Type parameters
- Value = any
Type declaration
optionalDataEditor?: DataEditorComponent<CellBase<Value>>
Custom component to render when the cell is edited, if not defined would default to the component defined for the Spreadsheet
optionalDataViewer?: DataViewerComponent<CellBase<Value>>
Custom component to render when the cell is viewed, if not defined would default to the component defined for the Spreadsheet
optionalclassName?: string
Class to be given for the cell element
optionalreadOnly?: boolean
Whether the cell should not be editable
value: Value
The value of the cell
CellComponent
CellComponentProps
Type of Spreadsheet Cell component props
Type declaration
DataViewer: DataViewerComponent<Cell>
The DataViewer component to be used by the cell
activate: (point: Point) => void
Activate the cell at the given point
Parameters
point: Point
Returns void
active: boolean
Whether the cell is active
column: number
The column of the cell
copied: boolean
Whether the cell is copied
data: Cell | undefined
The data of the cell
dragging: boolean
Whether the user is dragging
evaluatedData: Cell | undefined
The evaluated data of the cell
mode: Mode
The mode of the cell
row: number
The row of the cell
select: (point: Point) => void
Select the cell at the given point
Parameters
point: Point
Returns void
selected: boolean
Whether the cell is selected
setCellData: (cell: Cell) => void
Set data of the cell
Parameters
cell: Cell
Returns void
setCellDimensions: (point: Point, dimensions: Dimensions) => void
Set the dimensions of the cell at the given point with the given dimensions
Parameters
point: Point
dimensions: Dimensions
Returns void
CellDescriptor
A cell with it's coordinates
Type parameters
- Cell
ColumnIndicatorComponent
Type of the ColumnIndicator component
ColumnIndicatorProps
Type of the Spreadsheet ColumnIndicator component props
Type declaration
column: number
The column the indicator indicates
optionallabel?: React.ReactNode | null
A custom label for the indicator as provided in columnLabels
onSelect: (column: number, extend: boolean) => void
Callback to be called when the column is selected
Parameters
column: number
extend: boolean
Returns void
selected: boolean
Whether the entire column in selected
CornerIndicatorComponent
Type of the CornerIndicator component
CornerIndicatorProps
Type of the Spreadsheet CornerIndicator component props
Type declaration
onSelect: () => void
Callback to select the entire table
Returns void
selected: boolean
Whether the entire table is selected
DataEditorComponent
DataEditorProps
DataViewerComponent
DataViewerProps
Dimensions
Dimensions of an element
Type declaration
height: number
The element's height in pixels
left: number
The distance of the element from it's container left border in pixels
top: number
The distance of the element from it's container top border in pixels
width: number
The element's width in pixels
HeaderRowComponent
Type of the HeaderRow component
HeaderRowProps
Type of the Spreadsheet HeaderRow component props
Matrix
A two-dimensional array of given type T in rows and columns
Type parameters
- T
Mode
The spreadsheet's write mode
Point
A cell coordinates in the spreadsheet
Type declaration
column: number
The cell's column
row: number
The cell's row
Props
The Spreadsheet component props
Type parameters
- CellType: Types.CellBase
Type declaration
optionalCell?: Types.CellComponent<CellType>
The Spreadsheet's cell component.
optionalColumnIndicator?: Types.ColumnIndicatorComponent
Component rendered above each column.
optionalCornerIndicator?: Types.CornerIndicatorComponent
Component rendered in the corner of row and column indicators.
optionalDataEditor?: Types.DataEditorComponent<CellType>
Component rendered for cells in edit mode.
optionalDataViewer?: Types.DataViewerComponent<CellType>
Component rendered for cells in view mode.
optionalHeaderRow?: Types.HeaderRowComponent
The spreadsheet's header row component
optionalRow?: Types.RowComponent
The Spreadsheet's row component.
optionalRowIndicator?: Types.RowIndicatorComponent
Component rendered next to each row.
optionalTable?: Types.TableComponent
The Spreadsheet's table component.
optionalclassName?: string
Class name to be added to the spreadsheet's root element
optionalcolumnLabels?: string[]
Labels to use in column indicators.
optionalcreateFormulaParser?: Types.CreateFormulaParser
Function used to create the formula parser (instance of "fast-formula-parser") used by the Spreadsheet by getting the spreadsheet's data.
optionaldarkMode?: boolean
Use dark colors that complement dark mode
data: Matrix.Matrix<CellType>
The spreadsheet's data
optionalhideColumnIndicators?: boolean
If set to true, hides the column indicators of the spreadsheet.
optionalhideRowIndicators?: boolean
If set to true, hides the row indicators of the spreadsheet.
optionalonActivate?: (active: Point.Point) => void
Callback called when Spreadsheet's active cell changes.
Parameters
active: Point.Point
Returns void
optionalonBlur?: () => void
Callback called when the Spreadsheet loses focus
Returns void
optionalonCellCommit?: (prevCell: null | CellType, nextCell: null | CellType, coords: null | Point.Point) => void
Parameters
prevCell: null | CellType
nextCell: null | CellType
coords: null | Point.Point
Returns void
optionalonChange?: (data: Matrix.Matrix<CellType>) => void
Callback called when the Spreadsheet's data changes.
Parameters
data: Matrix.Matrix<CellType>
Returns void
optionalonEvaluatedDataChange?: (data: Matrix.Matrix<CellType>) => void
Callback called when the Spreadsheet's evaluated data changes.
Parameters
data: Matrix.Matrix<CellType>
Returns void
optionalonKeyDown?: (event: React.KeyboardEvent) => void
Callback called on key down inside the spreadsheet.
Parameters
event: React.KeyboardEvent
Returns void
optionalonModeChange?: (mode: Types.Mode) => void
Callback called when the Spreadsheet's edit mode changes.
Parameters
mode: Types.Mode
Returns void
optionalonSelect?: (selected: Selection) => void
Callback called when the Spreadsheet's selection changes.
Parameters
selected: Selection
Returns void
optionalrowLabels?: string[]
Labels to use in row indicators.
optionalselected?: Selection
The selected cells in the worksheet.
RowComponent
Type of the Row component
RowIndicatorComponent
Type of the RowIndicator component
RowIndicatorProps
Type of the Spreadsheet RowIndicator component props
Type declaration
optionallabel?: React.ReactNode | null
A custom label for the indicator as provided in rowLabels
onSelect: (row: number, extend: boolean) => void
Callback to be called when the row is selected
Parameters
row: number
extend: boolean
Returns void
row: number
The row the indicator indicates
selected: boolean
Whether the entire row is selected
RowProps
Type of the Spreadsheet Row component props
SpreadsheetRef
The Spreadsheet Ref Type
Type declaration
activate: (point: Point.Point) => void
Pass the desired point as a prop to specify which one should be activated.
Parameters
point: Point.Point
Returns void
TableComponent
Type of the Spreadsheet Table component
TableProps
Type of the Spreadsheet Table component props
The base type of cell data in Spreadsheet