From 15f5f1f5f774e7e4634660f5107df670416609d2 Mon Sep 17 00:00:00 2001 From: Peter <94077014+pzcfg@users.noreply.github.com> Date: Thu, 10 Feb 2022 15:45:18 -0800 Subject: [PATCH 1/4] Correct minor typo in Overscroll story `s/seting/setting/` --- packages/core/src/data-editor/data-editor-beautiful.stories.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/data-editor/data-editor-beautiful.stories.tsx b/packages/core/src/data-editor/data-editor-beautiful.stories.tsx index 96793b25d..b24e4ff8a 100644 --- a/packages/core/src/data-editor/data-editor-beautiful.stories.tsx +++ b/packages/core/src/data-editor/data-editor-beautiful.stories.tsx @@ -529,7 +529,7 @@ export const Overscroll: React.VFC = p => { description={ <> - You can allocate extra space at the ends of the grid by seting the{" "} + You can allocate extra space at the ends of the grid by setting the{" "} overscrollX and overscrollY props From 0eb25665b6e1451b028fd2f0e7cfc7b7881a1ad5 Mon Sep 17 00:00:00 2001 From: krisolchova <61697894+krisolchova@users.noreply.github.com> Date: Tue, 15 Feb 2022 22:01:43 +0000 Subject: [PATCH 2/4] on finish editing callback added (#173) --- .../core/src/data-editor/data-editor.test.tsx | 26 +++++++++++++++++++ packages/core/src/data-editor/data-editor.tsx | 6 +++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/packages/core/src/data-editor/data-editor.test.tsx b/packages/core/src/data-editor/data-editor.test.tsx index ada87959b..356631993 100644 --- a/packages/core/src/data-editor/data-editor.test.tsx +++ b/packages/core/src/data-editor/data-editor.test.tsx @@ -317,6 +317,32 @@ describe("data-editor", () => { expect(spy).toHaveBeenCalledWith([1, 1], expect.anything()); }); + test("Emits finished editing", async () => { + const spy = jest.fn(); + jest.useFakeTimers(); + render(, { + wrapper: Context, + }); + prep(); + const canvas = screen.getByTestId("data-grid-canvas"); + fireEvent.mouseDown(canvas, { + clientX: 300, // Col B + clientY: 36 + 32 + 16, // Row 1 (0 indexed) + }); + + fireEvent.keyDown(canvas, { + keyCode: 74, + }); + + const overlay = screen.getByDisplayValue("j"); + + fireEvent.keyDown(overlay, { + key: "Enter", + }); + + expect(spy).toBeCalledWith({ allowOverlay: true, data: "j", displayData: "1, 1", kind: "text" }, [0, 1]); + }); + test("Emits header click", async () => { const spy = jest.fn(); diff --git a/packages/core/src/data-editor/data-editor.tsx b/packages/core/src/data-editor/data-editor.tsx index eb93432d7..7037b67ad 100644 --- a/packages/core/src/data-editor/data-editor.tsx +++ b/packages/core/src/data-editor/data-editor.tsx @@ -97,7 +97,7 @@ export interface DataEditorProps extends Props { readonly onGroupHeaderClicked?: (colIndex: number, event: GroupHeaderClickedEventArgs) => void; readonly onGroupHeaderRenamed?: (groupName: string, newVal: string) => void; readonly onCellClicked?: (cell: readonly [number, number], event: CellClickedEventArgs) => void; - + readonly onFinishedEditing?: (newValue: GridCell | undefined, movement: readonly [number, number]) => void; readonly onHeaderContextMenu?: (colIndex: number, event: HeaderClickedEventArgs) => void; readonly onGroupHeaderContextMenu?: (colIndex: number, event: GroupHeaderClickedEventArgs) => void; readonly onCellContextMenu?: (cell: readonly [number, number], event: CellClickedEventArgs) => void; @@ -207,6 +207,7 @@ const DataEditorImpl: React.ForwardRefRenderFunction Date: Tue, 15 Feb 2022 14:41:01 -0800 Subject: [PATCH 3/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0236bdfb9..ac6264c51 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -21,3 +21,7 @@ npm run i && npm run storybook ## Forking the data grid? Please consider submitting your work for review. We are a small project but we are super enthused when anyone comes by to help us build the best damned data grid on the internet. + +##Any contributions you make will be under the MIT Software License + +In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern. From 974defa4864a53622cfa9027913e27afa806ed5d Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Tue, 15 Feb 2022 14:46:49 -0800 Subject: [PATCH 4/4] Update CONTRIBUTING.md --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ac6264c51..8524d4b7b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,6 @@ npm run i && npm run storybook Please consider submitting your work for review. We are a small project but we are super enthused when anyone comes by to help us build the best damned data grid on the internet. -##Any contributions you make will be under the MIT Software License +## Any contributions you make will be under the MIT Software License In short, when you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.