Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/range-selection

Package Overview
Dependencies
2
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 25.3.0 to 26.0.0

dist/cjs/rangeSelection/rangeService.d.ts

19

dist/cjs/rangeSelection/abstractSelectionHandle.d.ts

@@ -1,13 +0,14 @@

import { CellComp, RowRenderer, DragService, Component, MouseEventService, ColumnController, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType, ControllersService } from "@ag-grid-community/core";
import { RangeController } from "./rangeController";
import { CellCtrl, RowRenderer, DragService, Component, MouseEventService, ColumnModel, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType, NavigationService, CtrlsService } from "@ag-grid-community/core";
import { RangeService } from "./rangeService";
export declare abstract class AbstractSelectionHandle extends Component implements ISelectionHandle {
protected rowRenderer: RowRenderer;
protected dragService: DragService;
protected rangeController: RangeController;
protected rangeService: RangeService;
protected mouseEventService: MouseEventService;
protected columnController: ColumnController;
protected columnModel: ColumnModel;
protected cellNavigationService: CellNavigationService;
protected navigationService: NavigationService;
protected rowPositionUtils: RowPositionUtils;
protected controllersService: ControllersService;
private cellComp;
protected ctrlsService: CtrlsService;
private cellCtrl;
private cellRange;

@@ -26,4 +27,4 @@ private rangeStartRow;

protected isDragging(): boolean;
protected getCellComp(): CellComp | undefined;
protected setCellComp(cellComp: CellComp): void;
protected getCellCtrl(): CellCtrl | undefined;
protected setCellCtrl(cellComp: CellCtrl): void;
protected getCellRange(): CellRange;

@@ -41,3 +42,3 @@ protected setCellRange(range: CellRange): void;

getType(): SelectionHandleType;
refresh(cellComp: CellComp): void;
refresh(cellCtrl: CellCtrl): void;
protected clearValues(): void;

@@ -44,0 +45,0 @@ private removeListeners;

@@ -40,3 +40,3 @@ "use strict";

_this.dragging = true;
_this.rangeController.autoScrollService.check(e);
_this.rangeService.autoScrollService.check(e);
if (_this.changedCalculatedValues) {

@@ -51,3 +51,3 @@ _this.onDrag(e);

_this.clearValues();
_this.rangeController.autoScrollService.ensureCleared();
_this.rangeService.autoScrollService.ensureCleared();
// TODO: this causes a bug where if there are multiple grids in the same page, all of them will

@@ -66,7 +66,7 @@ // be affected by a drag on any. Move it to the root element.

};
AbstractSelectionHandle.prototype.getCellComp = function () {
return this.cellComp;
AbstractSelectionHandle.prototype.getCellCtrl = function () {
return this.cellCtrl;
};
AbstractSelectionHandle.prototype.setCellComp = function (cellComp) {
this.cellComp = cellComp;
AbstractSelectionHandle.prototype.setCellCtrl = function (cellComp) {
this.cellCtrl = cellComp;
};

@@ -99,3 +99,3 @@ AbstractSelectionHandle.prototype.getCellRange = function () {

AbstractSelectionHandle.prototype.onDragStart = function (e) {
this.cellHoverListener = this.addManagedListener(this.controllersService.getGridCompController().getGui(), 'mousemove', this.updateValuesOnMove.bind(this));
this.cellHoverListener = this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(), 'mousemove', this.updateValuesOnMove.bind(this));
core_1._.addCssClass(document.body, this.getDraggingCssClass());

@@ -117,7 +117,7 @@ };

};
AbstractSelectionHandle.prototype.refresh = function (cellComp) {
AbstractSelectionHandle.prototype.refresh = function (cellCtrl) {
var _this = this;
var oldCellComp = this.getCellComp();
var oldCellComp = this.getCellCtrl();
var eGui = this.getGui();
var cellRange = core_1._.last(this.rangeController.getCellRanges());
var cellRange = core_1._.last(this.rangeService.getCellRanges());
var start = cellRange.startRow;

@@ -136,7 +136,7 @@ var end = cellRange.endRow;

}
if (oldCellComp !== cellComp || !core_1._.isVisible(eGui)) {
this.setCellComp(cellComp);
if (oldCellComp !== cellCtrl || !core_1._.isVisible(eGui)) {
this.setCellCtrl(cellCtrl);
window.setTimeout(function () {
if (_this.isAlive()) {
cellComp.appendChild(eGui);
cellCtrl.appendChild(eGui);
}

@@ -178,4 +178,4 @@ }, 1);

__decorate([
core_1.Autowired("rangeController")
], AbstractSelectionHandle.prototype, "rangeController", void 0);
core_1.Autowired("rangeService")
], AbstractSelectionHandle.prototype, "rangeService", void 0);
__decorate([

@@ -185,4 +185,4 @@ core_1.Autowired("mouseEventService")

__decorate([
core_1.Autowired("columnController")
], AbstractSelectionHandle.prototype, "columnController", void 0);
core_1.Autowired("columnModel")
], AbstractSelectionHandle.prototype, "columnModel", void 0);
__decorate([

@@ -192,7 +192,10 @@ core_1.Autowired("cellNavigationService")

__decorate([
core_1.Autowired("navigationService")
], AbstractSelectionHandle.prototype, "navigationService", void 0);
__decorate([
core_1.Autowired('rowPositionUtils')
], AbstractSelectionHandle.prototype, "rowPositionUtils", void 0);
__decorate([
core_1.Autowired('controllersService')
], AbstractSelectionHandle.prototype, "controllersService", void 0);
core_1.Autowired('ctrlsService')
], AbstractSelectionHandle.prototype, "ctrlsService", void 0);
__decorate([

@@ -199,0 +202,0 @@ core_1.PostConstruct

@@ -1,2 +0,2 @@

import { CellComp, SelectionHandleType } from '@ag-grid-community/core';
import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';
import { AbstractSelectionHandle } from "./abstractSelectionHandle";

@@ -9,3 +9,3 @@ export declare class FillHandle extends AbstractSelectionHandle {

private lastCellMarked;
private markedCellComps;
private markedCells;
private cellValues;

@@ -34,3 +34,3 @@ private dragAxis;

private reduceHorizontal;
refresh(cellComp: CellComp): void;
refresh(cellCtrl: CellCtrl): void;
}

@@ -46,3 +46,3 @@ "use strict";

var _this = _super.call(this, FillHandle.TEMPLATE) || this;
_this.markedCellComps = [];
_this.markedCells = [];
_this.cellValues = [];

@@ -79,7 +79,7 @@ _this.isUp = false;

if (!this.initialPosition) {
var cellComp = this.getCellComp();
if (!cellComp) {
var cellCtrl = this.getCellCtrl();
if (!cellCtrl) {
return;
}
this.initialPosition = cellComp.getCellPosition();
this.initialPosition = cellCtrl.getCellPosition();
}

@@ -93,3 +93,3 @@ var lastCellHovered = this.getLastCellHovered();

this.initialXY = null;
if (!this.markedCellComps.length) {
if (!this.markedCells.length) {
return;

@@ -104,3 +104,3 @@ }

if (!this.isUp && !this.isLeft) {
finalRange = this.rangeController.createCellRangeFromCellRangeParams({
finalRange = this.rangeService.createCellRangeFromCellRangeParams({
rowStartIndex: rangeStartRow.rowIndex,

@@ -116,3 +116,3 @@ rowStartPinned: rangeStartRow.rowPinned,

var startRow = isX ? rangeStartRow : this.lastCellMarked;
finalRange = this.rangeController.createCellRangeFromCellRangeParams({
finalRange = this.rangeService.createCellRangeFromCellRangeParams({
rowStartIndex: startRow.rowIndex,

@@ -130,3 +130,3 @@ rowStartPinned: startRow.rowPinned,

this.handleValueChanged(initialRange, finalRange, e);
this.rangeController.setCellRanges([finalRange]);
this.rangeService.setCellRanges([finalRange]);
this.raiseFillEndEvent(initialRange, finalRange);

@@ -155,6 +155,6 @@ }

var _this = this;
var initialRangeEndRow = this.rangeController.getRangeEndRow(initialRange);
var initialRangeStartRow = this.rangeController.getRangeStartRow(initialRange);
var finalRangeEndRow = this.rangeController.getRangeEndRow(finalRange);
var finalRangeStartRow = this.rangeController.getRangeStartRow(finalRange);
var initialRangeEndRow = this.rangeService.getRangeEndRow(initialRange);
var initialRangeStartRow = this.rangeService.getRangeStartRow(initialRange);
var finalRangeEndRow = this.rangeService.getRangeEndRow(finalRange);
var finalRangeStartRow = this.rangeService.getRangeStartRow(finalRange);
var isVertical = this.dragAxis === 'y';

@@ -318,10 +318,10 @@ // if the range is being reduced in size, all we need to do is

FillHandle.prototype.clearMarkedPath = function () {
this.markedCellComps.forEach(function (cellComp) {
var eGui = cellComp.getGui();
core_1._.removeCssClass(eGui, 'ag-selection-fill-top');
core_1._.removeCssClass(eGui, 'ag-selection-fill-right');
core_1._.removeCssClass(eGui, 'ag-selection-fill-bottom');
core_1._.removeCssClass(eGui, 'ag-selection-fill-left');
this.markedCells.forEach(function (cell) {
var comp = cell.getComp();
comp.addOrRemoveCssClass('ag-selection-fill-top', false);
comp.addOrRemoveCssClass('ag-selection-fill-right', false);
comp.addOrRemoveCssClass('ag-selection-fill-bottom', false);
comp.addOrRemoveCssClass('ag-selection-fill-left', false);
});
this.markedCellComps.length = 0;
this.markedCells.length = 0;
this.isUp = false;

@@ -363,3 +363,3 @@ this.isLeft = false;

}
var displayedColumns = this.columnController.getAllDisplayedColumns();
var displayedColumns = this.columnModel.getAllDisplayedColumns();
var initialIndex = displayedColumns.indexOf(initialColumn);

@@ -379,3 +379,3 @@ var currentIndex = displayedColumns.indexOf(currentColumn);

FillHandle.prototype.extendVertical = function (initialPosition, endPosition, isMovingUp) {
var _a = this, rowRenderer = _a.rowRenderer, rangeController = _a.rangeController;
var _a = this, navigationService = _a.navigationService, rangeService = _a.rangeService;
var row = initialPosition;

@@ -389,3 +389,3 @@ do {

var cellPos = __assign(__assign({}, rowPos), { column: column });
var cellInRange = rangeController.isCellInSpecificRange(cellPos, cellRange);
var cellInRange = rangeService.isCellInSpecificRange(cellPos, cellRange);
var isInitialRow = this.rowPositionUtils.sameRow(row, initialPosition);

@@ -396,11 +396,11 @@ if (isMovingUp) {

if (!isInitialRow) {
var cellComp = rowRenderer.getComponentForCell(cellPos);
if (cellComp) {
this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
var cell = navigationService.getCellByPosition(cellPos);
if (cell) {
this.markedCells.push(cell);
var cellCtrl = cell.getComp();
if (!cellInRange) {
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-left', i === 0);
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', i === colLen - 1);
cellCtrl.addOrRemoveCssClass('ag-selection-fill-left', i === 0);
cellCtrl.addOrRemoveCssClass('ag-selection-fill-right', i === colLen - 1);
}
core_1._.addOrRemoveCssClass(eGui, isMovingUp ? 'ag-selection-fill-top' : 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
cellCtrl.addOrRemoveCssClass(isMovingUp ? 'ag-selection-fill-top' : 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
}

@@ -427,7 +427,7 @@ }

var celPos = __assign(__assign({}, rowPos), { column: cellRange.columns[i] });
var cellComp = this.rowRenderer.getComponentForCell(celPos);
if (cellComp) {
this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
var cell = this.navigationService.getCellByPosition(celPos);
if (cell) {
this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
}

@@ -443,3 +443,3 @@ }

var _this = this;
var allCols = this.columnController.getAllDisplayedColumns();
var allCols = this.columnModel.getAllDisplayedColumns();
var startCol = allCols.indexOf(isMovingLeft ? endPosition.column : initialPosition.column);

@@ -456,3 +456,3 @@ var endCol = allCols.indexOf(isMovingLeft ? this.getCellRange().columns[0] : endPosition.column);

isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);
var cellComp = _this.rowRenderer.getComponentForCell({
var cell = _this.navigationService.getCellByPosition({
rowIndex: row.rowIndex,

@@ -462,13 +462,13 @@ rowPinned: row.rowPinned,

});
if (cellComp) {
_this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-top', _this.rowPositionUtils.sameRow(row, rangeStartRow));
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-bottom', _this.rowPositionUtils.sameRow(row, rangeEndRow));
if (cell) {
_this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-top', _this.rowPositionUtils.sameRow(row, rangeStartRow));
cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', _this.rowPositionUtils.sameRow(row, rangeEndRow));
if (isMovingLeft) {
_this.isLeft = true;
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-left', column === colsToMark[0]);
cellComp.addOrRemoveCssClass('ag-selection-fill-left', column === colsToMark[0]);
}
else {
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', column === core_1._.last(colsToMark));
cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === core_1._.last(colsToMark));
}

@@ -482,3 +482,3 @@ }

var _this = this;
var allCols = this.columnController.getAllDisplayedColumns();
var allCols = this.columnModel.getAllDisplayedColumns();
var startCol = allCols.indexOf(endPosition.column);

@@ -494,3 +494,3 @@ var endCol = allCols.indexOf(initialPosition.column);

isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);
var cellComp = _this.rowRenderer.getComponentForCell({
var cell = _this.navigationService.getCellByPosition({
rowIndex: row.rowIndex,

@@ -500,6 +500,6 @@ rowPinned: row.rowPinned,

});
if (cellComp) {
_this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
core_1._.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', column === colsToMark[0]);
if (cell) {
_this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === colsToMark[0]);
}

@@ -510,4 +510,4 @@ row = _this.cellNavigationService.getRowBelow(row);

};
FillHandle.prototype.refresh = function (cellComp) {
var cellRange = this.rangeController.getCellRanges()[0];
FillHandle.prototype.refresh = function (cellCtrl) {
var cellRange = this.rangeService.getCellRanges()[0];
var isColumnRange = !cellRange.startRow || !cellRange.endRow;

@@ -518,3 +518,3 @@ if (isColumnRange) {

}
_super.prototype.refresh.call(this, cellComp);
_super.prototype.refresh.call(this, cellCtrl);
};

@@ -521,0 +521,0 @@ FillHandle.TEMPLATE = "<div class=\"ag-fill-handle\"></div>";

@@ -42,3 +42,3 @@ "use strict";

}
var cellRanges = this.rangeController.getCellRanges();
var cellRanges = this.rangeService.getCellRanges();
var lastRange = core_1._.last(cellRanges);

@@ -56,12 +56,12 @@ if (!this.rangeFixed) {

if (cellRanges.length === 2 && cellRanges[0].type === core_1.CellRangeType.DIMENSION && lastRange.type === core_1.CellRangeType.VALUE) {
var rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeController.getRangeEndRow(lastRange));
var rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeService.getRangeEndRow(lastRange));
if (rowChanged) {
// ensure the dimension range is kept in sync with the value range (which has the handle)
this.rangeController.updateRangeEnd(cellRanges[0], __assign(__assign({}, this.endPosition), { column: cellRanges[0].columns[0] }), true);
this.rangeService.updateRangeEnd(cellRanges[0], __assign(__assign({}, this.endPosition), { column: cellRanges[0].columns[0] }), true);
}
}
this.rangeController.extendLatestRangeToCell(this.endPosition);
this.rangeService.extendLatestRangeToCell(this.endPosition);
};
RangeHandle.prototype.onDragEnd = function (e) {
var cellRange = core_1._.last(this.rangeController.getCellRanges());
var cellRange = core_1._.last(this.rangeService.getCellRanges());
this.fixRangeStartEnd(cellRange);

@@ -71,4 +71,4 @@ this.rangeFixed = false;

RangeHandle.prototype.fixRangeStartEnd = function (cellRange) {
var startRow = this.rangeController.getRangeStartRow(cellRange);
var endRow = this.rangeController.getRangeEndRow(cellRange);
var startRow = this.rangeService.getRangeStartRow(cellRange);
var endRow = this.rangeService.getRangeEndRow(cellRange);
var column = cellRange.columns[0];

@@ -75,0 +75,0 @@ cellRange.startRow = startRow;

@@ -5,3 +5,3 @@ "use strict";

var core_2 = require("@ag-grid-enterprise/core");
var rangeController_1 = require("./rangeSelection/rangeController");
var rangeService_1 = require("./rangeSelection/rangeService");
var fillHandle_1 = require("./rangeSelection/fillHandle");

@@ -12,3 +12,3 @@ var rangeHandle_1 = require("./rangeSelection/rangeHandle");

moduleName: core_1.ModuleNames.RangeSelectionModule,
beans: [rangeController_1.RangeController, selectionHandleFactory_1.SelectionHandleFactory],
beans: [rangeService_1.RangeService, selectionHandleFactory_1.SelectionHandleFactory],
agStackComponents: [

@@ -15,0 +15,0 @@ { componentName: 'AgFillHandle', componentClass: fillHandle_1.FillHandle },

@@ -1,13 +0,14 @@

import { CellComp, RowRenderer, DragService, Component, MouseEventService, ColumnController, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType, ControllersService } from "@ag-grid-community/core";
import { RangeController } from "./rangeController";
import { CellCtrl, RowRenderer, DragService, Component, MouseEventService, ColumnModel, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType, NavigationService, CtrlsService } from "@ag-grid-community/core";
import { RangeService } from "./rangeService";
export declare abstract class AbstractSelectionHandle extends Component implements ISelectionHandle {
protected rowRenderer: RowRenderer;
protected dragService: DragService;
protected rangeController: RangeController;
protected rangeService: RangeService;
protected mouseEventService: MouseEventService;
protected columnController: ColumnController;
protected columnModel: ColumnModel;
protected cellNavigationService: CellNavigationService;
protected navigationService: NavigationService;
protected rowPositionUtils: RowPositionUtils;
protected controllersService: ControllersService;
private cellComp;
protected ctrlsService: CtrlsService;
private cellCtrl;
private cellRange;

@@ -26,4 +27,4 @@ private rangeStartRow;

protected isDragging(): boolean;
protected getCellComp(): CellComp | undefined;
protected setCellComp(cellComp: CellComp): void;
protected getCellCtrl(): CellCtrl | undefined;
protected setCellCtrl(cellComp: CellCtrl): void;
protected getCellRange(): CellRange;

@@ -41,3 +42,3 @@ protected setCellRange(range: CellRange): void;

getType(): SelectionHandleType;
refresh(cellComp: CellComp): void;
refresh(cellCtrl: CellCtrl): void;
protected clearValues(): void;

@@ -44,0 +45,0 @@ private removeListeners;

@@ -38,3 +38,3 @@ var __extends = (this && this.__extends) || (function () {

_this.dragging = true;
_this.rangeController.autoScrollService.check(e);
_this.rangeService.autoScrollService.check(e);
if (_this.changedCalculatedValues) {

@@ -49,3 +49,3 @@ _this.onDrag(e);

_this.clearValues();
_this.rangeController.autoScrollService.ensureCleared();
_this.rangeService.autoScrollService.ensureCleared();
// TODO: this causes a bug where if there are multiple grids in the same page, all of them will

@@ -64,7 +64,7 @@ // be affected by a drag on any. Move it to the root element.

};
AbstractSelectionHandle.prototype.getCellComp = function () {
return this.cellComp;
AbstractSelectionHandle.prototype.getCellCtrl = function () {
return this.cellCtrl;
};
AbstractSelectionHandle.prototype.setCellComp = function (cellComp) {
this.cellComp = cellComp;
AbstractSelectionHandle.prototype.setCellCtrl = function (cellComp) {
this.cellCtrl = cellComp;
};

@@ -97,3 +97,3 @@ AbstractSelectionHandle.prototype.getCellRange = function () {

AbstractSelectionHandle.prototype.onDragStart = function (e) {
this.cellHoverListener = this.addManagedListener(this.controllersService.getGridCompController().getGui(), 'mousemove', this.updateValuesOnMove.bind(this));
this.cellHoverListener = this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(), 'mousemove', this.updateValuesOnMove.bind(this));
_.addCssClass(document.body, this.getDraggingCssClass());

@@ -115,7 +115,7 @@ };

};
AbstractSelectionHandle.prototype.refresh = function (cellComp) {
AbstractSelectionHandle.prototype.refresh = function (cellCtrl) {
var _this = this;
var oldCellComp = this.getCellComp();
var oldCellComp = this.getCellCtrl();
var eGui = this.getGui();
var cellRange = _.last(this.rangeController.getCellRanges());
var cellRange = _.last(this.rangeService.getCellRanges());
var start = cellRange.startRow;

@@ -134,7 +134,7 @@ var end = cellRange.endRow;

}
if (oldCellComp !== cellComp || !_.isVisible(eGui)) {
this.setCellComp(cellComp);
if (oldCellComp !== cellCtrl || !_.isVisible(eGui)) {
this.setCellCtrl(cellCtrl);
window.setTimeout(function () {
if (_this.isAlive()) {
cellComp.appendChild(eGui);
cellCtrl.appendChild(eGui);
}

@@ -176,4 +176,4 @@ }, 1);

__decorate([
Autowired("rangeController")
], AbstractSelectionHandle.prototype, "rangeController", void 0);
Autowired("rangeService")
], AbstractSelectionHandle.prototype, "rangeService", void 0);
__decorate([

@@ -183,4 +183,4 @@ Autowired("mouseEventService")

__decorate([
Autowired("columnController")
], AbstractSelectionHandle.prototype, "columnController", void 0);
Autowired("columnModel")
], AbstractSelectionHandle.prototype, "columnModel", void 0);
__decorate([

@@ -190,7 +190,10 @@ Autowired("cellNavigationService")

__decorate([
Autowired("navigationService")
], AbstractSelectionHandle.prototype, "navigationService", void 0);
__decorate([
Autowired('rowPositionUtils')
], AbstractSelectionHandle.prototype, "rowPositionUtils", void 0);
__decorate([
Autowired('controllersService')
], AbstractSelectionHandle.prototype, "controllersService", void 0);
Autowired('ctrlsService')
], AbstractSelectionHandle.prototype, "ctrlsService", void 0);
__decorate([

@@ -197,0 +200,0 @@ PostConstruct

@@ -1,2 +0,2 @@

import { CellComp, SelectionHandleType } from '@ag-grid-community/core';
import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';
import { AbstractSelectionHandle } from "./abstractSelectionHandle";

@@ -9,3 +9,3 @@ export declare class FillHandle extends AbstractSelectionHandle {

private lastCellMarked;
private markedCellComps;
private markedCells;
private cellValues;

@@ -34,3 +34,3 @@ private dragAxis;

private reduceHorizontal;
refresh(cellComp: CellComp): void;
refresh(cellCtrl: CellCtrl): void;
}

@@ -44,3 +44,3 @@ var __extends = (this && this.__extends) || (function () {

var _this = _super.call(this, FillHandle.TEMPLATE) || this;
_this.markedCellComps = [];
_this.markedCells = [];
_this.cellValues = [];

@@ -77,7 +77,7 @@ _this.isUp = false;

if (!this.initialPosition) {
var cellComp = this.getCellComp();
if (!cellComp) {
var cellCtrl = this.getCellCtrl();
if (!cellCtrl) {
return;
}
this.initialPosition = cellComp.getCellPosition();
this.initialPosition = cellCtrl.getCellPosition();
}

@@ -91,3 +91,3 @@ var lastCellHovered = this.getLastCellHovered();

this.initialXY = null;
if (!this.markedCellComps.length) {
if (!this.markedCells.length) {
return;

@@ -102,3 +102,3 @@ }

if (!this.isUp && !this.isLeft) {
finalRange = this.rangeController.createCellRangeFromCellRangeParams({
finalRange = this.rangeService.createCellRangeFromCellRangeParams({
rowStartIndex: rangeStartRow.rowIndex,

@@ -114,3 +114,3 @@ rowStartPinned: rangeStartRow.rowPinned,

var startRow = isX ? rangeStartRow : this.lastCellMarked;
finalRange = this.rangeController.createCellRangeFromCellRangeParams({
finalRange = this.rangeService.createCellRangeFromCellRangeParams({
rowStartIndex: startRow.rowIndex,

@@ -128,3 +128,3 @@ rowStartPinned: startRow.rowPinned,

this.handleValueChanged(initialRange, finalRange, e);
this.rangeController.setCellRanges([finalRange]);
this.rangeService.setCellRanges([finalRange]);
this.raiseFillEndEvent(initialRange, finalRange);

@@ -153,6 +153,6 @@ }

var _this = this;
var initialRangeEndRow = this.rangeController.getRangeEndRow(initialRange);
var initialRangeStartRow = this.rangeController.getRangeStartRow(initialRange);
var finalRangeEndRow = this.rangeController.getRangeEndRow(finalRange);
var finalRangeStartRow = this.rangeController.getRangeStartRow(finalRange);
var initialRangeEndRow = this.rangeService.getRangeEndRow(initialRange);
var initialRangeStartRow = this.rangeService.getRangeStartRow(initialRange);
var finalRangeEndRow = this.rangeService.getRangeEndRow(finalRange);
var finalRangeStartRow = this.rangeService.getRangeStartRow(finalRange);
var isVertical = this.dragAxis === 'y';

@@ -316,10 +316,10 @@ // if the range is being reduced in size, all we need to do is

FillHandle.prototype.clearMarkedPath = function () {
this.markedCellComps.forEach(function (cellComp) {
var eGui = cellComp.getGui();
_.removeCssClass(eGui, 'ag-selection-fill-top');
_.removeCssClass(eGui, 'ag-selection-fill-right');
_.removeCssClass(eGui, 'ag-selection-fill-bottom');
_.removeCssClass(eGui, 'ag-selection-fill-left');
this.markedCells.forEach(function (cell) {
var comp = cell.getComp();
comp.addOrRemoveCssClass('ag-selection-fill-top', false);
comp.addOrRemoveCssClass('ag-selection-fill-right', false);
comp.addOrRemoveCssClass('ag-selection-fill-bottom', false);
comp.addOrRemoveCssClass('ag-selection-fill-left', false);
});
this.markedCellComps.length = 0;
this.markedCells.length = 0;
this.isUp = false;

@@ -361,3 +361,3 @@ this.isLeft = false;

}
var displayedColumns = this.columnController.getAllDisplayedColumns();
var displayedColumns = this.columnModel.getAllDisplayedColumns();
var initialIndex = displayedColumns.indexOf(initialColumn);

@@ -377,3 +377,3 @@ var currentIndex = displayedColumns.indexOf(currentColumn);

FillHandle.prototype.extendVertical = function (initialPosition, endPosition, isMovingUp) {
var _a = this, rowRenderer = _a.rowRenderer, rangeController = _a.rangeController;
var _a = this, navigationService = _a.navigationService, rangeService = _a.rangeService;
var row = initialPosition;

@@ -387,3 +387,3 @@ do {

var cellPos = __assign(__assign({}, rowPos), { column: column });
var cellInRange = rangeController.isCellInSpecificRange(cellPos, cellRange);
var cellInRange = rangeService.isCellInSpecificRange(cellPos, cellRange);
var isInitialRow = this.rowPositionUtils.sameRow(row, initialPosition);

@@ -394,11 +394,11 @@ if (isMovingUp) {

if (!isInitialRow) {
var cellComp = rowRenderer.getComponentForCell(cellPos);
if (cellComp) {
this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
var cell = navigationService.getCellByPosition(cellPos);
if (cell) {
this.markedCells.push(cell);
var cellCtrl = cell.getComp();
if (!cellInRange) {
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-left', i === 0);
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', i === colLen - 1);
cellCtrl.addOrRemoveCssClass('ag-selection-fill-left', i === 0);
cellCtrl.addOrRemoveCssClass('ag-selection-fill-right', i === colLen - 1);
}
_.addOrRemoveCssClass(eGui, isMovingUp ? 'ag-selection-fill-top' : 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
cellCtrl.addOrRemoveCssClass(isMovingUp ? 'ag-selection-fill-top' : 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
}

@@ -425,7 +425,7 @@ }

var celPos = __assign(__assign({}, rowPos), { column: cellRange.columns[i] });
var cellComp = this.rowRenderer.getComponentForCell(celPos);
if (cellComp) {
this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
var cell = this.navigationService.getCellByPosition(celPos);
if (cell) {
this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', this.rowPositionUtils.sameRow(row, endPosition));
}

@@ -441,3 +441,3 @@ }

var _this = this;
var allCols = this.columnController.getAllDisplayedColumns();
var allCols = this.columnModel.getAllDisplayedColumns();
var startCol = allCols.indexOf(isMovingLeft ? endPosition.column : initialPosition.column);

@@ -454,3 +454,3 @@ var endCol = allCols.indexOf(isMovingLeft ? this.getCellRange().columns[0] : endPosition.column);

isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);
var cellComp = _this.rowRenderer.getComponentForCell({
var cell = _this.navigationService.getCellByPosition({
rowIndex: row.rowIndex,

@@ -460,13 +460,13 @@ rowPinned: row.rowPinned,

});
if (cellComp) {
_this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-top', _this.rowPositionUtils.sameRow(row, rangeStartRow));
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-bottom', _this.rowPositionUtils.sameRow(row, rangeEndRow));
if (cell) {
_this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-top', _this.rowPositionUtils.sameRow(row, rangeStartRow));
cellComp.addOrRemoveCssClass('ag-selection-fill-bottom', _this.rowPositionUtils.sameRow(row, rangeEndRow));
if (isMovingLeft) {
_this.isLeft = true;
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-left', column === colsToMark[0]);
cellComp.addOrRemoveCssClass('ag-selection-fill-left', column === colsToMark[0]);
}
else {
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', column === _.last(colsToMark));
cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === _.last(colsToMark));
}

@@ -480,3 +480,3 @@ }

var _this = this;
var allCols = this.columnController.getAllDisplayedColumns();
var allCols = this.columnModel.getAllDisplayedColumns();
var startCol = allCols.indexOf(endPosition.column);

@@ -492,3 +492,3 @@ var endCol = allCols.indexOf(initialPosition.column);

isLastRow = _this.rowPositionUtils.sameRow(row, rangeEndRow);
var cellComp = _this.rowRenderer.getComponentForCell({
var cell = _this.navigationService.getCellByPosition({
rowIndex: row.rowIndex,

@@ -498,6 +498,6 @@ rowPinned: row.rowPinned,

});
if (cellComp) {
_this.markedCellComps.push(cellComp);
var eGui = cellComp.getGui();
_.addOrRemoveCssClass(eGui, 'ag-selection-fill-right', column === colsToMark[0]);
if (cell) {
_this.markedCells.push(cell);
var cellComp = cell.getComp();
cellComp.addOrRemoveCssClass('ag-selection-fill-right', column === colsToMark[0]);
}

@@ -508,4 +508,4 @@ row = _this.cellNavigationService.getRowBelow(row);

};
FillHandle.prototype.refresh = function (cellComp) {
var cellRange = this.rangeController.getCellRanges()[0];
FillHandle.prototype.refresh = function (cellCtrl) {
var cellRange = this.rangeService.getCellRanges()[0];
var isColumnRange = !cellRange.startRow || !cellRange.endRow;

@@ -516,3 +516,3 @@ if (isColumnRange) {

}
_super.prototype.refresh.call(this, cellComp);
_super.prototype.refresh.call(this, cellCtrl);
};

@@ -519,0 +519,0 @@ FillHandle.TEMPLATE = "<div class=\"ag-fill-handle\"></div>";

@@ -40,3 +40,3 @@ var __extends = (this && this.__extends) || (function () {

}
var cellRanges = this.rangeController.getCellRanges();
var cellRanges = this.rangeService.getCellRanges();
var lastRange = _.last(cellRanges);

@@ -54,12 +54,12 @@ if (!this.rangeFixed) {

if (cellRanges.length === 2 && cellRanges[0].type === CellRangeType.DIMENSION && lastRange.type === CellRangeType.VALUE) {
var rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeController.getRangeEndRow(lastRange));
var rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeService.getRangeEndRow(lastRange));
if (rowChanged) {
// ensure the dimension range is kept in sync with the value range (which has the handle)
this.rangeController.updateRangeEnd(cellRanges[0], __assign(__assign({}, this.endPosition), { column: cellRanges[0].columns[0] }), true);
this.rangeService.updateRangeEnd(cellRanges[0], __assign(__assign({}, this.endPosition), { column: cellRanges[0].columns[0] }), true);
}
}
this.rangeController.extendLatestRangeToCell(this.endPosition);
this.rangeService.extendLatestRangeToCell(this.endPosition);
};
RangeHandle.prototype.onDragEnd = function (e) {
var cellRange = _.last(this.rangeController.getCellRanges());
var cellRange = _.last(this.rangeService.getCellRanges());
this.fixRangeStartEnd(cellRange);

@@ -69,4 +69,4 @@ this.rangeFixed = false;

RangeHandle.prototype.fixRangeStartEnd = function (cellRange) {
var startRow = this.rangeController.getRangeStartRow(cellRange);
var endRow = this.rangeController.getRangeEndRow(cellRange);
var startRow = this.rangeService.getRangeStartRow(cellRange);
var endRow = this.rangeService.getRangeEndRow(cellRange);
var column = cellRange.columns[0];

@@ -73,0 +73,0 @@ cellRange.startRow = startRow;

import { ModuleNames } from "@ag-grid-community/core";
import { EnterpriseCoreModule } from "@ag-grid-enterprise/core";
import { RangeController } from "./rangeSelection/rangeController";
import { RangeService } from "./rangeSelection/rangeService";
import { FillHandle } from "./rangeSelection/fillHandle";

@@ -9,3 +9,3 @@ import { RangeHandle } from "./rangeSelection/rangeHandle";

moduleName: ModuleNames.RangeSelectionModule,
beans: [RangeController, SelectionHandleFactory],
beans: [RangeService, SelectionHandleFactory],
agStackComponents: [

@@ -12,0 +12,0 @@ { componentName: 'AgFillHandle', componentClass: FillHandle },

{
"name": "@ag-grid-enterprise/range-selection",
"version": "25.3.0",
"version": "26.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components",

@@ -9,4 +9,4 @@ "main": "./dist/cjs/main.js",

"scripts": {
"build-cjs": "tsc -p tsconfig.json",
"build-es6": "tsc -p tsconfig.es6.json",
"build-cjs": "npx tsc -p tsconfig.json",
"build-es6": "npx tsc -p tsconfig.es6.json",
"package": "node ../../module-build/rollup/build.js",

@@ -46,4 +46,4 @@ "build": "npm run build-cjs && npm run build-es6 && npm run hash",

"dependencies": {
"@ag-grid-community/core": "~25.3.0",
"@ag-grid-enterprise/core": "~25.3.0"
"@ag-grid-community/core": "~26.0.0",
"@ag-grid-enterprise/core": "~26.0.0"
},

@@ -50,0 +50,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 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc