-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix: #592 Spreadsheet fixes for better usability
- Loading branch information
Cuong Vu
authored
Mar 13, 2020
1 parent
ace6937
commit 9586c60
Showing
15 changed files
with
637 additions
and
368 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import * as React from 'react' | ||
import { Cell, SetData, SetSelected, SetContextMenuProp } from '../types' | ||
import ReactDataSheet from 'react-datasheet' | ||
import { Cell, SetData, SetSelected, SetContextMenuProp, AfterCellsChanged } from '../types' | ||
|
||
export const parseResult = { | ||
data: [ | ||
|
@@ -92,14 +91,14 @@ export const data: Cell[][] = [ | |
], | ||
] | ||
|
||
export const cellRenderProps: ReactDataSheet.CellRendererProps<Cell> = { | ||
export const cellRenderProps = { | ||
row: 3, | ||
col: 10, | ||
cell: { value: '[email protected]' }, | ||
selected: false, | ||
editing: false, | ||
updated: false, | ||
attributesRenderer: jest.fn() as ReactDataSheet.AttributesRenderer<Cell>, | ||
attributesRenderer: jest.fn() as any, | ||
className: 'cell', | ||
style: { background: 'red' }, | ||
onMouseDown: jest.fn(), | ||
|
@@ -118,3 +117,5 @@ export const selectedMatrix = { | |
start: { i: 0, j: 1 }, | ||
end: { i: 2, j: 3 }, | ||
} | ||
|
||
export const afterCellsChanged = jest.fn() as AfterCellsChanged |
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 |
---|---|---|
|
@@ -15,6 +15,7 @@ exports[`customCellRenderer should match snapshot with CustomComponent 1`] = ` | |
value="[email protected]" | ||
> | ||
<CustomComponent | ||
afterCellsChanged={[MockFunction]} | ||
cellRenderProps={ | ||
Object { | ||
"attributesRenderer": [MockFunction], | ||
|
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.