@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 { merge, Property, 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 { merge, Property, ChildProperty, Collection, isNullOrUndefined, Browser, initializeTelemetryFeature, removeClass, 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 { Logger as Logger$1, Grid, 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, RowDD as RowDD$1, Scroll, VirtualRowModelGenerator, Filter as Filter$1, ExcelExport as ExcelExport$1, Data, ExportHelper, PdfExport as PdfExport$1, Page as Page$1, Toolbar as Toolbar$1, Aggregate as Aggregate$1, calculateAggregate, Sort as Sort$1, ColumnMenu as ColumnMenu$1, ContextMenu as ContextMenu$1, Edit as Edit$1, resetRowIndex, CommandColumn as CommandColumn$1, DetailRow as DetailRow$1, VirtualContentRenderer, Cell, getVisiblePage, InterSectionObserver, getTransformValues, VirtualScroll as VirtualScroll$1, RenderType, VirtualHeaderRenderer, ColumnChooser as ColumnChooser$1, InfiniteScroll as InfiniteScroll$1, getRowIndexFromElement, RowRenderer } 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';
@@ -902,6 +902,7 @@ class Selection {
902
902
  this.headerSelectionState = 'uncheck';
903
903
  this.checkedItemCount = 0;
904
904
  this.visibleUidIndex = {};
905
+ initializeTelemetryFeature('selection', 'treegrid');
905
906
  this.parent = parent;
906
907
  this.selectedItems = [];
907
908
  this.selectedIndexes = []; // Initialize here
@@ -4753,6 +4754,7 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
4753
4754
  * @returns {void}
4754
4755
  */
4755
4756
  render() {
4757
+ initializeTelemetry('treegrid');
4756
4758
  if (this.isReact) {
4757
4759
  this.grid.isReact = true;
4758
4760
  this.grid.portals = [];
@@ -8039,15 +8041,9 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8039
8041
  localExpand(action, row, record) {
8040
8042
  let rows;
8041
8043
  const detailRow = row.nextElementSibling ? row.nextElementSibling.classList.contains('e-detailrow') ? row.nextElementSibling : null : null;
8042
- let childRecords;
8043
- if (this.enableInfiniteScrolling) {
8044
- childRecords = this.grid.getRowsObject().filter((e) => { return e.data.parentUniqueID === record.uniqueID; });
8045
- }
8046
- else {
8047
- childRecords = this.grid.currentViewData.filter((e) => {
8048
- return e.parentUniqueID === record.uniqueID;
8049
- });
8050
- }
8044
+ const childRecords = this.grid.currentViewData.filter((e) => {
8045
+ return e.parentUniqueID === record.uniqueID;
8046
+ });
8051
8047
  if (this.isPixelHeight() && row.cells[0].classList.contains('e-lastrowcell')) {
8052
8048
  this.lastRowBorder(row, false);
8053
8049
  }
@@ -8121,11 +8117,12 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
8121
8117
  this.toggleRowVisibility(freezeRightRows[parseInt(i.toString(), 10)], displayAction);
8122
8118
  }
8123
8119
  this.notify('childRowExpand', { row: rows[parseInt(i.toString(), 10)] });
8124
- if ((!isNullOrUndefined(childRecords)) && (!isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].childRecords) && childRecords[parseInt(i.toString(), 10)].childRecords.length > 0) && (action !== 'expand' ||
8125
- isNullOrUndefined(childRecords[parseInt(i.toString(), 10)].expanded) || childRecords[parseInt(i.toString(), 10)].expanded)) {
8126
- this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8120
+ const childRecord = !isNullOrUndefined(childRecords) ? childRecords[parseInt(i.toString(), 10)] : undefined;
8121
+ if (childRecord && (childRecord.childRecords && childRecord.childRecords.length > 0) && (action !== 'expand' ||
8122
+ isNullOrUndefined(childRecord.expanded) || childRecord.expanded)) {
8123
+ this.expandCollapse(action, rows[parseInt(i.toString(), 10)], childRecord, true);
8127
8124
  if (this.frozenColumns <= this.treeColumnIndex && !isNullOrUndefined(movableRows)) {
8128
- this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecords[parseInt(i.toString(), 10)], true);
8125
+ this.expandCollapse(action, movableRows[parseInt(i.toString(), 10)], childRecord, true);
8129
8126
  }
8130
8127
  }
8131
8128
  }
@@ -9343,6 +9340,7 @@ class RowDD {
9343
9340
  * Indicates whether the item is being added to the bottom of the TreeGrid.
9344
9341
  */
9345
9342
  this.isaddtoBottom = false;
9343
+ initializeTelemetryFeature('rowDragAndDrop', 'treegrid');
9346
9344
  Grid.Inject(RowDD$1);
9347
9345
  this.parent = parent;
9348
9346
  this.addEventListener();
@@ -11320,6 +11318,7 @@ class Filter {
11320
11318
  * @param {TreeGrid} parent - Tree Grid instance
11321
11319
  */
11322
11320
  constructor(parent) {
11321
+ initializeTelemetryFeature('filter', 'treegrid');
11323
11322
  Grid.Inject(Filter$1);
11324
11323
  this.parent = parent;
11325
11324
  this.isHierarchyFilter = false;
@@ -12004,6 +12003,7 @@ class PdfExport {
12004
12003
  */
12005
12004
  class Page {
12006
12005
  constructor(parent) {
12006
+ initializeTelemetryFeature('pager', 'treegrid');
12007
12007
  Grid.Inject(Page$1);
12008
12008
  this.parent = parent;
12009
12009
  this.addEventListener();
@@ -12583,6 +12583,7 @@ class Aggregate {
12583
12583
  */
12584
12584
  class Sort {
12585
12585
  constructor(grid) {
12586
+ initializeTelemetryFeature('sort', 'treegrid');
12586
12587
  Grid.Inject(Sort$1);
12587
12588
  this.parent = grid;
12588
12589
  this.taskIds = [];
@@ -12722,6 +12723,7 @@ class ColumnMenu {
12722
12723
  * @param {TreeGrid} parent - Tree Grid instance
12723
12724
  */
12724
12725
  constructor(parent) {
12726
+ initializeTelemetryFeature('columnMenu', 'treegrid');
12725
12727
  Grid.Inject(ColumnMenu$1);
12726
12728
  this.parent = parent;
12727
12729
  }
@@ -13589,6 +13591,7 @@ class Edit {
13589
13591
  this.isAddedRowByContextMenu = false;
13590
13592
  this.isIndexUndefined = false;
13591
13593
  this.isAddedMultipleRowsByMethod = false;
13594
+ initializeTelemetryFeature('edit', 'treegrid');
13592
13595
  Grid.Inject(Edit$1);
13593
13596
  this.parent = parent;
13594
13597
  this.isSelfReference = !isNullOrUndefined(parent.parentIdMapping);
@@ -14766,6 +14769,7 @@ class CommandColumn {
14766
14769
  */
14767
14770
  class DetailRow {
14768
14771
  constructor(parent) {
14772
+ initializeTelemetryFeature('detailRow', 'treegrid');
14769
14773
  Grid.Inject(DetailRow$1);
14770
14774
  this.parent = parent;
14771
14775
  this.addEventListener();
@@ -16367,6 +16371,7 @@ class Freeze {
16367
16371
  * @param {TreeGrid} parent - Tree Grid instance
16368
16372
  */
16369
16373
  constructor(parent) {
16374
+ initializeTelemetryFeature('freeze', 'treegrid');
16370
16375
  Grid.Inject(Freeze$1);
16371
16376
  this.parent = parent;
16372
16377
  this.addEventListener();
@@ -16466,6 +16471,7 @@ class ColumnChooser {
16466
16471
  * @param {TreeGrid} parent - Tree Grid instance.
16467
16472
  */
16468
16473
  constructor(parent) {
16474
+ initializeTelemetryFeature('ColumnChooser', 'treegrid');
16469
16475
  Grid.Inject(ColumnChooser$1);
16470
16476
  this.parent = parent;
16471
16477
  }
@@ -16589,7 +16595,8 @@ class InfiniteScroll {
16589
16595
  const previousPage = this.parent.grid.pageSettings.currentPage;
16590
16596
  const nextPage = Math.ceil(index / this.parent.grid.pageSettings.pageSize) + 1;
16591
16597
  const totalVisibleCount = this.visualData ? this.visualData.length : 0;
16592
- if ((previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
16598
+ if ((totalVisibleCount > 0 && (index + 1) >= totalVisibleCount) ||
16599
+ (previousPage >= this.maxPage) || (nextPage > this.maxPage)) {
16593
16600
  return;
16594
16601
  }
16595
16602
  this.parent.grid.pageSettings.currentPage = nextPage;
@@ -16672,6 +16679,7 @@ class InfiniteScroll {
16672
16679
  const initial = actions.some((value) => { return value === actionArgs.requestType; });
16673
16680
  const initialRender = initial ? true : this.parent.initialRender ? true : false;
16674
16681
  this.visualData = visualData;
16682
+ this.maxPage = Math.ceil(visualData.length / this.parent.pageSettings.pageSize);
16675
16683
  pageingDetails.count = visualData.length;
16676
16684
  if (getValue('isPrinting', pageingDetails.actionArgs)) {
16677
16685
  pageingDetails.result = visualData;