From 9e91780f7e5c96d0945f2b6a8414b1a96355bff5 Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 4 Jan 2021 11:00:15 +0100 Subject: [PATCH 1/2] DataGrid mouse handler: Expose pressData for subclasses Signed-off-by: martinRenou --- packages/datagrid/src/basicmousehandler.ts | 38 +++++++++++++++------- 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/packages/datagrid/src/basicmousehandler.ts b/packages/datagrid/src/basicmousehandler.ts index 2a0263e04..2a2da04f3 100644 --- a/packages/datagrid/src/basicmousehandler.ts +++ b/packages/datagrid/src/basicmousehandler.ts @@ -599,28 +599,36 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { grid.scrollBy(dx, dy); } -/** -* Convert a resize handle into a cursor. -*/ -cursorForHandle(handle: ResizeHandle): string { - return Private.cursorMap[handle]; -} + /** + * Convert a resize handle into a cursor. + */ + cursorForHandle(handle: ResizeHandle): string { + return Private.cursorMap[handle]; + } + + /** + * Get the current pressData + */ + get pressData (): PressData.PressData | null { + return this._pressData; + } private _disposed = false; - private _pressData: Private.PressData | null; + private _pressData: PressData.PressData | null = null; } /** * A type alias for the resize handle types. */ - export - type ResizeHandle = 'top' | 'left' | 'right' | 'bottom' | 'none'; +export +type ResizeHandle = 'top' | 'left' | 'right' | 'bottom' | 'none'; /** - * The namespace for the module implementation details. + * The namespace for the pressdata. */ -namespace Private { +export +namespace PressData { /** * A type alias for the row resize data. */ @@ -744,7 +752,13 @@ namespace Private { */ export type PressData = RowResizeData | ColumnResizeData | SelectData ; +} +/** + * The namespace for the module implementation details. + */ +export +namespace Private { /** * Get the resize handle for a grid hit test. */ @@ -826,7 +840,7 @@ namespace Private { * @param data - The select data of interest. */ export - function autoselect(grid: DataGrid, data: SelectData): void { + function autoselect(grid: DataGrid, data: PressData.SelectData): void { // Bail early if the timeout has been reset. if (data.timeout < 0) { return; From 8596fa1252bbb0374221228db497d8d7b6cef91f Mon Sep 17 00:00:00 2001 From: martinRenou Date: Mon, 4 Jan 2021 18:12:06 +0100 Subject: [PATCH 2/2] Remove extra space --- packages/datagrid/src/basicmousehandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/datagrid/src/basicmousehandler.ts b/packages/datagrid/src/basicmousehandler.ts index 2a2da04f3..0671c9618 100644 --- a/packages/datagrid/src/basicmousehandler.ts +++ b/packages/datagrid/src/basicmousehandler.ts @@ -609,7 +609,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { /** * Get the current pressData */ - get pressData (): PressData.PressData | null { + get pressData(): PressData.PressData | null { return this._pressData; }