@syncfusion/ej2-treegrid 32.2.9 → 33.1.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, L10n, EventHandler, KeyboardEvents, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
2
- import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, getRowIndexFromElement, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
2
+ import { Grid, Logger as Logger$1, detailLists, Clipboard, getObject, parentsUntil, Print as Print$1, templateCompiler, appendChildren, extend, CellRenderer, getUid, CellType, Freeze as Freeze$1, getNumberFormat, setEnableSeamlessScrolling, getActualProperties, iterateArrayOrObject, RowDropSettings as RowDropSettings$1, Reorder as Reorder$1, Resize as Resize$1, Scroll, RowDD as RowDD$1, VirtualRowModelGenerator, Filter as Filter$1, Data, ExportHelper, ExcelExport as ExcelExport$1, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, calculateAggregate, Aggregate as Aggregate$1, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, resetRowIndex, Edit as Edit$1, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, Cell, getVisiblePage, VirtualContentRenderer, InterSectionObserver, getTransformValues, RenderType, VirtualHeaderRenderer, VirtualScroll as VirtualScroll$1, ColumnChooser as ColumnChooser$1, getRowIndexFromElement, RowRenderer, InfiniteScroll as InfiniteScroll$1 } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { DataManager, ODataAdaptor, WebApiAdaptor, WebMethodAdaptor, CacheAdaptor, UrlAdaptor, Query, DataUtil, RemoteSaveAdaptor, Deferred, JsonAdaptor, Predicate as Predicate$1 } from '@syncfusion/ej2-data';
5
5
  import { showSpinner, hideSpinner, createSpinner } from '@syncfusion/ej2-popups';
@@ -3311,7 +3311,6 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3311
3311
  var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
3312
3312
  var count = isCountRequired(this.parent) ? getValue('count', this.parent.dataSource)
3313
3313
  : results.length;
3314
- var qry = new Query();
3315
3314
  var gridQuery = getObject('query', args);
3316
3315
  var filterQuery;
3317
3316
  var searchQuery;
@@ -3327,11 +3326,7 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3327
3326
  gridQuery = getValue('grid.renderModule.data', this.parent).filterQuery(gridQuery);
3328
3327
  gridQuery = getValue('grid.renderModule.data', this.parent).searchQuery(gridQuery);
3329
3328
  }
3330
- var fltrQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
3331
- var srchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
3332
- qry.queries = fltrQuery.concat(srchQuery);
3333
- var filteredData = new DataManager(results).executeLocal(qry);
3334
- this.parent.notify('updateFilterRecs', { data: filteredData });
3329
+ this.parent.getData({ query: gridQuery, isFilter: true });
3335
3330
  results = this.dataResults.result;
3336
3331
  this.dataResults.result = null;
3337
3332
  if (this.parent.grid.aggregates.length > 0) {
@@ -3356,34 +3351,8 @@ var DataManipulation = /** @__PURE__ @class */ (function () {
3356
3351
  }
3357
3352
  if (this.parent.grid.sortSettings.columns.length > 0 || this.isSortAction) {
3358
3353
  this.isSortAction = false;
3359
- var parentData = this.parent.parentData;
3360
3354
  var query = getObject('query', args);
3361
- var srtQry = new Query();
3362
- for (var srt = this.parent.grid.sortSettings.columns.length - 1; srt >= 0; srt--) {
3363
- var getColumnByField = 'getColumnByField';
3364
- var col = this.parent.grid.renderModule.data["" + getColumnByField](this.parent.grid.
3365
- sortSettings.columns[parseInt(srt.toString(), 10)].field);
3366
- var compFun = col.sortComparer && isOffline(this.parent) ?
3367
- col.sortComparer.bind(col) :
3368
- this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].direction;
3369
- srtQry.sortBy(this.parent.grid.sortSettings.columns[parseInt(srt.toString(), 10)].field, compFun);
3370
- }
3371
- var modifiedData = new DataManager(parentData).executeLocal(srtQry);
3372
- if (this.parent.allowRowDragAndDrop && !isNullOrUndefined(this.parent.rowDragAndDropModule['draggedRecord']) &&
3373
- this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
3374
- var dragdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['draggedRecord']);
3375
- modifiedData.splice(dragdIndex, 1);
3376
- var dropdIndex = modifiedData.indexOf(this.parent.rowDragAndDropModule['droppedRecord']);
3377
- if (this.parent.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.parent.rowDragAndDropModule['dropPosition'] === 'topSegment') {
3378
- modifiedData.splice(dropdIndex, 0, this.parent.rowDragAndDropModule['draggedRecord']);
3379
- }
3380
- else if (this.parent.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
3381
- modifiedData.splice(dropdIndex + 1, 0, this.parent.rowDragAndDropModule['draggedRecord']);
3382
- }
3383
- }
3384
- var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: srtQry };
3385
- this.parent.notify('createSort', sortArgs);
3386
- results = sortArgs.modifiedData;
3355
+ results = this.parent.getData({ query: query, isSort: true });
3387
3356
  this.dataResults.result = null;
3388
3357
  this.sortedData = results;
3389
3358
  this.parent.notify('updateModel', {});
@@ -4351,6 +4320,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4351
4320
  _this.isComponentRefresh = false;
4352
4321
  _this.isVirtualExpandCollapse = false;
4353
4322
  _this.isInfiniteCollapse = false;
4323
+ /** @hidden */
4324
+ _this.enableSeamlessScrolling = false;
4354
4325
  _this.objectEqualityChecker = function (old, current) {
4355
4326
  if (old) {
4356
4327
  var keys = Object.keys(old);
@@ -5098,7 +5069,15 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5098
5069
  this.renderModule = new Render(this);
5099
5070
  this.dataModule = new DataManipulation(this);
5100
5071
  this.printModule = new Print(this);
5101
- this.trigger(load);
5072
+ if (this.enableVirtualization || this.enableColumnVirtualization) {
5073
+ var args = { enableSeamlessScrolling: this.enableSeamlessScrolling };
5074
+ this.trigger(load, args);
5075
+ this.enableSeamlessScrolling = args.enableSeamlessScrolling;
5076
+ setEnableSeamlessScrolling(this.enableSeamlessScrolling);
5077
+ }
5078
+ else {
5079
+ this.trigger(load);
5080
+ }
5102
5081
  this.autoGenerateColumns();
5103
5082
  this.initialRender = true;
5104
5083
  if (!isNullOrUndefined(this.dataSource)) {
@@ -5371,6 +5350,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5371
5350
  this.grid.clipMode = getActualProperties(this.clipMode);
5372
5351
  this.grid.enableColumnSpan = this.enableColumnSpan;
5373
5352
  this.grid.enableRowSpan = this.enableRowSpan;
5353
+ this.grid.enableSeamlessScrolling = this.enableSeamlessScrolling;
5374
5354
  var templateInstance = 'templateDotnetInstance';
5375
5355
  this.grid["" + templateInstance] = this["" + templateInstance];
5376
5356
  var isJsComponent = 'isJsComponent';
@@ -5848,7 +5828,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5848
5828
  }
5849
5829
  _this.notify('updateGridActions', args);
5850
5830
  _this.isVirtualExpandCollapse = false;
5851
- if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
5831
+ if (args.requestType === 'save' && _this.aggregates.some(function (ag) { return ag.showChildSummary === true; })) {
5852
5832
  _this.grid.refresh();
5853
5833
  }
5854
5834
  if ((args.action === 'clearFilter' || args.action === 'clear-filter' || args.requestType === 'sorting') && _this.enableInfiniteScrolling) {
@@ -6594,6 +6574,115 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
6594
6574
  }
6595
6575
  }
6596
6576
  };
6577
+ /**
6578
+ * Retrieves all records that match the current search criteria and are sorted according to the active sort settings.
6579
+ *
6580
+ * This method processes the data source by applying search filters and sort operations,
6581
+ * returning the searched and sorted records excluding summary rows.
6582
+ *
6583
+ * @param {Object} args - Optional arguments object to control query execution behavior.
6584
+ * @param {Query} args.query - Optional custom Query object to override the default generated query.
6585
+ * @param {boolean} args.isFilter - Optional flag to include only filtered records without sorting (default: false).
6586
+ * @param {boolean} args.isSort - Optional flag to apply only sorting without filtering (default: false).
6587
+ *
6588
+ * @returns {ITreeData[]} - Array of searched and sorted TreeGrid records with summary rows excluded.
6589
+ * @hidden
6590
+ */
6591
+ TreeGrid.prototype.getData = function (args) {
6592
+ var dataObj = isCountRequired(this) ? getValue('result', this.grid.dataSource)
6593
+ : this.grid.dataSource;
6594
+ var results = dataObj instanceof DataManager ? dataObj.dataSource.json : dataObj;
6595
+ var gridQuery = (!isNullOrUndefined(args) && args.query) ? args.query : this.getDataModule().baseModule.generateQuery();
6596
+ var filterQuery;
6597
+ var searchQuery;
6598
+ if (!isNullOrUndefined(gridQuery)) {
6599
+ filterQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
6600
+ searchQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
6601
+ }
6602
+ var skipFilterSearch = (!isNullOrUndefined(args) && args.isSort);
6603
+ if (!skipFilterSearch && (this.grid.allowFiltering && this.grid.filterSettings.columns.length) ||
6604
+ (this.grid.searchSettings.key.length > 0) && (!isNullOrUndefined(gridQuery))
6605
+ || ((filterQuery && filterQuery.length > 0) || (searchQuery && searchQuery.length > 0))) {
6606
+ var filterQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onWhere'; });
6607
+ var searchQuery_1 = gridQuery.queries.filter(function (q) { return q.fn === 'onSearch'; });
6608
+ var query = new Query();
6609
+ query.queries = filterQuery_1.concat(searchQuery_1);
6610
+ var filteredData = new DataManager(results).executeLocal(query);
6611
+ this.notify('updateFilterRecs', { data: filteredData });
6612
+ results = isRemoteData(this) ? this.dataResults : this.filterModule.filteredResult;
6613
+ if (!isNullOrUndefined(args) && args.isFilter) {
6614
+ return isRemoteData(this) ? results.result.filter(function (item) { return !item.isSummaryRow; })
6615
+ : results.filter(function (item) { return !item.isSummaryRow; });
6616
+ }
6617
+ }
6618
+ var sortQuery = gridQuery.queries.filter(function (q) { return q.fn === 'onSortBy'; });
6619
+ if (this.grid.sortSettings.columns.length > 0 || sortQuery.length) {
6620
+ var parentData = this.parentData;
6621
+ var query = new Query();
6622
+ query.queries = sortQuery;
6623
+ var modifiedData = new DataManager(parentData).executeLocal(query);
6624
+ if (this.allowRowDragAndDrop && !isNullOrUndefined(this.rowDragAndDropModule['draggedRecord']) &&
6625
+ this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] !== 'middleSegment') {
6626
+ var dragdIndex = modifiedData.indexOf(this.rowDragAndDropModule['draggedRecord']);
6627
+ modifiedData.splice(dragdIndex, 1);
6628
+ var dropdIndex = modifiedData.indexOf(this.rowDragAndDropModule['droppedRecord']);
6629
+ if (this.rowDragAndDropModule['droppedRecord'].hasChildRecords && this.rowDragAndDropModule['dropPosition'] === 'topSegment') {
6630
+ modifiedData.splice(dropdIndex, 0, this.rowDragAndDropModule['draggedRecord']);
6631
+ }
6632
+ else if (this.rowDragAndDropModule['dropPosition'] === 'bottomSegment') {
6633
+ modifiedData.splice(dropdIndex + 1, 0, this.rowDragAndDropModule['draggedRecord']);
6634
+ }
6635
+ }
6636
+ var sortArgs = { modifiedData: modifiedData, filteredData: results, srtQry: query };
6637
+ this.notify('createSort', sortArgs);
6638
+ results = isRemoteData(this) ? this.dataResults : sortArgs.modifiedData;
6639
+ }
6640
+ return isRemoteData(this) ? this.dataResults.result.filter(function (item) { return !item.isSummaryRow; })
6641
+ : results.filter(function (item) { return !item.isSummaryRow; });
6642
+ };
6643
+ /**
6644
+ * Retrieves the processed Tree Grid data based on current operations such as
6645
+ * sorting, filtering, and searching. Maintains hierarchy and current structure.
6646
+ *
6647
+ * For local data: when skipPage is true (the default), it returns all available records;
6648
+ * when skipPage is false, it returns only the records for the current page.
6649
+ * For remote data: it always returns only the records for the current page.
6650
+ *
6651
+ * @param {boolean} skipPage - if set to false, returns only the records for the current page.
6652
+ * @returns {ITreeData[]} - Array of tree records (summary rows excluded).
6653
+ * @hidden
6654
+ */
6655
+ TreeGrid.prototype.getProcessedRecords = function (skipPage) {
6656
+ var _this = this;
6657
+ var result;
6658
+ if (skipPage !== true || isRemoteData(this)) {
6659
+ result = this.getData();
6660
+ var dm = new DataManager(result);
6661
+ var expanded = new Predicate$1('expanded', 'notequal', null).or('expanded', 'notequal', undefined);
6662
+ var parents_1 = dm.executeLocal(new Query().where(expanded));
6663
+ var visualData = parents_1.filter(function (e) {
6664
+ return getExpandStatus(_this, e);
6665
+ });
6666
+ var query = new Query();
6667
+ if (this.allowPaging || this.enableVirtualization || this.enableInfiniteScrolling) {
6668
+ var pageSize = this.grid.pageSettings.pageSize;
6669
+ var currentPage = this.grid.pageSettings.currentPage;
6670
+ if (visualData.length < (currentPage * pageSize)) {
6671
+ currentPage = (Math.floor(visualData.length / pageSize)) + ((visualData.length % pageSize) ? 1 : 0);
6672
+ currentPage = currentPage ? currentPage : 1;
6673
+ this.grid.setProperties({ pageSettings: { currentPage: currentPage } }, true);
6674
+ }
6675
+ var skip = pageSize * (currentPage - 1);
6676
+ query = query.skip(skip).take(pageSize);
6677
+ }
6678
+ dm.dataSource.json = visualData;
6679
+ result = dm.executeLocal(query);
6680
+ }
6681
+ else {
6682
+ result = this.getData();
6683
+ }
6684
+ return result;
6685
+ };
6597
6686
  /**
6598
6687
  * Retrieves all the TreeGrid row elements.
6599
6688
  *
@@ -10821,10 +10910,16 @@ var RowDD = /** @__PURE__ @class */ (function () {
10821
10910
  var droppedRecord = void 0;
10822
10911
  if (isNullOrUndefined(args.dropIndex)) {
10823
10912
  var primaryKeyField = this.parent.getPrimaryKeyFieldNames()[0];
10824
- var rowIndex = tObj.selectedRowIndex === -1 ?
10913
+ var rowIndex_1 = tObj.selectedRowIndex === -1 ?
10825
10914
  (this.parent.grid.getRowIndexByPrimaryKey(args.data[0]["" + primaryKeyField])) - 1
10826
10915
  : tObj.getSelectedRowIndexes()[0] - 1;
10827
- var record = tObj.getCurrentViewRecords()[parseInt(rowIndex.toString(), 10)];
10916
+ var record = void 0;
10917
+ if (this.parent.enableVirtualization) {
10918
+ record = tObj.getCurrentViewRecords().find(function (e) { return e.index === rowIndex_1; });
10919
+ }
10920
+ else {
10921
+ record = tObj.getCurrentViewRecords()[parseInt(rowIndex_1.toString(), 10)];
10922
+ }
10828
10923
  this.getParentData(record, args.data);
10829
10924
  }
10830
10925
  else {
@@ -15299,7 +15394,11 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15299
15394
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
15300
15395
  this.parent["" + action]('data-ready', this.onDataReady, this);
15301
15396
  this.parent["" + action]('refresh-virtual-block', this.refreshContentRows, this);
15397
+ this.parent.on(destroy, this.destroy, this);
15302
15398
  this.fn = function () {
15399
+ if (_this.parent.root.enableSeamlessScrolling) {
15400
+ window.addEventListener('resize', _this.updateScrollbar.bind(_this));
15401
+ }
15303
15402
  _this.observers.observes(function (scrollArgs) { return _this.scrollListeners(scrollArgs); }, _this.onEnteredAction(), _this.parent);
15304
15403
  var gObj = _this.parent;
15305
15404
  if (gObj.root.enablePersistence && gObj.root.scrollPosition) {
@@ -15349,6 +15448,10 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15349
15448
  var virtualCellFocus = 'virtualCellFocus';
15350
15449
  _super.prototype["" + virtualCellFocus].call(this, e);
15351
15450
  };
15451
+ VirtualTreeContentRenderer.prototype.updateScrollbar = function () {
15452
+ var updateScrollbarOnResize = 'updateScrollbarOnResize';
15453
+ _super.prototype["" + updateScrollbarOnResize].call(this);
15454
+ };
15352
15455
  /**
15353
15456
  * Handles the data ready event for the virtual tree grid content renderer.
15354
15457
  *
@@ -15389,9 +15492,6 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15389
15492
  _super.prototype.renderTable.call(this);
15390
15493
  if (!(this.parent.dataSource instanceof DataManager && this.parent.dataSource.dataSource.url !== undefined
15391
15494
  && this.parent.dataSource.dataSource.offline && this.parent.dataSource.dataSource.url !== '') || !isCountRequired(this.parent)) {
15392
- if (this.observers) {
15393
- this.observers.disconnect();
15394
- }
15395
15495
  getValue('observer', this).options.debounceEvent = false;
15396
15496
  this.observers = new TreeInterSectionObserver(getValue('observer', this).element, getValue('observer', this).options);
15397
15497
  this.contents = this.getPanel().firstChild;
@@ -15472,7 +15572,7 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15472
15572
  }
15473
15573
  var treeGridParent = this.parent.clipboardModule['treeGridParent'];
15474
15574
  if (isNullOrUndefined(treeGridParent.editModule) ||
15475
- isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== 0) {
15575
+ isNullOrUndefined(treeGridParent.editModule['addRowIndex']) || args.selectedIndex !== -1) {
15476
15576
  if (!isNullOrUndefined(treeGridParent.grid.sortModule) && treeGridParent.grid.sortModule['sortedColumns'].length > 0) {
15477
15577
  var sortedData = treeGridParent.dataModule['sortedData'];
15478
15578
  if (!isNullOrUndefined(sortedData) && sortedData.length > 0) {
@@ -15772,16 +15872,28 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
15772
15872
  var maxLeft = _this.vgenerator.cOffsets[idx - 1];
15773
15873
  x = x > maxLeft ? maxLeft : x; //TODO: This fix horizontal scrollbar jumping issue in column virtualization.
15774
15874
  }
15775
- var y = _this.getTranslateY(e.top, height, xAxis && top_1 === e.top ? _this.prevInfo : undefined, true);
15875
+ var isRowScrollAction = _this.prevInfo && _this.prevInfo.page === 1 &&
15876
+ (direction !== _this.prevInfo.direction || direction !== _this.prevInfo.direction);
15877
+ var translateY = _this.getTranslateY(e.top, height, xAxis && top_1 === e.top ? _this.prevInfo : undefined, isRowScrollAction ? false : true);
15776
15878
  if (!_this.parent.isFrozenGrid() || _this.parent.enableVirtualMaskRow) {
15777
15879
  if (_this.parent.enableVirtualMaskRow) {
15778
15880
  var upScroll = (e.top - _this.translateY) < 0;
15779
- y = (Math.round(_this.translateY) > y && !upScroll) ? Math.round(_this.translateY) : y;
15780
- _this.virtualEle.adjustTable(x, y);
15881
+ translateY = (Math.round(_this.translateY) > translateY && !upScroll) ? Math.round(_this.translateY) : translateY;
15882
+ _this.virtualEle.adjustTable(x, translateY);
15781
15883
  }
15782
15884
  else {
15783
15885
  _this.virtualEle.adjustTable(x, _this.translateY);
15784
15886
  }
15887
+ var wrapperBottom = _this.virtualEle.wrapper.getBoundingClientRect().bottom;
15888
+ var contentBottom = _this.virtualEle.content.getBoundingClientRect().bottom;
15889
+ if (direction === 'up' && _this.prevInfo.page === Math.ceil(_this.getTotalBlocks() / 2) &&
15890
+ Math.round(wrapperBottom) < Math.round(contentBottom)) {
15891
+ var bottomGap = Math.round(contentBottom) - Math.round(wrapperBottom);
15892
+ var adjustedTranslateY = Math.min(translateY + bottomGap, _this.offsets[_this['maxBlock']]);
15893
+ if (adjustedTranslateY !== translateY) {
15894
+ _this.virtualEle.adjustTable(x, adjustedTranslateY);
15895
+ }
15896
+ }
15785
15897
  if (_this.parent.enableColumnVirtualization) {
15786
15898
  _this.header.virtualEle.adjustTable(x, 0);
15787
15899
  if (_this.parent.isFrozenGrid()) {
@@ -16110,10 +16222,17 @@ var VirtualTreeContentRenderer = /** @__PURE__ @class */ (function (_super) {
16110
16222
  this.parent.off('refresh-virtual-editform-cells', this.refreshCell);
16111
16223
  this.parent.off('virtaul-cell-focus', this.cellFocus);
16112
16224
  this.parent.off('virtual-scroll-edit', this.restoreEditState);
16113
- if (this.observers) {
16114
- this.observers.disconnect();
16225
+ this.parent.off(destroy, this.destroy);
16226
+ if (this.parent.root.enableSeamlessScrolling) {
16227
+ window.removeEventListener('resize', this.updateScrollbar);
16115
16228
  }
16116
16229
  };
16230
+ VirtualTreeContentRenderer.prototype.destroy = function () {
16231
+ if (this.parent.isDestroyed) {
16232
+ return;
16233
+ }
16234
+ this.removeEventListener();
16235
+ };
16117
16236
  return VirtualTreeContentRenderer;
16118
16237
  }(VirtualContentRenderer));
16119
16238
  var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
@@ -16126,6 +16245,9 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16126
16245
  _this.timer = 0;
16127
16246
  return _this;
16128
16247
  }
16248
+ TreeInterSectionObserver.prototype.onWheelEvent = function () {
16249
+ this.isWheeling = true;
16250
+ };
16129
16251
  /**
16130
16252
  * Sets up observers to monitor scroll events on a given container
16131
16253
  * and its movable companion within a virtual grid setup.
@@ -16138,28 +16260,28 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16138
16260
  TreeInterSectionObserver.prototype.observes = function (callback, onEnterCallback, instance) {
16139
16261
  var containerRect = 'containerRect';
16140
16262
  _super.prototype["" + containerRect] = getValue('options', this).container.getBoundingClientRect();
16141
- this.containerEl = getValue('options', this).container;
16142
- this.containerScrollHandler = this.virtualScrollHandlers(callback, onEnterCallback, instance);
16143
- EventHandler.add(this.containerEl, 'scroll', this.containerScrollHandler, this);
16144
- if (getValue('options', this).movableContainer) {
16145
- var movableContainerRect = 'movableContainerRect';
16146
- _super.prototype["" + movableContainerRect] = getValue('options', this).movableContainer.getBoundingClientRect();
16147
- this.movableContainerEl = getValue('options', this).movableContainer;
16148
- this.movableScrollHandler = this.virtualScrollHandlers(callback, onEnterCallback, instance);
16149
- EventHandler.add(this.movableContainerEl, 'scroll', this.movableScrollHandler, this);
16150
- }
16151
- };
16152
- TreeInterSectionObserver.prototype.disconnect = function () {
16153
- if (this.containerEl && this.containerScrollHandler) {
16154
- EventHandler.remove(this.containerEl, 'scroll', this.containerScrollHandler);
16155
- this.containerScrollHandler = null;
16263
+ var options = getValue('options', this);
16264
+ EventHandler.add(options.container, 'wheel', this.onWheelEvent, this);
16265
+ if (!isNullOrUndefined(options.horizontalScrollbar)) {
16266
+ EventHandler.add(options.horizontalScrollbar, 'wheel', this.onWheelEvent, this);
16267
+ EventHandler.add(options.horizontalScrollbar, 'scroll', this.onVirtualContentScrolling(), this);
16156
16268
  }
16157
- if (this.movableContainerEl && this.movableScrollHandler) {
16158
- EventHandler.remove(this.movableContainerEl, 'scroll', this.movableScrollHandler);
16159
- this.movableScrollHandler = null;
16269
+ if (!isNullOrUndefined(options.verticalScrollbar)) {
16270
+ EventHandler.add(options.verticalScrollbar, 'wheel', this.onWheelEvent, this);
16271
+ EventHandler.add(options.verticalScrollbar, 'scroll', this.onVirtualContentScrolling(), this);
16160
16272
  }
16161
- this.containerEl = null;
16162
- this.movableContainerEl = null;
16273
+ EventHandler.add(options.container, 'scroll', this.virtualScrollHandlers(callback, onEnterCallback, instance), this);
16274
+ };
16275
+ TreeInterSectionObserver.prototype.onVirtualContentScrolling = function () {
16276
+ var _this = this;
16277
+ return function (e) {
16278
+ if (e.target.classList.contains('e-virtual-vertical-scrollbar')) {
16279
+ getValue('options', _this).container.scrollTop = e.target.scrollTop;
16280
+ }
16281
+ if (e.target.classList.contains('e-virtual-horizontal-scrollbar')) {
16282
+ getValue('options', _this).container.scrollLeft = e.target.scrollLeft;
16283
+ }
16284
+ };
16163
16285
  };
16164
16286
  /**
16165
16287
  * Clears the last known position.
@@ -16205,6 +16327,12 @@ var TreeInterSectionObserver = /** @__PURE__ @class */ (function (_super) {
16205
16327
  direction = _this["" + options].prevLeft === left ? direction : _this["" + options].prevLeft < left ? 'right' : 'left';
16206
16328
  _this["" + options].prevTop = top;
16207
16329
  _this["" + options].prevLeft = left;
16330
+ if (!isNullOrUndefined(_this["" + options].verticalScrollbar)) {
16331
+ _this["" + options].verticalScrollbar.scrollTop = _this["" + options].container.scrollTop;
16332
+ }
16333
+ if (!isNullOrUndefined(_this["" + options].horizontalScrollbar)) {
16334
+ _this["" + options].horizontalScrollbar.scrollLeft = _this["" + options].container.scrollLeft;
16335
+ }
16208
16336
  var current = _this.sentinelInfo["" + direction];
16209
16337
  var delta = 0;
16210
16338
  _this.newPos = top;