Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/range-selection

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 31.3.2 to 32.0.0

dist/types/src/rangeSelection/agFillHandle.d.ts

30

CONTRIBUTING.md

@@ -5,6 +5,4 @@ # Contributing to AG Grid Enterprise

Retention of Intellectual Property Rights for AG Grid Enterprise component
==============
# Retention of Intellectual Property Rights for AG Grid Enterprise component
1.DEFINITIONS

@@ -27,9 +25,9 @@

- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Feature Requests](#feature)
- [Submission Guidelines](#submit)
- [Coding Rules](#rules)
- [Commit Message Guidelines](#commit)
- [Signing the CLA](#cla)

@@ -45,2 +43,3 @@ ## <a name="question"></a> Got a Question or Problem?

## <a name="issue"></a> Found a Bug?
If you find a bug in the source code, you can help us by

@@ -50,3 +49,4 @@ [submitting an issue](#submit-issue) to our [GitHub Repository][github].

## <a name="feature"></a> Missing a Feature?
You can *request* a new feature by [submitting an issue](#submit-issue) to our GitHub
You can _request_ a new feature by [submitting an issue](#submit-issue) to our GitHub
Repository.

@@ -62,5 +62,5 @@

- version of AG Grid Enterprise used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails
- version of AG Grid Enterprise used
- 3rd-party libraries and their versions
- and most importantly - a use-case that fails

@@ -78,3 +78,1 @@ A minimal reproduce scenario using http://plnkr.co/ allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem. If plunker is not a suitable way to demonstrate the problem (for example for issues related to our npm packaging), please create a standalone git repository demonstrating the problem.

[stackoverflow]: http://stackoverflow.com/questions/tagged/ag-grid
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __export = (target, all) => {

@@ -35,11 +18,2 @@ for (var name in all)

var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var __decorateClass = (decorators, target, key, kind) => {
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
for (var i = decorators.length - 1, decorator; i >= 0; i--)
if (decorator = decorators[i])
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
if (kind && result)
__defProp(target, key, result);
return result;
};

@@ -57,2 +31,13 @@ // enterprise-modules/range-selection/src/main.ts

// enterprise-modules/range-selection/src/rangeSelection/rangeSelectionApi.ts
function getCellRanges(beans) {
return beans.rangeService?.getCellRanges() ?? null;
}
function addCellRange(beans, params) {
beans.rangeService?.addCellRange(params);
}
function clearRangeSelection(beans) {
beans.rangeService?.removeAllCellRanges();
}
// enterprise-modules/range-selection/src/rangeSelection/rangeService.ts

@@ -63,2 +48,3 @@ var import_core = require("@ag-grid-community/core");

super(...arguments);
this.beanName = "rangeService";
this.cellRanges = [];

@@ -69,12 +55,29 @@ this.bodyScrollListener = this.onBodyScroll.bind(this);

}
init() {
this.addManagedListener(this.eventService, import_core.Events.EVENT_NEW_COLUMNS_LOADED, () => this.onColumnsChanged());
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_VISIBLE, this.onColumnsChanged.bind(this));
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_VALUE_CHANGED, this.onColumnsChanged.bind(this));
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED, () => this.removeAllCellRanges());
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_ROW_GROUP_CHANGED, () => this.removeAllCellRanges());
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_PIVOT_CHANGED, () => this.removeAllCellRanges());
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_GROUP_OPENED, this.refreshLastRangeStart.bind(this));
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_MOVED, this.refreshLastRangeStart.bind(this));
this.addManagedListener(this.eventService, import_core.Events.EVENT_COLUMN_PINNED, this.refreshLastRangeStart.bind(this));
wireBeans(beans) {
this.rowModel = beans.rowModel;
this.dragService = beans.dragService;
this.columnModel = beans.columnModel;
this.visibleColsService = beans.visibleColsService;
this.cellNavigationService = beans.cellNavigationService;
this.pinnedRowModel = beans.pinnedRowModel;
this.rowPositionUtils = beans.rowPositionUtils;
this.cellPositionUtils = beans.cellPositionUtils;
this.ctrlsService = beans.ctrlsService;
this.valueService = beans.valueService;
}
postConstruct() {
const onColumnsChanged = this.onColumnsChanged.bind(this);
const removeAllCellRanges = () => this.removeAllCellRanges();
const refreshLastRangeStart = this.refreshLastRangeStart.bind(this);
this.addManagedEventListeners({
newColumnsLoaded: onColumnsChanged,
columnVisible: onColumnsChanged,
columnValueChanged: onColumnsChanged,
columnPivotModeChanged: removeAllCellRanges,
columnRowGroupChanged: removeAllCellRanges,
columnPivotChanged: removeAllCellRanges,
columnGroupOpened: refreshLastRangeStart,
columnMoved: refreshLastRangeStart,
columnPinned: refreshLastRangeStart
});
this.ctrlsService.whenReady((p) => {

@@ -97,3 +100,3 @@ const gridBodyCtrl = p.gridBodyCtrl;

this.refreshLastRangeStart();
const allColumns = this.columnModel.getAllDisplayedColumns();
const allColumns = this.visibleColsService.getAllCols();
this.cellRanges.forEach((cellRange) => {

@@ -104,3 +107,3 @@ const beforeCols = cellRange.columns;

);
const colsInRangeChanged = !import_core._.areEqual(beforeCols, cellRange.columns);
const colsInRangeChanged = !(0, import_core._areEqual)(beforeCols, cellRange.columns);
if (colsInRangeChanged) {

@@ -117,3 +120,3 @@ this.dispatchChangedEvent(false, true, cellRange.id);

refreshLastRangeStart() {
const lastRange = import_core._.last(this.cellRanges);
const lastRange = (0, import_core._last)(this.cellRanges);
if (!lastRange) {

@@ -129,5 +132,5 @@ return;

}
const allColumns = this.columnModel.getAllDisplayedColumns();
const allColumns = this.visibleColsService.getAllCols();
const allPositions = rangeColumns.map((c) => allColumns.indexOf(c)).sort((a, b) => a - b);
return import_core._.last(allPositions) - allPositions[0] + 1 === rangeColumns.length;
return (0, import_core._last)(allPositions) - allPositions[0] + 1 === rangeColumns.length;
}

@@ -167,3 +170,3 @@ getRangeStartRow(cellRange) {

const suppressMultiRangeSelections = this.gos.get("suppressMultiRangeSelection");
if (suppressMultiRangeSelections || !appendRange || import_core._.missing(this.cellRanges)) {
if (suppressMultiRangeSelections || !appendRange || (0, import_core._missing)(this.cellRanges)) {
this.removeAllCellRanges(true);

@@ -190,3 +193,3 @@ }

}
const cellRange = import_core._.last(this.cellRanges);
const cellRange = (0, import_core._last)(this.cellRanges);
this.updateRangeEnd(cellRange, cellPosition);

@@ -223,3 +226,3 @@ }

}
const shouldMoveRightCol = startColumn === import_core._.last(columns) && startColumn === right;
const shouldMoveRightCol = startColumn === (0, import_core._last)(columns) && startColumn === right;
if (shouldMoveRightCol) {

@@ -231,7 +234,7 @@ moveColInCellRange(right, false);

getRangeEdgeColumns(cellRange) {
const allColumns = this.columnModel.getAllDisplayedColumns();
const allColumns = this.visibleColsService.getAllCols();
const allIndices = cellRange.columns.map((c) => allColumns.indexOf(c)).filter((i) => i > -1).sort((a, b) => a - b);
return {
left: allColumns[allIndices[0]],
right: allColumns[import_core._.last(allIndices)]
right: allColumns[(0, import_core._last)(allIndices)]
};

@@ -246,6 +249,6 @@ }

const ctrlKey = event.ctrlKey || event.metaKey;
const lastRange = import_core._.last(this.cellRanges);
const lastRange = (0, import_core._last)(this.cellRanges);
const startCell = this.newestRangeStartCell;
const firstCol = lastRange.columns[0];
const lastCol = import_core._.last(lastRange.columns);
const lastCol = (0, import_core._last)(lastRange.columns);
const endCellIndex = lastRange.endRow.rowIndex;

@@ -277,3 +280,3 @@ const endCellFloating = lastRange.endRow.rowPinned;

setCellRanges(cellRanges) {
if (import_core._.shallowCompare(this.cellRanges, cellRanges)) {
if ((0, import_core._shallowCompare)(this.cellRanges, cellRanges)) {
return;

@@ -299,10 +302,6 @@ }

let { cellRanges } = params;
const {
cellEventSource = "rangeService",
dispatchWrapperEvents,
wrapperEventSource = "deleteKey"
} = params;
const { cellEventSource = "rangeService", dispatchWrapperEvents, wrapperEventSource = "deleteKey" } = params;
if (dispatchWrapperEvents) {
const startEvent = {
type: import_core.Events.EVENT_RANGE_DELETE_START,
type: "rangeDeleteStart",
source: wrapperEventSource

@@ -317,3 +316,2 @@ };

this.forEachRowInRange(cellRange, (rowPosition) => {
var _a;
const rowNode = this.rowPositionUtils.getRowNode(rowPosition);

@@ -324,7 +322,7 @@ if (!rowNode) {

for (let i = 0; i < cellRange.columns.length; i++) {
const column = this.columnModel.getGridColumn(cellRange.columns[i]);
const column = this.columnModel.getCol(cellRange.columns[i]);
if (!column || !column.isCellEditable(rowNode)) {
continue;
}
const emptyValue = (_a = this.valueService.parseValue(column, rowNode, "", rowNode.getValueFromValueService(column))) != null ? _a : null;
const emptyValue = this.valueService.parseValue(column, rowNode, "", rowNode.getValueFromValueService(column)) ?? null;
rowNode.setDataValue(column, emptyValue, cellEventSource);

@@ -336,3 +334,3 @@ }

const endEvent = {
type: import_core.Events.EVENT_RANGE_DELETE_END,
type: "rangeDeleteEnd",
source: wrapperEventSource

@@ -351,6 +349,6 @@ };

if (params.columns) {
columns = params.columns.map((c) => this.columnModel.getColumnWithValidation(c)).filter((c) => c);
columns = params.columns.map((c) => this.columnModel.getCol(c)).filter((c) => c);
} else {
const columnStart = this.columnModel.getColumnWithValidation(params.columnStart);
const columnEnd = this.columnModel.getColumnWithValidation(params.columnEnd);
const columnStart = this.columnModel.getCol(params.columnStart);
const columnEnd = this.columnModel.getCol(params.columnEnd);
if (!columnStart || !columnEnd) {

@@ -379,3 +377,3 @@ return;

columns,
startColumn: startsOnTheRight ? import_core._.last(columns) : columns[0]
startColumn: startsOnTheRight ? (0, import_core._last)(columns) : columns[0]
};

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

isCellInSpecificRange(cell, range) {
const columnInRange = range.columns !== null && import_core._.includes(range.columns, cell.column);
const columnInRange = range.columns !== null && (0, import_core._includes)(range.columns, cell.column);
const rowInRange = this.isRowInRange(cell.rowIndex, cell.rowPinned, range);

@@ -494,3 +492,3 @@ return columnInRange && rowInRange;

const rangeFirstIndexColumn = cellRange.columns[0];
const rangeLastIndexColumn = import_core._.last(cellRange.columns);
const rangeLastIndexColumn = (0, import_core._last)(cellRange.columns);
const lastRangeColumn = cellRange.startColumn === rangeFirstIndexColumn ? rangeLastIndexColumn : rangeFirstIndexColumn;

@@ -501,8 +499,8 @@ const isLastColumn = cell.column === lastRangeColumn;

isBottomRightCell(cellRange, cell) {
const allColumns = this.columnModel.getAllDisplayedColumns();
const allColumns = this.visibleColsService.getAllCols();
const allPositions = cellRange.columns.map((c) => allColumns.indexOf(c)).sort((a, b) => a - b);
const { startRow, endRow } = cellRange;
const lastRow = this.rowPositionUtils.before(startRow, endRow) ? endRow : startRow;
const isRightColumn = allColumns.indexOf(cell.column) === import_core._.last(allPositions);
const isLastRow = cell.rowIndex === lastRow.rowIndex && import_core._.makeNull(cell.rowPinned) === import_core._.makeNull(lastRow.rowPinned);
const isRightColumn = allColumns.indexOf(cell.column) === (0, import_core._last)(allPositions);
const isLastRow = cell.rowIndex === lastRow.rowIndex && (0, import_core._makeNull)(cell.rowPinned) === (0, import_core._makeNull)(lastRow.rowPinned);
return isRightColumn && isLastRow;

@@ -517,6 +515,6 @@ }

}
isRowInRange(rowIndex, floating, cellRange) {
isRowInRange(rowIndex, rowPinned, cellRange) {
const firstRow = this.getRangeStartRow(cellRange);
const lastRow = this.getRangeEndRow(cellRange);
const thisRow = { rowIndex, rowPinned: floating || null };
const thisRow = { rowIndex, rowPinned: rowPinned || null };
const equalsFirstRow = thisRow.rowIndex === firstRow.rowIndex && thisRow.rowPinned == firstRow.rowPinned;

@@ -542,4 +540,4 @@ const equalsLastRow = thisRow.rowIndex === lastRow.rowIndex && thisRow.rowPinned == lastRow.rowPinned;

const isMultiSelect = allowMulti ? isMultiKey : false;
const extendRange = shiftKey && import_core._.existsAndNotEmpty(this.cellRanges);
if (!isMultiSelect && (!extendRange || import_core._.exists(import_core._.last(this.cellRanges).type))) {
const extendRange = shiftKey && (0, import_core._existsAndNotEmpty)(this.cellRanges);
if (!isMultiSelect && (!extendRange || (0, import_core._exists)((0, import_core._last)(this.cellRanges).type))) {
this.removeAllCellRanges(true);

@@ -561,3 +559,3 @@ }

if (this.cellRanges.length > 0) {
this.draggingRange = import_core._.last(this.cellRanges);
this.draggingRange = (0, import_core._last)(this.cellRanges);
} else {

@@ -590,3 +588,3 @@ const mouseRowPosition = {

const rowPosUtils = this.rowPositionUtils;
const lastRange = import_core._.last(this.cellRanges);
const lastRange = (0, import_core._last)(this.cellRanges);
const intersectionStartRow = this.getRangeStartRow(lastRange);

@@ -613,3 +611,3 @@ const intersectionEndRow = this.getRangeEndRow(lastRange);

startColumn: lastRange.startColumn,
startRow: __spreadValues({}, startRow),
startRow: { ...startRow },
endRow: this.cellNavigationService.getRowAbove(intersectionStartRow)

@@ -622,5 +620,5 @@ };

columns: intersectCols,
startColumn: import_core._.includes(intersectCols, lastRange.startColumn) ? lastRange.startColumn : intersectCols[0],
startRow: this.rowMax([__spreadValues({}, intersectionStartRow), __spreadValues({}, startRow)]),
endRow: this.rowMin([__spreadValues({}, intersectionEndRow), __spreadValues({}, endRow)])
startColumn: (0, import_core._includes)(intersectCols, lastRange.startColumn) ? lastRange.startColumn : intersectCols[0],
startRow: this.rowMax([{ ...intersectionStartRow }, { ...startRow }]),
endRow: this.rowMin([{ ...intersectionEndRow }, { ...endRow }])
};

@@ -634,3 +632,3 @@ newRanges.push(middle);

startRow: this.cellNavigationService.getRowBelow(intersectionEndRow),
endRow: __spreadValues({}, endRow)
endRow: { ...endRow }
});

@@ -666,4 +664,4 @@ }

updateValuesOnMove(eventTarget) {
const cellCtrl = import_core._.getCtrlForEventTarget(this.gos, eventTarget, import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL);
const cell = cellCtrl == null ? void 0 : cellCtrl.getCellPosition();
const cellCtrl = (0, import_core._getCtrlForEventTarget)(this.gos, eventTarget, import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL);
const cell = cellCtrl?.getCellPosition();
this.cellHasChanged = false;

@@ -691,3 +689,6 @@ if (!cell || this.lastCellHovered && this.cellPositionUtils.equals(cell, this.lastCellHovered)) {

}
const columns = this.calculateColumnsBetween(this.newestRangeStartCell.column, cellPosition.column);
const columns = this.calculateColumnsBetween(
this.newestRangeStartCell.column,
cellPosition.column
);
if (!columns) {

@@ -722,3 +723,3 @@ return;

const event = {
type: import_core.Events.EVENT_RANGE_SELECTION_CHANGED,
type: "rangeSelectionChanged",
started,

@@ -731,7 +732,8 @@ finished,

calculateColumnsBetween(columnFrom, columnTo) {
const allColumns = this.columnModel.getAllDisplayedColumns();
const allColumns = this.visibleColsService.getAllCols();
const isSameColumn = columnFrom === columnTo;
const fromIndex = allColumns.indexOf(columnFrom);
const logMissing = (column) => (0, import_core._warnOnce)(`column ${column.getId()} is not visible`);
if (fromIndex < 0) {
console.warn(`AG Grid: column ${columnFrom.getId()} is not visible`);
logMissing(columnFrom);
return;

@@ -741,3 +743,3 @@ }

if (toIndex < 0) {
console.warn(`AG Grid: column ${columnTo.getId()} is not visible`);
logMissing(columnTo);
return;

@@ -757,37 +759,7 @@ }

};
__decorateClass([
(0, import_core.Autowired)("rowModel")
], RangeService.prototype, "rowModel", 2);
__decorateClass([
(0, import_core.Autowired)("dragService")
], RangeService.prototype, "dragService", 2);
__decorateClass([
(0, import_core.Autowired)("columnModel")
], RangeService.prototype, "columnModel", 2);
__decorateClass([
(0, import_core.Autowired)("cellNavigationService")
], RangeService.prototype, "cellNavigationService", 2);
__decorateClass([
(0, import_core.Autowired)("pinnedRowModel")
], RangeService.prototype, "pinnedRowModel", 2);
__decorateClass([
(0, import_core.Autowired)("rowPositionUtils")
], RangeService.prototype, "rowPositionUtils", 2);
__decorateClass([
(0, import_core.Autowired)("cellPositionUtils")
], RangeService.prototype, "cellPositionUtils", 2);
__decorateClass([
(0, import_core.Autowired)("ctrlsService")
], RangeService.prototype, "ctrlsService", 2);
__decorateClass([
(0, import_core.Autowired)("valueService")
], RangeService.prototype, "valueService", 2);
__decorateClass([
import_core.PostConstruct
], RangeService.prototype, "init", 1);
RangeService = __decorateClass([
(0, import_core.Bean)("rangeService")
], RangeService);
// enterprise-modules/range-selection/src/rangeSelection/fillHandle.ts
// enterprise-modules/range-selection/src/rangeSelection/selectionHandleFactory.ts
var import_core5 = require("@ag-grid-community/core");
// enterprise-modules/range-selection/src/rangeSelection/agFillHandle.ts
var import_core3 = require("@ag-grid-community/core");

@@ -804,3 +776,11 @@

}
init() {
wireBeans(beans) {
this.dragService = beans.dragService;
this.rangeService = beans.rangeService;
this.mouseEventService = beans.mouseEventService;
this.rowPositionUtils = beans.rowPositionUtils;
this.cellPositionUtils = beans.cellPositionUtils;
this.ctrlsService = beans.ctrlsService;
}
postConstruct() {
this.dragService.addDragSource({

@@ -829,7 +809,3 @@ dragStartPixels: 0,

});
this.addManagedListener(
this.getGui(),
"mousedown",
this.preventRangeExtension.bind(this)
);
this.addManagedElementListeners(this.getGui(), { mousedown: this.preventRangeExtension.bind(this) });
}

@@ -870,7 +846,5 @@ isDragging() {

onDragStart(e) {
this.cellHoverListener = this.addManagedListener(
this.ctrlsService.get("gridCtrl").getGui(),
"mousemove",
this.updateValuesOnMove.bind(this)
);
[this.cellHoverListener] = this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(), {
mousemove: this.updateValuesOnMove.bind(this)
});
document.body.classList.add(this.getDraggingCssClass());

@@ -895,3 +869,3 @@ }

const eGui = this.getGui();
const cellRange = import_core2._.last(this.rangeService.getCellRanges());
const cellRange = (0, import_core2._last)(this.rangeService.getCellRanges());
const start = cellRange.startRow;

@@ -909,3 +883,3 @@ const end = cellRange.endRow;

}
if (oldCellComp !== cellCtrl || !import_core2._.isVisible(eGui)) {
if (oldCellComp !== cellCtrl || !(0, import_core2._isVisible)(eGui)) {
this.setCellCtrl(cellCtrl);

@@ -931,3 +905,3 @@ const eParentOfValue = cellCtrl.getComp().getParentOfValue();

if (!this.shouldDestroyOnEndDragging && this.isDragging()) {
import_core2._.setDisplayed(this.getGui(), false);
(0, import_core2._setDisplayed)(this.getGui(), false);
this.shouldDestroyOnEndDragging = true;

@@ -945,35 +919,2 @@ return;

};
__decorateClass([
(0, import_core2.Autowired)("rowRenderer")
], AbstractSelectionHandle.prototype, "rowRenderer", 2);
__decorateClass([
(0, import_core2.Autowired)("dragService")
], AbstractSelectionHandle.prototype, "dragService", 2);
__decorateClass([
(0, import_core2.Autowired)("rangeService")
], AbstractSelectionHandle.prototype, "rangeService", 2);
__decorateClass([
(0, import_core2.Autowired)("mouseEventService")
], AbstractSelectionHandle.prototype, "mouseEventService", 2);
__decorateClass([
(0, import_core2.Autowired)("columnModel")
], AbstractSelectionHandle.prototype, "columnModel", 2);
__decorateClass([
(0, import_core2.Autowired)("cellNavigationService")
], AbstractSelectionHandle.prototype, "cellNavigationService", 2);
__decorateClass([
(0, import_core2.Autowired)("navigationService")
], AbstractSelectionHandle.prototype, "navigationService", 2);
__decorateClass([
(0, import_core2.Autowired)("rowPositionUtils")
], AbstractSelectionHandle.prototype, "rowPositionUtils", 2);
__decorateClass([
(0, import_core2.Autowired)("cellPositionUtils")
], AbstractSelectionHandle.prototype, "cellPositionUtils", 2);
__decorateClass([
(0, import_core2.Autowired)("ctrlsService")
], AbstractSelectionHandle.prototype, "ctrlsService", 2);
__decorateClass([
import_core2.PostConstruct
], AbstractSelectionHandle.prototype, "init", 1);

@@ -1020,6 +961,9 @@ // enterprise-modules/range-selection/src/rangeSelection/utils.ts

// enterprise-modules/range-selection/src/rangeSelection/fillHandle.ts
var _FillHandle = class _FillHandle extends AbstractSelectionHandle {
// enterprise-modules/range-selection/src/rangeSelection/agFillHandle.ts
var AgFillHandle = class extends AbstractSelectionHandle {
constructor() {
super(_FillHandle.TEMPLATE);
super(
/* html */
`<div class="ag-fill-handle"></div>`
);
this.markedCells = [];

@@ -1032,2 +976,9 @@ this.cellValues = [];

}
wireBeans(beans) {
super.wireBeans(beans);
this.valueService = beans.valueService;
this.navigationService = beans.navigationService;
this.cellNavigationService = beans.cellNavigationService;
this.visibleColsService = beans.visibleColsService;
}
updateValuesOnMove(e) {

@@ -1054,3 +1005,4 @@ super.updateValuesOnMove(e);

}
onDrag(e) {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
onDrag(_e) {
if (!this.initialPosition) {

@@ -1112,3 +1064,3 @@ const cellCtrl = this.getCellCtrl();

if (direction !== "x" && direction !== "y" && direction !== "xy") {
import_core3._.warnOnce(`valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.`);
(0, import_core3._warnOnce)(`valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.`);
return "xy";

@@ -1120,3 +1072,3 @@ }

const fillStartEvent = {
type: import_core3.Events.EVENT_FILL_START
type: "fillStart"
};

@@ -1127,3 +1079,3 @@ this.eventService.dispatchEvent(fillStartEvent);

const fillEndEvent = {
type: import_core3.Events.EVENT_FILL_END,
type: "fillEnd",
initialRange,

@@ -1175,3 +1127,6 @@ finalRange

fillValues(values, column, rowNode, () => {
return !this.rowPositionUtils.sameRow(currentRow, this.isUp ? initialRangeStartRow : initialRangeEndRow);
return !this.rowPositionUtils.sameRow(
currentRow,
this.isUp ? initialRangeStartRow : initialRangeEndRow
);
});

@@ -1181,8 +1136,10 @@ } else if (columns) {

resetValues();
columns.forEach((col) => fillValues(
values,
col,
rowNode,
() => col !== (this.isLeft ? initialRange.columns[0] : import_core3._.last(initialRange.columns))
));
columns.forEach(
(col) => fillValues(
values,
col,
rowNode,
() => col !== (this.isLeft ? initialRange.columns[0] : (0, import_core3._last)(initialRange.columns))
)
);
}

@@ -1194,3 +1151,2 @@ finished = this.rowPositionUtils.sameRow(currentRow, this.isUp ? finalRangeStartRow : finalRangeEndRow);

const fillValues = (currentValues, col, rowNode, updateInitialSet) => {
var _a, _b;
let currentValue;

@@ -1219,4 +1175,4 @@ let skipValue = false;

if (!fromUserFunction) {
if (sourceCol && ((_a = sourceCol.getColDef()) == null ? void 0 : _a.useValueFormatterForExport) !== false) {
currentValue = (_b = this.valueService.formatValue(sourceCol, sourceRowNode, currentValue)) != null ? _b : currentValue;
if (sourceCol && sourceCol.getColDef()?.useValueFormatterForExport !== false) {
currentValue = this.valueService.formatValue(sourceCol, sourceRowNode, currentValue) ?? currentValue;
}

@@ -1228,3 +1184,3 @@ if (col.getColDef().useValueParserForImport !== false) {

// if no sourceCol, then currentValue is a number
sourceCol ? currentValue : import_core3._.toStringOrNull(currentValue),
sourceCol ? currentValue : (0, import_core3._toStringOrNull)(currentValue),
cellValue

@@ -1302,3 +1258,3 @@ );

const multiplier = this.isUp || this.isLeft ? -1 : 1;
return { value: parseFloat(import_core3._.last(values).value) + 1 * multiplier, fromUserFunction: false };
return { value: parseFloat((0, import_core3._last)(values).value) + 1 * multiplier, fromUserFunction: false };
}

@@ -1308,3 +1264,6 @@ const { value, column: sourceCol, rowNode: sourceRowNode } = values[idx % values.length];

}
return { value: import_core3._.last(findLineByLeastSquares(values.map(({ value }) => Number(value)))), fromUserFunction: false };
return {
value: (0, import_core3._last)(findLineByLeastSquares(values.map(({ value }) => Number(value)))),
fromUserFunction: false
};
}

@@ -1359,3 +1318,3 @@ clearValues() {

}
const displayedColumns = this.columnModel.getAllDisplayedColumns();
const displayedColumns = this.visibleColsService.getAllCols();
const initialIndex = displayedColumns.indexOf(initialColumn);

@@ -1382,3 +1341,3 @@ const currentIndex = displayedColumns.indexOf(currentColumn);

const rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned };
const cellPos = __spreadProps(__spreadValues({}, rowPos), { column });
const cellPos = { ...rowPos, column };
const cellInRange = rangeService.isCellInSpecificRange(cellPos, cellRange);

@@ -1421,3 +1380,3 @@ const isInitialRow = this.rowPositionUtils.sameRow(row, initialPosition);

const rowPos = { rowIndex: row.rowIndex, rowPinned: row.rowPinned };
const celPos = __spreadProps(__spreadValues({}, rowPos), { column: cellRange.columns[i] });
const celPos = { ...rowPos, column: cellRange.columns[i] };
const cell = this.navigationService.getCellByPosition(celPos);

@@ -1439,5 +1398,7 @@ if (cell) {

extendHorizontal(initialPosition, endPosition, isMovingLeft) {
const allCols = this.columnModel.getAllDisplayedColumns();
const allCols = this.visibleColsService.getAllCols();
const startCol = allCols.indexOf(isMovingLeft ? endPosition.column : initialPosition.column);
const endCol = allCols.indexOf(isMovingLeft ? this.getCellRange().columns[0] : endPosition.column);
const endCol = allCols.indexOf(
isMovingLeft ? this.getCellRange().columns[0] : endPosition.column
);
const offset = isMovingLeft ? 0 : 1;

@@ -1460,4 +1421,10 @@ const colsToMark = allCols.slice(startCol + offset, endCol + offset);

const 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));
cellComp.addOrRemoveCssClass(
"ag-selection-fill-top",
this.rowPositionUtils.sameRow(row, rangeStartRow)
);
cellComp.addOrRemoveCssClass(
"ag-selection-fill-bottom",
this.rowPositionUtils.sameRow(row, rangeEndRow)
);
if (isMovingLeft) {

@@ -1467,3 +1434,3 @@ this.isLeft = true;

} else {
cellComp.addOrRemoveCssClass("ag-selection-fill-right", column === import_core3._.last(colsToMark));
cellComp.addOrRemoveCssClass("ag-selection-fill-right", column === (0, import_core3._last)(colsToMark));
}

@@ -1476,3 +1443,3 @@ }

reduceHorizontal(initialPosition, endPosition) {
const allCols = this.columnModel.getAllDisplayedColumns();
const allCols = this.visibleColsService.getAllCols();
const startCol = allCols.indexOf(endPosition.column);

@@ -1512,14 +1479,11 @@ const endCol = allCols.indexOf(initialPosition.column);

};
_FillHandle.TEMPLATE = /* html */
`<div class="ag-fill-handle"></div>`;
__decorateClass([
(0, import_core3.Autowired)("valueService")
], _FillHandle.prototype, "valueService", 2);
var FillHandle = _FillHandle;
// enterprise-modules/range-selection/src/rangeSelection/rangeHandle.ts
// enterprise-modules/range-selection/src/rangeSelection/agRangeHandle.ts
var import_core4 = require("@ag-grid-community/core");
var _RangeHandle = class _RangeHandle extends AbstractSelectionHandle {
var AgRangeHandle = class extends AbstractSelectionHandle {
constructor() {
super(_RangeHandle.TEMPLATE);
super(
/* html */
`<div class="ag-range-handle"></div>`
);
this.type = import_core4.SelectionHandleType.RANGE;

@@ -1534,3 +1498,3 @@ this.rangeFixed = false;

const cellRanges = this.rangeService.getCellRanges();
const lastRange = import_core4._.last(cellRanges);
const lastRange = (0, import_core4._last)(cellRanges);
if (!this.rangeFixed) {

@@ -1546,9 +1510,13 @@ this.fixRangeStartEnd(lastRange);

if (cellRanges.length === 2 && cellRanges[0].type === import_core4.CellRangeType.DIMENSION && lastRange.type === import_core4.CellRangeType.VALUE) {
const rowChanged = !this.rowPositionUtils.sameRow(this.endPosition, this.rangeService.getRangeEndRow(lastRange));
const rowChanged = !this.rowPositionUtils.sameRow(
this.endPosition,
this.rangeService.getRangeEndRow(lastRange)
);
if (rowChanged) {
this.rangeService.updateRangeEnd(
cellRanges[0],
__spreadProps(__spreadValues({}, this.endPosition), {
{
...this.endPosition,
column: cellRanges[0].columns[0]
}),
},
true

@@ -1561,3 +1529,3 @@ );

onDragEnd(e) {
const cellRange = import_core4._.last(this.rangeService.getCellRanges());
const cellRange = (0, import_core4._last)(this.rangeService.getCellRanges());
this.fixRangeStartEnd(cellRange);

@@ -1575,32 +1543,38 @@ this.rangeFixed = false;

};
_RangeHandle.TEMPLATE = /* html */
`<div class="ag-range-handle"></div>`;
var RangeHandle = _RangeHandle;
// enterprise-modules/range-selection/src/rangeSelection/selectionHandleFactory.ts
var import_core5 = require("@ag-grid-community/core");
var SelectionHandleFactory = class extends import_core5.BeanStub {
constructor() {
super(...arguments);
this.beanName = "selectionHandleFactory";
}
createSelectionHandle(type) {
return this.createBean(type === import_core5.SelectionHandleType.RANGE ? new RangeHandle() : new FillHandle());
return this.createBean(type === import_core5.SelectionHandleType.RANGE ? new AgRangeHandle() : new AgFillHandle());
}
};
SelectionHandleFactory = __decorateClass([
(0, import_core5.Bean)("selectionHandleFactory")
], SelectionHandleFactory);
// enterprise-modules/range-selection/src/version.ts
var VERSION = "31.3.2";
var VERSION = "32.0.0";
// enterprise-modules/range-selection/src/rangeSelectionModule.ts
var RangeSelectionCoreModule = {
version: VERSION,
moduleName: `${import_core6.ModuleNames.RangeSelectionModule}-core`,
beans: [RangeService, SelectionHandleFactory],
dependantModules: [import_core7.EnterpriseCoreModule]
};
var RangeSelectionApiModule = {
version: VERSION,
moduleName: `${import_core6.ModuleNames.RangeSelectionModule}-api`,
apiFunctions: {
getCellRanges,
addCellRange,
clearRangeSelection
},
dependantModules: [RangeSelectionCoreModule]
};
var RangeSelectionModule = {
version: VERSION,
moduleName: import_core6.ModuleNames.RangeSelectionModule,
beans: [RangeService, SelectionHandleFactory],
agStackComponents: [
{ componentName: "AgFillHandle", componentClass: FillHandle },
{ componentName: "AgRangeHandle", componentClass: RangeHandle }
],
dependantModules: [
import_core7.EnterpriseCoreModule
]
dependantModules: [RangeSelectionCoreModule, RangeSelectionApiModule]
};

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

var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(t,e,s)=>e in t?__defProp(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,__spreadValues=(t,e)=>{for(var s in e||(e={}))__hasOwnProp.call(e,s)&&__defNormalProp(t,s,e[s]);if(__getOwnPropSymbols)for(var s of __getOwnPropSymbols(e))__propIsEnum.call(e,s)&&__defNormalProp(t,s,e[s]);return t},__spreadProps=(t,e)=>__defProps(t,__getOwnPropDescs(e)),__export=(t,e)=>{for(var s in e)__defProp(t,s,{get:e[s],enumerable:!0})},__copyProps=(t,e,s,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of __getOwnPropNames(e))!__hasOwnProp.call(t,o)&&o!==s&&__defProp(t,o,{get:()=>e[o],enumerable:!(n=__getOwnPropDesc(e,o))||n.enumerable});return t},__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,s,n)=>{for(var o=n>1?void 0:n?__getOwnPropDesc(e,s):e,i=t.length-1,l;i>=0;i--)(l=t[i])&&(o=(n?l(e,s,o):l(o))||o);return n&&o&&__defProp(e,s,o),o},main_exports={};__export(main_exports,{RangeSelectionModule:()=>RangeSelectionModule}),module.exports=__toCommonJS(main_exports);var import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core"),import_core=require("@ag-grid-community/core"),RangeService=class extends import_core.BeanStub{constructor(){super(...arguments),this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}init(){this.addManagedListener(this.eventService,import_core.Events.EVENT_NEW_COLUMNS_LOADED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_PIVOT_CHANGED,()=>this.removeAllCellRanges()),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,import_core.Events.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady(t=>{const e=t.gridBodyCtrl;this.autoScrollService=new import_core.AutoScrollService({scrollContainer:e.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>e.getScrollFeature().getVScrollPosition().top,setVerticalPosition:s=>e.getScrollFeature().setVerticalScrollPosition(s),getHorizontalPosition:()=>e.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:s=>e.getScrollFeature().setHorizontalScrollPosition(s),shouldSkipVerticalScroll:()=>!this.gos.isDomLayout("normal"),shouldSkipHorizontalScroll:()=>!e.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const t=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach(s=>{const n=s.columns;s.columns=s.columns.filter(i=>i.isVisible()&&t.indexOf(i)!==-1),!import_core._.areEqual(n,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)});const e=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),e>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const t=import_core._.last(this.cellRanges);t&&this.refreshRangeStart(t)}isContiguousRange(t){const e=t.columns;if(!e.length)return!1;const s=this.columnModel.getAllDisplayedColumns(),n=e.map(o=>s.indexOf(o)).sort((o,i)=>o-i);return import_core._.last(n)-n[0]+1===e.length}getRangeStartRow(t){return t.startRow&&t.endRow?this.rowPositionUtils.before(t.startRow,t.endRow)?t.startRow:t.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(t){if(t.startRow&&t.endRow)return this.rowPositionUtils.before(t.startRow,t.endRow)?t.endRow:t.startRow;const e=this.pinnedRowModel.getPinnedBottomRowCount();return e>0?{rowIndex:e-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(t,e=!1){if(!this.gos.get("enableRangeSelection"))return;const s=this.calculateColumnsBetween(t.column,t.column);if(!s)return;(this.gos.get("suppressMultiRangeSelection")||!e||import_core._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);const o={rowIndex:t.rowIndex,rowPinned:t.rowPinned},i={startRow:o,endRow:o,columns:s,startColumn:t.column};this.cellRanges.push(i),this.setNewestRangeStartCell(t),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(t){if(this.isEmpty()||!this.newestRangeStartCell)return;const e=import_core._.last(this.cellRanges);this.updateRangeEnd(e,t)}updateRangeEnd(t,e,s=!1){const n=e.column,o=this.calculateColumnsBetween(t.startColumn,n);!o||this.isLastCellOfRange(t,e)||(t.columns=o,t.endRow={rowIndex:e.rowIndex,rowPinned:e.rowPinned},s||this.dispatchChangedEvent(!0,!0,t.id))}refreshRangeStart(t){const{startColumn:e,columns:s}=t,n=(a,c)=>{const d=t.columns.filter(g=>g!==a);a?(t.startColumn=a,t.columns=c?[a,...d]:[...d,a]):t.columns=d},{left:o,right:i}=this.getRangeEdgeColumns(t);if(e===s[0]&&e!==o){n(o,!0);return}if(e===import_core._.last(s)&&e===i){n(i,!1);return}}getRangeEdgeColumns(t){const e=this.columnModel.getAllDisplayedColumns(),s=t.columns.map(n=>e.indexOf(n)).filter(n=>n>-1).sort((n,o)=>n-o);return{left:e[s[0]],right:e[import_core._.last(s)]}}extendLatestRangeInDirection(t){if(this.isEmpty()||!this.newestRangeStartCell)return;const e=t.key,s=t.ctrlKey||t.metaKey,n=import_core._.last(this.cellRanges),o=this.newestRangeStartCell,i=n.columns[0],l=import_core._.last(n.columns),r=n.endRow.rowIndex,a=n.endRow.rowPinned,d={column:o.column===i?l:i,rowIndex:r,rowPinned:a},g=this.cellNavigationService.getNextCellToFocus(e,d,s);if(g)return this.setCellRange({rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:g.rowIndex,rowEndPinned:g.rowPinned,columnStart:o.column,columnEnd:g.column}),g}setCellRange(t){this.gos.get("enableRangeSelection")&&(this.removeAllCellRanges(!0),this.addCellRange(t))}setCellRanges(t){import_core._.shallowCompare(this.cellRanges,t)||(this.removeAllCellRanges(!0),t.forEach(e=>{e.columns&&e.startRow&&this.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),this.cellRanges.push(e)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(t){this.newestRangeStartCell=t}clearCellRangeCellValues(t){let{cellRanges:e}=t;const{cellEventSource:s="rangeService",dispatchWrapperEvents:n,wrapperEventSource:o="deleteKey"}=t;if(n){const i={type:import_core.Events.EVENT_RANGE_DELETE_START,source:o};this.eventService.dispatchEvent(i)}if(e||(e=this.cellRanges),e.forEach(i=>{this.forEachRowInRange(i,l=>{var r;const a=this.rowPositionUtils.getRowNode(l);if(a)for(let c=0;c<i.columns.length;c++){const d=this.columnModel.getGridColumn(i.columns[c]);if(!d||!d.isCellEditable(a))continue;const g=(r=this.valueService.parseValue(d,a,"",a.getValueFromValueService(d)))!=null?r:null;a.setDataValue(d,g,s)}})}),n){const i={type:import_core.Events.EVENT_RANGE_DELETE_END,source:o};this.eventService.dispatchEvent(i)}}createCellRangeFromCellRangeParams(t){return this.createPartialCellRangeFromRangeParams(t,!1)}createPartialCellRangeFromRangeParams(t,e){let s,n=!1;if(t.columns)s=t.columns.map(l=>this.columnModel.getColumnWithValidation(l)).filter(l=>l);else{const l=this.columnModel.getColumnWithValidation(t.columnStart),r=this.columnModel.getColumnWithValidation(t.columnEnd);if(!l||!r)return;s=this.calculateColumnsBetween(l,r),s&&s.length&&(n=s[0]!==l)}if(!s||!e&&s.length===0)return;const o=t.rowStartIndex!=null?{rowIndex:t.rowStartIndex,rowPinned:t.rowStartPinned||null}:void 0,i=t.rowEndIndex!=null?{rowIndex:t.rowEndIndex,rowPinned:t.rowEndPinned||null}:void 0;return{startRow:o,endRow:i,columns:s,startColumn:n?import_core._.last(s):s[0]}}addCellRange(t){if(!this.gos.get("enableRangeSelection"))return;const e=this.createCellRangeFromCellRangeParams(t);e&&(e.startRow&&this.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.startColumn}),this.cellRanges.push(e),this.dispatchChangedEvent(!1,!0,e.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const t=this.cellRanges.length;if(t===0)return!1;if(t>1)return!0;const e=this.cellRanges[0],s=this.getRangeStartRow(e),n=this.getRangeEndRow(e);return s.rowPinned!==n.rowPinned||s.rowIndex!==n.rowIndex||e.columns.length!==1}areAllRangesAbleToMerge(){const t=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(n=>{this.forEachRowInRange(n,o=>{const i=`${o.rowPinned||"normal"}_${o.rowIndex}`,l=t.get(i),r=n.columns.map(a=>a.getId());if(l){const a=r.filter(c=>l.indexOf(c)===-1);l.push(...a)}else t.set(i,r)})});let s;for(const n of t.values()){const o=n.sort().join();if(s===void 0){s=o;continue}if(s!==o)return!1}return!0}forEachRowInRange(t,e){const s=this.getRangeStartRow(t),n=this.getRangeEndRow(t);let o=s;for(;o&&(e(o),!this.rowPositionUtils.sameRow(o,n));)o=this.cellNavigationService.getRowBelow(o)}removeAllCellRanges(t){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,t||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(t){return this.getCellRangeCount(t)>0}isCellInSpecificRange(t,e){const s=e.columns!==null&&import_core._.includes(e.columns,t.column),n=this.isRowInRange(t.rowIndex,t.rowPinned,e);return s&&n}isLastCellOfRange(t,e){const{startRow:s,endRow:n}=t,o=this.rowPositionUtils.before(s,n)?n:s,i=e.rowIndex===o.rowIndex&&e.rowPinned===o.rowPinned,l=t.columns[0],r=import_core._.last(t.columns),a=t.startColumn===l?r:l;return e.column===a&&i}isBottomRightCell(t,e){const s=this.columnModel.getAllDisplayedColumns(),n=t.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:o,endRow:i}=t,l=this.rowPositionUtils.before(o,i)?i:o,r=s.indexOf(e.column)===import_core._.last(n),a=e.rowIndex===l.rowIndex&&import_core._.makeNull(e.rowPinned)===import_core._.makeNull(l.rowPinned);return r&&a}getCellRangeCount(t){return this.isEmpty()?0:this.cellRanges.filter(e=>this.isCellInSpecificRange(t,e)).length}isRowInRange(t,e,s){const n=this.getRangeStartRow(s),o=this.getRangeEndRow(s),i={rowIndex:t,rowPinned:e||null},l=i.rowIndex===n.rowIndex&&i.rowPinned==n.rowPinned,r=i.rowIndex===o.rowIndex&&i.rowPinned==o.rowPinned;if(l||r)return!0;const a=!this.rowPositionUtils.before(i,n),c=this.rowPositionUtils.before(i,o);return a&&c}getDraggingRange(){return this.draggingRange}onDragStart(t){if(!this.gos.get("enableRangeSelection"))return;const{ctrlKey:e,metaKey:s,shiftKey:n}=t,o=e||s,l=!this.gos.get("suppressMultiRangeSelection")?o:!1,r=n&&import_core._.existsAndNotEmpty(this.cellRanges);!l&&(!r||import_core._.exists(import_core._.last(this.cellRanges).type))&&this.removeAllCellRanges(!0);const a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=t,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=import_core._.last(this.cellRanges);else{const c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(t){if(t&&this.dragging||this.gos.get("suppressMultiRangeSelection")||this.isEmpty())return;const e=this.rowPositionUtils,s=import_core._.last(this.cellRanges),n=this.getRangeStartRow(s),o=this.getRangeEndRow(s),i=[];this.cellRanges.slice(0,-1).forEach(l=>{const r=this.getRangeStartRow(l),a=this.getRangeEndRow(l),c=l.columns,d=c.filter(h=>s.columns.indexOf(h)===-1);if(d.length===c.length){i.push(l);return}if(e.before(o,r)||e.before(a,n)){i.push(l);return}const g=i.length;if(e.before(r,n)){const h={columns:[...c],startColumn:s.startColumn,startRow:__spreadValues({},r),endRow:this.cellNavigationService.getRowAbove(n)};i.push(h)}if(d.length>0){const h={columns:d,startColumn:import_core._.includes(d,s.startColumn)?s.startColumn:d[0],startRow:this.rowMax([__spreadValues({},n),__spreadValues({},r)]),endRow:this.rowMin([__spreadValues({},o),__spreadValues({},a)])};i.push(h)}e.before(o,a)&&i.push({columns:[...c],startColumn:s.startColumn,startRow:this.cellNavigationService.getRowBelow(o),endRow:__spreadValues({},a)}),i.length-g===1&&(i[i.length-1].id=l.id)}),this.cellRanges=i,t&&this.dispatchChangedEvent(!1,!0)}rowMax(t){let e;return t.forEach(s=>{(e===void 0||this.rowPositionUtils.before(e,s))&&(e=s)}),e}rowMin(t){let e;return t.forEach(s=>{(e===void 0||this.rowPositionUtils.before(s,e))&&(e=s)}),e}updateValuesOnMove(t){const e=import_core._.getCtrlForEventTarget(this.gos,t,import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL),s=e?.getCellPosition();this.cellHasChanged=!1,!(!s||this.lastCellHovered&&this.cellPositionUtils.equals(s,this.lastCellHovered))&&(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s)}onDragging(t){if(!this.dragging||!t)return;this.updateValuesOnMove(t.target),this.lastMouseEvent=t;const e=this.lastCellHovered,s=i=>e&&e.rowPinned===i&&this.newestRangeStartCell.rowPinned===i,n=s("top")||s("bottom");if(this.autoScrollService.check(t,n),!this.cellHasChanged)return;const o=this.calculateColumnsBetween(this.newestRangeStartCell.column,e.column);o&&(this.draggingRange.endRow={rowIndex:e.rowIndex,rowPinned:e.rowPinned},this.draggingRange.columns=o,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:t}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,t)}dispatchChangedEvent(t,e,s){const n={type:import_core.Events.EVENT_RANGE_SELECTION_CHANGED,started:t,finished:e,id:s};this.eventService.dispatchEvent(n)}calculateColumnsBetween(t,e){const s=this.columnModel.getAllDisplayedColumns(),n=t===e,o=s.indexOf(t);if(o<0){console.warn(`AG Grid: column ${t.getId()} is not visible`);return}const i=n?o:s.indexOf(e);if(i<0){console.warn(`AG Grid: column ${e.getId()} is not visible`);return}if(n)return[t];const l=Math.min(o,i),r=l===o?i:o,a=[];for(let c=l;c<=r;c++)a.push(s[c]);return a}};__decorateClass([(0,import_core.Autowired)("rowModel")],RangeService.prototype,"rowModel",2),__decorateClass([(0,import_core.Autowired)("dragService")],RangeService.prototype,"dragService",2),__decorateClass([(0,import_core.Autowired)("columnModel")],RangeService.prototype,"columnModel",2),__decorateClass([(0,import_core.Autowired)("cellNavigationService")],RangeService.prototype,"cellNavigationService",2),__decorateClass([(0,import_core.Autowired)("pinnedRowModel")],RangeService.prototype,"pinnedRowModel",2),__decorateClass([(0,import_core.Autowired)("rowPositionUtils")],RangeService.prototype,"rowPositionUtils",2),__decorateClass([(0,import_core.Autowired)("cellPositionUtils")],RangeService.prototype,"cellPositionUtils",2),__decorateClass([(0,import_core.Autowired)("ctrlsService")],RangeService.prototype,"ctrlsService",2),__decorateClass([(0,import_core.Autowired)("valueService")],RangeService.prototype,"valueService",2),__decorateClass([import_core.PostConstruct],RangeService.prototype,"init",1),RangeService=__decorateClass([(0,import_core.Bean)("rangeService")],RangeService);var import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),AbstractSelectionHandle=class extends import_core2.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}init(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:t=>{this.dragging=!0,this.rangeService.autoScrollService.check(t),this.changedCalculatedValues&&(this.onDrag(t),this.changedCalculatedValues=!1)},onDragStop:t=>{this.dragging=!1,this.onDragEnd(t),this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(t){this.cellCtrl=t}getCellRange(){return this.cellRange}setCellRange(t){this.cellRange=t}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(t){this.rangeStartRow=t}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(t){this.rangeEndRow=t}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(t){t.stopPropagation()}onDragStart(t){this.cellHoverListener=this.addManagedListener(this.ctrlsService.get("gridCtrl").getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===import_core2.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(t){const e=this.mouseEventService.getCellPositionForEvent(t);!e||this.lastCellHovered&&this.cellPositionUtils.equals(e,this.lastCellHovered)||(this.lastCellHovered=e,this.changedCalculatedValues=!0)}getType(){return this.type}refresh(t){const e=this.getCellCtrl(),s=this.getGui(),n=import_core2._.last(this.rangeService.getCellRanges()),o=n.startRow,i=n.endRow;if(o&&i&&(this.rowPositionUtils.before(i,o)?(this.setRangeStartRow(i),this.setRangeEndRow(o)):(this.setRangeStartRow(o),this.setRangeEndRow(i))),e!==t||!import_core2._.isVisible(s)){this.setCellCtrl(t);const l=t.getComp().getParentOfValue();l&&l.appendChild(s)}this.setCellRange(n)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){import_core2._.setDisplayed(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const t=this.getGui();t.parentElement&&t.parentElement.removeChild(t)}};__decorateClass([(0,import_core2.Autowired)("rowRenderer")],AbstractSelectionHandle.prototype,"rowRenderer",2),__decorateClass([(0,import_core2.Autowired)("dragService")],AbstractSelectionHandle.prototype,"dragService",2),__decorateClass([(0,import_core2.Autowired)("rangeService")],AbstractSelectionHandle.prototype,"rangeService",2),__decorateClass([(0,import_core2.Autowired)("mouseEventService")],AbstractSelectionHandle.prototype,"mouseEventService",2),__decorateClass([(0,import_core2.Autowired)("columnModel")],AbstractSelectionHandle.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("cellNavigationService")],AbstractSelectionHandle.prototype,"cellNavigationService",2),__decorateClass([(0,import_core2.Autowired)("navigationService")],AbstractSelectionHandle.prototype,"navigationService",2),__decorateClass([(0,import_core2.Autowired)("rowPositionUtils")],AbstractSelectionHandle.prototype,"rowPositionUtils",2),__decorateClass([(0,import_core2.Autowired)("cellPositionUtils")],AbstractSelectionHandle.prototype,"cellPositionUtils",2),__decorateClass([(0,import_core2.Autowired)("ctrlsService")],AbstractSelectionHandle.prototype,"ctrlsService",2),__decorateClass([import_core2.PostConstruct],AbstractSelectionHandle.prototype,"init",1);function findLineByLeastSquares(t){const e=t.length;let s=0;if(e<=1)return t;for(let g=0;g<t.length;g++){const h=t[g],m=h.toString().split("e-");if(m.length>1){s=Math.max(s,parseInt(m[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let n=0,o=0,i=0,l=0,r=0;for(let g=0;g<e;g++)r=t[g],n+=g,o+=r,l+=g*g,i+=g*r;const a=(e*i-n*o)/(e*l-n*n),c=o/e-a*n/e,d=[];for(let g=0;g<=e;g++)d.push(parseFloat((g*a+c).toFixed(s)));return d}var _FillHandle=class V extends AbstractSelectionHandle{constructor(){super(V.TEMPLATE),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=import_core3.SelectionHandleType.FILL}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:s,y:n}=this.initialXY,{x:o,y:i}=this.mouseEventService.getNormalisedPosition(e),l=Math.abs(s-o),r=Math.abs(n-i),a=this.getFillHandleDirection();let c;a==="xy"?c=l>r?"x":"y":c=a,c!==this.dragAxis&&(this.dragAxis=c,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const n=this.getCellCtrl();if(!n)return;this.initialPosition=n.getCellPosition()}const s=this.getLastCellHovered();s&&this.markPathFrom(this.initialPosition,s)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const s=this.dragAxis==="x",n=this.getCellRange(),o=n.columns.length,i=this.getRangeStartRow(),l=this.getRangeEndRow();let r;if(!this.isUp&&!this.isLeft)r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:n.columns[0],rowEndIndex:s?l.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:s?l.rowPinned:this.lastCellMarked.rowPinned,columnEnd:s?this.lastCellMarked.column:n.columns[o-1]});else{const a=s?i:this.lastCellMarked;r=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:a.rowIndex,rowStartPinned:a.rowPinned,columnStart:s?this.lastCellMarked.column:n.columns[0],rowEndIndex:l.rowIndex,rowEndPinned:l.rowPinned,columnEnd:n.columns[o-1]})}r&&(this.raiseFillStartEvent(),this.handleValueChanged(n,r,e),this.rangeService.setCellRanges([r]),this.raiseFillEndEvent(n,r))}getFillHandleDirection(){const e=this.gos.get("fillHandleDirection");return e?e!=="x"&&e!=="y"&&e!=="xy"?(import_core3._.warnOnce("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}raiseFillStartEvent(){const e={type:import_core3.Events.EVENT_FILL_START};this.eventService.dispatchEvent(e)}raiseFillEndEvent(e,s){const n={type:import_core3.Events.EVENT_FILL_END,initialRange:e,finalRange:s};this.eventService.dispatchEvent(n)}handleValueChanged(e,s,n){const o=this.rangeService.getRangeEndRow(e),i=this.rangeService.getRangeStartRow(e),l=this.rangeService.getRangeEndRow(s),r=this.rangeService.getRangeStartRow(s),a=this.dragAxis==="y";if(this.isReduce&&!this.gos.get("suppressClearOnFillReduction")){const v=a?e.columns:e.columns.filter(w=>s.columns.indexOf(w)<0),f=a?this.cellNavigationService.getRowBelow(l):r;f&&this.clearCellsInRange(f,o,v);return}const c=[],d=[],g=[],h=[];let m=!0,R=0;const u=()=>{c.length=0,d.length=0,g.length=0,h.length=0,R=0},p=(v,f)=>{let w=this.isUp?o:i,x=!1;for(a&&(m=!0,u());!x&&w;){const S=this.rowPositionUtils.getRowNode(w);if(!S)break;a&&v?P(c,v,S,()=>!this.rowPositionUtils.sameRow(w,this.isUp?i:o)):f&&(m=!0,u(),f.forEach(E=>P(c,E,S,()=>E!==(this.isLeft?e.columns[0]:import_core3._.last(e.columns))))),x=this.rowPositionUtils.sameRow(w,this.isUp?r:l),w=this.isUp?this.cellNavigationService.getRowAbove(w):this.cellNavigationService.getRowBelow(w)}},P=(v,f,w,x)=>{var S,E;let C,_=!1;if(m)C=this.valueService.getValue(f,w),d.push(C),g.push(this.valueService.getValue(f,w,void 0,!0)),h.push(this.valueService.formatValue(f,w,C)),m=x();else{const{value:O,fromUserFunction:I,sourceCol:y,sourceRowNode:N}=this.processValues({event:n,values:v,initialValues:d,initialNonAggregatedValues:g,initialFormattedValues:h,col:f,rowNode:w,idx:R++});if(C=O,f.isCellEditable(w)){const M=this.valueService.getValue(f,w);I||(y&&((S=y.getColDef())==null?void 0:S.useValueFormatterForExport)!==!1&&(C=(E=this.valueService.formatValue(y,N,C))!=null?E:C),f.getColDef().useValueParserForImport!==!1&&(C=this.valueService.parseValue(f,w,y?C:import_core3._.toStringOrNull(C),M))),!I||M!==C?w.setDataValue(f,C,"rangeService"):_=!0}}_||v.push({value:C,column:f,rowNode:w})};if(a)e.columns.forEach(v=>{p(v)});else{const v=this.isLeft?[...s.columns].reverse():s.columns;p(void 0,v)}}clearCellsInRange(e,s,n){const o={startRow:e,endRow:s,columns:n,startColumn:n[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[o]})}processValues(e){const{event:s,values:n,initialValues:o,initialNonAggregatedValues:i,initialFormattedValues:l,col:r,rowNode:a,idx:c}=e,d=this.gos.getCallback("fillOperation"),g=this.dragAxis==="y";let h;if(g?h=this.isUp?"up":"down":h=this.isLeft?"left":"right",d){const R={event:s,values:n.map(({value:p})=>p),initialValues:o,initialNonAggregatedValues:i,initialFormattedValues:l,currentIndex:c,currentCellValue:this.valueService.getValue(r,a),direction:h,column:r,rowNode:a},u=d(R);if(u!==!1)return{value:u,fromUserFunction:!0}}const m=!n.some(({value:R})=>{const u=parseFloat(R);return isNaN(u)||u.toString()!==R.toString()});if(s.altKey||!m){if(m&&o.length===1){const P=this.isUp||this.isLeft?-1:1;return{value:parseFloat(import_core3._.last(n).value)+1*P,fromUserFunction:!1}}const{value:R,column:u,rowNode:p}=n[c%n.length];return{value:R,fromUserFunction:!1,sourceCol:u,sourceRowNode:p}}return{value:import_core3._.last(findLineByLeastSquares(n.map(({value:R})=>Number(R)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const s=e.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",!1),s.addOrRemoveCssClass("ag-selection-fill-right",!1),s.addOrRemoveCssClass("ag-selection-fill-bottom",!1),s.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,s){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(s,e))return;const n=this.rowPositionUtils.before(s,e),o=this.getRangeStartRow(),i=this.getRangeEndRow();n&&(s.rowPinned==o.rowPinned&&s.rowIndex>=o.rowIndex||o.rowPinned!=i.rowPinned&&s.rowPinned==i.rowPinned&&s.rowIndex<=i.rowIndex)?(this.reduceVertical(e,s),this.isReduce=!0):(this.extendVertical(e,s,n),this.isReduce=!1)}else{const n=e.column,o=s.column;if(n===o)return;const i=this.columnModel.getAllDisplayedColumns(),l=i.indexOf(n),r=i.indexOf(o);r<=l&&r>=i.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,s),this.isReduce=!0):(this.extendHorizontal(e,s,r<l),this.isReduce=!1)}this.lastCellMarked=s}extendVertical(e,s,n){const{navigationService:o,rangeService:i}=this;let l=e;do{const r=this.getCellRange(),a=r.columns.length;for(let c=0;c<a;c++){const d=r.columns[c],g={rowIndex:l.rowIndex,rowPinned:l.rowPinned},h=__spreadProps(__spreadValues({},g),{column:d}),m=i.isCellInSpecificRange(h,r),R=this.rowPositionUtils.sameRow(l,e);if(n&&(this.isUp=!0),!R){const u=o.getCellByPosition(h);if(u){this.markedCells.push(u);const p=u.getComp();m||(p.addOrRemoveCssClass("ag-selection-fill-left",c===0),p.addOrRemoveCssClass("ag-selection-fill-right",c===a-1)),p.addOrRemoveCssClass(n?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(l,s))}}}if(this.rowPositionUtils.sameRow(l,s))break}while(l=n?this.cellNavigationService.getRowAbove(l):this.cellNavigationService.getRowBelow(l))}reduceVertical(e,s){let n=e;do{const o=this.getCellRange(),i=o.columns.length,l=this.rowPositionUtils.sameRow(n,s);for(let r=0;r<i;r++){const a={rowIndex:n.rowIndex,rowPinned:n.rowPinned},c=__spreadProps(__spreadValues({},a),{column:o.columns[r]}),d=this.navigationService.getCellByPosition(c);d&&(this.markedCells.push(d),d.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,s)))}if(l)break}while(n=this.cellNavigationService.getRowAbove(n))}extendHorizontal(e,s,n){const o=this.columnModel.getAllDisplayedColumns(),i=o.indexOf(n?s.column:e.column),l=o.indexOf(n?this.getCellRange().columns[0]:s.column),r=n?0:1,a=o.slice(i+r,l+r),c=this.getRangeStartRow(),d=this.getRangeEndRow();a.forEach(g=>{let h=c,m=!1;do{m=this.rowPositionUtils.sameRow(h,d);const R=this.navigationService.getCellByPosition({rowIndex:h.rowIndex,rowPinned:h.rowPinned,column:g});if(R){this.markedCells.push(R);const u=R.getComp();u.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(h,c)),u.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(h,d)),n?(this.isLeft=!0,u.addOrRemoveCssClass("ag-selection-fill-left",g===a[0])):u.addOrRemoveCssClass("ag-selection-fill-right",g===import_core3._.last(a))}h=this.cellNavigationService.getRowBelow(h)}while(!m)})}reduceHorizontal(e,s){const n=this.columnModel.getAllDisplayedColumns(),o=n.indexOf(s.column),i=n.indexOf(e.column),l=n.slice(o,i),r=this.getRangeStartRow(),a=this.getRangeEndRow();l.forEach(c=>{let d=r,g=!1;do{g=this.rowPositionUtils.sameRow(d,a);const h=this.navigationService.getCellByPosition({rowIndex:d.rowIndex,rowPinned:d.rowPinned,column:c});h&&(this.markedCells.push(h),h.getComp().addOrRemoveCssClass("ag-selection-fill-right",c===l[0])),d=this.cellNavigationService.getRowBelow(d)}while(!g)})}refresh(e){const s=this.rangeService.getCellRanges()[0];if(!s.startRow||!s.endRow){this.destroy();return}super.refresh(e)}};_FillHandle.TEMPLATE='<div class="ag-fill-handle"></div>',__decorateClass([(0,import_core3.Autowired)("valueService")],_FillHandle.prototype,"valueService",2);var FillHandle=_FillHandle,import_core4=require("@ag-grid-community/core"),_RangeHandle=class L extends AbstractSelectionHandle{constructor(){super(L.TEMPLATE),this.type=import_core4.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const s=this.getLastCellHovered();if(!s)return;const n=this.rangeService.getCellRanges(),o=import_core4._.last(n);this.rangeFixed||(this.fixRangeStartEnd(o),this.rangeFixed=!0),this.endPosition={rowIndex:s.rowIndex,rowPinned:s.rowPinned,column:s.column},n.length===2&&n[0].type===import_core4.CellRangeType.DIMENSION&&o.type===import_core4.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(o))&&this.rangeService.updateRangeEnd(n[0],__spreadProps(__spreadValues({},this.endPosition),{column:n[0].columns[0]}),!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const s=import_core4._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(s),this.rangeFixed=!1}fixRangeStartEnd(e){const s=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e),o=e.columns[0];e.startRow=s,e.endRow=n,e.startColumn=o}};_RangeHandle.TEMPLATE='<div class="ag-range-handle"></div>';var RangeHandle=_RangeHandle,import_core5=require("@ag-grid-community/core"),SelectionHandleFactory=class extends import_core5.BeanStub{createSelectionHandle(t){return this.createBean(t===import_core5.SelectionHandleType.RANGE?new RangeHandle:new FillHandle)}};SelectionHandleFactory=__decorateClass([(0,import_core5.Bean)("selectionHandleFactory")],SelectionHandleFactory);var VERSION="31.3.2",RangeSelectionModule={version:VERSION,moduleName:import_core6.ModuleNames.RangeSelectionModule,beans:[RangeService,SelectionHandleFactory],agStackComponents:[{componentName:"AgFillHandle",componentClass:FillHandle},{componentName:"AgRangeHandle",componentClass:RangeHandle}],dependantModules:[import_core7.EnterpriseCoreModule]};
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of __getOwnPropNames(t))!__hasOwnProp.call(e,i)&&i!==s&&__defProp(e,i,{get:()=>t[i],enumerable:!(n=__getOwnPropDesc(t,i))||n.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{RangeSelectionModule:()=>RangeSelectionModule}),module.exports=__toCommonJS(main_exports);var import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core");function getCellRanges(e){return e.rangeService?.getCellRanges()??null}function addCellRange(e,t){e.rangeService?.addCellRange(t)}function clearRangeSelection(e){e.rangeService?.removeAllCellRanges()}var import_core=require("@ag-grid-community/core"),RangeService=class extends import_core.BeanStub{constructor(){super(...arguments),this.beanName="rangeService",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragService=e.dragService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsService.whenReady(n=>{const i=n.gridBodyCtrl;this.autoScrollService=new import_core.AutoScrollService({scrollContainer:i.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>i.getScrollFeature().getVScrollPosition().top,setVerticalPosition:o=>i.getScrollFeature().setVerticalScrollPosition(o),getHorizontalPosition:()=>i.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:o=>i.getScrollFeature().setHorizontalScrollPosition(o),shouldSkipVerticalScroll:()=>!this.gos.isDomLayout("normal"),shouldSkipHorizontalScroll:()=>!i.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleColsService.getAllCols();this.cellRanges.forEach(s=>{const n=s.columns;s.columns=s.columns.filter(o=>o.isVisible()&&e.indexOf(o)!==-1),!(0,import_core._areEqual)(n,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=(0,import_core._last)(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleColsService.getAllCols(),n=t.map(i=>s.indexOf(i)).sort((i,o)=>i-o);return(0,import_core._last)(n)-n[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!this.gos.get("enableRangeSelection"))return;const s=this.calculateColumnsBetween(e.column,e.column);if(!s)return;(this.gos.get("suppressMultiRangeSelection")||!t||(0,import_core._missing)(this.cellRanges))&&this.removeAllCellRanges(!0);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned},o={startRow:i,endRow:i,columns:s,startColumn:e.column};this.cellRanges.push(o),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=(0,import_core._last)(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,s=!1){const n=t.column,i=this.calculateColumnsBetween(e.startColumn,n);!i||this.isLastCellOfRange(e,t)||(e.columns=i,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},s||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:s}=e,n=(a,c)=>{const d=e.columns.filter(g=>g!==a);a?(e.startColumn=a,e.columns=c?[a,...d]:[...d,a]):e.columns=d},{left:i,right:o}=this.getRangeEdgeColumns(e);if(t===s[0]&&t!==i){n(i,!0);return}if(t===(0,import_core._last)(s)&&t===o){n(o,!1);return}}getRangeEdgeColumns(e){const t=this.visibleColsService.getAllCols(),s=e.columns.map(n=>t.indexOf(n)).filter(n=>n>-1).sort((n,i)=>n-i);return{left:t[s[0]],right:t[(0,import_core._last)(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,n=(0,import_core._last)(this.cellRanges),i=this.newestRangeStartCell,o=n.columns[0],l=(0,import_core._last)(n.columns),r=n.endRow.rowIndex,a=n.endRow.rowPinned,d={column:i.column===o?l:o,rowIndex:r,rowPinned:a},g=this.cellNavigationService.getNextCellToFocus(t,d,s);if(g)return this.setCellRange({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:g.rowIndex,rowEndPinned:g.rowPinned,columnStart:i.column,columnEnd:g.column}),g}setCellRange(e){this.gos.get("enableRangeSelection")&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){(0,import_core._shallowCompare)(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(t=>{t.columns&&t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),this.cellRanges.push(t)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:s="rangeService",dispatchWrapperEvents:n,wrapperEventSource:i="deleteKey"}=e;if(n){const o={type:"rangeDeleteStart",source:i};this.eventService.dispatchEvent(o)}if(t||(t=this.cellRanges),t.forEach(o=>{this.forEachRowInRange(o,l=>{const r=this.rowPositionUtils.getRowNode(l);if(r)for(let a=0;a<o.columns.length;a++){const c=this.columnModel.getCol(o.columns[a]);if(!c||!c.isCellEditable(r))continue;const d=this.valueService.parseValue(c,r,"",r.getValueFromValueService(c))??null;r.setDataValue(c,d,s)}})}),n){const o={type:"rangeDeleteEnd",source:i};this.eventService.dispatchEvent(o)}}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let s,n=!1;if(e.columns)s=e.columns.map(l=>this.columnModel.getCol(l)).filter(l=>l);else{const l=this.columnModel.getCol(e.columnStart),r=this.columnModel.getCol(e.columnEnd);if(!l||!r)return;s=this.calculateColumnsBetween(l,r),s&&s.length&&(n=s[0]!==l)}if(!s||!t&&s.length===0)return;const i=e.rowStartIndex!=null?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,o=e.rowEndIndex!=null?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0;return{startRow:i,endRow:o,columns:s,startColumn:n?(0,import_core._last)(s):s[0]}}addCellRange(e){if(!this.gos.get("enableRangeSelection"))return;const t=this.createCellRangeFromCellRangeParams(e);t&&(t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.startColumn}),this.cellRanges.push(t),this.dispatchChangedEvent(!1,!0,t.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),n=this.getRangeEndRow(t);return s.rowPinned!==n.rowPinned||s.rowIndex!==n.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(n=>{this.forEachRowInRange(n,i=>{const o=`${i.rowPinned||"normal"}_${i.rowIndex}`,l=e.get(o),r=n.columns.map(a=>a.getId());if(l){const a=r.filter(c=>l.indexOf(c)===-1);l.push(...a)}else e.set(o,r)})});let s;for(const n of e.values()){const i=n.sort().join();if(s===void 0){s=i;continue}if(s!==i)return!1}return!0}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),n=this.getRangeEndRow(e);let i=s;for(;i&&(t(i),!this.rowPositionUtils.sameRow(i,n));)i=this.cellNavigationService.getRowBelow(i)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns!==null&&(0,import_core._includes)(t.columns,e.column),n=this.isRowInRange(e.rowIndex,e.rowPinned,t);return s&&n}isLastCellOfRange(e,t){const{startRow:s,endRow:n}=e,i=this.rowPositionUtils.before(s,n)?n:s,o=t.rowIndex===i.rowIndex&&t.rowPinned===i.rowPinned,l=e.columns[0],r=(0,import_core._last)(e.columns),a=e.startColumn===l?r:l;return t.column===a&&o}isBottomRightCell(e,t){const s=this.visibleColsService.getAllCols(),n=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:i,endRow:o}=e,l=this.rowPositionUtils.before(i,o)?o:i,r=s.indexOf(t.column)===(0,import_core._last)(n),a=t.rowIndex===l.rowIndex&&(0,import_core._makeNull)(t.rowPinned)===(0,import_core._makeNull)(l.rowPinned);return r&&a}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,s){const n=this.getRangeStartRow(s),i=this.getRangeEndRow(s),o={rowIndex:e,rowPinned:t||null},l=o.rowIndex===n.rowIndex&&o.rowPinned==n.rowPinned,r=o.rowIndex===i.rowIndex&&o.rowPinned==i.rowPinned;if(l||r)return!0;const a=!this.rowPositionUtils.before(o,n),c=this.rowPositionUtils.before(o,i);return a&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!this.gos.get("enableRangeSelection"))return;const{ctrlKey:t,metaKey:s,shiftKey:n}=e,i=t||s,l=!this.gos.get("suppressMultiRangeSelection")?i:!1,r=n&&(0,import_core._existsAndNotEmpty)(this.cellRanges);!l&&(!r||(0,import_core._exists)((0,import_core._last)(this.cellRanges).type))&&this.removeAllCellRanges(!0);const a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,r||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=(0,import_core._last)(this.cellRanges);else{const c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging||this.gos.get("suppressMultiRangeSelection")||this.isEmpty())return;const t=this.rowPositionUtils,s=(0,import_core._last)(this.cellRanges),n=this.getRangeStartRow(s),i=this.getRangeEndRow(s),o=[];this.cellRanges.slice(0,-1).forEach(l=>{const r=this.getRangeStartRow(l),a=this.getRangeEndRow(l),c=l.columns,d=c.filter(h=>s.columns.indexOf(h)===-1);if(d.length===c.length){o.push(l);return}if(t.before(i,r)||t.before(a,n)){o.push(l);return}const g=o.length;if(t.before(r,n)){const h={columns:[...c],startColumn:s.startColumn,startRow:{...r},endRow:this.cellNavigationService.getRowAbove(n)};o.push(h)}if(d.length>0){const h={columns:d,startColumn:(0,import_core._includes)(d,s.startColumn)?s.startColumn:d[0],startRow:this.rowMax([{...n},{...r}]),endRow:this.rowMin([{...i},{...a}])};o.push(h)}t.before(i,a)&&o.push({columns:[...c],startColumn:s.startColumn,startRow:this.cellNavigationService.getRowBelow(i),endRow:{...a}}),o.length-g===1&&(o[o.length-1].id=l.id)}),this.cellRanges=o,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(t,s))&&(t=s)}),t}rowMin(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(s,t))&&(t=s)}),t}updateValuesOnMove(e){const s=(0,import_core._getCtrlForEventTarget)(this.gos,e,import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL)?.getCellPosition();this.cellHasChanged=!1,!(!s||this.lastCellHovered&&this.cellPositionUtils.equals(s,this.lastCellHovered))&&(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s)}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,s=o=>t&&t.rowPinned===o&&this.newestRangeStartCell.rowPinned===o,n=s("top")||s("bottom");if(this.autoScrollService.check(e,n),!this.cellHasChanged)return;const i=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);i&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=i,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,s){const n={type:"rangeSelectionChanged",started:e,finished:t,id:s};this.eventService.dispatchEvent(n)}calculateColumnsBetween(e,t){const s=this.visibleColsService.getAllCols(),n=e===t,i=s.indexOf(e),o=d=>(0,import_core._warnOnce)(`column ${d.getId()} is not visible`);if(i<0){o(e);return}const l=n?i:s.indexOf(t);if(l<0){o(t);return}if(n)return[e];const r=Math.min(i,l),a=r===i?l:i,c=[];for(let d=r;d<=a;d++)c.push(s[d]);return c}},import_core5=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),AbstractSelectionHandle=class extends import_core2.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService,this.mouseEventService=e.mouseEventService,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService}postConstruct(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass()),this.shouldDestroyOnEndDragging&&this.destroy()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===import_core2.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),s=this.getGui(),n=(0,import_core2._last)(this.rangeService.getCellRanges()),i=n.startRow,o=n.endRow;if(i&&o&&(this.rowPositionUtils.before(o,i)?(this.setRangeStartRow(o),this.setRangeEndRow(i)):(this.setRangeStartRow(i),this.setRangeEndRow(o))),t!==e||!(0,import_core2._isVisible)(s)){this.setCellCtrl(e);const l=e.getComp().getParentOfValue();l&&l.appendChild(s)}this.setCellRange(n)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){(0,import_core2._setDisplayed)(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function findLineByLeastSquares(e){const t=e.length;let s=0;if(t<=1)return e;for(let g=0;g<e.length;g++){const h=e[g],u=h.toString().split("e-");if(u.length>1){s=Math.max(s,parseInt(u[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let n=0,i=0,o=0,l=0,r=0;for(let g=0;g<t;g++)r=e[g],n+=g,i+=r,l+=g*g,o+=g*r;const a=(t*o-n*i)/(t*l-n*n),c=i/t-a*n/t,d=[];for(let g=0;g<=t;g++)d.push(parseFloat((g*a+c).toFixed(s)));return d}var AgFillHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-fill-handle"></div>'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=import_core3.SelectionHandleType.FILL}wireBeans(e){super.wireBeans(e),this.valueService=e.valueService,this.navigationService=e.navigationService,this.cellNavigationService=e.cellNavigationService,this.visibleColsService=e.visibleColsService}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:s}=this.initialXY,{x:n,y:i}=this.mouseEventService.getNormalisedPosition(e),o=Math.abs(t-n),l=Math.abs(s-i),r=this.getFillHandleDirection();let a;r==="xy"?a=o>l?"x":"y":a=r,a!==this.dragAxis&&(this.dragAxis=a,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const s=this.getCellCtrl();if(!s)return;this.initialPosition=s.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",s=this.getCellRange(),n=s.columns.length,i=this.getRangeStartRow(),o=this.getRangeEndRow();let l;if(!this.isUp&&!this.isLeft)l=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,columnStart:s.columns[0],rowEndIndex:t?o.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?o.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[n-1]});else{const r=t?i:this.lastCellMarked;l=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnEnd:s.columns[n-1]})}l&&(this.raiseFillStartEvent(),this.handleValueChanged(s,l,e),this.rangeService.setCellRanges([l]),this.raiseFillEndEvent(s,l))}getFillHandleDirection(){const e=this.gos.get("fillHandleDirection");return e?e!=="x"&&e!=="y"&&e!=="xy"?((0,import_core3._warnOnce)("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}raiseFillStartEvent(){const e={type:"fillStart"};this.eventService.dispatchEvent(e)}raiseFillEndEvent(e,t){const s={type:"fillEnd",initialRange:e,finalRange:t};this.eventService.dispatchEvent(s)}handleValueChanged(e,t,s){const n=this.rangeService.getRangeEndRow(e),i=this.rangeService.getRangeStartRow(e),o=this.rangeService.getRangeEndRow(t),l=this.rangeService.getRangeStartRow(t),r=this.dragAxis==="y";if(this.isReduce&&!this.gos.get("suppressClearOnFillReduction")){const m=r?e.columns:e.columns.filter(R=>t.columns.indexOf(R)<0),f=r?this.cellNavigationService.getRowBelow(o):l;f&&this.clearCellsInRange(f,n,m);return}const a=[],c=[],d=[],g=[];let h=!0,u=0;const w=()=>{a.length=0,c.length=0,d.length=0,g.length=0,u=0},v=(m,f)=>{let R=this.isUp?n:i,x=!1;for(r&&(h=!0,w());!x&&R;){const C=this.rowPositionUtils.getRowNode(R);if(!C)break;r&&m?p(a,m,C,()=>!this.rowPositionUtils.sameRow(R,this.isUp?i:n)):f&&(h=!0,w(),f.forEach(S=>p(a,S,C,()=>S!==(this.isLeft?e.columns[0]:(0,import_core3._last)(e.columns))))),x=this.rowPositionUtils.sameRow(R,this.isUp?l:o),R=this.isUp?this.cellNavigationService.getRowAbove(R):this.cellNavigationService.getRowBelow(R)}},p=(m,f,R,x)=>{let C,S=!1;if(h)C=this.valueService.getValue(f,R),c.push(C),d.push(this.valueService.getValue(f,R,void 0,!0)),g.push(this.valueService.formatValue(f,R,C)),h=x();else{const{value:I,fromUserFunction:E,sourceCol:P,sourceRowNode:M}=this.processValues({event:s,values:m,initialValues:c,initialNonAggregatedValues:d,initialFormattedValues:g,col:f,rowNode:R,idx:u++});if(C=I,f.isCellEditable(R)){const y=this.valueService.getValue(f,R);E||(P&&P.getColDef()?.useValueFormatterForExport!==!1&&(C=this.valueService.formatValue(P,M,C)??C),f.getColDef().useValueParserForImport!==!1&&(C=this.valueService.parseValue(f,R,P?C:(0,import_core3._toStringOrNull)(C),y))),!E||y!==C?R.setDataValue(f,C,"rangeService"):S=!0}}S||m.push({value:C,column:f,rowNode:R})};if(r)e.columns.forEach(m=>{v(m)});else{const m=this.isLeft?[...t.columns].reverse():t.columns;v(void 0,m)}}clearCellsInRange(e,t,s){const n={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[n]})}processValues(e){const{event:t,values:s,initialValues:n,initialNonAggregatedValues:i,initialFormattedValues:o,col:l,rowNode:r,idx:a}=e,c=this.gos.getCallback("fillOperation"),d=this.dragAxis==="y";let g;if(d?g=this.isUp?"up":"down":g=this.isLeft?"left":"right",c){const u={event:t,values:s.map(({value:v})=>v),initialValues:n,initialNonAggregatedValues:i,initialFormattedValues:o,currentIndex:a,currentCellValue:this.valueService.getValue(l,r),direction:g,column:l,rowNode:r},w=c(u);if(w!==!1)return{value:w,fromUserFunction:!0}}const h=!s.some(({value:u})=>{const w=parseFloat(u);return isNaN(w)||w.toString()!==u.toString()});if(t.altKey||!h){if(h&&n.length===1){const p=this.isUp||this.isLeft?-1:1;return{value:parseFloat((0,import_core3._last)(s).value)+1*p,fromUserFunction:!1}}const{value:u,column:w,rowNode:v}=s[a%s.length];return{value:u,fromUserFunction:!1,sourceCol:w,sourceRowNode:v}}return{value:(0,import_core3._last)(findLineByLeastSquares(s.map(({value:u})=>Number(u)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(t,e))return;const s=this.rowPositionUtils.before(t,e),n=this.getRangeStartRow(),i=this.getRangeEndRow();s&&(t.rowPinned==n.rowPinned&&t.rowIndex>=n.rowIndex||n.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,n=t.column;if(s===n)return;const i=this.visibleColsService.getAllCols(),o=i.indexOf(s),l=i.indexOf(n);l<=o&&l>=i.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,l<o),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,s){const{navigationService:n,rangeService:i}=this;let o=e;do{const l=this.getCellRange(),r=l.columns.length;for(let a=0;a<r;a++){const c=l.columns[a],g={...{rowIndex:o.rowIndex,rowPinned:o.rowPinned},column:c},h=i.isCellInSpecificRange(g,l),u=this.rowPositionUtils.sameRow(o,e);if(s&&(this.isUp=!0),!u){const w=n.getCellByPosition(g);if(w){this.markedCells.push(w);const v=w.getComp();h||(v.addOrRemoveCssClass("ag-selection-fill-left",a===0),v.addOrRemoveCssClass("ag-selection-fill-right",a===r-1)),v.addOrRemoveCssClass(s?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,t))}}}if(this.rowPositionUtils.sameRow(o,t))break}while(o=s?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))}reduceVertical(e,t){let s=e;do{const n=this.getCellRange(),i=n.columns.length,o=this.rowPositionUtils.sameRow(s,t);for(let l=0;l<i;l++){const a={...{rowIndex:s.rowIndex,rowPinned:s.rowPinned},column:n.columns[l]},c=this.navigationService.getCellByPosition(a);c&&(this.markedCells.push(c),c.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(s,t)))}if(o)break}while(s=this.cellNavigationService.getRowAbove(s))}extendHorizontal(e,t,s){const n=this.visibleColsService.getAllCols(),i=n.indexOf(s?t.column:e.column),o=n.indexOf(s?this.getCellRange().columns[0]:t.column),l=s?0:1,r=n.slice(i+l,o+l),a=this.getRangeStartRow(),c=this.getRangeEndRow();r.forEach(d=>{let g=a,h=!1;do{h=this.rowPositionUtils.sameRow(g,c);const u=this.navigationService.getCellByPosition({rowIndex:g.rowIndex,rowPinned:g.rowPinned,column:d});if(u){this.markedCells.push(u);const w=u.getComp();w.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(g,a)),w.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(g,c)),s?(this.isLeft=!0,w.addOrRemoveCssClass("ag-selection-fill-left",d===r[0])):w.addOrRemoveCssClass("ag-selection-fill-right",d===(0,import_core3._last)(r))}g=this.cellNavigationService.getRowBelow(g)}while(!h)})}reduceHorizontal(e,t){const s=this.visibleColsService.getAllCols(),n=s.indexOf(t.column),i=s.indexOf(e.column),o=s.slice(n,i),l=this.getRangeStartRow(),r=this.getRangeEndRow();o.forEach(a=>{let c=l,d=!1;do{d=this.rowPositionUtils.sameRow(c,r);const g=this.navigationService.getCellByPosition({rowIndex:c.rowIndex,rowPinned:c.rowPinned,column:a});g&&(this.markedCells.push(g),g.getComp().addOrRemoveCssClass("ag-selection-fill-right",a===o[0])),c=this.cellNavigationService.getRowBelow(c)}while(!d)})}refresh(e){const t=this.rangeService.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},import_core4=require("@ag-grid-community/core"),AgRangeHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-range-handle"></div>'),this.type=import_core4.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const s=this.rangeService.getCellRanges(),n=(0,import_core4._last)(s);this.rangeFixed||(this.fixRangeStartEnd(n),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},s.length===2&&s[0].type===import_core4.CellRangeType.DIMENSION&&n.type===import_core4.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(n))&&this.rangeService.updateRangeEnd(s[0],{...this.endPosition,column:s[0].columns[0]},!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=(0,import_core4._last)(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),s=this.rangeService.getRangeEndRow(e),n=e.columns[0];e.startRow=t,e.endRow=s,e.startColumn=n}},SelectionHandleFactory=class extends import_core5.BeanStub{constructor(){super(...arguments),this.beanName="selectionHandleFactory"}createSelectionHandle(e){return this.createBean(e===import_core5.SelectionHandleType.RANGE?new AgRangeHandle:new AgFillHandle)}},VERSION="32.0.0",RangeSelectionCoreModule={version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-core`,beans:[RangeService,SelectionHandleFactory],dependantModules:[import_core7.EnterpriseCoreModule]},RangeSelectionApiModule={version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-api`,apiFunctions:{getCellRanges,addCellRange,clearRangeSelection},dependantModules:[RangeSelectionCoreModule]},RangeSelectionModule={version:VERSION,moduleName:import_core6.ModuleNames.RangeSelectionModule,dependantModules:[RangeSelectionCoreModule,RangeSelectionApiModule]};
{
"name": "@ag-grid-enterprise/range-selection",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,5 +14,6 @@ "main": "./dist/package/main.cjs.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0"
},

@@ -19,0 +20,0 @@ "devDependencies": {

{
"name": "@ag-grid-enterprise/range-selection",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,5 +14,6 @@ "main": "./src/main.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0"
},

@@ -19,0 +20,0 @@ "devDependencies": {

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

export { RangeSelectionModule } from "./rangeSelectionModule";
export { RangeSelectionModule } from './rangeSelectionModule';

@@ -1,14 +0,12 @@

import { CellCtrl, RowRenderer, DragService, Component, MouseEventService, ColumnModel, CellNavigationService, CellRange, RowPosition, CellPosition, ISelectionHandle, RowPositionUtils, SelectionHandleType, NavigationService, CtrlsService, CellPositionUtils } from "@ag-grid-community/core";
import { RangeService } from "./rangeService";
import type { BeanCollection, CellCtrl, CellPosition, CellPositionUtils, CellRange, CtrlsService, DragService, ISelectionHandle, MouseEventService, RowPosition, RowPositionUtils } from '@ag-grid-community/core';
import { Component, SelectionHandleType } from '@ag-grid-community/core';
import type { RangeService } from './rangeService';
export declare abstract class AbstractSelectionHandle extends Component implements ISelectionHandle {
protected rowRenderer: RowRenderer;
protected dragService: DragService;
protected rangeService: RangeService;
protected mouseEventService: MouseEventService;
protected columnModel: ColumnModel;
protected cellNavigationService: CellNavigationService;
protected navigationService: NavigationService;
protected rowPositionUtils: RowPositionUtils;
cellPositionUtils: CellPositionUtils;
protected cellPositionUtils: CellPositionUtils;
protected ctrlsService: CtrlsService;
wireBeans(beans: BeanCollection): void;
private cellCtrl;

@@ -24,3 +22,3 @@ private cellRange;

protected shouldDestroyOnEndDragging: boolean;
private init;
postConstruct(): void;
protected abstract onDrag(e: MouseEvent | Touch): void;

@@ -46,3 +44,3 @@ protected abstract onDragEnd(e: MouseEvent | Touch): void;

private removeListeners;
protected destroy(): void;
destroy(): void;
}

@@ -1,12 +0,16 @@

import { CellPosition, CellPositionUtils, Column, IRangeService, CellRangeParams, CellRange, RowPosition, RowPositionUtils, BeanStub, CtrlsService, AutoScrollService, ClearCellRangeParams, PartialCellRange } from "@ag-grid-community/core";
export declare class RangeService extends BeanStub implements IRangeService {
import type { AgColumn, BeanCollection, CellPosition, CellRange, CellRangeParams, ClearCellRangeParams, IRangeService, NamedBean, PartialCellRange, RowPosition } from '@ag-grid-community/core';
import { AutoScrollService, BeanStub } from '@ag-grid-community/core';
export declare class RangeService extends BeanStub implements NamedBean, IRangeService {
beanName: "rangeService";
private rowModel;
private dragService;
private columnModel;
private visibleColsService;
private cellNavigationService;
private pinnedRowModel;
rowPositionUtils: RowPositionUtils;
cellPositionUtils: CellPositionUtils;
ctrlsService: CtrlsService;
private rowPositionUtils;
private cellPositionUtils;
private ctrlsService;
private valueService;
wireBeans(beans: BeanCollection): void;
private cellRanges;

@@ -22,3 +26,3 @@ private lastMouseEvent;

autoScrollService: AutoScrollService;
private init;
postConstruct(): void;
onColumnsChanged(): void;

@@ -34,4 +38,4 @@ refreshLastRangeStart(): void;

getRangeEdgeColumns(cellRange: CellRange): {
left: Column;
right: Column;
left: AgColumn;
right: AgColumn;
};

@@ -38,0 +42,0 @@ extendLatestRangeInDirection(event: KeyboardEvent): CellPosition | undefined;

@@ -1,4 +0,6 @@

import { BeanStub, ISelectionHandle, ISelectionHandleFactory, SelectionHandleType } from "@ag-grid-community/core";
export declare class SelectionHandleFactory extends BeanStub implements ISelectionHandleFactory {
import type { ISelectionHandle, ISelectionHandleFactory, NamedBean } from '@ag-grid-community/core';
import { BeanStub, SelectionHandleType } from '@ag-grid-community/core';
export declare class SelectionHandleFactory extends BeanStub implements NamedBean, ISelectionHandleFactory {
beanName: "selectionHandleFactory";
createSelectionHandle(type: SelectionHandleType): ISelectionHandle;
}

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

import { Module } from "@ag-grid-community/core";
import type { Module } from '@ag-grid-community/core';
export declare const RangeSelectionCoreModule: Module;
export declare const RangeSelectionApiModule: Module;
export declare const RangeSelectionModule: Module;

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

export declare const VERSION = "31.3.2";
export declare const VERSION = "32.0.0";
{
"name": "@ag-grid-enterprise/range-selection",
"version": "31.3.2",
"version": "32.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -14,5 +14,6 @@ "main": "./dist/package/main.cjs.js",

},
"sideEffects": false,
"dependencies": {
"@ag-grid-community/core": "31.3.2",
"@ag-grid-enterprise/core": "31.3.2"
"@ag-grid-community/core": "32.0.0",
"@ag-grid-enterprise/core": "32.0.0"
},

@@ -19,0 +20,0 @@ "devDependencies": {

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

AG Grid Enterprise
==============
# AG Grid Enterprise

@@ -8,4 +7,4 @@ This project contains AG Grid Enterprise features.

Frameworks Supported
====================
# Frameworks Supported
Framework specific Getting Started guides:

@@ -21,4 +20,3 @@

Issue Reporting
==============
# Issue Reporting

@@ -29,2 +27,1 @@ If you are an Enterprise customer (or are evaluating AG Grid Enterprise) and wish to report a Bug or raise a new Feature Request please do so on our [Support Portal](https://ag-grid.zendesk.com/).

Send an email to accounts@ag-grid.com with your license key

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

Support and Maintenance document is now merged into the licence document. Please see the licence.

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

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc