@ag-grid-enterprise/range-selection
Advanced tools
Comparing version 32.2.0 to 32.2.1
@@ -372,4 +372,4 @@ var __defProp = Object.defineProperty; | ||
} | ||
if ((0, import_core._isUsingNewSelectionAPI)(gos) && (0, import_core._getSuppressMultiRanges)(gos) && this.cellRanges.length > 0) { | ||
return (0, import_core._warnOnce)("cannot add multiple ranges when `selection.suppressMultiRanges = true`"); | ||
if ((0, import_core._isUsingNewCellSelectionAPI)(gos) && (0, import_core._getSuppressMultiRanges)(gos) && this.cellRanges.length > 0) { | ||
return (0, import_core._warnOnce)("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`"); | ||
} | ||
@@ -1519,3 +1519,3 @@ const newRange = this.createCellRangeFromCellRangeParams(params); | ||
// enterprise-modules/range-selection/src/version.ts | ||
var VERSION = "32.2.0"; | ||
var VERSION = "32.2.1"; | ||
@@ -1522,0 +1522,0 @@ // enterprise-modules/range-selection/src/rangeSelectionModule.ts |
@@ -1,1 +0,1 @@ | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==s&&__defProp(e,n,{get:()=>t[n],enumerable:!(i=__getOwnPropDesc(t,n))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{RangeSelectionModule:()=>RangeSelectionModule}),module.exports=__toCommonJS(main_exports);var import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core");function getCellRanges(e){return e.rangeService?.getCellRanges()??null}function addCellRange(e,t){e.rangeService?.addCellRange(t)}function clearRangeSelection(e){e.rangeService?.removeAllCellRanges()}var import_core=require("@ag-grid-community/core"),RangeService=class extends import_core.BeanStub{constructor(){super(...arguments),this.beanName="rangeService",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragService=e.dragService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsService.whenReady(this,i=>{const n=i.gridBodyCtrl;this.autoScrollService=new import_core.AutoScrollService({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>n.getScrollFeature().getVScrollPosition().top,setVerticalPosition:o=>n.getScrollFeature().setVerticalScrollPosition(o),getHorizontalPosition:()=>n.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:o=>n.getScrollFeature().setHorizontalScrollPosition(o),shouldSkipVerticalScroll:()=>!(0,import_core._isDomLayout)(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!n.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleColsService.getAllCols();this.cellRanges.forEach(s=>{const i=s.columns;s.columns=s.columns.filter(o=>o.isVisible()&&e.indexOf(o)!==-1),!(0,import_core._areEqual)(i,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=(0,import_core._last)(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleColsService.getAllCols(),i=t.map(n=>s.indexOf(n)).sort((n,o)=>n-o);return(0,import_core._last)(i)-i[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!(0,import_core._isCellSelectionEnabled)(this.gos))return;const s=this.calculateColumnsBetween(e.column,e.column);if(!s)return;((0,import_core._getSuppressMultiRanges)(this.gos)||!t||(0,import_core._missing)(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},o={startRow:n,endRow:n,columns:s,startColumn:e.column};this.cellRanges.push(o),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=(0,import_core._last)(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,s=!1){const i=t.column,n=this.calculateColumnsBetween(e.startColumn,i);!n||this.isLastCellOfRange(e,t)||(e.columns=n,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},s||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:s}=e,i=(r,c)=>{const d=e.columns.filter(g=>g!==r);r?(e.startColumn=r,e.columns=c?[r,...d]:[...d,r]):e.columns=d},{left:n,right:o}=this.getRangeEdgeColumns(e);if(t===s[0]&&t!==n){i(n,!0);return}if(t===(0,import_core._last)(s)&&t===o){i(o,!1);return}}getRangeEdgeColumns(e){const t=this.visibleColsService.getAllCols(),s=e.columns.map(i=>t.indexOf(i)).filter(i=>i>-1).sort((i,n)=>i-n);return{left:t[s[0]],right:t[(0,import_core._last)(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,i=(0,import_core._last)(this.cellRanges),n=this.newestRangeStartCell,o=i.columns[0],l=(0,import_core._last)(i.columns),a=i.endRow.rowIndex,r=i.endRow.rowPinned,d={column:n.column===o?l:o,rowIndex:a,rowPinned:r},g=this.cellNavigationService.getNextCellToFocus(t,d,s);if(g)return this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:g.rowIndex,rowEndPinned:g.rowPinned,columnStart:n.column,columnEnd:g.column}),g}setCellRange(e){(0,import_core._isCellSelectionEnabled)(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){(0,import_core._shallowCompare)(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(t=>{t.columns&&t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),this.cellRanges.push(t)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:s="rangeService",dispatchWrapperEvents:i,wrapperEventSource:n="deleteKey"}=e;i&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteStart",source:n})),t||(t=this.cellRanges),t.forEach(o=>{this.forEachRowInRange(o,l=>{const a=this.rowPositionUtils.getRowNode(l);if(a)for(let r=0;r<o.columns.length;r++){const c=this.columnModel.getCol(o.columns[r]);if(!c||!c.isCellEditable(a))continue;const d=this.valueService.getDeleteValue(c,a);a.setDataValue(c,d,s)}})}),i&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let s,i=!1;if(e.columns)s=e.columns.map(l=>this.columnModel.getCol(l)).filter(l=>l);else{const l=this.columnModel.getCol(e.columnStart),a=this.columnModel.getCol(e.columnEnd);if(!l||!a)return;s=this.calculateColumnsBetween(l,a),s&&s.length&&(i=s[0]!==l)}if(!s||!t&&s.length===0)return;const n=e.rowStartIndex!=null?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,o=e.rowEndIndex!=null?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0;return{startRow:n,endRow:o,columns:s,startColumn:i?(0,import_core._last)(s):s[0]}}addCellRange(e){const t=this.gos;if(!(0,import_core._isCellSelectionEnabled)(t))return;if((0,import_core._isUsingNewSelectionAPI)(t)&&(0,import_core._getSuppressMultiRanges)(t)&&this.cellRanges.length>0)return(0,import_core._warnOnce)("cannot add multiple ranges when `selection.suppressMultiRanges = true`");const s=this.createCellRangeFromCellRangeParams(e);s&&(s.startRow&&this.setNewestRangeStartCell({rowIndex:s.startRow.rowIndex,rowPinned:s.startRow.rowPinned,column:s.startColumn}),this.cellRanges.push(s),this.dispatchChangedEvent(!1,!0,s.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(i=>{this.forEachRowInRange(i,n=>{const o=`${n.rowPinned||"normal"}_${n.rowIndex}`,l=e.get(o),a=i.columns.map(r=>r.getId());if(l){const r=a.filter(c=>l.indexOf(c)===-1);l.push(...r)}else e.set(o,a)})});let s;for(const i of e.values()){const n=i.sort().join();if(s===void 0){s=n;continue}if(s!==n)return!1}return!0}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),i=this.getRangeEndRow(e);let n=s;for(;n&&(t(n),!this.rowPositionUtils.sameRow(n,i));)n=this.cellNavigationService.getRowBelow(n)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns!==null&&(0,import_core._includes)(t.columns,e.column),i=this.isRowInRange(e.rowIndex,e.rowPinned,t);return s&&i}isLastCellOfRange(e,t){const{startRow:s,endRow:i}=e,n=this.rowPositionUtils.before(s,i)?i:s,o=t.rowIndex===n.rowIndex&&t.rowPinned===n.rowPinned,l=e.columns[0],a=(0,import_core._last)(e.columns),r=e.startColumn===l?a:l;return t.column===r&&o}isBottomRightCell(e,t){const s=this.visibleColsService.getAllCols(),i=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:n,endRow:o}=e,l=this.rowPositionUtils.before(n,o)?o:n,a=s.indexOf(t.column)===(0,import_core._last)(i),r=t.rowIndex===l.rowIndex&&(0,import_core._makeNull)(t.rowPinned)===(0,import_core._makeNull)(l.rowPinned);return a&&r}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,s){const i=this.getRangeStartRow(s),n=this.getRangeEndRow(s),o={rowIndex:e,rowPinned:t||null},l=o.rowIndex===i.rowIndex&&o.rowPinned==i.rowPinned,a=o.rowIndex===n.rowIndex&&o.rowPinned==n.rowPinned;if(l||a)return!0;const r=!this.rowPositionUtils.before(o,i),c=this.rowPositionUtils.before(o,n);return r&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!(0,import_core._isCellSelectionEnabled)(this.gos))return;const{ctrlKey:t,metaKey:s,shiftKey:i}=e,n=t||s,l=!(0,import_core._getSuppressMultiRanges)(this.gos)?n:!1,a=i&&(0,import_core._existsAndNotEmpty)(this.cellRanges);!l&&(!a||(0,import_core._exists)((0,import_core._last)(this.cellRanges).type))&&this.removeAllCellRanges(!0);const r=this.dragService.getStartTarget();if(r&&this.updateValuesOnMove(r),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=l&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=(0,import_core._last)(this.cellRanges);else{const c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging||(0,import_core._getSuppressMultiRanges)(this.gos)||this.isEmpty())return;const t=this.rowPositionUtils,s=(0,import_core._last)(this.cellRanges),i=this.getRangeStartRow(s),n=this.getRangeEndRow(s),o=[];this.cellRanges.slice(0,-1).forEach(l=>{const a=this.getRangeStartRow(l),r=this.getRangeEndRow(l),c=l.columns,d=c.filter(h=>s.columns.indexOf(h)===-1);if(d.length===c.length){o.push(l);return}if(t.before(n,a)||t.before(r,i)){o.push(l);return}const g=o.length;if(t.before(a,i)){const h={columns:[...c],startColumn:s.startColumn,startRow:{...a},endRow:this.cellNavigationService.getRowAbove(i)};o.push(h)}if(d.length>0){const h={columns:d,startColumn:(0,import_core._includes)(d,s.startColumn)?s.startColumn:d[0],startRow:this.rowMax([{...i},{...a}]),endRow:this.rowMin([{...n},{...r}])};o.push(h)}t.before(n,r)&&o.push({columns:[...c],startColumn:s.startColumn,startRow:this.cellNavigationService.getRowBelow(n),endRow:{...r}}),o.length-g===1&&(o[o.length-1].id=l.id)}),this.cellRanges=o,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(t,s))&&(t=s)}),t}rowMin(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(s,t))&&(t=s)}),t}updateValuesOnMove(e){const t=(0,import_core._getCtrlForEventTarget)(this.gos,e,import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL),s=t?.getCellPosition();if(this.cellHasChanged=!1,!(!s||this.lastCellHovered&&this.cellPositionUtils.equals(s,this.lastCellHovered))){if(t?.isEditing()){this.dragService.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s}}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,s=o=>t&&t.rowPinned===o&&this.newestRangeStartCell.rowPinned===o,i=s("top")||s("bottom");if(this.autoScrollService.check(e,i),!this.cellHasChanged)return;const n=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);n&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=n,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,s){this.eventService.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:s}),this.eventService.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:s})}calculateColumnsBetween(e,t){const s=this.visibleColsService.getAllCols(),i=e===t,n=s.indexOf(e),o=d=>(0,import_core._warnOnce)(`column ${d.getId()} is not visible`);if(n<0){o(e);return}const l=i?n:s.indexOf(t);if(l<0){o(t);return}if(i)return[e];const a=Math.min(n,l),r=a===n?l:n,c=[];for(let d=a;d<=r;d++)c.push(s[d]);return c}},import_core5=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),AbstractSelectionHandle=class extends import_core2.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService,this.mouseEventService=e.mouseEventService,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService}postConstruct(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===import_core2.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),s=this.getGui(),i=(0,import_core2._last)(this.rangeService.getCellRanges()),n=i.startRow,o=i.endRow;if(n&&o&&(this.rowPositionUtils.before(o,n)?(this.setRangeStartRow(o),this.setRangeEndRow(n)):(this.setRangeStartRow(n),this.setRangeEndRow(o))),t!==e||!(0,import_core2._isVisible)(s)){this.setCellCtrl(e);const l=e.getComp().getParentOfValue();l&&l.appendChild(s)}this.setCellRange(i)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){(0,import_core2._setDisplayed)(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function findLineByLeastSquares(e){const t=e.length;let s=0;if(t<=1)return e;for(let g=0;g<e.length;g++){const h=e[g],u=h.toString().split("e-");if(u.length>1){s=Math.max(s,parseInt(u[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let i=0,n=0,o=0,l=0,a=0;for(let g=0;g<t;g++)a=e[g],i+=g,n+=a,l+=g*g,o+=g*a;const r=(t*o-i*n)/(t*l-i*i),c=n/t-r*i/t,d=[];for(let g=0;g<=t;g++)d.push(parseFloat((g*r+c).toFixed(s)));return d}var AgFillHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-fill-handle"></div>'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=import_core3.SelectionHandleType.FILL}wireBeans(e){super.wireBeans(e),this.valueService=e.valueService,this.navigationService=e.navigationService,this.cellNavigationService=e.cellNavigationService,this.visibleColsService=e.visibleColsService}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:s}=this.initialXY,{x:i,y:n}=this.mouseEventService.getNormalisedPosition(e),o=Math.abs(t-i),l=Math.abs(s-n),a=this.getFillHandleDirection();let r;a==="xy"?r=o>l?"x":"y":r=a,r!==this.dragAxis&&(this.dragAxis=r,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const s=this.getCellCtrl();if(!s)return;this.initialPosition=s.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",s=this.getCellRange(),i=s.columns.length,n=this.getRangeStartRow(),o=this.getRangeEndRow();let l;if(!this.isUp&&!this.isLeft)l=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,columnStart:s.columns[0],rowEndIndex:t?o.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?o.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[i-1]});else{const a=t?n:this.lastCellMarked;l=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:a.rowIndex,rowStartPinned:a.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:o.rowIndex,rowEndPinned:o.rowPinned,columnEnd:s.columns[i-1]})}l&&(this.eventService.dispatchEvent({type:"fillStart"}),this.handleValueChanged(s,l,e),this.rangeService.setCellRanges([l]),this.eventService.dispatchEvent({type:"fillEnd",initialRange:s,finalRange:l}))}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}getFillHandleDirection(){const e=(0,import_core3._getFillHandle)(this.gos)?.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?((0,import_core3._warnOnce)("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}handleValueChanged(e,t,s){const i=this.rangeService.getRangeEndRow(e),n=this.rangeService.getRangeStartRow(e),o=this.rangeService.getRangeEndRow(t),l=this.rangeService.getRangeStartRow(t),a=this.dragAxis==="y";if(this.isReduce&&!(0,import_core3._getFillHandle)(this.gos)?.suppressClearOnFillReduction){const m=a?e.columns:e.columns.filter(R=>t.columns.indexOf(R)<0),f=a?this.cellNavigationService.getRowBelow(o):l;f&&this.clearCellsInRange(f,i,m);return}const r=[],c=[],d=[],g=[];let h=!0,u=0;const w=()=>{r.length=0,c.length=0,d.length=0,g.length=0,u=0},v=(m,f)=>{let R=this.isUp?i:n,x=!1;for(a&&(h=!0,w());!x&&R;){const C=this.rowPositionUtils.getRowNode(R);if(!C)break;a&&m?p(r,m,C,()=>!this.rowPositionUtils.sameRow(R,this.isUp?n:i)):f&&(h=!0,w(),f.forEach(S=>p(r,S,C,()=>S!==(this.isLeft?e.columns[0]:(0,import_core3._last)(e.columns))))),x=this.rowPositionUtils.sameRow(R,this.isUp?l:o),R=this.isUp?this.cellNavigationService.getRowAbove(R):this.cellNavigationService.getRowBelow(R)}},p=(m,f,R,x)=>{let C,S=!1;if(h)C=this.valueService.getValue(f,R),c.push(C),d.push(this.valueService.getValue(f,R,void 0,!0)),g.push(this.valueService.formatValue(f,R,C)),h=x();else{const{value:I,fromUserFunction:E,sourceCol:P,sourceRowNode:_}=this.processValues({event:s,values:m,initialValues:c,initialNonAggregatedValues:d,initialFormattedValues:g,col:f,rowNode:R,idx:u++});if(C=I,f.isCellEditable(R)){const y=this.valueService.getValue(f,R);E||(P&&P.getColDef()?.useValueFormatterForExport!==!1&&(C=this.valueService.formatValue(P,_,C)??C),f.getColDef().useValueParserForImport!==!1&&(C=this.valueService.parseValue(f,R,P?C:(0,import_core3._toStringOrNull)(C),y))),!E||y!==C?R.setDataValue(f,C,"rangeService"):S=!0}}S||m.push({value:C,column:f,rowNode:R})};if(a)e.columns.forEach(m=>{v(m)});else{const m=this.isLeft?[...t.columns].reverse():t.columns;v(void 0,m)}}clearCellsInRange(e,t,s){const i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[i]})}processValues(e){const{event:t,values:s,initialValues:i,initialNonAggregatedValues:n,initialFormattedValues:o,col:l,rowNode:a,idx:r}=e,c=(0,import_core3._getFillHandle)(this.gos)?.setFillValue,d=this.dragAxis==="y";let g;if(d?g=this.isUp?"up":"down":g=this.isLeft?"left":"right",c){const u=this.gos.addGridCommonParams({event:t,values:s.map(({value:v})=>v),initialValues:i,initialNonAggregatedValues:n,initialFormattedValues:o,currentIndex:r,currentCellValue:this.valueService.getValue(l,a),direction:g,column:l,rowNode:a}),w=c(u);if(w!==!1)return{value:w,fromUserFunction:!0}}const h=!s.some(({value:u})=>{const w=parseFloat(u);return isNaN(w)||w.toString()!==u.toString()});if(t.altKey||!h){if(h&&i.length===1){const p=this.isUp||this.isLeft?-1:1;return{value:parseFloat((0,import_core3._last)(s).value)+1*p,fromUserFunction:!1}}const{value:u,column:w,rowNode:v}=s[r%s.length];return{value:u,fromUserFunction:!1,sourceCol:w,sourceRowNode:v}}return{value:(0,import_core3._last)(findLineByLeastSquares(s.map(({value:u})=>Number(u)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(t,e))return;const s=this.rowPositionUtils.before(t,e),i=this.getRangeStartRow(),n=this.getRangeEndRow();s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=n.rowPinned&&t.rowPinned==n.rowPinned&&t.rowIndex<=n.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,i=t.column;if(s===i)return;const n=this.visibleColsService.getAllCols(),o=n.indexOf(s),l=n.indexOf(i);l<=o&&l>=n.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,l<o),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,s){const{navigationService:i,rangeService:n}=this;let o=e;do{const l=this.getCellRange(),a=l.columns.length;for(let r=0;r<a;r++){const c=l.columns[r],g={...{rowIndex:o.rowIndex,rowPinned:o.rowPinned},column:c},h=n.isCellInSpecificRange(g,l),u=this.rowPositionUtils.sameRow(o,e);if(s&&(this.isUp=!0),!u){const w=i.getCellByPosition(g);if(w){this.markedCells.push(w);const v=w.getComp();h||(v.addOrRemoveCssClass("ag-selection-fill-left",r===0),v.addOrRemoveCssClass("ag-selection-fill-right",r===a-1)),v.addOrRemoveCssClass(s?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(o,t))}}}if(this.rowPositionUtils.sameRow(o,t))break}while(o=s?this.cellNavigationService.getRowAbove(o):this.cellNavigationService.getRowBelow(o))}reduceVertical(e,t){let s=e;do{const i=this.getCellRange(),n=i.columns.length,o=this.rowPositionUtils.sameRow(s,t);for(let l=0;l<n;l++){const r={...{rowIndex:s.rowIndex,rowPinned:s.rowPinned},column:i.columns[l]},c=this.navigationService.getCellByPosition(r);c&&(this.markedCells.push(c),c.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(s,t)))}if(o)break}while(s=this.cellNavigationService.getRowAbove(s))}extendHorizontal(e,t,s){const i=this.visibleColsService.getAllCols(),n=i.indexOf(s?t.column:e.column),o=i.indexOf(s?this.getCellRange().columns[0]:t.column),l=s?0:1,a=i.slice(n+l,o+l),r=this.getRangeStartRow(),c=this.getRangeEndRow();a.forEach(d=>{let g=r,h=!1;do{h=this.rowPositionUtils.sameRow(g,c);const u=this.navigationService.getCellByPosition({rowIndex:g.rowIndex,rowPinned:g.rowPinned,column:d});if(u){this.markedCells.push(u);const w=u.getComp();w.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(g,r)),w.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(g,c)),s?(this.isLeft=!0,w.addOrRemoveCssClass("ag-selection-fill-left",d===a[0])):w.addOrRemoveCssClass("ag-selection-fill-right",d===(0,import_core3._last)(a))}g=this.cellNavigationService.getRowBelow(g)}while(!h)})}reduceHorizontal(e,t){const s=this.visibleColsService.getAllCols(),i=s.indexOf(t.column),n=s.indexOf(e.column),o=s.slice(i,n),l=this.getRangeStartRow(),a=this.getRangeEndRow();o.forEach(r=>{let c=l,d=!1;do{d=this.rowPositionUtils.sameRow(c,a);const g=this.navigationService.getCellByPosition({rowIndex:c.rowIndex,rowPinned:c.rowPinned,column:r});g&&(this.markedCells.push(g),g.getComp().addOrRemoveCssClass("ag-selection-fill-right",r===o[0])),c=this.cellNavigationService.getRowBelow(c)}while(!d)})}refresh(e){const t=this.rangeService.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},import_core4=require("@ag-grid-community/core"),AgRangeHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-range-handle"></div>'),this.type=import_core4.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const s=this.rangeService.getCellRanges(),i=(0,import_core4._last)(s);this.rangeFixed||(this.fixRangeStartEnd(i),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},s.length===2&&s[0].type===import_core4.CellRangeType.DIMENSION&&i.type===import_core4.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(i))&&this.rangeService.updateRangeEnd(s[0],{...this.endPosition,column:s[0].columns[0]},!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=(0,import_core4._last)(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),s=this.rangeService.getRangeEndRow(e),i=e.columns[0];e.startRow=t,e.endRow=s,e.startColumn=i}},SelectionHandleFactory=class extends import_core5.BeanStub{constructor(){super(...arguments),this.beanName="selectionHandleFactory"}createSelectionHandle(e){return this.createBean(e===import_core5.SelectionHandleType.RANGE?new AgRangeHandle:new AgFillHandle)}},VERSION="32.2.0",RangeSelectionCoreModule=(0,import_core6._defineModule)({version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-core`,beans:[RangeService,SelectionHandleFactory],dependantModules:[import_core7.EnterpriseCoreModule]}),RangeSelectionApiModule=(0,import_core6._defineModule)({version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-api`,apiFunctions:{getCellRanges,addCellRange,clearRangeSelection,clearCellSelection:clearRangeSelection},dependantModules:[RangeSelectionCoreModule]}),RangeSelectionModule=(0,import_core6._defineModule)({version:VERSION,moduleName:import_core6.ModuleNames.RangeSelectionModule,dependantModules:[RangeSelectionCoreModule,RangeSelectionApiModule]}); | ||
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var s in t)__defProp(e,s,{get:t[s],enumerable:!0})},__copyProps=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of __getOwnPropNames(t))!__hasOwnProp.call(e,n)&&n!==s&&__defProp(e,n,{get:()=>t[n],enumerable:!(i=__getOwnPropDesc(t,n))||i.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{RangeSelectionModule:()=>RangeSelectionModule}),module.exports=__toCommonJS(main_exports);var import_core6=require("@ag-grid-community/core"),import_core7=require("@ag-grid-enterprise/core");function getCellRanges(e){return e.rangeService?.getCellRanges()??null}function addCellRange(e,t){e.rangeService?.addCellRange(t)}function clearRangeSelection(e){e.rangeService?.removeAllCellRanges()}var import_core=require("@ag-grid-community/core"),RangeService=class extends import_core.BeanStub{constructor(){super(...arguments),this.beanName="rangeService",this.cellRanges=[],this.bodyScrollListener=this.onBodyScroll.bind(this),this.dragging=!1,this.intersectionRange=!1}wireBeans(e){this.rowModel=e.rowModel,this.dragService=e.dragService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService}postConstruct(){const e=this.onColumnsChanged.bind(this),t=()=>this.removeAllCellRanges(),s=this.refreshLastRangeStart.bind(this);this.addManagedEventListeners({newColumnsLoaded:e,columnVisible:e,columnValueChanged:e,columnPivotModeChanged:t,columnRowGroupChanged:t,columnPivotChanged:t,columnGroupOpened:s,columnMoved:s,columnPinned:s}),this.ctrlsService.whenReady(this,i=>{const n=i.gridBodyCtrl;this.autoScrollService=new import_core.AutoScrollService({scrollContainer:n.getBodyViewportElement(),scrollAxis:"xy",getVerticalPosition:()=>n.getScrollFeature().getVScrollPosition().top,setVerticalPosition:l=>n.getScrollFeature().setVerticalScrollPosition(l),getHorizontalPosition:()=>n.getScrollFeature().getHScrollPosition().left,setHorizontalPosition:l=>n.getScrollFeature().setHorizontalScrollPosition(l),shouldSkipVerticalScroll:()=>!(0,import_core._isDomLayout)(this.gos,"normal"),shouldSkipHorizontalScroll:()=>!n.getScrollFeature().isHorizontalScrollShowing()})})}onColumnsChanged(){this.refreshLastRangeStart();const e=this.visibleColsService.getAllCols();this.cellRanges.forEach(s=>{const i=s.columns;s.columns=s.columns.filter(l=>l.isVisible()&&e.indexOf(l)!==-1),!(0,import_core._areEqual)(i,s.columns)&&this.dispatchChangedEvent(!1,!0,s.id)});const t=this.cellRanges.length;this.cellRanges=this.cellRanges.filter(s=>s.columns.length>0),t>this.cellRanges.length&&this.dispatchChangedEvent(!1,!0)}refreshLastRangeStart(){const e=(0,import_core._last)(this.cellRanges);e&&this.refreshRangeStart(e)}isContiguousRange(e){const t=e.columns;if(!t.length)return!1;const s=this.visibleColsService.getAllCols(),i=t.map(n=>s.indexOf(n)).sort((n,l)=>n-l);return(0,import_core._last)(i)-i[0]+1===t.length}getRangeStartRow(e){return e.startRow&&e.endRow?this.rowPositionUtils.before(e.startRow,e.endRow)?e.startRow:e.endRow:{rowIndex:0,rowPinned:this.pinnedRowModel.getPinnedTopRowCount()>0?"top":null}}getRangeEndRow(e){if(e.startRow&&e.endRow)return this.rowPositionUtils.before(e.startRow,e.endRow)?e.endRow:e.startRow;const t=this.pinnedRowModel.getPinnedBottomRowCount();return t>0?{rowIndex:t-1,rowPinned:"bottom"}:{rowIndex:this.rowModel.getRowCount()-1,rowPinned:null}}setRangeToCell(e,t=!1){if(!(0,import_core._isCellSelectionEnabled)(this.gos))return;const s=this.calculateColumnsBetween(e.column,e.column);if(!s)return;((0,import_core._getSuppressMultiRanges)(this.gos)||!t||(0,import_core._missing)(this.cellRanges))&&this.removeAllCellRanges(!0);const n={rowIndex:e.rowIndex,rowPinned:e.rowPinned},l={startRow:n,endRow:n,columns:s,startColumn:e.column};this.cellRanges.push(l),this.setNewestRangeStartCell(e),this.onDragStop(),this.dispatchChangedEvent(!0,!0)}extendLatestRangeToCell(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=(0,import_core._last)(this.cellRanges);this.updateRangeEnd(t,e)}updateRangeEnd(e,t,s=!1){const i=t.column,n=this.calculateColumnsBetween(e.startColumn,i);!n||this.isLastCellOfRange(e,t)||(e.columns=n,e.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},s||this.dispatchChangedEvent(!0,!0,e.id))}refreshRangeStart(e){const{startColumn:t,columns:s}=e,i=(r,c)=>{const d=e.columns.filter(g=>g!==r);r?(e.startColumn=r,e.columns=c?[r,...d]:[...d,r]):e.columns=d},{left:n,right:l}=this.getRangeEdgeColumns(e);if(t===s[0]&&t!==n){i(n,!0);return}if(t===(0,import_core._last)(s)&&t===l){i(l,!1);return}}getRangeEdgeColumns(e){const t=this.visibleColsService.getAllCols(),s=e.columns.map(i=>t.indexOf(i)).filter(i=>i>-1).sort((i,n)=>i-n);return{left:t[s[0]],right:t[(0,import_core._last)(s)]}}extendLatestRangeInDirection(e){if(this.isEmpty()||!this.newestRangeStartCell)return;const t=e.key,s=e.ctrlKey||e.metaKey,i=(0,import_core._last)(this.cellRanges),n=this.newestRangeStartCell,l=i.columns[0],o=(0,import_core._last)(i.columns),a=i.endRow.rowIndex,r=i.endRow.rowPinned,d={column:n.column===l?o:l,rowIndex:a,rowPinned:r},g=this.cellNavigationService.getNextCellToFocus(t,d,s);if(g)return this.setCellRange({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,rowEndIndex:g.rowIndex,rowEndPinned:g.rowPinned,columnStart:n.column,columnEnd:g.column}),g}setCellRange(e){(0,import_core._isCellSelectionEnabled)(this.gos)&&(this.removeAllCellRanges(!0),this.addCellRange(e))}setCellRanges(e){(0,import_core._shallowCompare)(this.cellRanges,e)||(this.removeAllCellRanges(!0),e.forEach(t=>{t.columns&&t.startRow&&this.setNewestRangeStartCell({rowIndex:t.startRow.rowIndex,rowPinned:t.startRow.rowPinned,column:t.columns[0]}),this.cellRanges.push(t)}),this.dispatchChangedEvent(!1,!0))}setNewestRangeStartCell(e){this.newestRangeStartCell=e}clearCellRangeCellValues(e){let{cellRanges:t}=e;const{cellEventSource:s="rangeService",dispatchWrapperEvents:i,wrapperEventSource:n="deleteKey"}=e;i&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteStart",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteStart",source:n})),t||(t=this.cellRanges),t.forEach(l=>{this.forEachRowInRange(l,o=>{const a=this.rowPositionUtils.getRowNode(o);if(a)for(let r=0;r<l.columns.length;r++){const c=this.columnModel.getCol(l.columns[r]);if(!c||!c.isCellEditable(a))continue;const d=this.valueService.getDeleteValue(c,a);a.setDataValue(c,d,s)}})}),i&&(this.eventService.dispatchEvent({type:"cellSelectionDeleteEnd",source:n}),this.eventService.dispatchEvent({type:"rangeDeleteEnd",source:n}))}createCellRangeFromCellRangeParams(e){return this.createPartialCellRangeFromRangeParams(e,!1)}createPartialCellRangeFromRangeParams(e,t){let s,i=!1;if(e.columns)s=e.columns.map(o=>this.columnModel.getCol(o)).filter(o=>o);else{const o=this.columnModel.getCol(e.columnStart),a=this.columnModel.getCol(e.columnEnd);if(!o||!a)return;s=this.calculateColumnsBetween(o,a),s&&s.length&&(i=s[0]!==o)}if(!s||!t&&s.length===0)return;const n=e.rowStartIndex!=null?{rowIndex:e.rowStartIndex,rowPinned:e.rowStartPinned||null}:void 0,l=e.rowEndIndex!=null?{rowIndex:e.rowEndIndex,rowPinned:e.rowEndPinned||null}:void 0;return{startRow:n,endRow:l,columns:s,startColumn:i?(0,import_core._last)(s):s[0]}}addCellRange(e){const t=this.gos;if(!(0,import_core._isCellSelectionEnabled)(t))return;if((0,import_core._isUsingNewCellSelectionAPI)(t)&&(0,import_core._getSuppressMultiRanges)(t)&&this.cellRanges.length>0)return(0,import_core._warnOnce)("cannot add multiple ranges when `cellSelection.suppressMultiRanges = true`");const s=this.createCellRangeFromCellRangeParams(e);s&&(s.startRow&&this.setNewestRangeStartCell({rowIndex:s.startRow.rowIndex,rowPinned:s.startRow.rowPinned,column:s.startColumn}),this.cellRanges.push(s),this.dispatchChangedEvent(!1,!0,s.id))}getCellRanges(){return this.cellRanges}isEmpty(){return this.cellRanges.length===0}isMoreThanOneCell(){const e=this.cellRanges.length;if(e===0)return!1;if(e>1)return!0;const t=this.cellRanges[0],s=this.getRangeStartRow(t),i=this.getRangeEndRow(t);return s.rowPinned!==i.rowPinned||s.rowIndex!==i.rowIndex||t.columns.length!==1}areAllRangesAbleToMerge(){const e=new Map;if(this.cellRanges.length<=1)return!0;this.cellRanges.forEach(i=>{this.forEachRowInRange(i,n=>{const l=`${n.rowPinned||"normal"}_${n.rowIndex}`,o=e.get(l),a=i.columns.map(r=>r.getId());if(o){const r=a.filter(c=>o.indexOf(c)===-1);o.push(...r)}else e.set(l,a)})});let s;for(const i of e.values()){const n=i.sort().join();if(s===void 0){s=n;continue}if(s!==n)return!1}return!0}forEachRowInRange(e,t){const s=this.getRangeStartRow(e),i=this.getRangeEndRow(e);let n=s;for(;n&&(t(n),!this.rowPositionUtils.sameRow(n,i));)n=this.cellNavigationService.getRowBelow(n)}removeAllCellRanges(e){this.isEmpty()||(this.onDragStop(),this.cellRanges.length=0,e||this.dispatchChangedEvent(!1,!0))}onBodyScroll(){this.dragging&&this.lastMouseEvent&&this.onDragging(this.lastMouseEvent)}isCellInAnyRange(e){return this.getCellRangeCount(e)>0}isCellInSpecificRange(e,t){const s=t.columns!==null&&(0,import_core._includes)(t.columns,e.column),i=this.isRowInRange(e.rowIndex,e.rowPinned,t);return s&&i}isLastCellOfRange(e,t){const{startRow:s,endRow:i}=e,n=this.rowPositionUtils.before(s,i)?i:s,l=t.rowIndex===n.rowIndex&&t.rowPinned===n.rowPinned,o=e.columns[0],a=(0,import_core._last)(e.columns),r=e.startColumn===o?a:o;return t.column===r&&l}isBottomRightCell(e,t){const s=this.visibleColsService.getAllCols(),i=e.columns.map(c=>s.indexOf(c)).sort((c,d)=>c-d),{startRow:n,endRow:l}=e,o=this.rowPositionUtils.before(n,l)?l:n,a=s.indexOf(t.column)===(0,import_core._last)(i),r=t.rowIndex===o.rowIndex&&(0,import_core._makeNull)(t.rowPinned)===(0,import_core._makeNull)(o.rowPinned);return a&&r}getCellRangeCount(e){return this.isEmpty()?0:this.cellRanges.filter(t=>this.isCellInSpecificRange(e,t)).length}isRowInRange(e,t,s){const i=this.getRangeStartRow(s),n=this.getRangeEndRow(s),l={rowIndex:e,rowPinned:t||null},o=l.rowIndex===i.rowIndex&&l.rowPinned==i.rowPinned,a=l.rowIndex===n.rowIndex&&l.rowPinned==n.rowPinned;if(o||a)return!0;const r=!this.rowPositionUtils.before(l,i),c=this.rowPositionUtils.before(l,n);return r&&c}getDraggingRange(){return this.draggingRange}onDragStart(e){if(!(0,import_core._isCellSelectionEnabled)(this.gos))return;const{ctrlKey:t,metaKey:s,shiftKey:i}=e,n=t||s,o=!(0,import_core._getSuppressMultiRanges)(this.gos)?n:!1,a=i&&(0,import_core._existsAndNotEmpty)(this.cellRanges);!o&&(!a||(0,import_core._exists)((0,import_core._last)(this.cellRanges).type))&&this.removeAllCellRanges(!0);const r=this.dragService.getStartTarget();if(r&&this.updateValuesOnMove(r),!!this.lastCellHovered){if(this.dragging=!0,this.lastMouseEvent=e,this.intersectionRange=o&&this.getCellRangeCount(this.lastCellHovered)>1,a||this.setNewestRangeStartCell(this.lastCellHovered),this.cellRanges.length>0)this.draggingRange=(0,import_core._last)(this.cellRanges);else{const c={rowIndex:this.lastCellHovered.rowIndex,rowPinned:this.lastCellHovered.rowPinned};this.draggingRange={startRow:c,endRow:c,columns:[this.lastCellHovered.column],startColumn:this.newestRangeStartCell.column},this.cellRanges.push(this.draggingRange)}this.ctrlsService.getGridBodyCtrl().addScrollEventListener(this.bodyScrollListener),this.dispatchChangedEvent(!0,!1,this.draggingRange.id)}}intersectLastRange(e){if(e&&this.dragging||(0,import_core._getSuppressMultiRanges)(this.gos)||this.isEmpty())return;const t=this.rowPositionUtils,s=(0,import_core._last)(this.cellRanges),i=this.getRangeStartRow(s),n=this.getRangeEndRow(s),l=[];this.cellRanges.slice(0,-1).forEach(o=>{const a=this.getRangeStartRow(o),r=this.getRangeEndRow(o),c=o.columns,d=c.filter(h=>s.columns.indexOf(h)===-1);if(d.length===c.length){l.push(o);return}if(t.before(n,a)||t.before(r,i)){l.push(o);return}const g=l.length;if(t.before(a,i)){const h={columns:[...c],startColumn:s.startColumn,startRow:{...a},endRow:this.cellNavigationService.getRowAbove(i)};l.push(h)}if(d.length>0){const h={columns:d,startColumn:(0,import_core._includes)(d,s.startColumn)?s.startColumn:d[0],startRow:this.rowMax([{...i},{...a}]),endRow:this.rowMin([{...n},{...r}])};l.push(h)}t.before(n,r)&&l.push({columns:[...c],startColumn:s.startColumn,startRow:this.cellNavigationService.getRowBelow(n),endRow:{...r}}),l.length-g===1&&(l[l.length-1].id=o.id)}),this.cellRanges=l,e&&this.dispatchChangedEvent(!1,!0)}rowMax(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(t,s))&&(t=s)}),t}rowMin(e){let t;return e.forEach(s=>{(t===void 0||this.rowPositionUtils.before(s,t))&&(t=s)}),t}updateValuesOnMove(e){const t=(0,import_core._getCtrlForEventTarget)(this.gos,e,import_core.CellCtrl.DOM_DATA_KEY_CELL_CTRL),s=t?.getCellPosition();if(this.cellHasChanged=!1,!(!s||this.lastCellHovered&&this.cellPositionUtils.equals(s,this.lastCellHovered))){if(t?.isEditing()){this.dragService.cancelDrag(e);return}this.lastCellHovered&&(this.cellHasChanged=!0),this.lastCellHovered=s}}onDragging(e){if(!this.dragging||!e)return;this.updateValuesOnMove(e.target),this.lastMouseEvent=e;const t=this.lastCellHovered,s=l=>t&&t.rowPinned===l&&this.newestRangeStartCell.rowPinned===l,i=s("top")||s("bottom");if(this.autoScrollService.check(e,i),!this.cellHasChanged)return;const n=this.calculateColumnsBetween(this.newestRangeStartCell.column,t.column);n&&(this.draggingRange.endRow={rowIndex:t.rowIndex,rowPinned:t.rowPinned},this.draggingRange.columns=n,this.dispatchChangedEvent(!1,!1,this.draggingRange.id))}onDragStop(){if(!this.dragging)return;const{id:e}=this.draggingRange;this.autoScrollService.ensureCleared(),this.ctrlsService.getGridBodyCtrl().removeScrollEventListener(this.bodyScrollListener),this.lastMouseEvent=null,this.dragging=!1,this.draggingRange=void 0,this.lastCellHovered=void 0,this.intersectionRange&&(this.intersectionRange=!1,this.intersectLastRange()),this.dispatchChangedEvent(!1,!0,e)}dispatchChangedEvent(e,t,s){this.eventService.dispatchEvent({type:"cellSelectionChanged",started:e,finished:t,id:s}),this.eventService.dispatchEvent({type:"rangeSelectionChanged",started:e,finished:t,id:s})}calculateColumnsBetween(e,t){const s=this.visibleColsService.getAllCols(),i=e===t,n=s.indexOf(e),l=d=>(0,import_core._warnOnce)(`column ${d.getId()} is not visible`);if(n<0){l(e);return}const o=i?n:s.indexOf(t);if(o<0){l(t);return}if(i)return[e];const a=Math.min(n,o),r=a===n?o:n,c=[];for(let d=a;d<=r;d++)c.push(s[d]);return c}},import_core5=require("@ag-grid-community/core"),import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),AbstractSelectionHandle=class extends import_core2.Component{constructor(){super(...arguments),this.changedCalculatedValues=!1,this.dragging=!1,this.shouldDestroyOnEndDragging=!1}wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService,this.mouseEventService=e.mouseEventService,this.rowPositionUtils=e.rowPositionUtils,this.cellPositionUtils=e.cellPositionUtils,this.ctrlsService=e.ctrlsService}postConstruct(){this.dragService.addDragSource({dragStartPixels:0,eElement:this.getGui(),onDragStart:this.onDragStart.bind(this),onDragging:e=>{this.dragging=!0,this.rangeService.autoScrollService.check(e),this.changedCalculatedValues&&(this.onDrag(e),this.changedCalculatedValues=!1)},onDragStop:e=>{this.dragging=!1,this.onDragEnd(e),this.clearDragProperties(),this.shouldDestroyOnEndDragging&&this.destroy()},onDragCancel:()=>{this.dragging=!1,this.onDragCancel(),this.clearDragProperties()}}),this.addManagedElementListeners(this.getGui(),{mousedown:this.preventRangeExtension.bind(this)})}isDragging(){return this.dragging}getCellCtrl(){return this.cellCtrl}setCellCtrl(e){this.cellCtrl=e}getCellRange(){return this.cellRange}setCellRange(e){this.cellRange=e}getRangeStartRow(){return this.rangeStartRow}setRangeStartRow(e){this.rangeStartRow=e}getRangeEndRow(){return this.rangeEndRow}setRangeEndRow(e){this.rangeEndRow=e}getLastCellHovered(){return this.lastCellHovered}preventRangeExtension(e){e.stopPropagation()}onDragStart(e){[this.cellHoverListener]=this.addManagedElementListeners(this.ctrlsService.get("gridCtrl").getGui(),{mousemove:this.updateValuesOnMove.bind(this)}),document.body.classList.add(this.getDraggingCssClass())}getDraggingCssClass(){return`ag-dragging-${this.type===import_core2.SelectionHandleType.FILL?"fill":"range"}-handle`}updateValuesOnMove(e){const t=this.mouseEventService.getCellPositionForEvent(e);!t||this.lastCellHovered&&this.cellPositionUtils.equals(t,this.lastCellHovered)||(this.lastCellHovered=t,this.changedCalculatedValues=!0)}clearDragProperties(){this.clearValues(),this.rangeService.autoScrollService.ensureCleared(),document.body.classList.remove(this.getDraggingCssClass())}getType(){return this.type}refresh(e){const t=this.getCellCtrl(),s=this.getGui(),i=(0,import_core2._last)(this.rangeService.getCellRanges()),n=i.startRow,l=i.endRow;if(n&&l&&(this.rowPositionUtils.before(l,n)?(this.setRangeStartRow(l),this.setRangeEndRow(n)):(this.setRangeStartRow(n),this.setRangeEndRow(l))),t!==e||!(0,import_core2._isVisible)(s)){this.setCellCtrl(e);const o=e.getComp().getParentOfValue();o&&o.appendChild(s)}this.setCellRange(i)}clearValues(){this.lastCellHovered=void 0,this.removeListeners()}removeListeners(){this.cellHoverListener&&(this.cellHoverListener(),this.cellHoverListener=void 0)}destroy(){if(!this.shouldDestroyOnEndDragging&&this.isDragging()){(0,import_core2._setDisplayed)(this.getGui(),!1),this.shouldDestroyOnEndDragging=!0;return}this.shouldDestroyOnEndDragging=!1,super.destroy(),this.removeListeners();const e=this.getGui();e.parentElement&&e.parentElement.removeChild(e)}};function findLineByLeastSquares(e){const t=e.length;let s=0;if(t<=1)return e;for(let g=0;g<e.length;g++){const h=e[g],u=h.toString().split("e-");if(u.length>1){s=Math.max(s,parseInt(u[1],10));continue}Math.floor(h)!==h&&(s=Math.max(s,h.toString().split(".")[1].length))}let i=0,n=0,l=0,o=0,a=0;for(let g=0;g<t;g++)a=e[g],i+=g,n+=a,o+=g*g,l+=g*a;const r=(t*l-i*n)/(t*o-i*i),c=n/t-r*i/t,d=[];for(let g=0;g<=t;g++)d.push(parseFloat((g*r+c).toFixed(s)));return d}var AgFillHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-fill-handle"></div>'),this.markedCells=[],this.cellValues=[],this.isUp=!1,this.isLeft=!1,this.isReduce=!1,this.type=import_core3.SelectionHandleType.FILL}wireBeans(e){super.wireBeans(e),this.valueService=e.valueService,this.navigationService=e.navigationService,this.cellNavigationService=e.cellNavigationService,this.visibleColsService=e.visibleColsService}updateValuesOnMove(e){super.updateValuesOnMove(e),this.initialXY||(this.initialXY=this.mouseEventService.getNormalisedPosition(e));const{x:t,y:s}=this.initialXY,{x:i,y:n}=this.mouseEventService.getNormalisedPosition(e),l=Math.abs(t-i),o=Math.abs(s-n),a=this.getFillHandleDirection();let r;a==="xy"?r=l>o?"x":"y":r=a,r!==this.dragAxis&&(this.dragAxis=r,this.changedCalculatedValues=!0)}onDrag(e){if(!this.initialPosition){const s=this.getCellCtrl();if(!s)return;this.initialPosition=s.getCellPosition()}const t=this.getLastCellHovered();t&&this.markPathFrom(this.initialPosition,t)}onDragEnd(e){if(this.initialXY=null,!this.markedCells.length)return;const t=this.dragAxis==="x",s=this.getCellRange(),i=s.columns.length,n=this.getRangeStartRow(),l=this.getRangeEndRow();let o;if(!this.isUp&&!this.isLeft)o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:n.rowIndex,rowStartPinned:n.rowPinned,columnStart:s.columns[0],rowEndIndex:t?l.rowIndex:this.lastCellMarked.rowIndex,rowEndPinned:t?l.rowPinned:this.lastCellMarked.rowPinned,columnEnd:t?this.lastCellMarked.column:s.columns[i-1]});else{const a=t?n:this.lastCellMarked;o=this.rangeService.createCellRangeFromCellRangeParams({rowStartIndex:a.rowIndex,rowStartPinned:a.rowPinned,columnStart:t?this.lastCellMarked.column:s.columns[0],rowEndIndex:l.rowIndex,rowEndPinned:l.rowPinned,columnEnd:s.columns[i-1]})}o&&(this.eventService.dispatchEvent({type:"fillStart"}),this.handleValueChanged(s,o,e),this.rangeService.setCellRanges([o]),this.eventService.dispatchEvent({type:"fillEnd",initialRange:s,finalRange:o}))}onDragCancel(){this.initialXY=null,this.markedCells.length&&this.clearMarkedPath()}getFillHandleDirection(){const e=(0,import_core3._getFillHandle)(this.gos)?.direction;return e?e!=="x"&&e!=="y"&&e!=="xy"?((0,import_core3._warnOnce)("valid values for fillHandleDirection are 'x', 'y' and 'xy'. Default to 'xy'."),"xy"):e:"xy"}handleValueChanged(e,t,s){const i=this.rangeService.getRangeEndRow(e),n=this.rangeService.getRangeStartRow(e),l=this.rangeService.getRangeEndRow(t),o=this.rangeService.getRangeStartRow(t),a=this.dragAxis==="y";if(this.isReduce&&!(0,import_core3._getFillHandle)(this.gos)?.suppressClearOnFillReduction){const m=a?e.columns:e.columns.filter(R=>t.columns.indexOf(R)<0),f=a?this.cellNavigationService.getRowBelow(l):o;f&&this.clearCellsInRange(f,i,m);return}const r=[],c=[],d=[],g=[];let h=!0,u=0;const w=()=>{r.length=0,c.length=0,d.length=0,g.length=0,u=0},v=(m,f)=>{let R=this.isUp?i:n,x=!1;for(a&&(h=!0,w());!x&&R;){const C=this.rowPositionUtils.getRowNode(R);if(!C)break;a&&m?p(r,m,C,()=>!this.rowPositionUtils.sameRow(R,this.isUp?n:i)):f&&(h=!0,w(),f.forEach(S=>p(r,S,C,()=>S!==(this.isLeft?e.columns[0]:(0,import_core3._last)(e.columns))))),x=this.rowPositionUtils.sameRow(R,this.isUp?o:l),R=this.isUp?this.cellNavigationService.getRowAbove(R):this.cellNavigationService.getRowBelow(R)}},p=(m,f,R,x)=>{let C,S=!1;if(h)C=this.valueService.getValue(f,R),c.push(C),d.push(this.valueService.getValue(f,R,void 0,!0)),g.push(this.valueService.formatValue(f,R,C)),h=x();else{const{value:I,fromUserFunction:E,sourceCol:P,sourceRowNode:_}=this.processValues({event:s,values:m,initialValues:c,initialNonAggregatedValues:d,initialFormattedValues:g,col:f,rowNode:R,idx:u++});if(C=I,f.isCellEditable(R)){const y=this.valueService.getValue(f,R);E||(P&&P.getColDef()?.useValueFormatterForExport!==!1&&(C=this.valueService.formatValue(P,_,C)??C),f.getColDef().useValueParserForImport!==!1&&(C=this.valueService.parseValue(f,R,P?C:(0,import_core3._toStringOrNull)(C),y))),!E||y!==C?R.setDataValue(f,C,"rangeService"):S=!0}}S||m.push({value:C,column:f,rowNode:R})};if(a)e.columns.forEach(m=>{v(m)});else{const m=this.isLeft?[...t.columns].reverse():t.columns;v(void 0,m)}}clearCellsInRange(e,t,s){const i={startRow:e,endRow:t,columns:s,startColumn:s[0]};this.rangeService.clearCellRangeCellValues({cellRanges:[i]})}processValues(e){const{event:t,values:s,initialValues:i,initialNonAggregatedValues:n,initialFormattedValues:l,col:o,rowNode:a,idx:r}=e,c=(0,import_core3._getFillHandle)(this.gos)?.setFillValue,d=this.dragAxis==="y";let g;if(d?g=this.isUp?"up":"down":g=this.isLeft?"left":"right",c){const u=this.gos.addGridCommonParams({event:t,values:s.map(({value:v})=>v),initialValues:i,initialNonAggregatedValues:n,initialFormattedValues:l,currentIndex:r,currentCellValue:this.valueService.getValue(o,a),direction:g,column:o,rowNode:a}),w=c(u);if(w!==!1)return{value:w,fromUserFunction:!0}}const h=!s.some(({value:u})=>{const w=parseFloat(u);return isNaN(w)||w.toString()!==u.toString()});if(t.altKey||!h){if(h&&i.length===1){const p=this.isUp||this.isLeft?-1:1;return{value:parseFloat((0,import_core3._last)(s).value)+1*p,fromUserFunction:!1}}const{value:u,column:w,rowNode:v}=s[r%s.length];return{value:u,fromUserFunction:!1,sourceCol:w,sourceRowNode:v}}return{value:(0,import_core3._last)(findLineByLeastSquares(s.map(({value:u})=>Number(u)))),fromUserFunction:!1}}clearValues(){this.clearMarkedPath(),this.clearCellValues(),this.lastCellMarked=void 0,super.clearValues()}clearMarkedPath(){this.markedCells.forEach(e=>{if(!e.isAlive())return;const t=e.getComp();t.addOrRemoveCssClass("ag-selection-fill-top",!1),t.addOrRemoveCssClass("ag-selection-fill-right",!1),t.addOrRemoveCssClass("ag-selection-fill-bottom",!1),t.addOrRemoveCssClass("ag-selection-fill-left",!1)}),this.markedCells.length=0,this.isUp=!1,this.isLeft=!1,this.isReduce=!1}clearCellValues(){this.cellValues.length=0}markPathFrom(e,t){if(this.clearMarkedPath(),this.clearCellValues(),this.dragAxis==="y"){if(this.rowPositionUtils.sameRow(t,e))return;const s=this.rowPositionUtils.before(t,e),i=this.getRangeStartRow(),n=this.getRangeEndRow();s&&(t.rowPinned==i.rowPinned&&t.rowIndex>=i.rowIndex||i.rowPinned!=n.rowPinned&&t.rowPinned==n.rowPinned&&t.rowIndex<=n.rowIndex)?(this.reduceVertical(e,t),this.isReduce=!0):(this.extendVertical(e,t,s),this.isReduce=!1)}else{const s=e.column,i=t.column;if(s===i)return;const n=this.visibleColsService.getAllCols(),l=n.indexOf(s),o=n.indexOf(i);o<=l&&o>=n.indexOf(this.getCellRange().columns[0])?(this.reduceHorizontal(e,t),this.isReduce=!0):(this.extendHorizontal(e,t,o<l),this.isReduce=!1)}this.lastCellMarked=t}extendVertical(e,t,s){const{navigationService:i,rangeService:n}=this;let l=e;do{const o=this.getCellRange(),a=o.columns.length;for(let r=0;r<a;r++){const c=o.columns[r],g={...{rowIndex:l.rowIndex,rowPinned:l.rowPinned},column:c},h=n.isCellInSpecificRange(g,o),u=this.rowPositionUtils.sameRow(l,e);if(s&&(this.isUp=!0),!u){const w=i.getCellByPosition(g);if(w){this.markedCells.push(w);const v=w.getComp();h||(v.addOrRemoveCssClass("ag-selection-fill-left",r===0),v.addOrRemoveCssClass("ag-selection-fill-right",r===a-1)),v.addOrRemoveCssClass(s?"ag-selection-fill-top":"ag-selection-fill-bottom",this.rowPositionUtils.sameRow(l,t))}}}if(this.rowPositionUtils.sameRow(l,t))break}while(l=s?this.cellNavigationService.getRowAbove(l):this.cellNavigationService.getRowBelow(l))}reduceVertical(e,t){let s=e;do{const i=this.getCellRange(),n=i.columns.length,l=this.rowPositionUtils.sameRow(s,t);for(let o=0;o<n;o++){const r={...{rowIndex:s.rowIndex,rowPinned:s.rowPinned},column:i.columns[o]},c=this.navigationService.getCellByPosition(r);c&&(this.markedCells.push(c),c.getComp().addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(s,t)))}if(l)break}while(s=this.cellNavigationService.getRowAbove(s))}extendHorizontal(e,t,s){const i=this.visibleColsService.getAllCols(),n=i.indexOf(s?t.column:e.column),l=i.indexOf(s?this.getCellRange().columns[0]:t.column),o=s?0:1,a=i.slice(n+o,l+o),r=this.getRangeStartRow(),c=this.getRangeEndRow();a.forEach(d=>{let g=r,h=!1;do{h=this.rowPositionUtils.sameRow(g,c);const u=this.navigationService.getCellByPosition({rowIndex:g.rowIndex,rowPinned:g.rowPinned,column:d});if(u){this.markedCells.push(u);const w=u.getComp();w.addOrRemoveCssClass("ag-selection-fill-top",this.rowPositionUtils.sameRow(g,r)),w.addOrRemoveCssClass("ag-selection-fill-bottom",this.rowPositionUtils.sameRow(g,c)),s?(this.isLeft=!0,w.addOrRemoveCssClass("ag-selection-fill-left",d===a[0])):w.addOrRemoveCssClass("ag-selection-fill-right",d===(0,import_core3._last)(a))}g=this.cellNavigationService.getRowBelow(g)}while(!h)})}reduceHorizontal(e,t){const s=this.visibleColsService.getAllCols(),i=s.indexOf(t.column),n=s.indexOf(e.column),l=s.slice(i,n),o=this.getRangeStartRow(),a=this.getRangeEndRow();l.forEach(r=>{let c=o,d=!1;do{d=this.rowPositionUtils.sameRow(c,a);const g=this.navigationService.getCellByPosition({rowIndex:c.rowIndex,rowPinned:c.rowPinned,column:r});g&&(this.markedCells.push(g),g.getComp().addOrRemoveCssClass("ag-selection-fill-right",r===l[0])),c=this.cellNavigationService.getRowBelow(c)}while(!d)})}refresh(e){const t=this.rangeService.getCellRanges()[0];if(!t.startRow||!t.endRow){this.destroy();return}super.refresh(e)}},import_core4=require("@ag-grid-community/core"),AgRangeHandle=class extends AbstractSelectionHandle{constructor(){super('<div class="ag-range-handle"></div>'),this.type=import_core4.SelectionHandleType.RANGE,this.rangeFixed=!1}onDrag(e){const t=this.getLastCellHovered();if(!t)return;const s=this.rangeService.getCellRanges(),i=(0,import_core4._last)(s);this.rangeFixed||(this.fixRangeStartEnd(i),this.rangeFixed=!0),this.endPosition={rowIndex:t.rowIndex,rowPinned:t.rowPinned,column:t.column},s.length===2&&s[0].type===import_core4.CellRangeType.DIMENSION&&i.type===import_core4.CellRangeType.VALUE&&!this.rowPositionUtils.sameRow(this.endPosition,this.rangeService.getRangeEndRow(i))&&this.rangeService.updateRangeEnd(s[0],{...this.endPosition,column:s[0].columns[0]},!0),this.rangeService.extendLatestRangeToCell(this.endPosition)}onDragEnd(e){const t=(0,import_core4._last)(this.rangeService.getCellRanges());this.fixRangeStartEnd(t),this.rangeFixed=!1}onDragCancel(){this.rangeFixed=!1}fixRangeStartEnd(e){const t=this.rangeService.getRangeStartRow(e),s=this.rangeService.getRangeEndRow(e),i=e.columns[0];e.startRow=t,e.endRow=s,e.startColumn=i}},SelectionHandleFactory=class extends import_core5.BeanStub{constructor(){super(...arguments),this.beanName="selectionHandleFactory"}createSelectionHandle(e){return this.createBean(e===import_core5.SelectionHandleType.RANGE?new AgRangeHandle:new AgFillHandle)}},VERSION="32.2.1",RangeSelectionCoreModule=(0,import_core6._defineModule)({version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-core`,beans:[RangeService,SelectionHandleFactory],dependantModules:[import_core7.EnterpriseCoreModule]}),RangeSelectionApiModule=(0,import_core6._defineModule)({version:VERSION,moduleName:`${import_core6.ModuleNames.RangeSelectionModule}-api`,apiFunctions:{getCellRanges,addCellRange,clearRangeSelection,clearCellSelection:clearRangeSelection},dependantModules:[RangeSelectionCoreModule]}),RangeSelectionModule=(0,import_core6._defineModule)({version:VERSION,moduleName:import_core6.ModuleNames.RangeSelectionModule,dependantModules:[RangeSelectionCoreModule,RangeSelectionApiModule]}); |
{ | ||
"name": "@ag-grid-enterprise/range-selection", | ||
"version": "32.2.0", | ||
"version": "32.2.1", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,4 +16,4 @@ "main": "./dist/package/main.cjs.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.2.0", | ||
"@ag-grid-enterprise/core": "32.2.0" | ||
"@ag-grid-community/core": "32.2.1", | ||
"@ag-grid-enterprise/core": "32.2.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
{ | ||
"name": "@ag-grid-enterprise/range-selection", | ||
"version": "32.2.0", | ||
"version": "32.2.1", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,4 +16,4 @@ "main": "./src/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.2.0", | ||
"@ag-grid-enterprise/core": "32.2.0" | ||
"@ag-grid-community/core": "32.2.1", | ||
"@ag-grid-enterprise/core": "32.2.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "32.2.0"; | ||
export declare const VERSION = "32.2.1"; |
{ | ||
"name": "@ag-grid-enterprise/range-selection", | ||
"version": "32.2.0", | ||
"version": "32.2.1", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,4 +16,4 @@ "main": "./dist/package/main.cjs.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.2.0", | ||
"@ag-grid-enterprise/core": "32.2.0" | ||
"@ag-grid-community/core": "32.2.1", | ||
"@ag-grid-enterprise/core": "32.2.1" | ||
}, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
326679
+ Added@ag-grid-community/core@32.2.1(transitive)
+ Added@ag-grid-enterprise/core@32.2.1(transitive)
- Removed@ag-grid-community/core@32.2.0(transitive)
- Removed@ag-grid-enterprise/core@32.2.0(transitive)