@ag-grid-enterprise/range-selection
Advanced tools
Comparing version 22.1.1 to 23.0.0
@@ -50,2 +50,4 @@ "use strict"; | ||
_this.rangeController.autoScrollService.ensureCleared(); | ||
// TODO: this causes a bug where if there are multiple grids in the same page, all of them will | ||
// be affected by a drag on any. Move it to the root element. | ||
core_1._.removeCssClass(document.body, "ag-dragging-" + _this.type + "-handle"); | ||
@@ -52,0 +54,0 @@ if (_this.shouldDestroyOnEndDragging) { |
@@ -56,8 +56,8 @@ "use strict"; | ||
if (!this.initialXY) { | ||
var _a = this.getGui().getBoundingClientRect(), left = _a.left, top_1 = _a.top; | ||
this.initialXY = { x: left, y: top_1 }; | ||
this.initialXY = this.mouseEventService.getNormalisedPosition(e); | ||
} | ||
var _b = this.initialXY, x = _b.x, y = _b.y; | ||
var diffX = Math.abs(x - e.clientX); | ||
var diffY = Math.abs(y - e.clientY); | ||
var _a = this.initialXY, x = _a.x, y = _a.y; | ||
var _b = this.mouseEventService.getNormalisedPosition(e), newX = _b.x, newY = _b.y; | ||
var diffX = Math.abs(x - newX); | ||
var diffY = Math.abs(y - newY); | ||
var direction = diffX > diffY ? 'x' : 'y'; | ||
@@ -275,3 +275,6 @@ if (direction !== this.dragAxis) { | ||
} | ||
var allNumbers = !values.some(function (val) { return isNaN(parseFloat(val)); }); | ||
var allNumbers = !values.some(function (val) { | ||
var asFloat = parseFloat(val); | ||
return isNaN(asFloat) || asFloat.toString() !== val.toString(); | ||
}); | ||
// values should be copied in order if the alt key is pressed | ||
@@ -285,3 +288,3 @@ // or if the values contain strings and numbers | ||
var multiplier = (this.isUp || this.isLeft) ? -1 : 1; | ||
return core_1._.last(values) + 1 * multiplier; | ||
return parseFloat(core_1._.last(values)) + 1 * multiplier; | ||
} | ||
@@ -288,0 +291,0 @@ return values[idx % values.length]; |
@@ -52,3 +52,4 @@ import { CellPosition, CellPositionUtils, Column, GridOptionsWrapper, GridPanel, IRangeController, CellRangeParams, CellRange, RowPosition, RowPositionUtils } from "@ag-grid-community/core"; | ||
isCellInSpecificRange(cell: CellPosition, range: CellRange): boolean; | ||
isLastCellOfRange(cellRange: CellRange, cell: CellPosition): boolean; | ||
private isLastCellOfRange; | ||
isBottomRightCell(cellRange: CellRange, cell: CellPosition): boolean; | ||
getCellRangeCount(cell: CellPosition): number; | ||
@@ -55,0 +56,0 @@ private isRowInRange; |
@@ -133,4 +133,3 @@ "use strict"; | ||
// range as the start point for the drag | ||
var atEndOfList = core_1._.last(this.cellRanges) === cellRange; | ||
if (!atEndOfList) { | ||
if (core_1._.last(this.cellRanges) !== cellRange) { | ||
core_1._.removeFromArray(this.cellRanges, cellRange); | ||
@@ -151,3 +150,3 @@ this.cellRanges.push(cellRange); | ||
this.onDragStop(); | ||
this.dispatchChangedEvent(false, true, cellRange.id); | ||
this.dispatchChangedEvent(true, true, cellRange.id); | ||
}; | ||
@@ -162,5 +161,6 @@ RangeController.prototype.extendLatestRangeToCell = function (cellPosition) { | ||
RangeController.prototype.updateRangeEnd = function (cellRange, cellPosition, silent) { | ||
if (silent === void 0) { silent = false; } | ||
var endColumn = cellPosition.column; | ||
var colsToAdd = this.calculateColumnsBetween(cellRange.startColumn, endColumn); | ||
if (!colsToAdd) { | ||
if (!colsToAdd || this.isLastCellOfRange(cellRange, cellPosition)) { | ||
return; | ||
@@ -171,3 +171,3 @@ } | ||
if (!silent) { | ||
this.dispatchChangedEvent(false, true, cellRange.id); | ||
this.dispatchChangedEvent(true, true, cellRange.id); | ||
} | ||
@@ -351,2 +351,12 @@ }; | ||
RangeController.prototype.isLastCellOfRange = function (cellRange, cell) { | ||
var startRow = cellRange.startRow, endRow = cellRange.endRow; | ||
var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow; | ||
var isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned; | ||
var rangeFirstIndexColumn = cellRange.columns[0]; | ||
var rangeLastIndexColumn = core_1._.last(cellRange.columns); | ||
var lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn; | ||
var isLastColumn = cell.column === lastRangeColumn; | ||
return isLastColumn && isLastRow; | ||
}; | ||
RangeController.prototype.isBottomRightCell = function (cellRange, cell) { | ||
var allColumns = this.columnController.getAllDisplayedColumns(); | ||
@@ -356,5 +366,5 @@ var allPositions = cellRange.columns.map(function (c) { return allColumns.indexOf(c); }).sort(function (a, b) { return a - b; }); | ||
var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow; | ||
var isLastColumn = allColumns.indexOf(cell.column) === core_1._.last(allPositions); | ||
var isRightColumn = allColumns.indexOf(cell.column) === core_1._.last(allPositions); | ||
var isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned; | ||
return isLastColumn && isLastRow; | ||
return isRightColumn && isLastRow; | ||
}; | ||
@@ -361,0 +371,0 @@ // returns the number of ranges this cell is in |
@@ -48,2 +48,4 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.rangeController.autoScrollService.ensureCleared(); | ||
// TODO: this causes a bug where if there are multiple grids in the same page, all of them will | ||
// be affected by a drag on any. Move it to the root element. | ||
_.removeCssClass(document.body, "ag-dragging-" + _this.type + "-handle"); | ||
@@ -50,0 +52,0 @@ if (_this.shouldDestroyOnEndDragging) { |
@@ -54,8 +54,8 @@ var __extends = (this && this.__extends) || (function () { | ||
if (!this.initialXY) { | ||
var _a = this.getGui().getBoundingClientRect(), left = _a.left, top_1 = _a.top; | ||
this.initialXY = { x: left, y: top_1 }; | ||
this.initialXY = this.mouseEventService.getNormalisedPosition(e); | ||
} | ||
var _b = this.initialXY, x = _b.x, y = _b.y; | ||
var diffX = Math.abs(x - e.clientX); | ||
var diffY = Math.abs(y - e.clientY); | ||
var _a = this.initialXY, x = _a.x, y = _a.y; | ||
var _b = this.mouseEventService.getNormalisedPosition(e), newX = _b.x, newY = _b.y; | ||
var diffX = Math.abs(x - newX); | ||
var diffY = Math.abs(y - newY); | ||
var direction = diffX > diffY ? 'x' : 'y'; | ||
@@ -273,3 +273,6 @@ if (direction !== this.dragAxis) { | ||
} | ||
var allNumbers = !values.some(function (val) { return isNaN(parseFloat(val)); }); | ||
var allNumbers = !values.some(function (val) { | ||
var asFloat = parseFloat(val); | ||
return isNaN(asFloat) || asFloat.toString() !== val.toString(); | ||
}); | ||
// values should be copied in order if the alt key is pressed | ||
@@ -283,3 +286,3 @@ // or if the values contain strings and numbers | ||
var multiplier = (this.isUp || this.isLeft) ? -1 : 1; | ||
return _.last(values) + 1 * multiplier; | ||
return parseFloat(_.last(values)) + 1 * multiplier; | ||
} | ||
@@ -286,0 +289,0 @@ return values[idx % values.length]; |
@@ -52,3 +52,4 @@ import { CellPosition, CellPositionUtils, Column, GridOptionsWrapper, GridPanel, IRangeController, CellRangeParams, CellRange, RowPosition, RowPositionUtils } from "@ag-grid-community/core"; | ||
isCellInSpecificRange(cell: CellPosition, range: CellRange): boolean; | ||
isLastCellOfRange(cellRange: CellRange, cell: CellPosition): boolean; | ||
private isLastCellOfRange; | ||
isBottomRightCell(cellRange: CellRange, cell: CellPosition): boolean; | ||
getCellRangeCount(cell: CellPosition): number; | ||
@@ -55,0 +56,0 @@ private isRowInRange; |
@@ -131,4 +131,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
// range as the start point for the drag | ||
var atEndOfList = _.last(this.cellRanges) === cellRange; | ||
if (!atEndOfList) { | ||
if (_.last(this.cellRanges) !== cellRange) { | ||
_.removeFromArray(this.cellRanges, cellRange); | ||
@@ -149,3 +148,3 @@ this.cellRanges.push(cellRange); | ||
this.onDragStop(); | ||
this.dispatchChangedEvent(false, true, cellRange.id); | ||
this.dispatchChangedEvent(true, true, cellRange.id); | ||
}; | ||
@@ -160,5 +159,6 @@ RangeController.prototype.extendLatestRangeToCell = function (cellPosition) { | ||
RangeController.prototype.updateRangeEnd = function (cellRange, cellPosition, silent) { | ||
if (silent === void 0) { silent = false; } | ||
var endColumn = cellPosition.column; | ||
var colsToAdd = this.calculateColumnsBetween(cellRange.startColumn, endColumn); | ||
if (!colsToAdd) { | ||
if (!colsToAdd || this.isLastCellOfRange(cellRange, cellPosition)) { | ||
return; | ||
@@ -169,3 +169,3 @@ } | ||
if (!silent) { | ||
this.dispatchChangedEvent(false, true, cellRange.id); | ||
this.dispatchChangedEvent(true, true, cellRange.id); | ||
} | ||
@@ -349,2 +349,12 @@ }; | ||
RangeController.prototype.isLastCellOfRange = function (cellRange, cell) { | ||
var startRow = cellRange.startRow, endRow = cellRange.endRow; | ||
var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow; | ||
var isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned; | ||
var rangeFirstIndexColumn = cellRange.columns[0]; | ||
var rangeLastIndexColumn = _.last(cellRange.columns); | ||
var lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn; | ||
var isLastColumn = cell.column === lastRangeColumn; | ||
return isLastColumn && isLastRow; | ||
}; | ||
RangeController.prototype.isBottomRightCell = function (cellRange, cell) { | ||
var allColumns = this.columnController.getAllDisplayedColumns(); | ||
@@ -354,5 +364,5 @@ var allPositions = cellRange.columns.map(function (c) { return allColumns.indexOf(c); }).sort(function (a, b) { return a - b; }); | ||
var lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow; | ||
var isLastColumn = allColumns.indexOf(cell.column) === _.last(allPositions); | ||
var isRightColumn = allColumns.indexOf(cell.column) === _.last(allPositions); | ||
var isLastRow = cell.rowIndex === lastRow.rowIndex && cell.rowPinned === lastRow.rowPinned; | ||
return isLastColumn && isLastRow; | ||
return isRightColumn && isLastRow; | ||
}; | ||
@@ -359,0 +369,0 @@ // returns the number of ranges this cell is in |
{ | ||
"name": "@ag-grid-enterprise/range-selection", | ||
"version": "22.1.1", | ||
"version": "23.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
"main": "./dist/cjs/main.js", | ||
"module": "./dist/es6/main.js", | ||
"types": "./dist/es6/main.d.ts", | ||
"types": "./dist/cjs/main.d.ts", | ||
"scripts": { | ||
@@ -44,4 +44,4 @@ "build-cjs": "tsc -p tsconfig.json", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~22.1.1", | ||
"@ag-grid-enterprise/core": "~22.1.1" | ||
"@ag-grid-community/core": "~23.0.0", | ||
"@ag-grid-enterprise/core": "~23.0.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "devDependencies": { |
@@ -13,3 +13,3 @@ | ||
[Angular 1](https://www.ag-grid.com/angular-grid/) | [Angular 2](https://www.ag-grid.com/angular-grid/) | [Javascript](https://www.ag-grid.com/javascript-grid/) | [Polymer](https://www.ag-grid.com/best-polymer-data-grid/) | [React](https://www.ag-grid.com/react-grid/) | [TypeScript](https://www.ag-grid.com/ag-grid-typescript-webpack-2/) | [VueJS](https://www.ag-grid.com/vuejs-grid/) | [Web Components](https://www.ag-grid.com/best-web-component-data-grid/) | [Aurelia](https://www.ag-grid.com/best-aurelia-data-grid/) | ||
[Angular 1](https://www.ag-grid.com/angular-grid/) | [Angular 2](https://www.ag-grid.com/angular-grid/) | [Javascript](https://www.ag-grid.com/javascript-grid/) | [Polymer](https://www.ag-grid.com/best-polymer-data-grid/) | [React](https://www.ag-grid.com/react-grid/) | [TypeScript](https://www.ag-grid.com/ag-grid-building-typescript/) | [VueJS](https://www.ag-grid.com/vuejs-grid/) | [Web Components](https://www.ag-grid.com/best-web-component-data-grid/) | [Aurelia](https://www.ag-grid.com/best-aurelia-data-grid/) | ||
@@ -16,0 +16,0 @@ This is not free software, this software is covered by copyright and to use you need a commercial license. |
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
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5440114
86100
+ Added@ag-grid-community/core@23.0.2(transitive)
+ Added@ag-grid-enterprise/core@23.0.2(transitive)
- Removed@ag-grid-community/core@22.1.1(transitive)
- Removed@ag-grid-enterprise/core@22.1.1(transitive)