@ag-grid-enterprise/range-selection
Advanced tools
Comparing version 24.0.0 to 24.1.0
@@ -17,3 +17,3 @@ import { CellComp, RowRenderer, DragService, Component, MouseEventService, ColumnController, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType } from "@ag-grid-community/core"; | ||
private lastCellHovered; | ||
private changedCell; | ||
protected changedCalculatedValues: boolean; | ||
private dragging; | ||
@@ -38,3 +38,3 @@ protected abstract type: SelectionHandleType; | ||
private getDraggingCssClass; | ||
private updateLastCellPositionHovered; | ||
protected updateValuesOnMove(e: MouseEvent): void; | ||
getType(): SelectionHandleType; | ||
@@ -41,0 +41,0 @@ refresh(cellComp: CellComp): void; |
@@ -27,3 +27,3 @@ "use strict"; | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.changedCell = false; | ||
_this.changedCalculatedValues = false; | ||
_this.dragging = false; | ||
@@ -42,4 +42,5 @@ _this.shouldDestroyOnEndDragging = false; | ||
_this.rangeController.autoScrollService.check(e); | ||
if (_this.changedCell) { | ||
if (_this.changedCalculatedValues) { | ||
_this.onDrag(e); | ||
_this.changedCalculatedValues = false; | ||
} | ||
@@ -97,3 +98,3 @@ }, | ||
AbstractSelectionHandle.prototype.onDragStart = function (e) { | ||
this.cellHoverListener = this.addManagedListener(this.rowRenderer.getGridCore().getRootGui(), 'mousemove', this.updateLastCellPositionHovered.bind(this)); | ||
this.cellHoverListener = this.addManagedListener(this.rowRenderer.getGridCore().getRootGui(), 'mousemove', this.updateValuesOnMove.bind(this)); | ||
core_1._.addCssClass(document.body, this.getDraggingCssClass()); | ||
@@ -104,10 +105,9 @@ }; | ||
}; | ||
AbstractSelectionHandle.prototype.updateLastCellPositionHovered = function (e) { | ||
AbstractSelectionHandle.prototype.updateValuesOnMove = function (e) { | ||
var cell = this.mouseEventService.getCellPositionForEvent(e); | ||
if (cell === this.lastCellHovered) { | ||
this.changedCell = false; | ||
return; | ||
} | ||
this.lastCellHovered = cell; | ||
this.changedCell = true; | ||
this.changedCalculatedValues = true; | ||
}; | ||
@@ -114,0 +114,0 @@ AbstractSelectionHandle.prototype.getType = function () { |
@@ -18,2 +18,3 @@ import { CellComp, SelectionHandleType } from '@ag-grid-community/core'; | ||
constructor(); | ||
protected updateValuesOnMove(e: MouseEvent): void; | ||
protected onDrag(e: MouseEvent): void; | ||
@@ -20,0 +21,0 @@ protected onDragEnd(e: MouseEvent): void; |
@@ -54,3 +54,4 @@ "use strict"; | ||
} | ||
FillHandle.prototype.onDrag = function (e) { | ||
FillHandle.prototype.updateValuesOnMove = function (e) { | ||
_super.prototype.updateValuesOnMove.call(this, e); | ||
if (!this.initialXY) { | ||
@@ -73,3 +74,6 @@ this.initialXY = this.mouseEventService.getNormalisedPosition(e); | ||
this.dragAxis = direction; | ||
this.changedCalculatedValues = true; | ||
} | ||
}; | ||
FillHandle.prototype.onDrag = function (e) { | ||
if (!this.initialPosition) { | ||
@@ -83,4 +87,3 @@ var cellComp = this.getCellComp(); | ||
var lastCellHovered = this.getLastCellHovered(); | ||
if (lastCellHovered && lastCellHovered !== this.lastCellMarked) { | ||
this.lastCellMarked = lastCellHovered; | ||
if (lastCellHovered) { | ||
this.markPathFrom(this.initialPosition, lastCellHovered); | ||
@@ -90,2 +93,3 @@ } | ||
FillHandle.prototype.onDragEnd = function (e) { | ||
this.initialXY = null; | ||
if (!this.markedCellComps.length) { | ||
@@ -367,2 +371,3 @@ return; | ||
} | ||
this.lastCellMarked = currentPosition; | ||
}; | ||
@@ -369,0 +374,0 @@ FillHandle.prototype.extendVertical = function (initialPosition, endPosition, isMovingUp) { |
@@ -260,2 +260,5 @@ "use strict"; | ||
var _this = this; | ||
if (core_1._.shallowCompare(this.cellRanges, cellRanges)) { | ||
return; | ||
} | ||
this.removeAllCellRanges(true); | ||
@@ -417,2 +420,3 @@ cellRanges.forEach(function (newRange) { | ||
var mouseCell = this.mouseEventService.getCellPositionForEvent(mouseEvent); | ||
var extendRange = shiftKey && core_1._.existsAndNotEmpty(this.cellRanges); | ||
if (core_1._.missing(mouseCell)) { | ||
@@ -423,3 +427,3 @@ // if drag wasn't on cell, then do nothing, including do not set dragging=true, | ||
} | ||
if (!multiSelectKeyPressed && (!shiftKey || core_1._.exists(core_1._.last(this.cellRanges).type))) { | ||
if (!multiSelectKeyPressed && (!extendRange || core_1._.exists(core_1._.last(this.cellRanges).type))) { | ||
this.removeAllCellRanges(true); | ||
@@ -430,3 +434,3 @@ } | ||
this.lastMouseEvent = mouseEvent; | ||
if (!shiftKey) { | ||
if (!extendRange) { | ||
this.newestRangeStartCell = mouseCell; | ||
@@ -433,0 +437,0 @@ } |
@@ -17,3 +17,3 @@ import { CellComp, RowRenderer, DragService, Component, MouseEventService, ColumnController, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType } from "@ag-grid-community/core"; | ||
private lastCellHovered; | ||
private changedCell; | ||
protected changedCalculatedValues: boolean; | ||
private dragging; | ||
@@ -38,3 +38,3 @@ protected abstract type: SelectionHandleType; | ||
private getDraggingCssClass; | ||
private updateLastCellPositionHovered; | ||
protected updateValuesOnMove(e: MouseEvent): void; | ||
getType(): SelectionHandleType; | ||
@@ -41,0 +41,0 @@ refresh(cellComp: CellComp): void; |
@@ -25,3 +25,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.changedCell = false; | ||
_this.changedCalculatedValues = false; | ||
_this.dragging = false; | ||
@@ -40,4 +40,5 @@ _this.shouldDestroyOnEndDragging = false; | ||
_this.rangeController.autoScrollService.check(e); | ||
if (_this.changedCell) { | ||
if (_this.changedCalculatedValues) { | ||
_this.onDrag(e); | ||
_this.changedCalculatedValues = false; | ||
} | ||
@@ -95,3 +96,3 @@ }, | ||
AbstractSelectionHandle.prototype.onDragStart = function (e) { | ||
this.cellHoverListener = this.addManagedListener(this.rowRenderer.getGridCore().getRootGui(), 'mousemove', this.updateLastCellPositionHovered.bind(this)); | ||
this.cellHoverListener = this.addManagedListener(this.rowRenderer.getGridCore().getRootGui(), 'mousemove', this.updateValuesOnMove.bind(this)); | ||
_.addCssClass(document.body, this.getDraggingCssClass()); | ||
@@ -102,10 +103,9 @@ }; | ||
}; | ||
AbstractSelectionHandle.prototype.updateLastCellPositionHovered = function (e) { | ||
AbstractSelectionHandle.prototype.updateValuesOnMove = function (e) { | ||
var cell = this.mouseEventService.getCellPositionForEvent(e); | ||
if (cell === this.lastCellHovered) { | ||
this.changedCell = false; | ||
return; | ||
} | ||
this.lastCellHovered = cell; | ||
this.changedCell = true; | ||
this.changedCalculatedValues = true; | ||
}; | ||
@@ -112,0 +112,0 @@ AbstractSelectionHandle.prototype.getType = function () { |
@@ -18,2 +18,3 @@ import { CellComp, SelectionHandleType } from '@ag-grid-community/core'; | ||
constructor(); | ||
protected updateValuesOnMove(e: MouseEvent): void; | ||
protected onDrag(e: MouseEvent): void; | ||
@@ -20,0 +21,0 @@ protected onDragEnd(e: MouseEvent): void; |
@@ -52,3 +52,4 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
FillHandle.prototype.onDrag = function (e) { | ||
FillHandle.prototype.updateValuesOnMove = function (e) { | ||
_super.prototype.updateValuesOnMove.call(this, e); | ||
if (!this.initialXY) { | ||
@@ -71,3 +72,6 @@ this.initialXY = this.mouseEventService.getNormalisedPosition(e); | ||
this.dragAxis = direction; | ||
this.changedCalculatedValues = true; | ||
} | ||
}; | ||
FillHandle.prototype.onDrag = function (e) { | ||
if (!this.initialPosition) { | ||
@@ -81,4 +85,3 @@ var cellComp = this.getCellComp(); | ||
var lastCellHovered = this.getLastCellHovered(); | ||
if (lastCellHovered && lastCellHovered !== this.lastCellMarked) { | ||
this.lastCellMarked = lastCellHovered; | ||
if (lastCellHovered) { | ||
this.markPathFrom(this.initialPosition, lastCellHovered); | ||
@@ -88,2 +91,3 @@ } | ||
FillHandle.prototype.onDragEnd = function (e) { | ||
this.initialXY = null; | ||
if (!this.markedCellComps.length) { | ||
@@ -365,2 +369,3 @@ return; | ||
} | ||
this.lastCellMarked = currentPosition; | ||
}; | ||
@@ -367,0 +372,0 @@ FillHandle.prototype.extendVertical = function (initialPosition, endPosition, isMovingUp) { |
@@ -258,2 +258,5 @@ var __extends = (this && this.__extends) || (function () { | ||
var _this = this; | ||
if (_.shallowCompare(this.cellRanges, cellRanges)) { | ||
return; | ||
} | ||
this.removeAllCellRanges(true); | ||
@@ -415,2 +418,3 @@ cellRanges.forEach(function (newRange) { | ||
var mouseCell = this.mouseEventService.getCellPositionForEvent(mouseEvent); | ||
var extendRange = shiftKey && _.existsAndNotEmpty(this.cellRanges); | ||
if (_.missing(mouseCell)) { | ||
@@ -421,3 +425,3 @@ // if drag wasn't on cell, then do nothing, including do not set dragging=true, | ||
} | ||
if (!multiSelectKeyPressed && (!shiftKey || _.exists(_.last(this.cellRanges).type))) { | ||
if (!multiSelectKeyPressed && (!extendRange || _.exists(_.last(this.cellRanges).type))) { | ||
this.removeAllCellRanges(true); | ||
@@ -428,3 +432,3 @@ } | ||
this.lastMouseEvent = mouseEvent; | ||
if (!shiftKey) { | ||
if (!extendRange) { | ||
this.newestRangeStartCell = mouseCell; | ||
@@ -431,0 +435,0 @@ } |
{ | ||
"name": "@ag-grid-enterprise/range-selection", | ||
"version": "24.0.0", | ||
"version": "24.1.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -45,4 +45,4 @@ "main": "./dist/cjs/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~24.0.0", | ||
"@ag-grid-enterprise/core": "~24.0.0" | ||
"@ag-grid-community/core": "~24.1.0", | ||
"@ag-grid-enterprise/core": "~24.1.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5979909
95696
+ Added@ag-grid-community/core@24.1.0(transitive)
+ Added@ag-grid-enterprise/core@24.1.0(transitive)
- Removed@ag-grid-community/core@24.0.0(transitive)
- Removed@ag-grid-enterprise/core@24.0.0(transitive)