Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/range-selection

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-enterprise/range-selection - npm Package Compare versions

Comparing version 28.2.1 to 29.0.0

dist/cjs/es5/rangeSelection/utils.d.ts

3

dist/cjs/es5/main.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeSelectionModule = void 0;
var rangeSelectionModule_1 = require("./rangeSelectionModule");
exports.RangeSelectionModule = rangeSelectionModule_1.RangeSelectionModule;
Object.defineProperty(exports, "RangeSelectionModule", { enumerable: true, get: function () { return rangeSelectionModule_1.RangeSelectionModule; } });

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -23,2 +23,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractSelectionHandle = void 0;
var core_1 = require("@ag-grid-community/core");

@@ -25,0 +26,0 @@ var AbstractSelectionHandle = /** @class */ (function (_super) {

@@ -20,2 +20,3 @@ import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';

protected onDragEnd(e: MouseEvent): void;
private getFillHandleDirection;
private raiseFillStartEvent;

@@ -22,0 +23,0 @@ private raiseFillEndEvent;

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -54,4 +54,6 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.FillHandle = void 0;
var core_1 = require("@ag-grid-community/core");
var abstractSelectionHandle_1 = require("./abstractSelectionHandle");
var utils_1 = require("./utils");
var FillHandle = /** @class */ (function (_super) {

@@ -78,3 +80,3 @@ __extends(FillHandle, _super);

var diffY = Math.abs(y - newY);
var allowedDirection = this.gridOptionsWrapper.getFillHandleDirection();
var allowedDirection = this.getFillHandleDirection();
var direction;

@@ -145,2 +147,13 @@ if (allowedDirection === 'xy') {

};
FillHandle.prototype.getFillHandleDirection = function () {
var direction = this.gridOptionsService.get('fillHandleDirection');
if (!direction) {
return 'xy';
}
if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {
core_1._.doOnce(function () { return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."); }, 'warn invalid fill direction');
return 'xy';
}
return direction;
};
FillHandle.prototype.raiseFillStartEvent = function () {

@@ -169,3 +182,3 @@ var fillStartEvent = {

// clear the cells that are no longer part of the range
if (this.isReduce && !this.gridOptionsWrapper.isSuppressClearOnFillReduction()) {
if (this.isReduce && !this.gridOptionsService.is('suppressClearOnFillReduction')) {
var columns = isVertical

@@ -267,3 +280,3 @@ ? initialRange.columns

FillHandle.prototype.processValues = function (event, values, initialValues, col, rowNode, idx) {
var userFillOperation = this.gridOptionsWrapper.getFillOperation();
var userFillOperation = this.gridOptionsService.getCallback('fillOperation');
var isVertical = this.dragAxis === 'y';

@@ -310,3 +323,3 @@ var direction;

}
return { value: core_1._.last(core_1._.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
return { value: core_1._.last(utils_1.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
};

@@ -313,0 +326,0 @@ FillHandle.prototype.getValueFromObject = function (val) {

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -28,2 +28,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeHandle = void 0;
var core_1 = require("@ag-grid-community/core");

@@ -30,0 +31,0 @@ var abstractSelectionHandle_1 = require("./abstractSelectionHandle");

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -65,2 +65,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeService = void 0;
var core_1 = require("@ag-grid-community/core");

@@ -97,4 +98,4 @@ var RangeService = /** @class */ (function (_super) {

setHorizontalPosition: function (position) { return gridBodyCtrl.getScrollFeature().setHorizontalScrollPosition(position); },
shouldSkipVerticalScroll: function () { return _this.gridOptionsWrapper.getDomLayout() !== core_1.Constants.DOM_LAYOUT_NORMAL; },
shouldSkipHorizontalScroll: function () { return gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing(); }
shouldSkipVerticalScroll: function () { return !_this.gridOptionsService.isDomLayout('normal'); },
shouldSkipHorizontalScroll: function () { return !gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing(); }
});

@@ -148,3 +149,3 @@ });

}
var rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? core_1.Constants.PINNED_TOP : null;
var rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? 'top' : null;
return { rowIndex: 0, rowPinned: rowPinned };

@@ -162,3 +163,3 @@ };

rowIndex: pinnedBottomRowCount - 1,
rowPinned: core_1.Constants.PINNED_BOTTOM
rowPinned: 'bottom'
};

@@ -173,3 +174,3 @@ }

if (appendRange === void 0) { appendRange = false; }
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -181,3 +182,3 @@ }

}
var suppressMultiRangeSelections = this.gridOptionsWrapper.isSuppressMultiRangeSelection();
var suppressMultiRangeSelections = this.gridOptionsService.is('suppressMultiRangeSelection');
// if not appending, then clear previous range selections

@@ -289,3 +290,3 @@ if (suppressMultiRangeSelections || !appendRange || core_1._.missing(this.cellRanges)) {

RangeService.prototype.setCellRange = function (params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -375,3 +376,3 @@ }

RangeService.prototype.addCellRange = function (params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -541,3 +542,3 @@ }

RangeService.prototype.onDragStart = function (mouseEvent) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -548,3 +549,3 @@ }

var multiKeyPressed = ctrlKey || metaKey;
var allowMulti = !this.gridOptionsWrapper.isSuppressMultiRangeSelection();
var allowMulti = !this.gridOptionsService.is('suppressMultiRangeSelection');
var multiSelectKeyPressed = allowMulti ? multiKeyPressed : false;

@@ -602,3 +603,3 @@ var extendRange = shiftKey && core_1._.existsAndNotEmpty(this.cellRanges);

}
if (this.gridOptionsWrapper.isSuppressMultiRangeSelection()) {
if (this.gridOptionsService.is('suppressMultiRangeSelection')) {
return;

@@ -605,0 +606,0 @@ }

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -23,2 +23,3 @@ };

Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionHandleFactory = void 0;
var core_1 = require("@ag-grid-community/core");

@@ -25,0 +26,0 @@ var rangeHandle_1 = require("./rangeHandle");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeSelectionModule = void 0;
var core_1 = require("@ag-grid-community/core");

@@ -9,3 +10,5 @@ var core_2 = require("@ag-grid-enterprise/core");

var selectionHandleFactory_1 = require("./rangeSelection/selectionHandleFactory");
var version_1 = require("./version");
exports.RangeSelectionModule = {
version: version_1.VERSION,
moduleName: core_1.ModuleNames.RangeSelectionModule,

@@ -12,0 +15,0 @@ beans: [rangeService_1.RangeService, selectionHandleFactory_1.SelectionHandleFactory],

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeSelectionModule = void 0;
var rangeSelectionModule_1 = require("./rangeSelectionModule");
exports.RangeSelectionModule = rangeSelectionModule_1.RangeSelectionModule;
Object.defineProperty(exports, "RangeSelectionModule", { enumerable: true, get: function () { return rangeSelectionModule_1.RangeSelectionModule; } });

@@ -9,2 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.AbstractSelectionHandle = void 0;
const core_1 = require("@ag-grid-community/core");

@@ -11,0 +12,0 @@ class AbstractSelectionHandle extends core_1.Component {

@@ -20,2 +20,3 @@ import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';

protected onDragEnd(e: MouseEvent): void;
private getFillHandleDirection;
private raiseFillStartEvent;

@@ -22,0 +23,0 @@ private raiseFillEndEvent;

@@ -9,4 +9,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.FillHandle = void 0;
const core_1 = require("@ag-grid-community/core");
const abstractSelectionHandle_1 = require("./abstractSelectionHandle");
const utils_1 = require("./utils");
class FillHandle extends abstractSelectionHandle_1.AbstractSelectionHandle {

@@ -31,3 +33,3 @@ constructor() {

const diffY = Math.abs(y - newY);
const allowedDirection = this.gridOptionsWrapper.getFillHandleDirection();
const allowedDirection = this.getFillHandleDirection();
let direction;

@@ -98,2 +100,13 @@ if (allowedDirection === 'xy') {

}
getFillHandleDirection() {
const direction = this.gridOptionsService.get('fillHandleDirection');
if (!direction) {
return 'xy';
}
if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {
core_1._.doOnce(() => console.warn(`AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.`), 'warn invalid fill direction');
return 'xy';
}
return direction;
}
raiseFillStartEvent() {

@@ -121,3 +134,3 @@ const fillStartEvent = {

// clear the cells that are no longer part of the range
if (this.isReduce && !this.gridOptionsWrapper.isSuppressClearOnFillReduction()) {
if (this.isReduce && !this.gridOptionsService.is('suppressClearOnFillReduction')) {
const columns = isVertical

@@ -214,3 +227,3 @@ ? initialRange.columns

processValues(event, values, initialValues, col, rowNode, idx) {
const userFillOperation = this.gridOptionsWrapper.getFillOperation();
const userFillOperation = this.gridOptionsService.getCallback('fillOperation');
const isVertical = this.dragAxis === 'y';

@@ -257,3 +270,3 @@ let direction;

}
return { value: core_1._.last(core_1._.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
return { value: core_1._.last(utils_1.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
}

@@ -260,0 +273,0 @@ getValueFromObject(val) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeHandle = void 0;
const core_1 = require("@ag-grid-community/core");

@@ -4,0 +5,0 @@ const abstractSelectionHandle_1 = require("./abstractSelectionHandle");

@@ -9,2 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeService = void 0;
const core_1 = require("@ag-grid-community/core");

@@ -38,4 +39,4 @@ let RangeService = class RangeService extends core_1.BeanStub {

setHorizontalPosition: (position) => gridBodyCtrl.getScrollFeature().setHorizontalScrollPosition(position),
shouldSkipVerticalScroll: () => this.gridOptionsWrapper.getDomLayout() !== core_1.Constants.DOM_LAYOUT_NORMAL,
shouldSkipHorizontalScroll: () => gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing()
shouldSkipVerticalScroll: () => !this.gridOptionsService.isDomLayout('normal'),
shouldSkipHorizontalScroll: () => !gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing()
});

@@ -88,3 +89,3 @@ });

}
const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? core_1.Constants.PINNED_TOP : null;
const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? 'top' : null;
return { rowIndex: 0, rowPinned };

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

rowIndex: pinnedBottomRowCount - 1,
rowPinned: core_1.Constants.PINNED_BOTTOM
rowPinned: 'bottom'
};

@@ -112,3 +113,3 @@ }

setRangeToCell(cell, appendRange = false) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -120,3 +121,3 @@ }

}
const suppressMultiRangeSelections = this.gridOptionsWrapper.isSuppressMultiRangeSelection();
const suppressMultiRangeSelections = this.gridOptionsService.is('suppressMultiRangeSelection');
// if not appending, then clear previous range selections

@@ -227,3 +228,3 @@ if (suppressMultiRangeSelections || !appendRange || core_1._.missing(this.cellRanges)) {

setCellRange(params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -310,3 +311,3 @@ }

addCellRange(params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -463,3 +464,3 @@ }

onDragStart(mouseEvent) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -470,3 +471,3 @@ }

const multiKeyPressed = ctrlKey || metaKey;
const allowMulti = !this.gridOptionsWrapper.isSuppressMultiRangeSelection();
const allowMulti = !this.gridOptionsService.is('suppressMultiRangeSelection');
const multiSelectKeyPressed = allowMulti ? multiKeyPressed : false;

@@ -523,3 +524,3 @@ const extendRange = shiftKey && core_1._.existsAndNotEmpty(this.cellRanges);

}
if (this.gridOptionsWrapper.isSuppressMultiRangeSelection()) {
if (this.gridOptionsService.is('suppressMultiRangeSelection')) {
return;

@@ -526,0 +527,0 @@ }

@@ -9,2 +9,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.SelectionHandleFactory = void 0;
const core_1 = require("@ag-grid-community/core");

@@ -11,0 +12,0 @@ const rangeHandle_1 = require("./rangeHandle");

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.RangeSelectionModule = void 0;
const core_1 = require("@ag-grid-community/core");

@@ -9,3 +10,5 @@ const core_2 = require("@ag-grid-enterprise/core");

const selectionHandleFactory_1 = require("./rangeSelection/selectionHandleFactory");
const version_1 = require("./version");
exports.RangeSelectionModule = {
version: version_1.VERSION,
moduleName: core_1.ModuleNames.RangeSelectionModule,

@@ -12,0 +15,0 @@ beans: [rangeService_1.RangeService, selectionHandleFactory_1.SelectionHandleFactory],

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -8,0 +8,0 @@ };

@@ -20,2 +20,3 @@ import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';

protected onDragEnd(e: MouseEvent): void;
private getFillHandleDirection;
private raiseFillStartEvent;

@@ -22,0 +23,0 @@ private raiseFillEndEvent;

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -54,2 +54,3 @@ };

import { AbstractSelectionHandle } from "./abstractSelectionHandle";
import { findLineByLeastSquares } from './utils';
var FillHandle = /** @class */ (function (_super) {

@@ -76,3 +77,3 @@ __extends(FillHandle, _super);

var diffY = Math.abs(y - newY);
var allowedDirection = this.gridOptionsWrapper.getFillHandleDirection();
var allowedDirection = this.getFillHandleDirection();
var direction;

@@ -143,2 +144,13 @@ if (allowedDirection === 'xy') {

};
FillHandle.prototype.getFillHandleDirection = function () {
var direction = this.gridOptionsService.get('fillHandleDirection');
if (!direction) {
return 'xy';
}
if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {
_.doOnce(function () { return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."); }, 'warn invalid fill direction');
return 'xy';
}
return direction;
};
FillHandle.prototype.raiseFillStartEvent = function () {

@@ -167,3 +179,3 @@ var fillStartEvent = {

// clear the cells that are no longer part of the range
if (this.isReduce && !this.gridOptionsWrapper.isSuppressClearOnFillReduction()) {
if (this.isReduce && !this.gridOptionsService.is('suppressClearOnFillReduction')) {
var columns = isVertical

@@ -265,3 +277,3 @@ ? initialRange.columns

FillHandle.prototype.processValues = function (event, values, initialValues, col, rowNode, idx) {
var userFillOperation = this.gridOptionsWrapper.getFillOperation();
var userFillOperation = this.gridOptionsService.getCallback('fillOperation');
var isVertical = this.dragAxis === 'y';

@@ -308,3 +320,3 @@ var direction;

}
return { value: _.last(_.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
return { value: _.last(findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
};

@@ -311,0 +323,0 @@ FillHandle.prototype.getValueFromObject = function (val) {

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -8,0 +8,0 @@ };

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -63,3 +63,3 @@ };

};
import { Autowired, Bean, Constants, Events, PostConstruct, BeanStub, AutoScrollService, _ } from "@ag-grid-community/core";
import { Autowired, Bean, Events, PostConstruct, BeanStub, AutoScrollService, _ } from "@ag-grid-community/core";
var RangeService = /** @class */ (function (_super) {

@@ -95,4 +95,4 @@ __extends(RangeService, _super);

setHorizontalPosition: function (position) { return gridBodyCtrl.getScrollFeature().setHorizontalScrollPosition(position); },
shouldSkipVerticalScroll: function () { return _this.gridOptionsWrapper.getDomLayout() !== Constants.DOM_LAYOUT_NORMAL; },
shouldSkipHorizontalScroll: function () { return gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing(); }
shouldSkipVerticalScroll: function () { return !_this.gridOptionsService.isDomLayout('normal'); },
shouldSkipHorizontalScroll: function () { return !gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing(); }
});

@@ -146,3 +146,3 @@ });

}
var rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? Constants.PINNED_TOP : null;
var rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? 'top' : null;
return { rowIndex: 0, rowPinned: rowPinned };

@@ -160,3 +160,3 @@ };

rowIndex: pinnedBottomRowCount - 1,
rowPinned: Constants.PINNED_BOTTOM
rowPinned: 'bottom'
};

@@ -171,3 +171,3 @@ }

if (appendRange === void 0) { appendRange = false; }
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -179,3 +179,3 @@ }

}
var suppressMultiRangeSelections = this.gridOptionsWrapper.isSuppressMultiRangeSelection();
var suppressMultiRangeSelections = this.gridOptionsService.is('suppressMultiRangeSelection');
// if not appending, then clear previous range selections

@@ -287,3 +287,3 @@ if (suppressMultiRangeSelections || !appendRange || _.missing(this.cellRanges)) {

RangeService.prototype.setCellRange = function (params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -373,3 +373,3 @@ }

RangeService.prototype.addCellRange = function (params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -539,3 +539,3 @@ }

RangeService.prototype.onDragStart = function (mouseEvent) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -546,3 +546,3 @@ }

var multiKeyPressed = ctrlKey || metaKey;
var allowMulti = !this.gridOptionsWrapper.isSuppressMultiRangeSelection();
var allowMulti = !this.gridOptionsService.is('suppressMultiRangeSelection');
var multiSelectKeyPressed = allowMulti ? multiKeyPressed : false;

@@ -600,3 +600,3 @@ var extendRange = shiftKey && _.existsAndNotEmpty(this.cellRanges);

}
if (this.gridOptionsWrapper.isSuppressMultiRangeSelection()) {
if (this.gridOptionsService.is('suppressMultiRangeSelection')) {
return;

@@ -603,0 +603,0 @@ }

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

({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);

@@ -8,0 +8,0 @@ };

@@ -7,3 +7,5 @@ import { ModuleNames } from "@ag-grid-community/core";

import { SelectionHandleFactory } from "./rangeSelection/selectionHandleFactory";
import { VERSION } from "./version";
export var RangeSelectionModule = {
version: VERSION,
moduleName: ModuleNames.RangeSelectionModule,

@@ -10,0 +12,0 @@ beans: [RangeService, SelectionHandleFactory],

@@ -20,2 +20,3 @@ import { SelectionHandleType, CellCtrl } from '@ag-grid-community/core';

protected onDragEnd(e: MouseEvent): void;
private getFillHandleDirection;
private raiseFillStartEvent;

@@ -22,0 +23,0 @@ private raiseFillEndEvent;

@@ -9,2 +9,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

import { AbstractSelectionHandle } from "./abstractSelectionHandle";
import { findLineByLeastSquares } from './utils';
export class FillHandle extends AbstractSelectionHandle {

@@ -29,3 +30,3 @@ constructor() {

const diffY = Math.abs(y - newY);
const allowedDirection = this.gridOptionsWrapper.getFillHandleDirection();
const allowedDirection = this.getFillHandleDirection();
let direction;

@@ -96,2 +97,13 @@ if (allowedDirection === 'xy') {

}
getFillHandleDirection() {
const direction = this.gridOptionsService.get('fillHandleDirection');
if (!direction) {
return 'xy';
}
if (direction !== 'x' && direction !== 'y' && direction !== 'xy') {
_.doOnce(() => console.warn(`AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.`), 'warn invalid fill direction');
return 'xy';
}
return direction;
}
raiseFillStartEvent() {

@@ -119,3 +131,3 @@ const fillStartEvent = {

// clear the cells that are no longer part of the range
if (this.isReduce && !this.gridOptionsWrapper.isSuppressClearOnFillReduction()) {
if (this.isReduce && !this.gridOptionsService.is('suppressClearOnFillReduction')) {
const columns = isVertical

@@ -212,3 +224,3 @@ ? initialRange.columns

processValues(event, values, initialValues, col, rowNode, idx) {
const userFillOperation = this.gridOptionsWrapper.getFillOperation();
const userFillOperation = this.gridOptionsService.getCallback('fillOperation');
const isVertical = this.dragAxis === 'y';

@@ -255,3 +267,3 @@ let direction;

}
return { value: _.last(_.findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
return { value: _.last(findLineByLeastSquares(processedValues.map(Number))), fromUserFunction: false };
}

@@ -258,0 +270,0 @@ getValueFromObject(val) {

@@ -7,3 +7,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

};
import { Autowired, Bean, Constants, Events, PostConstruct, BeanStub, AutoScrollService, _ } from "@ag-grid-community/core";
import { Autowired, Bean, Events, PostConstruct, BeanStub, AutoScrollService, _ } from "@ag-grid-community/core";
let RangeService = class RangeService extends BeanStub {

@@ -36,4 +36,4 @@ constructor() {

setHorizontalPosition: (position) => gridBodyCtrl.getScrollFeature().setHorizontalScrollPosition(position),
shouldSkipVerticalScroll: () => this.gridOptionsWrapper.getDomLayout() !== Constants.DOM_LAYOUT_NORMAL,
shouldSkipHorizontalScroll: () => gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing()
shouldSkipVerticalScroll: () => !this.gridOptionsService.isDomLayout('normal'),
shouldSkipHorizontalScroll: () => !gridBodyCtrl.getScrollFeature().isHorizontalScrollShowing()
});

@@ -86,3 +86,3 @@ });

}
const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? Constants.PINNED_TOP : null;
const rowPinned = this.pinnedRowModel.getPinnedTopRowCount() > 0 ? 'top' : null;
return { rowIndex: 0, rowPinned };

@@ -100,3 +100,3 @@ }

rowIndex: pinnedBottomRowCount - 1,
rowPinned: Constants.PINNED_BOTTOM
rowPinned: 'bottom'
};

@@ -110,3 +110,3 @@ }

setRangeToCell(cell, appendRange = false) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -118,3 +118,3 @@ }

}
const suppressMultiRangeSelections = this.gridOptionsWrapper.isSuppressMultiRangeSelection();
const suppressMultiRangeSelections = this.gridOptionsService.is('suppressMultiRangeSelection');
// if not appending, then clear previous range selections

@@ -225,3 +225,3 @@ if (suppressMultiRangeSelections || !appendRange || _.missing(this.cellRanges)) {

setCellRange(params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -308,3 +308,3 @@ }

addCellRange(params) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -461,3 +461,3 @@ }

onDragStart(mouseEvent) {
if (!this.gridOptionsWrapper.isEnableRangeSelection()) {
if (!this.gridOptionsService.isEnableRangeSelection()) {
return;

@@ -468,3 +468,3 @@ }

const multiKeyPressed = ctrlKey || metaKey;
const allowMulti = !this.gridOptionsWrapper.isSuppressMultiRangeSelection();
const allowMulti = !this.gridOptionsService.is('suppressMultiRangeSelection');
const multiSelectKeyPressed = allowMulti ? multiKeyPressed : false;

@@ -521,3 +521,3 @@ const extendRange = shiftKey && _.existsAndNotEmpty(this.cellRanges);

}
if (this.gridOptionsWrapper.isSuppressMultiRangeSelection()) {
if (this.gridOptionsService.is('suppressMultiRangeSelection')) {
return;

@@ -524,0 +524,0 @@ }

@@ -7,3 +7,5 @@ import { ModuleNames } from "@ag-grid-community/core";

import { SelectionHandleFactory } from "./rangeSelection/selectionHandleFactory";
import { VERSION } from "./version";
export const RangeSelectionModule = {
version: VERSION,
moduleName: ModuleNames.RangeSelectionModule,

@@ -10,0 +12,0 @@ beans: [RangeService, SelectionHandleFactory],

/**
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.0.0
* @link https://www.ag-grid.com/

@@ -7,6 +7,6 @@ * @license Commercial

/**
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v28.2.1
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v29.0.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),n=require("@ag-grid-enterprise/core"),o=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)},function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),i=function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},r=function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},s=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s},l=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(s(arguments[t]));return e},a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.cellRanges=[],t.bodyScrollListener=t.onBodyScroll.bind(t),t.dragging=!1,t.intersectionRange=!1,t}return o(n,e),n.prototype.init=function(){var e=this;this.addManagedListener(this.eventService,t.Events.EVENT_NEW_COLUMNS_LOADED,(function(){return e.onColumnsChanged()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PIVOT_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady((function(){var n=e.ctrlsService.getGridBodyCtrl();e.autoScrollService=new t.AutoScrollService({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:function(){return n.getScrollFeature().getVScrollPosition().top},setVerticalPosition:function(e){return n.getScrollFeature().setVerticalScrollPosition(e)},getHorizontalPosition:function(){return n.getScrollFeature().getHScrollPosition().left},setHorizontalPosition:function(e){return n.getScrollFeature().setHorizontalScrollPosition(e)},shouldSkipVerticalScroll:function(){return e.gridOptionsWrapper.getDomLayout()!==t.Constants.DOM_LAYOUT_NORMAL},shouldSkipHorizontalScroll:function(){return n.getScrollFeature().isHorizontalScrollShowing()}})}))},n.prototype.onColumnsChanged=function(){var e=this;this.refreshLastRangeStart();var n=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach((function(o){var i=o.columns;o.columns=o.columns.filter((function(e){return e.isVisible()&&-1!==n.indexOf(e)})),!t._.areEqual(i,o.columns)&&e.dispatchChangedEvent(!1,!0,o.id)}));var o=this.cellRanges.length;this.cellRanges=this.cellRanges.filter((function(e){return e.columns.length>0})),o>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)},n.prototype.refreshLastRangeStart=function(){var e=t._.last(this.cellRanges);e&&this.refreshRangeStart(e)},n.prototype.isContiguousRange=function(e){var n=e.columns;if(!n.length)return!1;var o=this.columnModel.getAllDisplayedColumns(),i=n.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t}));return t._.last(i)-i[0]+1===n.length},n.prototype.getRangeStartRow=function(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?t.Constants.PINNED_TOP:null}},n.prototype.getRangeEndRow=function(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;var n=this.pinnedRowModel.getPinnedBottomRowCount();return n>0?{rowIndex:n-1,rowPinned:t.Constants.PINNED_BOTTOM}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}},n.prototype.setRangeToCell=function(e,n){if(void 0===n&&(n=!1),this.gridOptionsWrapper.isEnableRangeSelection()){var o=this.calculateColumnsBetween(e.column,e.column);if(o){(this.gridOptionsWrapper.isSuppressMultiRangeSelection()||!n||t._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);var i={rowIndex:e.rowIndex,rowPinned:e.rowPinned},r={startRow:i,endRow:i,columns:o,startColumn:e.column};this.cellRanges.push(r),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}}},n.prototype.extendLatestRangeToCell=function(e){if(!this.isEmpty()&&this.newestRangeStartCell){var n=t._.last(this.cellRanges);this.updateRangeEnd(n,e)}},n.prototype.updateRangeEnd=function(e,t,n){void 0===n&&(n=!1);var o=t.column,i=this.calculateColumnsBetween(e.startColumn,o);i&&!this.isLastCellOfRange(e,t)&&(e.columns=i,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},n||this.dispatchChangedEvent(!0,!0,e.id))},n.prototype.refreshRangeStart=function(e){var n=e.startColumn,o=e.columns,i=function(t,n){var o=e.columns.filter((function(e){return e!==t}));t?(e.startColumn=t,e.columns=n?l([t],o):l(o,[t])):e.columns=o},r=this.getRangeEdgeColumns(e),s=r.left,a=r.right;n===o[0]&&n!==s?i(s,!0):n===t._.last(o)&&n===a&&i(a,!1)},n.prototype.getRangeEdgeColumns=function(e){var n=this.columnModel.getAllDisplayedColumns(),o=e.columns.map((function(e){return n.indexOf(e)})).filter((function(e){return e>-1})).sort((function(e,t){return e-t}));return{left:n[o[0]],right:n[t._.last(o)]}},n.prototype.extendLatestRangeInDirection=function(e){if(!this.isEmpty()&&this.newestRangeStartCell){var n=e.key,o=e.ctrlKey||e.metaKey,i=t._.last(this.cellRanges),r=this.newestRangeStartCell,s=i.columns[0],l=t._.last(i.columns),a=i.endRow.rowIndex,c=i.endRow.rowPinned,u={column:r.column===s?l:s,rowIndex:a,rowPinned:c},d=this.cellNavigationService.getNextCellToFocus(n,u,o);if(d)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:r.column,columnEnd:d.column}),d}},n.prototype.setCellRange=function(e){this.gridOptionsWrapper.isEnableRangeSelection()&&(this.removeAllCellRanges(!0),this.addCellRange(e))},n.prototype.setCellRanges=function(e){var n=this;t._.shallowCompare(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach((function(e){e.columns&&e.startRow&&n.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),n.cellRanges.push(e)})),this.dispatchChangedEvent(!1,!0))},n.prototype.setNewestRangeStartCell=function(e){this.newestRangeStartCell=e},n.prototype.clearCellRangeCellValues=function(e){var t=this;e||(e=this.cellRanges),e.forEach((function(e){t.forEachRowInRange(e,(function(n){var o=t.rowPositionUtils.getRowNode(n);if(o)for(var i=0;i<e.columns.length;i++){var r=t.columnModel.getGridColumn(e.columns[i]);if(!r||!r.isCellEditable(o))return;o.setDataValue(r,null,"rangeService")}}))}))},n.prototype.createCellRangeFromCellRangeParams=function(e){var n,o=this,i=!1;if(e.columns)n=e.columns.map((function(e){return o.columnModel.getColumnWithValidation(e)})).filter((function(e){return e}));else{var r=this.columnModel.getColumnWithValidation(e.columnStart),s=this.columnModel.getColumnWithValidation(e.columnEnd);if(!r||!s)return;(n=this.calculateColumnsBetween(r,s))&&n.length&&(i=n[0]!==r)}if(n)return{startRow:null!=e.rowStartIndex?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,endRow:null!=e.rowEndIndex?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0,columns:n,startColumn:i?t._.last(n):n[0]}},n.prototype.addCellRange=function(e){if(this.gridOptionsWrapper.isEnableRangeSelection()){var 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))}},n.prototype.getCellRanges=function(){return this.cellRanges},n.prototype.isEmpty=function(){return 0===this.cellRanges.length},n.prototype.isMoreThanOneCell=function(){var e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;var t=this.cellRanges[0],n=this.getRangeStartRow(t),o=this.getRangeEndRow(t);return n.rowPinned!==o.rowPinned||n.rowIndex!==o.rowIndex||1!==t.columns.length},n.prototype.areAllRangesAbleToMerge=function(){var e,t,n,o=this,i=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach((function(e){o.forEachRowInRange(e,(function(t){var n=(t.rowPinned||"normal")+"_"+t.rowIndex,o=i.get(n),r=e.columns.map((function(e){return e.getId()}));if(o){var s=r.filter((function(e){return-1===o.indexOf(e)}));o.push.apply(o,l(s))}else i.set(n,r)}))}));try{for(var r=a(i.values()),s=r.next();!s.done;s=r.next()){var c=s.value.sort().join();if(void 0!==n){if(n!==c)return!1}else n=c}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return!0},n.prototype.forEachRowInRange=function(e,t){for(var n=this.getRangeStartRow(e),o=this.getRangeEndRow(e),i=n;i&&(t(i),!this.rowPositionUtils.sameRow(i,o));)i=this.cellNavigationService.getRowBelow(i)},n.prototype.removeAllCellRanges=function(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))},n.prototype.onBodyScroll=function(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)},n.prototype.isCellInAnyRange=function(e){return this.getCellRangeCount(e)>0},n.prototype.isCellInSpecificRange=function(e,n){var o=null!==n.columns&&t._.includes(n.columns,e.column),i=this.isRowInRange(e.rowIndex,e.rowPinned,n);return o&&i},n.prototype.isLastCellOfRange=function(e,n){var o=e.startRow,i=e.endRow,r=this.rowPositionUtils.before(o,i)?i:o,s=n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned,l=e.columns[0],a=t._.last(e.columns),c=e.startColumn===l?a:l;return n.column===c&&s},n.prototype.isBottomRightCell=function(e,n){var o=this.columnModel.getAllDisplayedColumns(),i=e.columns.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t})),r=e.startRow,s=e.endRow,l=this.rowPositionUtils.before(r,s)?s:r,a=o.indexOf(n.column)===t._.last(i),c=n.rowIndex===l.rowIndex&&t._.makeNull(n.rowPinned)===t._.makeNull(l.rowPinned);return a&&c},n.prototype.getCellRangeCount=function(e){var t=this;return this.isEmpty()?0:this.cellRanges.filter((function(n){return t.isCellInSpecificRange(e,n)})).length},n.prototype.isRowInRange=function(e,t,n){var o=this.getRangeStartRow(n),i=this.getRangeEndRow(n),r={rowIndex:e,rowPinned:t||null},s=r.rowIndex===o.rowIndex&&r.rowPinned==o.rowPinned,l=r.rowIndex===i.rowIndex&&r.rowPinned==i.rowPinned;if(s||l)return!0;var a=!this.rowPositionUtils.before(r,o),c=this.rowPositionUtils.before(r,i);return a&&c},n.prototype.getDraggingRange=function(){return this.draggingRange},n.prototype.onDragStart=function(e){if(this.gridOptionsWrapper.isEnableRangeSelection()){var n=e.ctrlKey,o=e.metaKey,i=e.shiftKey,r=n||o,s=!!!this.gridOptionsWrapper.isSuppressMultiRangeSelection()&&r,l=i&&t._.existsAndNotEmpty(this.cellRanges);if(s||l&&!t._.exists(t._.last(this.cellRanges).type)||this.removeAllCellRanges(!0),this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),this.updateValuesOnMove(e),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=s&&this.getCellRangeCount(this.lastCellHovered)>1,l||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=t._.last(this.cellRanges);else{var a={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:a,endRow:a,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)}}},n.prototype.intersectLastRange=function(e){var n=this;if(!(e&&this.dragging||this.gridOptionsWrapper.isSuppressMultiRangeSelection()||this.isEmpty())){var o=t._.last(this.cellRanges),r=this.getRangeStartRow(o),s=this.getRangeEndRow(o),a=[];this.cellRanges.slice(0,-1).forEach((function(e){var c=n.getRangeStartRow(e),u=n.getRangeEndRow(e),d=e.columns,g=d.filter((function(e){return-1===o.columns.indexOf(e)}));if(g.length!==d.length)if(n.rowPositionUtils.before(s,c)||n.rowPositionUtils.before(u,r))a.push(e);else{var h=a.length;if(n.rowPositionUtils.before(c,r)){var p={columns:l(d),startColumn:o.startColumn,startRow:i({},c),endRow:n.cellNavigationService.getRowAbove(r)};a.push(p)}if(g.length>0){var f={columns:g,startColumn:t._.includes(g,o.startColumn)?o.startColumn:g[0],startRow:n.rowPositionUtils.rowMax([i({},r),i({},c)]),endRow:n.rowPositionUtils.rowMin([i({},s),i({},u)])};a.push(f)}n.rowPositionUtils.before(s,u)&&a.push({columns:l(d),startColumn:o.startColumn,startRow:n.cellNavigationService.getRowBelow(s),endRow:i({},u)}),a.length-h==1&&(a[a.length-1].id=e.id)}else a.push(e)})),this.cellRanges=a,e&&this.dispatchChangedEvent(!1,!0)}},n.prototype.updateValuesOnMove=function(e){var t=this.mouseEventService.getCellPositionForEvent(e);this.cellHasChanged=!1,!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=t)},n.prototype.onDragging=function(e){var t=this;if(this.dragging&&e){this.lastMouseEvent=e;var n=this.lastCellHovered,o=function(e){return n&&n.rowPinned===e&&t.newestRangeStartCell.rowPinned===e},i=o("top")||o("bottom");if(this.autoScrollService.check(e,i),this.cellHasChanged){var r=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);r&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=r,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},n.prototype.onDragStop=function(){if(this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0),this.dragging){var e=this.draggingRange.id;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)}},n.prototype.dispatchChangedEvent=function(e,n,o){var i=Object.freeze({type:t.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:n,id:o});this.eventService.dispatchEvent(i)},n.prototype.calculateColumnsBetween=function(e,t){var n=this.columnModel.getAllDisplayedColumns(),o=e===t,i=n.indexOf(e);if(i<0)console.warn("AG Grid: column "+e.getId()+" is not visible");else{var r=o?i:n.indexOf(t);if(!(r<0)){if(o)return[e];for(var s=Math.min(i,r),l=s===i?r:i,a=[],c=s;c<=l;c++)a.push(n[c]);return a}console.warn("AG Grid: column "+t.getId()+" is not visible")}},r([t.Autowired("rowModel")],n.prototype,"rowModel",void 0),r([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),r([t.Autowired("mouseEventService")],n.prototype,"mouseEventService",void 0),r([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),r([t.Autowired("pinnedRowModel")],n.prototype,"pinnedRowModel",void 0),r([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),r([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),r([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),r([t.PostConstruct],n.prototype,"init",null),n=r([t.Bean("rangeService")],n)}(t.BeanStub),u=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),d=function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},g=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.changedCalculatedValues=!1,t.dragging=!1,t.shouldDestroyOnEndDragging=!1,t}return u(n,e),n.prototype.init=function(){var e=this;this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:function(t){e.dragging=!0,e.rangeService.autoScrollService.check(t),e.changedCalculatedValues&&(e.onDrag(t),e.changedCalculatedValues=!1)},onDragStop:function(t){e.dragging=!1,e.onDragEnd(t),e.clearValues(),e.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(e.getDraggingCssClass()),e.shouldDestroyOnEndDragging&&e.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))},n.prototype.isDragging=function(){return this.dragging},n.prototype.getCellCtrl=function(){return this.cellCtrl},n.prototype.setCellCtrl=function(e){this.cellCtrl=e},n.prototype.getCellRange=function(){return this.cellRange},n.prototype.setCellRange=function(e){this.cellRange=e},n.prototype.getRangeStartRow=function(){return this.rangeStartRow},n.prototype.setRangeStartRow=function(e){this.rangeStartRow=e},n.prototype.getRangeEndRow=function(){return this.rangeEndRow},n.prototype.setRangeEndRow=function(e){this.rangeEndRow=e},n.prototype.getLastCellHovered=function(){return this.lastCellHovered},n.prototype.preventRangeExtension=function(e){e.preventDefault(),e.stopPropagation()},n.prototype.onDragStart=function(e){this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())},n.prototype.getDraggingCssClass=function(){return"ag-dragging-"+(this.type===t.SelectionHandleType.FILL?"fill":"range")+"-handle"},n.prototype.updateValuesOnMove=function(e){var t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)},n.prototype.getType=function(){return this.type},n.prototype.refresh=function(e){var n=this.getCellCtrl(),o=this.getGui(),i=t._.last(this.rangeService.getCellRanges()),r=i.startRow,s=i.endRow;r&&s&&(this.rowPositionUtils.before(s,r)?(this.setRangeStartRow(s),this.setRangeEndRow(r)):(this.setRangeStartRow(r),this.setRangeEndRow(s)));if(n!==e||!t._.isVisible(o)){this.setCellCtrl(e);var l=e.getComp().getParentOfValue();l&&l.appendChild(o)}this.setCellRange(i)},n.prototype.clearValues=function(){this.lastCellHovered=void 0,this.removeListeners()},n.prototype.removeListeners=function(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)},n.prototype.destroy=function(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return t._.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,e.prototype.destroy.call(this),this.removeListeners();var n=this.getGui();n.parentElement&&n.parentElement.removeChild(n)},d([t.Autowired("rowRenderer")],n.prototype,"rowRenderer",void 0),d([t.Autowired("dragService")],n.prototype,"dragService",void 0),d([t.Autowired("rangeService")],n.prototype,"rangeService",void 0),d([t.Autowired("mouseEventService")],n.prototype,"mouseEventService",void 0),d([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),d([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),d([t.Autowired("navigationService")],n.prototype,"navigationService",void 0),d([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),d([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),d([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),d([t.PostConstruct],n.prototype,"init",null),n}(t.Component),h=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),p=function(){return(p=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},f=function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},v=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s},w=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(v(arguments[t]));return e},R=function(e){function n(){var o=e.call(this,n.TEMPLATE)||this;return o.markedCells=[],o.cellValues=[],o.isUp=!1,o.isLeft=!1,o.isReduce=!1,o.type=t.SelectionHandleType.FILL,o}return h(n,e),n.prototype.updateValuesOnMove=function(t){e.prototype.updateValuesOnMove.call(this,t),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(t));var n,o=this.initialXY,i=o.x,r=o.y,s=this.mouseEventService.getNormalisedPosition(t),l=s.x,a=s.y,c=Math.abs(i-l),u=Math.abs(r-a),d=this.gridOptionsWrapper.getFillHandleDirection();(n="xy"===d?c>u?"x":"y":d)!==this.dragAxis&&(this.dragAxis=n,this.changedCalculatedValues=!0)},n.prototype.onDrag=function(e){if(!this.initialPosition){var t=this.getCellCtrl();if(!t)return;this.initialPosition=t.getCellPosition()}var n=this.getLastCellHovered();n&&this.markPathFrom(this.initialPosition,n)},n.prototype.onDragEnd=function(e){if(this.initialXY=null,this.markedCells.length){var t,n="x"===this.dragAxis,o=this.getCellRange(),i=o.columns.length,r=this.getRangeStartRow(),s=this.getRangeEndRow();if(this.isUp||this.isLeft){var l=n?r:this.lastCellMarked;t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:l.rowIndex,rowStartPinned:l.rowPinned,columnStart:n?this.lastCellMarked.column:o.columns[0],rowEndIndex:s.rowIndex,rowEndPinned:s.rowPinned,columnEnd:o.columns[i-1]})}else t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:o.columns[0],rowEndIndex:n?s.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:n?s.rowPinned:this.lastCellMarked.rowPinned,columnEnd:n?this.lastCellMarked.column:o.columns[i-1]});t&&(this.raiseFillStartEvent(),this.handleValueChanged(o,t,e),this.rangeService.setCellRanges([t]),this.raiseFillEndEvent(o,t))}},n.prototype.raiseFillStartEvent=function(){var e={type:t.Events.EVENT_FILL_START};this.eventService.dispatchEvent(e)},n.prototype.raiseFillEndEvent=function(e,n){var o={type:t.Events.EVENT_FILL_END,initialRange:e,finalRange:n};this.eventService.dispatchEvent(o)},n.prototype.handleValueChanged=function(e,n,o){var i=this,r=this.rangeService.getRangeEndRow(e),s=this.rangeService.getRangeStartRow(e),l=this.rangeService.getRangeEndRow(n),a=this.rangeService.getRangeStartRow(n),c="y"===this.dragAxis;if(!this.isReduce||this.gridOptionsWrapper.isSuppressClearOnFillReduction()){var u=!0,d=[],g=[],h=0,p=function(){d.length=0,g.length=0,h=0},f=function(n,o){var g=i.isUp?r:s,h=!1;c&&(u=!0,p());for(var f=function(){var f=i.rowPositionUtils.getRowNode(g);if(!f)return"break";c&&n?v(d,n,f,(function(){return!i.rowPositionUtils.sameRow(g,i.isUp?s:r)})):o&&(u=!0,p(),o.forEach((function(n){return v(d,n,f,(function(){return n!==(i.isLeft?e.columns[0]:t._.last(e.columns))}))}))),h=i.rowPositionUtils.sameRow(g,i.isUp?a:l),g=i.isUp?i.cellNavigationService.getRowAbove(g):i.cellNavigationService.getRowBelow(g)};!h&&g;){if("break"===f())break}},v=function(e,t,n,r){var s,l=!1;if(u)s=i.getValueFromObject(i.valueService.getValue(t,n)),g.push(s),u=r();else{var a=i.processValues(o,e,g,t,n,h++),c=a.value,d=a.fromUserFunction;if(s=c,t.isCellEditable(n)){var p=i.getValueFromObject(i.valueService.getValue(t,n));d&&p===s?l=!0:n.setDataValue(t,s,"rangeService")}}l||e.push(s)};if(c)e.columns.forEach((function(e){f(e)}));else{R=this.isLeft?w(n.columns).reverse():n.columns;f(void 0,R)}}else{var R=c?e.columns:e.columns.filter((function(e){return n.columns.indexOf(e)<0})),m=c?this.cellNavigationService.getRowBelow(l):a;m&&this.clearCellsInRange(m,r,R)}},n.prototype.clearCellsInRange=function(e,t,n){var o={startRow:e,endRow:t,columns:n,startColumn:n[0]};this.rangeService.clearCellRangeCellValues([o])},n.prototype.processValues=function(e,n,o,i,r,s){var l,a=this.gridOptionsWrapper.getFillOperation();if(l="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",a){var c=a({event:e,values:n,initialValues:o,currentIndex:s,currentCellValue:this.valueService.getValue(i,r),direction:l,column:i,rowNode:r});if(!1!==c)return{value:c,fromUserFunction:!0}}var u=n.map(this.getValueFromObject),d=!u.some((function(e){var t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()}));if(e.altKey||!d){if(d&&1===o.length){var g=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t._.last(u))+1*g,fromUserFunction:!1}}return{value:u[s%u.length],fromUserFunction:!1}}return{value:t._.last(t._.findLineByLeastSquares(u.map(Number))),fromUserFunction:!1}},n.prototype.getValueFromObject=function(e){return null!=e&&"object"==typeof e?e.toString():e},n.prototype.clearValues=function(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,e.prototype.clearValues.call(this)},n.prototype.clearMarkedPath=function(){this.markedCells.forEach((function(e){if(e.isAlive()){var 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},n.prototype.clearCellValues=function(){this.cellValues.length=0},n.prototype.markPathFrom=function(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(t,e))return;var n=this.rowPositionUtils.before(t,e),o=this.getRangeStartRow(),i=this.getRangeEndRow();n&&(t.rowPinned==o.rowPinned&&t.rowIndex>=o.rowIndex||o.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,n),this.isReduce=!1)}else{var r=e.column,s=t.column;if(r===s)return;var l=this.columnModel.getAllDisplayedColumns(),a=l.indexOf(r),c=l.indexOf(s);c<=a&&c>=l.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,c<a),this.isReduce=!1)}this.lastCellMarked=t},n.prototype.extendVertical=function(e,t,n){var o=this.navigationService,i=this.rangeService,r=e;do{for(var s=this.getCellRange(),l=s.columns.length,a=0;a<l;a++){var c=s.columns[a],u={rowIndex:r.rowIndex,rowPinned:r.rowPinned},d=p(p({},u),{column:c}),g=i.isCellInSpecificRange(d,s),h=this.rowPositionUtils.sameRow(r,e);if(n&&(this.isUp=!0),!h){var f=o.getCellByPosition(d);if(f){this.markedCells.push(f);var v=f.getComp();g||(v.addOrRemoveCssClass("ag-selection-fill-left",0===a),v.addOrRemoveCssClass("ag-selection-fill-right",a===l-1)),v.addOrRemoveCssClass(n?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(r,t))}}}if(this.rowPositionUtils.sameRow(r,t))break}while(r=n?this.cellNavigationService.getRowAbove(r):this.cellNavigationService.getRowBelow(r))},n.prototype.reduceVertical=function(e,t){var n=e;do{for(var o=this.getCellRange(),i=o.columns.length,r=this.rowPositionUtils.sameRow(n,t),s=0;s<i;s++){var l={rowIndex:n.rowIndex,rowPinned:n.rowPinned},a=p(p({},l),{column:o.columns[s]}),c=this.navigationService.getCellByPosition(a);if(c)this.markedCells.push(c),c.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,t))}if(r)break}while(n=this.cellNavigationService.getRowAbove(n))},n.prototype.extendHorizontal=function(e,n,o){var i=this,r=this.columnModel.getAllDisplayedColumns(),s=r.indexOf(o?n.column:e.column),l=r.indexOf(o?this.getCellRange().columns[0]:n.column),a=o?0:1,c=r.slice(s+a,l+a),u=this.getRangeStartRow(),d=this.getRangeEndRow();c.forEach((function(e){var n=u,r=!1;do{r=i.rowPositionUtils.sameRow(n,d);var s=i.navigationService.getCellByPosition({rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:e});if(s){i.markedCells.push(s);var l=s.getComp();l.addOrRemoveCssClass("ag-selection-fill-top",i.rowPositionUtils.sameRow(n,u)),l.addOrRemoveCssClass("ag-selection-fill-bottom",i.rowPositionUtils.sameRow(n,d)),o?(i.isLeft=!0,l.addOrRemoveCssClass("ag-selection-fill-left",e===c[0])):l.addOrRemoveCssClass("ag-selection-fill-right",e===t._.last(c))}n=i.cellNavigationService.getRowBelow(n)}while(!r)}))},n.prototype.reduceHorizontal=function(e,t){var n=this,o=this.columnModel.getAllDisplayedColumns(),i=o.indexOf(t.column),r=o.indexOf(e.column),s=o.slice(i,r),l=this.getRangeStartRow(),a=this.getRangeEndRow();s.forEach((function(e){var t=l,o=!1;do{o=n.rowPositionUtils.sameRow(t,a);var i=n.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(i)n.markedCells.push(i),i.getComp().addOrRemoveCssClass("ag-selection-fill-right",e===s[0]);t=n.cellNavigationService.getRowBelow(t)}while(!o)}))},n.prototype.refresh=function(t){var n=this.rangeService.getCellRanges()[0];n.startRow&&n.endRow?e.prototype.refresh.call(this,t):this.destroy()},n.TEMPLATE='<div class="ag-fill-handle"></div>',f([t.Autowired("valueService")],n.prototype,"valueService",void 0),n}(g),m=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),C=function(){return(C=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},y=function(e){function n(){var o=e.call(this,n.TEMPLATE)||this;return o.type=t.SelectionHandleType.RANGE,o.rangeFixed=!1,o}return m(n,e),n.prototype.onDrag=function(e){var n=this.getLastCellHovered();if(n){var o=this.rangeService.getCellRanges(),i=t._.last(o);if(this.rangeFixed||(this.fixRangeStartEnd(i),this.rangeFixed=!0),this.endPosition={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column},2===o.length&&o[0].type===t.CellRangeType.DIMENSION&&i.type===t.CellRangeType.VALUE)!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(i))&&this.rangeService.updateRangeEnd(o[0],C(C({},this.endPosition),{column:o[0].columns[0]}),!0);this.rangeService.extendLatestRangeToCell(this.endPosition)}},n.prototype.onDragEnd=function(e){var n=t._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(n),this.rangeFixed=!1},n.prototype.fixRangeStartEnd=function(e){var t=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e),o=e.columns[0];e.startRow=t,e.endRow=n,e.startColumn=o},n.TEMPLATE='<div class="ag-range-handle"></div>',n}(g),S=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),E=function(e,t,n,o){var i,r=arguments.length,s=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,o);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(s=(r<3?i(s):r>3?i(t,n,s):i(t,n))||s);return r>3&&s&&Object.defineProperty(t,n,s),s},P=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return S(n,e),n.prototype.createSelectionHandle=function(e){return this.createBean(e===t.SelectionHandleType.RANGE?new y:new R)},n=E([t.Bean("selectionHandleFactory")],n)}(t.BeanStub),O={moduleName:t.ModuleNames.RangeSelectionModule,beans:[c,P],agStackComponents:[{componentName:"AgFillHandle",componentClass:R},{componentName:"AgRangeHandle",componentClass:y}],dependantModules:[n.EnterpriseCoreModule]};exports.RangeSelectionModule=O;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=require("@ag-grid-community/core"),n=require("@ag-grid-enterprise/core"),o=(e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),i=function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},r=function(e,t,n,o){var i,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(r<3?i(l):r>3?i(t,n,l):i(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},l=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)l.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return l},s=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(l(arguments[t]));return e},a=function(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],o=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&o>=e.length&&(e=void 0),{value:e&&e[o++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},c=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.cellRanges=[],t.bodyScrollListener=t.onBodyScroll.bind(t),t.dragging=!1,t.intersectionRange=!1,t}return o(n,e),n.prototype.init=function(){var e=this;this.addManagedListener(this.eventService,t.Events.EVENT_NEW_COLUMNS_LOADED,(function(){return e.onColumnsChanged()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_VISIBLE,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_VALUE_CHANGED,this.onColumnsChanged.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PIVOT_CHANGED,(function(){return e.removeAllCellRanges()})),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_GROUP_OPENED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_MOVED,this.refreshLastRangeStart.bind(this)),this.addManagedListener(this.eventService,t.Events.EVENT_COLUMN_PINNED,this.refreshLastRangeStart.bind(this)),this.ctrlsService.whenReady((function(){var n=e.ctrlsService.getGridBodyCtrl();e.autoScrollService=new t.AutoScrollService({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:function(){return n.getScrollFeature().getVScrollPosition().top},setVerticalPosition:function(e){return n.getScrollFeature().setVerticalScrollPosition(e)},getHorizontalPosition:function(){return n.getScrollFeature().getHScrollPosition().left},setHorizontalPosition:function(e){return n.getScrollFeature().setHorizontalScrollPosition(e)},shouldSkipVerticalScroll:function(){return!e.gridOptionsService.isDomLayout("normal")},shouldSkipHorizontalScroll:function(){return!n.getScrollFeature().isHorizontalScrollShowing()}})}))},n.prototype.onColumnsChanged=function(){var e=this;this.refreshLastRangeStart();var n=this.columnModel.getAllDisplayedColumns();this.cellRanges.forEach((function(o){var i=o.columns;o.columns=o.columns.filter((function(e){return e.isVisible()&&-1!==n.indexOf(e)})),!t._.areEqual(i,o.columns)&&e.dispatchChangedEvent(!1,!0,o.id)}));var o=this.cellRanges.length;this.cellRanges=this.cellRanges.filter((function(e){return e.columns.length>0})),o>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)},n.prototype.refreshLastRangeStart=function(){var e=t._.last(this.cellRanges);e&&this.refreshRangeStart(e)},n.prototype.isContiguousRange=function(e){var n=e.columns;if(!n.length)return!1;var o=this.columnModel.getAllDisplayedColumns(),i=n.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t}));return t._.last(i)-i[0]+1===n.length},n.prototype.getRangeStartRow=function(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}},n.prototype.getRangeEndRow=function(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;var t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}},n.prototype.setRangeToCell=function(e,n){if(void 0===n&&(n=!1),this.gridOptionsService.isEnableRangeSelection()){var o=this.calculateColumnsBetween(e.column,e.column);if(o){(this.gridOptionsService.is("suppressMultiRangeSelection")||!n||t._.missing(this.cellRanges))&&this.removeAllCellRanges(!0);var i={rowIndex:e.rowIndex,rowPinned:e.rowPinned},r={startRow:i,endRow:i,columns:o,startColumn:e.column};this.cellRanges.push(r),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}}},n.prototype.extendLatestRangeToCell=function(e){if(!this.isEmpty()&&this.newestRangeStartCell){var n=t._.last(this.cellRanges);this.updateRangeEnd(n,e)}},n.prototype.updateRangeEnd=function(e,t,n){void 0===n&&(n=!1);var o=t.column,i=this.calculateColumnsBetween(e.startColumn,o);i&&!this.isLastCellOfRange(e,t)&&(e.columns=i,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},n||this.dispatchChangedEvent(!0,!0,e.id))},n.prototype.refreshRangeStart=function(e){var n=e.startColumn,o=e.columns,i=function(t,n){var o=e.columns.filter((function(e){return e!==t}));t?(e.startColumn=t,e.columns=n?s([t],o):s(o,[t])):e.columns=o},r=this.getRangeEdgeColumns(e),l=r.left,a=r.right;n===o[0]&&n!==l?i(l,!0):n===t._.last(o)&&n===a&&i(a,!1)},n.prototype.getRangeEdgeColumns=function(e){var n=this.columnModel.getAllDisplayedColumns(),o=e.columns.map((function(e){return n.indexOf(e)})).filter((function(e){return e>-1})).sort((function(e,t){return e-t}));return{left:n[o[0]],right:n[t._.last(o)]}},n.prototype.extendLatestRangeInDirection=function(e){if(!this.isEmpty()&&this.newestRangeStartCell){var n=e.key,o=e.ctrlKey||e.metaKey,i=t._.last(this.cellRanges),r=this.newestRangeStartCell,l=i.columns[0],s=t._.last(i.columns),a=i.endRow.rowIndex,c=i.endRow.rowPinned,u={column:r.column===l?s:l,rowIndex:a,rowPinned:c},d=this.cellNavigationService.getNextCellToFocus(n,u,o);if(d)return this.setCellRange({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:r.column,columnEnd:d.column}),d}},n.prototype.setCellRange=function(e){this.gridOptionsService.isEnableRangeSelection()&&(this.removeAllCellRanges(!0),this.addCellRange(e))},n.prototype.setCellRanges=function(e){var n=this;t._.shallowCompare(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach((function(e){e.columns&&e.startRow&&n.setNewestRangeStartCell({rowIndex:e.startRow.rowIndex,rowPinned:e.startRow.rowPinned,column:e.columns[0]}),n.cellRanges.push(e)})),this.dispatchChangedEvent(!1,!0))},n.prototype.setNewestRangeStartCell=function(e){this.newestRangeStartCell=e},n.prototype.clearCellRangeCellValues=function(e){var t=this;e||(e=this.cellRanges),e.forEach((function(e){t.forEachRowInRange(e,(function(n){var o=t.rowPositionUtils.getRowNode(n);if(o)for(var i=0;i<e.columns.length;i++){var r=t.columnModel.getGridColumn(e.columns[i]);if(!r||!r.isCellEditable(o))return;o.setDataValue(r,null,"rangeService")}}))}))},n.prototype.createCellRangeFromCellRangeParams=function(e){var n,o=this,i=!1;if(e.columns)n=e.columns.map((function(e){return o.columnModel.getColumnWithValidation(e)})).filter((function(e){return e}));else{var r=this.columnModel.getColumnWithValidation(e.columnStart),l=this.columnModel.getColumnWithValidation(e.columnEnd);if(!r||!l)return;(n=this.calculateColumnsBetween(r,l))&&n.length&&(i=n[0]!==r)}if(n)return{startRow:null!=e.rowStartIndex?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,endRow:null!=e.rowEndIndex?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0,columns:n,startColumn:i?t._.last(n):n[0]}},n.prototype.addCellRange=function(e){if(this.gridOptionsService.isEnableRangeSelection()){var 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))}},n.prototype.getCellRanges=function(){return this.cellRanges},n.prototype.isEmpty=function(){return 0===this.cellRanges.length},n.prototype.isMoreThanOneCell=function(){var e=this.cellRanges.length;if(0===e)return!1;if(e>1)return!0;var t=this.cellRanges[0],n=this.getRangeStartRow(t),o=this.getRangeEndRow(t);return n.rowPinned!==o.rowPinned||n.rowIndex!==o.rowIndex||1!==t.columns.length},n.prototype.areAllRangesAbleToMerge=function(){var e,t,n,o=this,i=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach((function(e){o.forEachRowInRange(e,(function(t){var n=(t.rowPinned||"normal")+"_"+t.rowIndex,o=i.get(n),r=e.columns.map((function(e){return e.getId()}));if(o){var l=r.filter((function(e){return-1===o.indexOf(e)}));o.push.apply(o,s(l))}else i.set(n,r)}))}));try{for(var r=a(i.values()),l=r.next();!l.done;l=r.next()){var c=l.value.sort().join();if(void 0!==n){if(n!==c)return!1}else n=c}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}return!0},n.prototype.forEachRowInRange=function(e,t){for(var n=this.getRangeStartRow(e),o=this.getRangeEndRow(e),i=n;i&&(t(i),!this.rowPositionUtils.sameRow(i,o));)i=this.cellNavigationService.getRowBelow(i)},n.prototype.removeAllCellRanges=function(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))},n.prototype.onBodyScroll=function(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)},n.prototype.isCellInAnyRange=function(e){return this.getCellRangeCount(e)>0},n.prototype.isCellInSpecificRange=function(e,n){var o=null!==n.columns&&t._.includes(n.columns,e.column),i=this.isRowInRange(e.rowIndex,e.rowPinned,n);return o&&i},n.prototype.isLastCellOfRange=function(e,n){var o=e.startRow,i=e.endRow,r=this.rowPositionUtils.before(o,i)?i:o,l=n.rowIndex===r.rowIndex&&n.rowPinned===r.rowPinned,s=e.columns[0],a=t._.last(e.columns),c=e.startColumn===s?a:s;return n.column===c&&l},n.prototype.isBottomRightCell=function(e,n){var o=this.columnModel.getAllDisplayedColumns(),i=e.columns.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t})),r=e.startRow,l=e.endRow,s=this.rowPositionUtils.before(r,l)?l:r,a=o.indexOf(n.column)===t._.last(i),c=n.rowIndex===s.rowIndex&&t._.makeNull(n.rowPinned)===t._.makeNull(s.rowPinned);return a&&c},n.prototype.getCellRangeCount=function(e){var t=this;return this.isEmpty()?0:this.cellRanges.filter((function(n){return t.isCellInSpecificRange(e,n)})).length},n.prototype.isRowInRange=function(e,t,n){var o=this.getRangeStartRow(n),i=this.getRangeEndRow(n),r={rowIndex:e,rowPinned:t||null},l=r.rowIndex===o.rowIndex&&r.rowPinned==o.rowPinned,s=r.rowIndex===i.rowIndex&&r.rowPinned==i.rowPinned;if(l||s)return!0;var a=!this.rowPositionUtils.before(r,o),c=this.rowPositionUtils.before(r,i);return a&&c},n.prototype.getDraggingRange=function(){return this.draggingRange},n.prototype.onDragStart=function(e){if(this.gridOptionsService.isEnableRangeSelection()){var n=e.ctrlKey,o=e.metaKey,i=e.shiftKey,r=n||o,l=!!!this.gridOptionsService.is("suppressMultiRangeSelection")&&r,s=i&&t._.existsAndNotEmpty(this.cellRanges);if(l||s&&!t._.exists(t._.last(this.cellRanges).type)||this.removeAllCellRanges(!0),this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),this.updateValuesOnMove(e),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,s||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=t._.last(this.cellRanges);else{var a={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:a,endRow:a,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)}}},n.prototype.intersectLastRange=function(e){var n=this;if(!(e&&this.dragging||this.gridOptionsService.is("suppressMultiRangeSelection")||this.isEmpty())){var o=t._.last(this.cellRanges),r=this.getRangeStartRow(o),l=this.getRangeEndRow(o),a=[];this.cellRanges.slice(0,-1).forEach((function(e){var c=n.getRangeStartRow(e),u=n.getRangeEndRow(e),d=e.columns,g=d.filter((function(e){return-1===o.columns.indexOf(e)}));if(g.length!==d.length)if(n.rowPositionUtils.before(l,c)||n.rowPositionUtils.before(u,r))a.push(e);else{var h=a.length;if(n.rowPositionUtils.before(c,r)){var p={columns:s(d),startColumn:o.startColumn,startRow:i({},c),endRow:n.cellNavigationService.getRowAbove(r)};a.push(p)}if(g.length>0){var v={columns:g,startColumn:t._.includes(g,o.startColumn)?o.startColumn:g[0],startRow:n.rowPositionUtils.rowMax([i({},r),i({},c)]),endRow:n.rowPositionUtils.rowMin([i({},l),i({},u)])};a.push(v)}n.rowPositionUtils.before(l,u)&&a.push({columns:s(d),startColumn:o.startColumn,startRow:n.cellNavigationService.getRowBelow(l),endRow:i({},u)}),a.length-h==1&&(a[a.length-1].id=e.id)}else a.push(e)})),this.cellRanges=a,e&&this.dispatchChangedEvent(!1,!0)}},n.prototype.updateValuesOnMove=function(e){var t=this.mouseEventService.getCellPositionForEvent(e);this.cellHasChanged=!1,!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=t)},n.prototype.onDragging=function(e){var t=this;if(this.dragging&&e){this.lastMouseEvent=e;var n=this.lastCellHovered,o=function(e){return n&&n.rowPinned===e&&t.newestRangeStartCell.rowPinned===e},i=o("top")||o("bottom");if(this.autoScrollService.check(e,i),this.cellHasChanged){var r=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);r&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=r,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},n.prototype.onDragStop=function(){if(this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0),this.dragging){var e=this.draggingRange.id;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)}},n.prototype.dispatchChangedEvent=function(e,n,o){var i=Object.freeze({type:t.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:n,id:o});this.eventService.dispatchEvent(i)},n.prototype.calculateColumnsBetween=function(e,t){var n=this.columnModel.getAllDisplayedColumns(),o=e===t,i=n.indexOf(e);if(i<0)console.warn("AG Grid: column "+e.getId()+" is not visible");else{var r=o?i:n.indexOf(t);if(!(r<0)){if(o)return[e];for(var l=Math.min(i,r),s=l===i?r:i,a=[],c=l;c<=s;c++)a.push(n[c]);return a}console.warn("AG Grid: column "+t.getId()+" is not visible")}},r([t.Autowired("rowModel")],n.prototype,"rowModel",void 0),r([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),r([t.Autowired("mouseEventService")],n.prototype,"mouseEventService",void 0),r([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),r([t.Autowired("pinnedRowModel")],n.prototype,"pinnedRowModel",void 0),r([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),r([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),r([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),r([t.PostConstruct],n.prototype,"init",null),n=r([t.Bean("rangeService")],n)}(t.BeanStub),u=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),d=function(e,t,n,o){var i,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(r<3?i(l):r>3?i(t,n,l):i(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},g=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.changedCalculatedValues=!1,t.dragging=!1,t.shouldDestroyOnEndDragging=!1,t}return u(n,e),n.prototype.init=function(){var e=this;this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:function(t){e.dragging=!0,e.rangeService.autoScrollService.check(t),e.changedCalculatedValues&&(e.onDrag(t),e.changedCalculatedValues=!1)},onDragStop:function(t){e.dragging=!1,e.onDragEnd(t),e.clearValues(),e.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(e.getDraggingCssClass()),e.shouldDestroyOnEndDragging&&e.destroy()}}),this.addManagedListener(this.getGui(),"mousedown",this.preventRangeExtension.bind(this))},n.prototype.isDragging=function(){return this.dragging},n.prototype.getCellCtrl=function(){return this.cellCtrl},n.prototype.setCellCtrl=function(e){this.cellCtrl=e},n.prototype.getCellRange=function(){return this.cellRange},n.prototype.setCellRange=function(e){this.cellRange=e},n.prototype.getRangeStartRow=function(){return this.rangeStartRow},n.prototype.setRangeStartRow=function(e){this.rangeStartRow=e},n.prototype.getRangeEndRow=function(){return this.rangeEndRow},n.prototype.setRangeEndRow=function(e){this.rangeEndRow=e},n.prototype.getLastCellHovered=function(){return this.lastCellHovered},n.prototype.preventRangeExtension=function(e){e.preventDefault(),e.stopPropagation()},n.prototype.onDragStart=function(e){this.cellHoverListener=this.addManagedListener(this.ctrlsService.getGridCtrl().getGui(),"mousemove",this.updateValuesOnMove.bind(this)),document.body.classList.add(this.getDraggingCssClass())},n.prototype.getDraggingCssClass=function(){return"ag-dragging-"+(this.type===t.SelectionHandleType.FILL?"fill":"range")+"-handle"},n.prototype.updateValuesOnMove=function(e){var t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)},n.prototype.getType=function(){return this.type},n.prototype.refresh=function(e){var n=this.getCellCtrl(),o=this.getGui(),i=t._.last(this.rangeService.getCellRanges()),r=i.startRow,l=i.endRow;r&&l&&(this.rowPositionUtils.before(l,r)?(this.setRangeStartRow(l),this.setRangeEndRow(r)):(this.setRangeStartRow(r),this.setRangeEndRow(l)));if(n!==e||!t._.isVisible(o)){this.setCellCtrl(e);var s=e.getComp().getParentOfValue();s&&s.appendChild(o)}this.setCellRange(i)},n.prototype.clearValues=function(){this.lastCellHovered=void 0,this.removeListeners()},n.prototype.removeListeners=function(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)},n.prototype.destroy=function(){if(!this.shouldDestroyOnEndDragging&&this.isDragging())return t._.setDisplayed(this.getGui(),!1),void(this.shouldDestroyOnEndDragging=!0);this.shouldDestroyOnEndDragging=!1,e.prototype.destroy.call(this),this.removeListeners();var n=this.getGui();n.parentElement&&n.parentElement.removeChild(n)},d([t.Autowired("rowRenderer")],n.prototype,"rowRenderer",void 0),d([t.Autowired("dragService")],n.prototype,"dragService",void 0),d([t.Autowired("rangeService")],n.prototype,"rangeService",void 0),d([t.Autowired("mouseEventService")],n.prototype,"mouseEventService",void 0),d([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),d([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),d([t.Autowired("navigationService")],n.prototype,"navigationService",void 0),d([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),d([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),d([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),d([t.PostConstruct],n.prototype,"init",null),n}(t.Component);function h(e){var t=e.length,n=0;if(t<=1)return e;for(var o=0;o<e.length;o++){var i=e[o],r=i.toString().split("e-");r.length>1?n=Math.max(n,parseInt(r[1],10)):Math.floor(i)!==i&&(n=Math.max(n,i.toString().split(".")[1].length))}for(var l=0,s=0,a=0,c=0,u=0,d=0;d<t;d++)l+=d,s+=u=e[d],c+=d*d,a+=d*u;var g=(t*a-l*s)/(t*c-l*l),h=s/t-g*l/t,p=[];for(d=0;d<=t;d++)p.push(parseFloat((d*g+h).toFixed(n)));return p}var p=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),v=function(){return(v=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},f=function(e,t,n,o){var i,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(r<3?i(l):r>3?i(t,n,l):i(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},w=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var o,i,r=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=r.next()).done;)l.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return l},R=function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e},m=function(e){function n(){var o=e.call(this,n.TEMPLATE)||this;return o.markedCells=[],o.cellValues=[],o.isUp=!1,o.isLeft=!1,o.isReduce=!1,o.type=t.SelectionHandleType.FILL,o}return p(n,e),n.prototype.updateValuesOnMove=function(t){e.prototype.updateValuesOnMove.call(this,t),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(t));var n,o=this.initialXY,i=o.x,r=o.y,l=this.mouseEventService.getNormalisedPosition(t),s=l.x,a=l.y,c=Math.abs(i-s),u=Math.abs(r-a),d=this.getFillHandleDirection();(n="xy"===d?c>u?"x":"y":d)!==this.dragAxis&&(this.dragAxis=n,this.changedCalculatedValues=!0)},n.prototype.onDrag=function(e){if(!this.initialPosition){var t=this.getCellCtrl();if(!t)return;this.initialPosition=t.getCellPosition()}var n=this.getLastCellHovered();n&&this.markPathFrom(this.initialPosition,n)},n.prototype.onDragEnd=function(e){if(this.initialXY=null,this.markedCells.length){var t,n="x"===this.dragAxis,o=this.getCellRange(),i=o.columns.length,r=this.getRangeStartRow(),l=this.getRangeEndRow();if(this.isUp||this.isLeft){var s=n?r:this.lastCellMarked;t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:s.rowIndex,rowStartPinned:s.rowPinned,columnStart:n?this.lastCellMarked.column:o.columns[0],rowEndIndex:l.rowIndex,rowEndPinned:l.rowPinned,columnEnd:o.columns[i-1]})}else t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,columnStart:o.columns[0],rowEndIndex:n?l.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:n?l.rowPinned:this.lastCellMarked.rowPinned,columnEnd:n?this.lastCellMarked.column:o.columns[i-1]});t&&(this.raiseFillStartEvent(),this.handleValueChanged(o,t,e),this.rangeService.setCellRanges([t]),this.raiseFillEndEvent(o,t))}},n.prototype.getFillHandleDirection=function(){var e=this.gridOptionsService.get("fillHandleDirection");return e?"x"!==e&&"y"!==e&&"xy"!==e?(t._.doOnce((function(){return console.warn("AG Grid: valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'.")}),"warn invalid fill direction"),"xy"):e:"xy"},n.prototype.raiseFillStartEvent=function(){var e={type:t.Events.EVENT_FILL_START};this.eventService.dispatchEvent(e)},n.prototype.raiseFillEndEvent=function(e,n){var o={type:t.Events.EVENT_FILL_END,initialRange:e,finalRange:n};this.eventService.dispatchEvent(o)},n.prototype.handleValueChanged=function(e,n,o){var i=this,r=this.rangeService.getRangeEndRow(e),l=this.rangeService.getRangeStartRow(e),s=this.rangeService.getRangeEndRow(n),a=this.rangeService.getRangeStartRow(n),c="y"===this.dragAxis;if(!this.isReduce||this.gridOptionsService.is("suppressClearOnFillReduction")){var u=!0,d=[],g=[],h=0,p=function(){d.length=0,g.length=0,h=0},v=function(n,o){var g=i.isUp?r:l,h=!1;c&&(u=!0,p());for(var v=function(){var v=i.rowPositionUtils.getRowNode(g);if(!v)return"break";c&&n?f(d,n,v,(function(){return!i.rowPositionUtils.sameRow(g,i.isUp?l:r)})):o&&(u=!0,p(),o.forEach((function(n){return f(d,n,v,(function(){return n!==(i.isLeft?e.columns[0]:t._.last(e.columns))}))}))),h=i.rowPositionUtils.sameRow(g,i.isUp?a:s),g=i.isUp?i.cellNavigationService.getRowAbove(g):i.cellNavigationService.getRowBelow(g)};!h&&g;){if("break"===v())break}},f=function(e,t,n,r){var l,s=!1;if(u)l=i.getValueFromObject(i.valueService.getValue(t,n)),g.push(l),u=r();else{var a=i.processValues(o,e,g,t,n,h++),c=a.value,d=a.fromUserFunction;if(l=c,t.isCellEditable(n)){var p=i.getValueFromObject(i.valueService.getValue(t,n));d&&p===l?s=!0:n.setDataValue(t,l,"rangeService")}}s||e.push(l)};if(c)e.columns.forEach((function(e){v(e)}));else{w=this.isLeft?R(n.columns).reverse():n.columns;v(void 0,w)}}else{var w=c?e.columns:e.columns.filter((function(e){return n.columns.indexOf(e)<0})),m=c?this.cellNavigationService.getRowBelow(s):a;m&&this.clearCellsInRange(m,r,w)}},n.prototype.clearCellsInRange=function(e,t,n){var o={startRow:e,endRow:t,columns:n,startColumn:n[0]};this.rangeService.clearCellRangeCellValues([o])},n.prototype.processValues=function(e,n,o,i,r,l){var s,a=this.gridOptionsService.getCallback("fillOperation");if(s="y"===this.dragAxis?this.isUp?"up":"down":this.isLeft?"left":"right",a){var c=a({event:e,values:n,initialValues:o,currentIndex:l,currentCellValue:this.valueService.getValue(i,r),direction:s,column:i,rowNode:r});if(!1!==c)return{value:c,fromUserFunction:!0}}var u=n.map(this.getValueFromObject),d=!u.some((function(e){var t=parseFloat(e);return isNaN(t)||t.toString()!==e.toString()}));if(e.altKey||!d){if(d&&1===o.length){var g=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t._.last(u))+1*g,fromUserFunction:!1}}return{value:u[l%u.length],fromUserFunction:!1}}return{value:t._.last(h(u.map(Number))),fromUserFunction:!1}},n.prototype.getValueFromObject=function(e){return null!=e&&"object"==typeof e?e.toString():e},n.prototype.clearValues=function(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,e.prototype.clearValues.call(this)},n.prototype.clearMarkedPath=function(){this.markedCells.forEach((function(e){if(e.isAlive()){var 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},n.prototype.clearCellValues=function(){this.cellValues.length=0},n.prototype.markPathFrom=function(e,t){if(this.clearMarkedPath(),this.clearCellValues(),"y"===this.dragAxis){if(this.rowPositionUtils.sameRow(t,e))return;var n=this.rowPositionUtils.before(t,e),o=this.getRangeStartRow(),i=this.getRangeEndRow();n&&(t.rowPinned==o.rowPinned&&t.rowIndex>=o.rowIndex||o.rowPinned!=i.rowPinned&&t.rowPinned==i.rowPinned&&t.rowIndex<=i.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,n),this.isReduce=!1)}else{var r=e.column,l=t.column;if(r===l)return;var s=this.columnModel.getAllDisplayedColumns(),a=s.indexOf(r),c=s.indexOf(l);c<=a&&c>=s.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,c<a),this.isReduce=!1)}this.lastCellMarked=t},n.prototype.extendVertical=function(e,t,n){var o=this.navigationService,i=this.rangeService,r=e;do{for(var l=this.getCellRange(),s=l.columns.length,a=0;a<s;a++){var c=l.columns[a],u={rowIndex:r.rowIndex,rowPinned:r.rowPinned},d=v(v({},u),{column:c}),g=i.isCellInSpecificRange(d,l),h=this.rowPositionUtils.sameRow(r,e);if(n&&(this.isUp=!0),!h){var p=o.getCellByPosition(d);if(p){this.markedCells.push(p);var f=p.getComp();g||(f.addOrRemoveCssClass("ag-selection-fill-left",0===a),f.addOrRemoveCssClass("ag-selection-fill-right",a===s-1)),f.addOrRemoveCssClass(n?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(r,t))}}}if(this.rowPositionUtils.sameRow(r,t))break}while(r=n?this.cellNavigationService.getRowAbove(r):this.cellNavigationService.getRowBelow(r))},n.prototype.reduceVertical=function(e,t){var n=e;do{for(var o=this.getCellRange(),i=o.columns.length,r=this.rowPositionUtils.sameRow(n,t),l=0;l<i;l++){var s={rowIndex:n.rowIndex,rowPinned:n.rowPinned},a=v(v({},s),{column:o.columns[l]}),c=this.navigationService.getCellByPosition(a);if(c)this.markedCells.push(c),c.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(n,t))}if(r)break}while(n=this.cellNavigationService.getRowAbove(n))},n.prototype.extendHorizontal=function(e,n,o){var i=this,r=this.columnModel.getAllDisplayedColumns(),l=r.indexOf(o?n.column:e.column),s=r.indexOf(o?this.getCellRange().columns[0]:n.column),a=o?0:1,c=r.slice(l+a,s+a),u=this.getRangeStartRow(),d=this.getRangeEndRow();c.forEach((function(e){var n=u,r=!1;do{r=i.rowPositionUtils.sameRow(n,d);var l=i.navigationService.getCellByPosition({rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:e});if(l){i.markedCells.push(l);var s=l.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",i.rowPositionUtils.sameRow(n,u)),s.addOrRemoveCssClass("ag-selection-fill-bottom",i.rowPositionUtils.sameRow(n,d)),o?(i.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",e===c[0])):s.addOrRemoveCssClass("ag-selection-fill-right",e===t._.last(c))}n=i.cellNavigationService.getRowBelow(n)}while(!r)}))},n.prototype.reduceHorizontal=function(e,t){var n=this,o=this.columnModel.getAllDisplayedColumns(),i=o.indexOf(t.column),r=o.indexOf(e.column),l=o.slice(i,r),s=this.getRangeStartRow(),a=this.getRangeEndRow();l.forEach((function(e){var t=s,o=!1;do{o=n.rowPositionUtils.sameRow(t,a);var i=n.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(i)n.markedCells.push(i),i.getComp().addOrRemoveCssClass("ag-selection-fill-right",e===l[0]);t=n.cellNavigationService.getRowBelow(t)}while(!o)}))},n.prototype.refresh=function(t){var n=this.rangeService.getCellRanges()[0];n.startRow&&n.endRow?e.prototype.refresh.call(this,t):this.destroy()},n.TEMPLATE='<div class="ag-fill-handle"></div>',f([t.Autowired("valueService")],n.prototype,"valueService",void 0),n}(g),y=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),C=function(){return(C=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},S=function(e){function n(){var o=e.call(this,n.TEMPLATE)||this;return o.type=t.SelectionHandleType.RANGE,o.rangeFixed=!1,o}return y(n,e),n.prototype.onDrag=function(e){var n=this.getLastCellHovered();if(n){var o=this.rangeService.getCellRanges(),i=t._.last(o);if(this.rangeFixed||(this.fixRangeStartEnd(i),this.rangeFixed=!0),this.endPosition={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column},2===o.length&&o[0].type===t.CellRangeType.DIMENSION&&i.type===t.CellRangeType.VALUE)!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(i))&&this.rangeService.updateRangeEnd(o[0],C(C({},this.endPosition),{column:o[0].columns[0]}),!0);this.rangeService.extendLatestRangeToCell(this.endPosition)}},n.prototype.onDragEnd=function(e){var n=t._.last(this.rangeService.getCellRanges());this.fixRangeStartEnd(n),this.rangeFixed=!1},n.prototype.fixRangeStartEnd=function(e){var t=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e),o=e.columns[0];e.startRow=t,e.endRow=n,e.startColumn=o},n.TEMPLATE='<div class="ag-range-handle"></div>',n}(g),E=function(){var e=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)};return function(t,n){function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}}(),P=function(e,t,n,o){var i,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(l=(r<3?i(l):r>3?i(t,n,l):i(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},O=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return E(n,e),n.prototype.createSelectionHandle=function(e){return this.createBean(e===t.SelectionHandleType.RANGE?new S:new m)},n=P([t.Bean("selectionHandleFactory")],n)}(t.BeanStub),x={version:"29.0.0",moduleName:t.ModuleNames.RangeSelectionModule,beans:[c,O],agStackComponents:[{componentName:"AgFillHandle",componentClass:m},{componentName:"AgRangeHandle",componentClass:S}],dependantModules:[n.EnterpriseCoreModule]};exports.RangeSelectionModule=x;
{
"name": "@ag-grid-enterprise/range-selection",
"version": "28.2.1",
"version": "29.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -50,7 +50,7 @@ "main": "./dist/cjs/es5/main.js",

"dependencies": {
"@ag-grid-community/core": "~28.2.1",
"@ag-grid-enterprise/core": "~28.2.1"
"@ag-grid-community/core": "~29.0.0",
"@ag-grid-enterprise/core": "~29.0.0"
},
"devDependencies": {
"typescript": "~3.7.7",
"typescript": "~4.0.8",
"rimraf": "3.0.2"

@@ -57,0 +57,0 @@ },

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc