Skip to content

Commit 20152f9

Browse files
authored
Merge pull request #146 from martinRenou/pressdata
DataGrid mouse handler: Expose pressData for subclasses
2 parents b268386 + 8596fa1 commit 20152f9

File tree

1 file changed

+26
-12
lines changed

1 file changed

+26
-12
lines changed

packages/datagrid/src/basicmousehandler.ts

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -599,28 +599,36 @@ class BasicMouseHandler implements DataGrid.IMouseHandler {
599599
grid.scrollBy(dx, dy);
600600
}
601601

602-
/**
603-
* Convert a resize handle into a cursor.
604-
*/
605-
cursorForHandle(handle: ResizeHandle): string {
606-
return Private.cursorMap[handle];
607-
}
602+
/**
603+
* Convert a resize handle into a cursor.
604+
*/
605+
cursorForHandle(handle: ResizeHandle): string {
606+
return Private.cursorMap[handle];
607+
}
608+
609+
/**
610+
* Get the current pressData
611+
*/
612+
get pressData(): PressData.PressData | null {
613+
return this._pressData;
614+
}
608615

609616
private _disposed = false;
610-
private _pressData: Private.PressData | null;
617+
private _pressData: PressData.PressData | null = null;
611618
}
612619

613620
/**
614621
* A type alias for the resize handle types.
615622
*/
616-
export
617-
type ResizeHandle = 'top' | 'left' | 'right' | 'bottom' | 'none';
623+
export
624+
type ResizeHandle = 'top' | 'left' | 'right' | 'bottom' | 'none';
618625

619626

620627
/**
621-
* The namespace for the module implementation details.
628+
* The namespace for the pressdata.
622629
*/
623-
namespace Private {
630+
export
631+
namespace PressData {
624632
/**
625633
* A type alias for the row resize data.
626634
*/
@@ -744,7 +752,13 @@ namespace Private {
744752
*/
745753
export
746754
type PressData = RowResizeData | ColumnResizeData | SelectData ;
755+
}
747756

757+
/**
758+
* The namespace for the module implementation details.
759+
*/
760+
export
761+
namespace Private {
748762
/**
749763
* Get the resize handle for a grid hit test.
750764
*/
@@ -826,7 +840,7 @@ namespace Private {
826840
* @param data - The select data of interest.
827841
*/
828842
export
829-
function autoselect(grid: DataGrid, data: SelectData): void {
843+
function autoselect(grid: DataGrid, data: PressData.SelectData): void {
830844
// Bail early if the timeout has been reset.
831845
if (data.timeout < 0) {
832846
return;

0 commit comments

Comments
 (0)