Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/range-selection

Package Overview
Dependencies
2
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 30.0.6 to 30.1.0

2

dist/cjs/es5/version.d.ts

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

export declare const VERSION = "30.0.6";
export declare const VERSION = "30.1.0";

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

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '30.0.6';
exports.VERSION = '30.1.0';

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

export declare const VERSION = "30.0.6";
export declare const VERSION = "30.1.0";

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

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '30.0.6';
exports.VERSION = '30.1.0';

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

export declare const VERSION = "30.0.6";
export declare const VERSION = "30.1.0";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '30.0.6';
export var VERSION = '30.1.0';

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

export declare const VERSION = "30.0.6";
export declare const VERSION = "30.1.0";
/**
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.0.6
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.1.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 v30.0.6
* @ag-grid-enterprise/range-selection - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.1.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)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(t,n)},function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),r=function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(e,t,n,o){var r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l},s=function(e,t){for(var n=0,o=t.length,r=e.length;n<o;n++,r++)e[r]=t[n];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 r=o.columns;o.columns=o.columns.filter((function(e){return e.isVisible()&&-1!==n.indexOf(e)})),!t._.areEqual(r,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(),r=n.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t}));return t._.last(r)-r[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 r={rowIndex:e.rowIndex,rowPinned:e.rowPinned},i={startRow:r,endRow:r,columns:o,startColumn:e.column};this.cellRanges.push(i),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,r=this.calculateColumnsBetween(e.startColumn,o);r&&!this.isLastCellOfRange(e,t)&&(e.columns=r,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,r=function(t,n){var o=e.columns.filter((function(e){return e!==t}));t?(e.startColumn=t,e.columns=n?s([t],l(o)):s(s([],l(o)),[t])):e.columns=o},i=this.getRangeEdgeColumns(e),a=i.left,c=i.right;n===o[0]&&n!==a?r(a,!0):n===t._.last(o)&&n===c&&r(c,!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,r=t._.last(this.cellRanges),i=this.newestRangeStartCell,l=r.columns[0],s=t._.last(r.columns),a=r.endRow.rowIndex,c=r.endRow.rowPinned,u={column:i.column===l?s:l,rowIndex:a,rowPinned:c},d=this.cellNavigationService.getNextCellToFocus(n,u,o);if(d)return this.setCellRange({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:i.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 n=this,o=e.cellRanges,r=e.cellEventSource,i=void 0===r?"rangeService":r,l=e.dispatchWrapperEvents,s=e.wrapperEventSource,a=void 0===s?"deleteKey":s;if(l){var c={type:t.Events.EVENT_RANGE_DELETE_START,source:a};this.eventService.dispatchEvent(c)}if(o||(o=this.cellRanges),o.forEach((function(e){n.forEachRowInRange(e,(function(t){var o=n.rowPositionUtils.getRowNode(t);if(o)for(var r=0;r<e.columns.length;r++){var l=n.columnModel.getGridColumn(e.columns[r]);if(!l||!l.isCellEditable(o))return;o.setDataValue(l,null,i)}}))})),l){var u={type:t.Events.EVENT_RANGE_DELETE_END,source:a};this.eventService.dispatchEvent(u)}},n.prototype.createCellRangeFromCellRangeParams=function(e){var n,o=this,r=!1;if(e.columns)n=e.columns.map((function(e){return o.columnModel.getColumnWithValidation(e)})).filter((function(e){return e}));else{var i=this.columnModel.getColumnWithValidation(e.columnStart),l=this.columnModel.getColumnWithValidation(e.columnEnd);if(!i||!l)return;(n=this.calculateColumnsBetween(i,l))&&n.length&&(r=n[0]!==i)}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:r?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,r=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=r.get(n),i=e.columns.map((function(e){return e.getId()}));if(o){var a=i.filter((function(e){return-1===o.indexOf(e)}));o.push.apply(o,s([],l(a)))}else r.set(n,i)}))}));try{for(var i=a(r.values()),c=i.next();!c.done;c=i.next()){var u=c.value.sort().join();if(void 0!==n){if(n!==u)return!1}else n=u}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return!0},n.prototype.forEachRowInRange=function(e,t){for(var n=this.getRangeStartRow(e),o=this.getRangeEndRow(e),r=n;r&&(t(r),!this.rowPositionUtils.sameRow(r,o));)r=this.cellNavigationService.getRowBelow(r)},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),r=this.isRowInRange(e.rowIndex,e.rowPinned,n);return o&&r},n.prototype.isLastCellOfRange=function(e,n){var o=e.startRow,r=e.endRow,i=this.rowPositionUtils.before(o,r)?r:o,l=n.rowIndex===i.rowIndex&&n.rowPinned===i.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(),r=e.columns.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t})),i=e.startRow,l=e.endRow,s=this.rowPositionUtils.before(i,l)?l:i,a=o.indexOf(n.column)===t._.last(r),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),r=this.getRangeEndRow(n),i={rowIndex:e,rowPinned:t||null},l=i.rowIndex===o.rowIndex&&i.rowPinned==o.rowPinned,s=i.rowIndex===r.rowIndex&&i.rowPinned==r.rowPinned;if(l||s)return!0;var a=!this.rowPositionUtils.before(i,o),c=this.rowPositionUtils.before(i,r);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,r=e.shiftKey,i=n||o,l=!!!this.gridOptionsService.is("suppressMultiRangeSelection")&&i,s=r&&t._.existsAndNotEmpty(this.cellRanges);l||s&&!t._.exists(t._.last(this.cellRanges).type)||this.removeAllCellRanges(!0);var a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,s||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=t._.last(this.cellRanges);else{var c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}},n.prototype.intersectLastRange=function(e){var n=this;if(!(e&&this.dragging||this.gridOptionsService.is("suppressMultiRangeSelection")||this.isEmpty())){var o=t._.last(this.cellRanges),i=this.getRangeStartRow(o),a=this.getRangeEndRow(o),c=[];this.cellRanges.slice(0,-1).forEach((function(e){var u=n.getRangeStartRow(e),d=n.getRangeEndRow(e),g=e.columns,h=g.filter((function(e){return-1===o.columns.indexOf(e)}));if(h.length!==g.length)if(n.rowPositionUtils.before(a,u)||n.rowPositionUtils.before(d,i))c.push(e);else{var p=c.length;if(n.rowPositionUtils.before(u,i)){var v={columns:s([],l(g)),startColumn:o.startColumn,startRow:r({},u),endRow:n.cellNavigationService.getRowAbove(i)};c.push(v)}if(h.length>0){var f={columns:h,startColumn:t._.includes(h,o.startColumn)?o.startColumn:h[0],startRow:n.rowPositionUtils.rowMax([r({},i),r({},u)]),endRow:n.rowPositionUtils.rowMin([r({},a),r({},d)])};c.push(f)}n.rowPositionUtils.before(a,d)&&c.push({columns:s([],l(g)),startColumn:o.startColumn,startRow:n.cellNavigationService.getRowBelow(a),endRow:r({},d)}),c.length-p==1&&(c[c.length-1].id=e.id)}else c.push(e)})),this.cellRanges=c,e&&this.dispatchChangedEvent(!1,!0)}},n.prototype.updateValuesOnMove=function(e){var n=t._.getCtrlForEventTarget(this.gridOptionsService,e,t.CellCtrl.DOM_DATA_KEY_CELL_CTRL),o=null==n?void 0:n.getCellPosition();this.cellHasChanged=!1,!o||this.lastCellHovered&&this.cellPositionUtils.equals(o,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=o)},n.prototype.onDragging=function(e){var t=this;if(this.dragging&&e){this.updateValuesOnMove(e.target),this.lastMouseEvent=e;var n=this.lastCellHovered,o=function(e){return n&&n.rowPinned===e&&t.newestRangeStartCell.rowPinned===e},r=o("top")||o("bottom");if(this.autoScrollService.check(e,r),this.cellHasChanged){var i=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);i&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=i,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},n.prototype.onDragStop=function(){if(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 r={type:t.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:n,id:o};this.eventService.dispatchEvent(r)},n.prototype.calculateColumnsBetween=function(e,t){var n=this.columnModel.getAllDisplayedColumns(),o=e===t,r=n.indexOf(e);if(r<0)console.warn("AG Grid: column "+e.getId()+" is not visible");else{var i=o?r:n.indexOf(t);if(!(i<0)){if(o)return[e];for(var l=Math.min(r,i),s=l===r?i:r,a=[],c=l;c<=s;c++)a.push(n[c]);return a}console.warn("AG Grid: column "+t.getId()+" is not visible")}},i([t.Autowired("rowModel")],n.prototype,"rowModel",void 0),i([t.Autowired("dragService")],n.prototype,"dragService",void 0),i([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),i([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),i([t.Autowired("pinnedRowModel")],n.prototype,"pinnedRowModel",void 0),i([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),i([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),i([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),i([t.PostConstruct],n.prototype,"init",null),n=i([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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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.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(),r=t._.last(this.rangeService.getCellRanges()),i=r.startRow,l=r.endRow;i&&l&&(this.rowPositionUtils.before(l,i)?(this.setRangeStartRow(l),this.setRangeEndRow(i)):(this.setRangeStartRow(i),this.setRangeEndRow(l)));if(n!==e||!t._.isVisible(o)){this.setCellCtrl(e);var s=e.getComp().getParentOfValue();s&&s.appendChild(o)}this.setCellRange(r)},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 r=e[o],i=r.toString().split("e-");i.length>1?n=Math.max(n,parseInt(i[1],10)):Math.floor(r)!==r&&(n=Math.max(n,r.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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},f=function(e,t,n,o){var r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l},R=function(e,t){for(var n=0,o=t.length,r=e.length;n<o;n++,r++)e[r]=t[n];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,r=o.x,i=o.y,l=this.mouseEventService.getNormalisedPosition(t),s=l.x,a=l.y,c=Math.abs(r-s),u=Math.abs(i-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(),r=o.columns.length,i=this.getRangeStartRow(),l=this.getRangeEndRow();if(this.isUp||this.isLeft){var s=n?i: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[r-1]})}else t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.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[r-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 r=this,i=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=r.isUp?i:l,h=!1;c&&(u=!0,p());for(var v=function(){var v=r.rowPositionUtils.getRowNode(g);if(!v)return"break";c&&n?f(d,n,v,(function(){return!r.rowPositionUtils.sameRow(g,r.isUp?l:i)})):o&&(u=!0,p(),o.forEach((function(n){return f(d,n,v,(function(){return n!==(r.isLeft?e.columns[0]:t._.last(e.columns))}))}))),h=r.rowPositionUtils.sameRow(g,r.isUp?a:s),g=r.isUp?r.cellNavigationService.getRowAbove(g):r.cellNavigationService.getRowBelow(g)};!h&&g;){if("break"===v())break}},f=function(e,n,i,l){var s,a,c,d=!1;if(u)c=r.valueService.getValue(n,i),g.push(c),u=l();else{var p=r.processValues(o,e,g,n,i,h++),v=p.value,f=p.fromUserFunction,w=p.sourceCol,R=p.sourceRowNode;if(c=v,n.isCellEditable(i)){var m=r.valueService.getValue(n,i);f||((null===(s=null==w?void 0:w.getColDef())||void 0===s?void 0:s.useValueFormatterForExport)&&(c=null!==(a=r.valueFormatterService.formatValue(w,R,c))&&void 0!==a?a:c),n.getColDef().useValueParserForImport&&(c=r.valueParserService.parseValue(n,i,w?c:t._.toStringOrNull(c),m))),f&&m===c?d=!0:i.setDataValue(n,c,"rangeService")}}d||e.push({value:c,column:n,rowNode:i})};if(c)e.columns.forEach((function(e){v(e)}));else{m=this.isLeft?R([],w(n.columns)).reverse():n.columns;v(void 0,m)}}else{var m=c?e.columns:e.columns.filter((function(e){return n.columns.indexOf(e)<0})),y=c?this.cellNavigationService.getRowBelow(s):a;y&&this.clearCellsInRange(y,i,m)}},n.prototype.clearCellsInRange=function(e,t,n){var o={startRow:e,endRow:t,columns:n,startColumn:n[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[o]})},n.prototype.processValues=function(e,n,o,r,i,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.map((function(e){return e.value})),initialValues:o,currentIndex:l,currentCellValue:this.valueService.getValue(r,i),direction:s,column:r,rowNode:i});if(!1!==c)return{value:c,fromUserFunction:!0}}var u=!n.some((function(e){var t=e.value,n=parseFloat(t);return isNaN(n)||n.toString()!==t.toString()}));if(e.altKey||!u){if(u&&1===o.length){var d=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t._.last(n).value)+1*d,fromUserFunction:!1}}var g=n[l%n.length];return{value:g.value,fromUserFunction:!1,sourceCol:g.column,sourceRowNode:g.rowNode}}return{value:t._.last(h(n.map((function(e){var t=e.value;return Number(t)})))),fromUserFunction:!1}},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(),r=this.getRangeEndRow();n&&(t.rowPinned==o.rowPinned&&t.rowIndex>=o.rowIndex||o.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,n),this.isReduce=!1)}else{var i=e.column,l=t.column;if(i===l)return;var s=this.columnModel.getAllDisplayedColumns(),a=s.indexOf(i),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,r=this.rangeService,i=e;do{for(var l=this.getCellRange(),s=l.columns.length,a=0;a<s;a++){var c=l.columns[a],u={rowIndex:i.rowIndex,rowPinned:i.rowPinned},d=v(v({},u),{column:c}),g=r.isCellInSpecificRange(d,l),h=this.rowPositionUtils.sameRow(i,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(i,t))}}}if(this.rowPositionUtils.sameRow(i,t))break}while(i=n?this.cellNavigationService.getRowAbove(i):this.cellNavigationService.getRowBelow(i))},n.prototype.reduceVertical=function(e,t){var n=e;do{for(var o=this.getCellRange(),r=o.columns.length,i=this.rowPositionUtils.sameRow(n,t),l=0;l<r;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(i)break}while(n=this.cellNavigationService.getRowAbove(n))},n.prototype.extendHorizontal=function(e,n,o){var r=this,i=this.columnModel.getAllDisplayedColumns(),l=i.indexOf(o?n.column:e.column),s=i.indexOf(o?this.getCellRange().columns[0]:n.column),a=o?0:1,c=i.slice(l+a,s+a),u=this.getRangeStartRow(),d=this.getRangeEndRow();c.forEach((function(e){var n=u,i=!1;do{i=r.rowPositionUtils.sameRow(n,d);var l=r.navigationService.getCellByPosition({rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:e});if(l){r.markedCells.push(l);var s=l.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",r.rowPositionUtils.sameRow(n,u)),s.addOrRemoveCssClass("ag-selection-fill-bottom",r.rowPositionUtils.sameRow(n,d)),o?(r.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",e===c[0])):s.addOrRemoveCssClass("ag-selection-fill-right",e===t._.last(c))}n=r.cellNavigationService.getRowBelow(n)}while(!i)}))},n.prototype.reduceHorizontal=function(e,t){var n=this,o=this.columnModel.getAllDisplayedColumns(),r=o.indexOf(t.column),i=o.indexOf(e.column),l=o.slice(r,i),s=this.getRangeStartRow(),a=this.getRangeEndRow();l.forEach((function(e){var t=s,o=!1;do{o=n.rowPositionUtils.sameRow(t,a);var r=n.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(r)n.markedCells.push(r),r.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),f([t.Autowired("valueParserService")],n.prototype,"valueParserService",void 0),f([t.Autowired("valueFormatterService")],n.prototype,"valueFormatterService",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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);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(),r=t._.last(o);if(this.rangeFixed||(this.fixRangeStartEnd(r),this.rangeFixed=!0),this.endPosition={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column},2===o.length&&o[0].type===t.CellRangeType.DIMENSION&&r.type===t.CellRangeType.VALUE)!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(r))&&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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l},x=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),O={version:"30.0.6",moduleName:t.ModuleNames.RangeSelectionModule,beans:[c,x],agStackComponents:[{componentName:"AgFillHandle",componentClass:m},{componentName:"AgRangeHandle",componentClass:S}],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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function o(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(o.prototype=n.prototype,new o)}),r=function(){return(r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},i=function(e,t,n,o){var r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l},s=function(e,t){for(var n=0,o=t.length,r=e.length;n<o;n++,r++)e[r]=t[n];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 r=o.columns;o.columns=o.columns.filter((function(e){return e.isVisible()&&-1!==n.indexOf(e)})),!t._.areEqual(r,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(),r=n.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t}));return t._.last(r)-r[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 r={rowIndex:e.rowIndex,rowPinned:e.rowPinned},i={startRow:r,endRow:r,columns:o,startColumn:e.column};this.cellRanges.push(i),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,r=this.calculateColumnsBetween(e.startColumn,o);r&&!this.isLastCellOfRange(e,t)&&(e.columns=r,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,r=function(t,n){var o=e.columns.filter((function(e){return e!==t}));t?(e.startColumn=t,e.columns=n?s([t],l(o)):s(s([],l(o)),[t])):e.columns=o},i=this.getRangeEdgeColumns(e),a=i.left,c=i.right;n===o[0]&&n!==a?r(a,!0):n===t._.last(o)&&n===c&&r(c,!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,r=t._.last(this.cellRanges),i=this.newestRangeStartCell,l=r.columns[0],s=t._.last(r.columns),a=r.endRow.rowIndex,c=r.endRow.rowPinned,u={column:i.column===l?s:l,rowIndex:a,rowPinned:c},d=this.cellNavigationService.getNextCellToFocus(n,u,o);if(d)return this.setCellRange({rowStartIndex:i.rowIndex,rowStartPinned:i.rowPinned,rowEndIndex:d.rowIndex,rowEndPinned:d.rowPinned,columnStart:i.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 n=this,o=e.cellRanges,r=e.cellEventSource,i=void 0===r?"rangeService":r,l=e.dispatchWrapperEvents,s=e.wrapperEventSource,a=void 0===s?"deleteKey":s;if(l){var c={type:t.Events.EVENT_RANGE_DELETE_START,source:a};this.eventService.dispatchEvent(c)}if(o||(o=this.cellRanges),o.forEach((function(e){n.forEachRowInRange(e,(function(t){var o=n.rowPositionUtils.getRowNode(t);if(o)for(var r=0;r<e.columns.length;r++){var l=n.columnModel.getGridColumn(e.columns[r]);if(!l||!l.isCellEditable(o))return;o.setDataValue(l,null,i)}}))})),l){var u={type:t.Events.EVENT_RANGE_DELETE_END,source:a};this.eventService.dispatchEvent(u)}},n.prototype.createCellRangeFromCellRangeParams=function(e){var n,o=this,r=!1;if(e.columns)n=e.columns.map((function(e){return o.columnModel.getColumnWithValidation(e)})).filter((function(e){return e}));else{var i=this.columnModel.getColumnWithValidation(e.columnStart),l=this.columnModel.getColumnWithValidation(e.columnEnd);if(!i||!l)return;(n=this.calculateColumnsBetween(i,l))&&n.length&&(r=n[0]!==i)}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:r?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,r=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=r.get(n),i=e.columns.map((function(e){return e.getId()}));if(o){var a=i.filter((function(e){return-1===o.indexOf(e)}));o.push.apply(o,s([],l(a)))}else r.set(n,i)}))}));try{for(var i=a(r.values()),c=i.next();!c.done;c=i.next()){var u=c.value.sort().join();if(void 0!==n){if(n!==u)return!1}else n=u}}catch(t){e={error:t}}finally{try{c&&!c.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}return!0},n.prototype.forEachRowInRange=function(e,t){for(var n=this.getRangeStartRow(e),o=this.getRangeEndRow(e),r=n;r&&(t(r),!this.rowPositionUtils.sameRow(r,o));)r=this.cellNavigationService.getRowBelow(r)},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),r=this.isRowInRange(e.rowIndex,e.rowPinned,n);return o&&r},n.prototype.isLastCellOfRange=function(e,n){var o=e.startRow,r=e.endRow,i=this.rowPositionUtils.before(o,r)?r:o,l=n.rowIndex===i.rowIndex&&n.rowPinned===i.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(),r=e.columns.map((function(e){return o.indexOf(e)})).sort((function(e,t){return e-t})),i=e.startRow,l=e.endRow,s=this.rowPositionUtils.before(i,l)?l:i,a=o.indexOf(n.column)===t._.last(r),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),r=this.getRangeEndRow(n),i={rowIndex:e,rowPinned:t||null},l=i.rowIndex===o.rowIndex&&i.rowPinned==o.rowPinned,s=i.rowIndex===r.rowIndex&&i.rowPinned==r.rowPinned;if(l||s)return!0;var a=!this.rowPositionUtils.before(i,o),c=this.rowPositionUtils.before(i,r);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,r=e.shiftKey,i=n||o,l=!!!this.gridOptionsService.is("suppressMultiRangeSelection")&&i,s=r&&t._.existsAndNotEmpty(this.cellRanges);l||s&&!t._.exists(t._.last(this.cellRanges).type)||this.removeAllCellRanges(!0);var a=this.dragService.getStartTarget();if(a&&this.updateValuesOnMove(a),this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,s||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=t._.last(this.cellRanges);else{var c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}},n.prototype.intersectLastRange=function(e){var n=this;if(!(e&&this.dragging||this.gridOptionsService.is("suppressMultiRangeSelection")||this.isEmpty())){var o=t._.last(this.cellRanges),i=this.getRangeStartRow(o),a=this.getRangeEndRow(o),c=[];this.cellRanges.slice(0,-1).forEach((function(e){var u=n.getRangeStartRow(e),d=n.getRangeEndRow(e),g=e.columns,h=g.filter((function(e){return-1===o.columns.indexOf(e)}));if(h.length!==g.length)if(n.rowPositionUtils.before(a,u)||n.rowPositionUtils.before(d,i))c.push(e);else{var p=c.length;if(n.rowPositionUtils.before(u,i)){var v={columns:s([],l(g)),startColumn:o.startColumn,startRow:r({},u),endRow:n.cellNavigationService.getRowAbove(i)};c.push(v)}if(h.length>0){var f={columns:h,startColumn:t._.includes(h,o.startColumn)?o.startColumn:h[0],startRow:n.rowPositionUtils.rowMax([r({},i),r({},u)]),endRow:n.rowPositionUtils.rowMin([r({},a),r({},d)])};c.push(f)}n.rowPositionUtils.before(a,d)&&c.push({columns:s([],l(g)),startColumn:o.startColumn,startRow:n.cellNavigationService.getRowBelow(a),endRow:r({},d)}),c.length-p==1&&(c[c.length-1].id=e.id)}else c.push(e)})),this.cellRanges=c,e&&this.dispatchChangedEvent(!1,!0)}},n.prototype.updateValuesOnMove=function(e){var n=t._.getCtrlForEventTarget(this.gridOptionsService,e,t.CellCtrl.DOM_DATA_KEY_CELL_CTRL),o=null==n?void 0:n.getCellPosition();this.cellHasChanged=!1,!o||this.lastCellHovered&&this.cellPositionUtils.equals(o,this.lastCellHovered)||(this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=o)},n.prototype.onDragging=function(e){var t=this;if(this.dragging&&e){this.updateValuesOnMove(e.target),this.lastMouseEvent=e;var n=this.lastCellHovered,o=function(e){return n&&n.rowPinned===e&&t.newestRangeStartCell.rowPinned===e},r=o("top")||o("bottom");if(this.autoScrollService.check(e,r),this.cellHasChanged){var i=this.calculateColumnsBetween(this.newestRangeStartCell.column,n.column);i&&(this.draggingRange.endRow={rowIndex:n.rowIndex,rowPinned:n.rowPinned},this.draggingRange.columns=i,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}}},n.prototype.onDragStop=function(){if(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 r={type:t.Events.EVENT_RANGE_SELECTION_CHANGED,started:e,finished:n,id:o};this.eventService.dispatchEvent(r)},n.prototype.calculateColumnsBetween=function(e,t){var n=this.columnModel.getAllDisplayedColumns(),o=e===t,r=n.indexOf(e);if(r<0)console.warn("AG Grid: column "+e.getId()+" is not visible");else{var i=o?r:n.indexOf(t);if(!(i<0)){if(o)return[e];for(var l=Math.min(r,i),s=l===r?i:r,a=[],c=l;c<=s;c++)a.push(n[c]);return a}console.warn("AG Grid: column "+t.getId()+" is not visible")}},i([t.Autowired("rowModel")],n.prototype,"rowModel",void 0),i([t.Autowired("dragService")],n.prototype,"dragService",void 0),i([t.Autowired("columnModel")],n.prototype,"columnModel",void 0),i([t.Autowired("cellNavigationService")],n.prototype,"cellNavigationService",void 0),i([t.Autowired("pinnedRowModel")],n.prototype,"pinnedRowModel",void 0),i([t.Autowired("rowPositionUtils")],n.prototype,"rowPositionUtils",void 0),i([t.Autowired("cellPositionUtils")],n.prototype,"cellPositionUtils",void 0),i([t.Autowired("ctrlsService")],n.prototype,"ctrlsService",void 0),i([t.PostConstruct],n.prototype,"init",null),n=i([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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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.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(),r=t._.last(this.rangeService.getCellRanges()),i=r.startRow,l=r.endRow;i&&l&&(this.rowPositionUtils.before(l,i)?(this.setRangeStartRow(l),this.setRangeEndRow(i)):(this.setRangeStartRow(i),this.setRangeEndRow(l)));if(n!==e||!t._.isVisible(o)){this.setCellCtrl(e);var s=e.getComp().getParentOfValue();s&&s.appendChild(o)}this.setCellRange(r)},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 r=e[o],i=r.toString().split("e-");i.length>1?n=Math.max(n,parseInt(i[1],10)):Math.floor(r)!==r&&(n=Math.max(n,r.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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},f=function(e,t,n,o){var r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>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,r,i=n.call(e),l=[];try{for(;(void 0===t||t-- >0)&&!(o=i.next()).done;)l.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return l},R=function(e,t){for(var n=0,o=t.length,r=e.length;n<o;n++,r++)e[r]=t[n];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,r=o.x,i=o.y,l=this.mouseEventService.getNormalisedPosition(t),s=l.x,a=l.y,c=Math.abs(r-s),u=Math.abs(i-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(),r=o.columns.length,i=this.getRangeStartRow(),l=this.getRangeEndRow();if(this.isUp||this.isLeft){var s=n?i: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[r-1]})}else t=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:i.rowIndex,rowStartPinned:i.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[r-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 r=this,i=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=r.isUp?i:l,h=!1;c&&(u=!0,p());for(var v=function(){var v=r.rowPositionUtils.getRowNode(g);if(!v)return"break";c&&n?f(d,n,v,(function(){return!r.rowPositionUtils.sameRow(g,r.isUp?l:i)})):o&&(u=!0,p(),o.forEach((function(n){return f(d,n,v,(function(){return n!==(r.isLeft?e.columns[0]:t._.last(e.columns))}))}))),h=r.rowPositionUtils.sameRow(g,r.isUp?a:s),g=r.isUp?r.cellNavigationService.getRowAbove(g):r.cellNavigationService.getRowBelow(g)};!h&&g;){if("break"===v())break}},f=function(e,n,i,l){var s,a,c,d=!1;if(u)c=r.valueService.getValue(n,i),g.push(c),u=l();else{var p=r.processValues(o,e,g,n,i,h++),v=p.value,f=p.fromUserFunction,w=p.sourceCol,R=p.sourceRowNode;if(c=v,n.isCellEditable(i)){var m=r.valueService.getValue(n,i);f||((null===(s=null==w?void 0:w.getColDef())||void 0===s?void 0:s.useValueFormatterForExport)&&(c=null!==(a=r.valueFormatterService.formatValue(w,R,c))&&void 0!==a?a:c),n.getColDef().useValueParserForImport&&(c=r.valueParserService.parseValue(n,i,w?c:t._.toStringOrNull(c),m))),f&&m===c?d=!0:i.setDataValue(n,c,"rangeService")}}d||e.push({value:c,column:n,rowNode:i})};if(c)e.columns.forEach((function(e){v(e)}));else{m=this.isLeft?R([],w(n.columns)).reverse():n.columns;v(void 0,m)}}else{var m=c?e.columns:e.columns.filter((function(e){return n.columns.indexOf(e)<0})),y=c?this.cellNavigationService.getRowBelow(s):a;y&&this.clearCellsInRange(y,i,m)}},n.prototype.clearCellsInRange=function(e,t,n){var o={startRow:e,endRow:t,columns:n,startColumn:n[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[o]})},n.prototype.processValues=function(e,n,o,r,i,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.map((function(e){return e.value})),initialValues:o,currentIndex:l,currentCellValue:this.valueService.getValue(r,i),direction:s,column:r,rowNode:i});if(!1!==c)return{value:c,fromUserFunction:!0}}var u=!n.some((function(e){var t=e.value,n=parseFloat(t);return isNaN(n)||n.toString()!==t.toString()}));if(e.altKey||!u){if(u&&1===o.length){var d=this.isUp||this.isLeft?-1:1;return{value:parseFloat(t._.last(n).value)+1*d,fromUserFunction:!1}}var g=n[l%n.length];return{value:g.value,fromUserFunction:!1,sourceCol:g.column,sourceRowNode:g.rowNode}}return{value:t._.last(h(n.map((function(e){var t=e.value;return Number(t)})))),fromUserFunction:!1}},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(),r=this.getRangeEndRow();n&&(t.rowPinned==o.rowPinned&&t.rowIndex>=o.rowIndex||o.rowPinned!=r.rowPinned&&t.rowPinned==r.rowPinned&&t.rowIndex<=r.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,n),this.isReduce=!1)}else{var i=e.column,l=t.column;if(i===l)return;var s=this.columnModel.getAllDisplayedColumns(),a=s.indexOf(i),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,r=this.rangeService,i=e;do{for(var l=this.getCellRange(),s=l.columns.length,a=0;a<s;a++){var c=l.columns[a],u={rowIndex:i.rowIndex,rowPinned:i.rowPinned},d=v(v({},u),{column:c}),g=r.isCellInSpecificRange(d,l),h=this.rowPositionUtils.sameRow(i,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(i,t))}}}if(this.rowPositionUtils.sameRow(i,t))break}while(i=n?this.cellNavigationService.getRowAbove(i):this.cellNavigationService.getRowBelow(i))},n.prototype.reduceVertical=function(e,t){var n=e;do{for(var o=this.getCellRange(),r=o.columns.length,i=this.rowPositionUtils.sameRow(n,t),l=0;l<r;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(i)break}while(n=this.cellNavigationService.getRowAbove(n))},n.prototype.extendHorizontal=function(e,n,o){var r=this,i=this.columnModel.getAllDisplayedColumns(),l=i.indexOf(o?n.column:e.column),s=i.indexOf(o?this.getCellRange().columns[0]:n.column),a=o?0:1,c=i.slice(l+a,s+a),u=this.getRangeStartRow(),d=this.getRangeEndRow();c.forEach((function(e){var n=u,i=!1;do{i=r.rowPositionUtils.sameRow(n,d);var l=r.navigationService.getCellByPosition({rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:e});if(l){r.markedCells.push(l);var s=l.getComp();s.addOrRemoveCssClass("ag-selection-fill-top",r.rowPositionUtils.sameRow(n,u)),s.addOrRemoveCssClass("ag-selection-fill-bottom",r.rowPositionUtils.sameRow(n,d)),o?(r.isLeft=!0,s.addOrRemoveCssClass("ag-selection-fill-left",e===c[0])):s.addOrRemoveCssClass("ag-selection-fill-right",e===t._.last(c))}n=r.cellNavigationService.getRowBelow(n)}while(!i)}))},n.prototype.reduceHorizontal=function(e,t){var n=this,o=this.columnModel.getAllDisplayedColumns(),r=o.indexOf(t.column),i=o.indexOf(e.column),l=o.slice(r,i),s=this.getRangeStartRow(),a=this.getRangeEndRow();l.forEach((function(e){var t=s,o=!1;do{o=n.rowPositionUtils.sameRow(t,a);var r=n.navigationService.getCellByPosition({rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:e});if(r)n.markedCells.push(r),r.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),f([t.Autowired("valueParserService")],n.prototype,"valueParserService",void 0),f([t.Autowired("valueFormatterService")],n.prototype,"valueFormatterService",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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);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(),r=t._.last(o);if(this.rangeFixed||(this.fixRangeStartEnd(r),this.rangeFixed=!0),this.endPosition={rowIndex:n.rowIndex,rowPinned:n.rowPinned,column:n.column},2===o.length&&o[0].type===t.CellRangeType.DIMENSION&&r.type===t.CellRangeType.VALUE)!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(r))&&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){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");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 r,i=arguments.length,l=i<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--)(r=e[s])&&(l=(i<3?r(l):i>3?r(t,n,l):r(t,n))||l);return i>3&&l&&Object.defineProperty(t,n,l),l},x=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),O={version:"30.1.0",moduleName:t.ModuleNames.RangeSelectionModule,beans:[c,x],agStackComponents:[{componentName:"AgFillHandle",componentClass:m},{componentName:"AgRangeHandle",componentClass:S}],dependantModules:[n.EnterpriseCoreModule]};exports.RangeSelectionModule=O;
{
"name": "@ag-grid-enterprise/range-selection",
"version": "30.0.6",
"version": "30.1.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -15,5 +15,4 @@ "main": "./dist/esm/es6/main.mjs",

"package": "node ../../module-build/rollup/build.js",
"build": "npm run build-cjs && npm run build-esm && npx gulp mjs-processing && npm run hash",
"build-prod": "npm run build-cjs-prod && npm run build-esm-prod && npx gulp mjs-processing && npm run hash",
"hash": "sh ../../scripts/hashDirectory.sh > .hash"
"build": "npm run build-cjs && npm run build-esm && npx gulp mjs-processing",
"build-prod": "npm run build-cjs-prod && npm run build-esm-prod && npx gulp mjs-processing"
},

@@ -51,4 +50,4 @@ "repository": {

"dependencies": {
"@ag-grid-community/core": "~30.0.6",
"@ag-grid-enterprise/core": "~30.0.6"
"@ag-grid-community/core": "~30.1.0",
"@ag-grid-enterprise/core": "~30.1.0"
},

@@ -55,0 +54,0 @@ "devDependencies": {

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc