@syncfusion/ej2-treegrid 34.1.32 → 34.2.2

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,4 +1,4 @@
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';
1
+ import { Property, merge, ChildProperty, Collection, isNullOrUndefined, Browser, removeClass, initializeTelemetryFeature, addClass, getValue, createElement, setValue, extend as extend$1, Internationalization, getEnumValue, compile, Component, L10n, EventHandler, KeyboardEvents, initializeTelemetry, SanitizeHtmlHelper, Complex, Event, NotifyPropertyChanges, closest, setStyleAttribute, select, classList, debounce, remove } from '@syncfusion/ej2-base';
2
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';
@@ -1018,6 +1018,7 @@ var Selection = /** @__PURE__ @class */ (function () {
1018
1018
  this.headerSelectionState = 'uncheck';
1019
1019
  this.checkedItemCount = 0;
1020
1020
  this.visibleUidIndex = {};
1021
+ initializeTelemetryFeature('selection', 'treegrid');
1021
1022
  this.parent = parent;
1022
1023
  this.selectedItems = [];
1023
1024
  this.selectedIndexes = []; // Initialize here
@@ -5070,6 +5071,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
5070
5071
  */
5071
5072
  TreeGrid.prototype.render = function () {
5072
5073
  var _this = this;
5074
+ initializeTelemetry('treegrid');
5073
5075
  if (this.isReact) {
5074
5076
  this.grid.isReact = true;
5075
5077
  this.grid.portals = [];
@@ -8396,15 +8398,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8396
8398
  var _this = this;
8397
8399
  var rows;
8398
8400
  var detailRow = row.nextElementSibling ? row.nextElementSibling.classList.contains('e-detailrow') ? row.nextElementSibling : null : null;
8399
- var childRecords;
8400
- if (this.enableInfiniteScrolling) {
8401
- childRecords = this.grid.getRowsObject().filter(function (e) { return e.data.parentUniqueID === record.uniqueID; });
8402
- }
8403
- else {
8404
- childRecords = this.grid.currentViewData.filter(function (e) {
8405
- return e.parentUniqueID === record.uniqueID;
8406
- });
8407
- }
8401
+ var childRecords = this.grid.currentViewData.filter(function (e) {
8402
+ return e.parentUniqueID === record.uniqueID;
8403
+ });
8408
8404
  if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {
8409
8405
  this.lastRowBorder(row, false);
8410
8406
  }
@@ -8486,11 +8482,12 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
8486
8482
  this.toggleRowVisibility(freezeRightRows[parseInt(i.toString(), 10)], displayAction);
8487
8483
  }
8488
8484
  this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });
8489
- if ((!isNullOrUndefined(childRecords)) && (!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||
8490
- isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {
8491
- this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8485
+ var childRecord = !isNullOrUndefined(childRecords) ? childRecords[parseInt(i.toString(), 10)] : undefined;
8486
+ if (childRecord && (childRecord.childRecords && childRecord.childRecords.length > 0) && (action !== 'expand' ||
8487
+ isNullOrUndefined(childRecord.expanded) || childRecord.expanded)) {
8488
+ this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecord, true);
8492
8489
  if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {
8493
- this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8490
+ this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecord, true);
8494
8491
  }
8495
8492
  }
8496
8493
  }
@@ -9716,6 +9713,7 @@ var RowDD = /** @__PURE__ @class */ (function () {
9716
9713
  * Indicates whether the item is being added to the bottom of the TreeGrid.
9717
9714
  */
9718
9715
  this.isaddtoBottom = false;
9716
+ initializeTelemetryFeature('rowDragAndDrop', 'treegrid');
9719
9717
  Grid.Inject(RowDD$1);
9720
9718
  this.parent = parent;
9721
9719
  this.addEventListener();
@@ -11740,6 +11738,7 @@ var Filter = /** @__PURE__ @class */ (function () {
11740
11738
  * @param {TreeGrid} parent - Tree Grid instance
11741
11739
  */
11742
11740
  function Filter(parent) {
11741
+ initializeTelemetryFeature('filter', 'treegrid');
11743
11742
  Grid.Inject(Filter$1);
11744
11743
  this.parent = parent;
11745
11744
  this.isHierarchyFilter = false;
@@ -12431,6 +12430,7 @@ var PdfExport = /** @__PURE__ @class */ (function () {
12431
12430
  */
12432
12431
  var Page = /** @__PURE__ @class */ (function () {
12433
12432
  function Page(parent) {
12433
+ initializeTelemetryFeature('pager', 'treegrid');
12434
12434
  Grid.Inject(Page$1);
12435
12435
  this.parent = parent;
12436
12436
  this.addEventListener();
@@ -13023,6 +13023,7 @@ var Aggregate = /** @__PURE__ @class */ (function () {
13023
13023
  */
13024
13024
  var Sort = /** @__PURE__ @class */ (function () {
13025
13025
  function Sort(grid) {
13026
+ initializeTelemetryFeature('sort', 'treegrid');
13026
13027
  Grid.Inject(Sort$1);
13027
13028
  this.parent = grid;
13028
13029
  this.taskIds = [];
@@ -13163,6 +13164,7 @@ var ColumnMenu = /** @__PURE__ @class */ (function () {
13163
13164
  * @param {TreeGrid} parent - Tree Grid instance
13164
13165
  */
13165
13166
  function ColumnMenu(parent) {
13167
+ initializeTelemetryFeature('columnMenu', 'treegrid');
13166
13168
  Grid.Inject(ColumnMenu$1);
13167
13169
  this.parent = parent;
13168
13170
  }
@@ -14050,6 +14052,7 @@ var Edit = /** @__PURE__ @class */ (function () {
14050
14052
  this.isAddedRowByContextMenu = false;
14051
14053
  this.isIndexUndefined = false;
14052
14054
  this.isAddedMultipleRowsByMethod = false;
14055
+ initializeTelemetryFeature('edit', 'treegrid');
14053
14056
  Grid.Inject(Edit$1);
14054
14057
  this.parent = parent;
14055
14058
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -15242,6 +15245,7 @@ var CommandColumn = /** @__PURE__ @class */ (function () {
15242
15245
  */
15243
15246
  var DetailRow = /** @__PURE__ @class */ (function () {
15244
15247
  function DetailRow(parent) {
15248
+ initializeTelemetryFeature('detailRow', 'treegrid');
15245
15249
  Grid.Inject(DetailRow$1);
15246
15250
  this.parent = parent;
15247
15251
  this.addEventListener();
@@ -16885,6 +16889,7 @@ var Freeze = /** @__PURE__ @class */ (function () {
16885
16889
  * @param {TreeGrid} parent - Tree Grid instance
16886
16890
  */
16887
16891
  function Freeze(parent) {
16892
+ initializeTelemetryFeature('freeze', 'treegrid');
16888
16893
  Grid.Inject(Freeze$1);
16889
16894
  this.parent = parent;
16890
16895
  this.addEventListener();
@@ -16989,6 +16994,7 @@ var ColumnChooser = /** @__PURE__ @class */ (function () {
16989
16994
  * @param {TreeGrid} parent - Tree Grid instance.
16990
16995
  */
16991
16996
  function ColumnChooser(parent) {
16997
+ initializeTelemetryFeature('ColumnChooser', 'treegrid');
16992
16998
  Grid.Inject(ColumnChooser$1);
16993
16999
  this.parent = parent;
16994
17000
  }
@@ -17113,7 +17119,8 @@ var InfiniteScroll = /** @__PURE__ @class */ (function () {
17113
17119
  var previousPage = this.parent.grid.pageSettings.currentPage;
17114
17120
  var nextPage = Math.ceil(index / this.parent.grid.pageSettings.pageSize) + 1;
17115
17121
  var totalVisibleCount = this.visualData ? this.visualData.length : 0;
17116
- if ((previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
17122
+ if ((totalVisibleCount > 0 && (index + 1) >= totalVisibleCount) ||
17123
+ (previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
17117
17124
  return;
17118
17125
  }
17119
17126
  this.parent.grid.pageSettings.currentPage = nextPage;
@@ -17197,6 +17204,7 @@ var InfiniteScroll = /** @__PURE__ @class */ (function () {
17197
17204
  var initial = actions.some(function (value) { return value === actionArgs.requestType; });
17198
17205
  var initialRender = initial ? true : this.parent.initialRender ? true : false;
17199
17206
  this.visualData = visualData;
17207
+ this.maxPage = Math.ceil(visualData.length / this.parent.pageSettings.pageSize);
17200
17208
  pageingDetails.count = visualData.length;
17201
17209
  if (getValue('isPrinting', pageingDetails.actionArgs)) {
17202
17210
  pageingDetails.result = visualData;