From d395ebc3d0045340efc284d4dce0a859d39a6908 Mon Sep 17 00:00:00 2001 From: Itay Dafna Date: Wed, 24 Mar 2021 17:23:22 -0700 Subject: [PATCH 1/3] BasicMouseHandler properties: private -> protected Signed-off-by: Itay Dafna --- packages/datagrid/src/basicmousehandler.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/datagrid/src/basicmousehandler.ts b/packages/datagrid/src/basicmousehandler.ts index 0671c9618..b5fd824f9 100644 --- a/packages/datagrid/src/basicmousehandler.ts +++ b/packages/datagrid/src/basicmousehandler.ts @@ -613,8 +613,8 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { return this._pressData; } - private _disposed = false; - private _pressData: PressData.PressData | null = null; + protected _disposed = false; + protected _pressData: PressData.PressData | null = null; } /** From aacc1c86f599b06e0f8b90fa8829320a0351af79 Mon Sep 17 00:00:00 2001 From: Itay Dafna Date: Tue, 30 Mar 2021 20:28:42 -0700 Subject: [PATCH 2/3] change isDisposed back to private Signed-off-by: Itay Dafna --- 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 b5fd824f9..742dc6eac 100644 --- a/packages/datagrid/src/basicmousehandler.ts +++ b/packages/datagrid/src/basicmousehandler.ts @@ -613,7 +613,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { return this._pressData; } - protected _disposed = false; + private _disposed = false; protected _pressData: PressData.PressData | null = null; } From cff11eb32ac19ab9e3899089e5d77ceb94e21824 Mon Sep 17 00:00:00 2001 From: Itay Dafna Date: Wed, 31 Mar 2021 10:56:36 -0700 Subject: [PATCH 3/3] remove getter method and leading underscore from _pressData Signed-off-by: Itay Dafna --- packages/datagrid/src/basicmousehandler.ts | 31 +++++++++------------- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/packages/datagrid/src/basicmousehandler.ts b/packages/datagrid/src/basicmousehandler.ts index 742dc6eac..0f78a6394 100644 --- a/packages/datagrid/src/basicmousehandler.ts +++ b/packages/datagrid/src/basicmousehandler.ts @@ -71,18 +71,18 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { */ release(): void { // Bail early if the is no press data. - if (!this._pressData) { + if (!this.pressData) { return; } // Clear the autoselect timeout. - if (this._pressData.type === 'select') { - this._pressData.timeout = -1; + if (this.pressData.type === 'select') { + this.pressData.timeout = -1; } // Clear the press data. - this._pressData.override.dispose(); - this._pressData = null; + this.pressData.override.dispose(); + this.pressData = null; } /** @@ -162,7 +162,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { let override = Drag.overrideCursor('default'); // Set up the press data. - this._pressData = { + this.pressData = { type: 'select', region, row, column, override, localX: -1, localY: -1, timeout: -1 }; @@ -241,7 +241,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { let override = Drag.overrideCursor(cursor); // Create the temporary press data. - this._pressData = { type, region: rgn, index, size, clientX, override }; + this.pressData = { type, region: rgn, index, size, clientX, override }; // Done. return; @@ -267,7 +267,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { let override = Drag.overrideCursor(cursor); // Create the temporary press data. - this._pressData = { type, region: rgn, index, size, clientY, override }; + this.pressData = { type, region: rgn, index, size, clientY, override }; // Done. return; @@ -287,7 +287,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { let override = Drag.overrideCursor('default'); // Set up the press data. - this._pressData = { + this.pressData = { type: 'select', region, row, column, override, localX: -1, localY: -1, timeout: -1 }; @@ -362,7 +362,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { */ onMouseMove(grid: DataGrid, event: MouseEvent): void { // Fetch the press data. - const data = this._pressData; + const data = this.pressData; // Bail early if there is no press data. if (!data) { @@ -570,7 +570,7 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { */ onWheel(grid: DataGrid, event: WheelEvent): void { // Bail if a mouse press is in progress. - if (this._pressData) { + if (this.pressData) { return; } @@ -606,15 +606,8 @@ class BasicMouseHandler implements DataGrid.IMouseHandler { return Private.cursorMap[handle]; } - /** - * Get the current pressData - */ - get pressData(): PressData.PressData | null { - return this._pressData; - } - private _disposed = false; - protected _pressData: PressData.PressData | null = null; + protected pressData: PressData.PressData | null = null; } /**