@syncfusion/ej2-treegrid 21.2.6 → 21.2.9

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,9 +1,15 @@
1
1
  import { Browser, ChildProperty, Collection, Complex, Component, Event, EventHandler, Internationalization, KeyboardEvents, L10n, NotifyPropertyChanges, Property, SanitizeHtmlHelper, addClass, classList, closest, compile, createElement, debounce, extend, getEnumValue, getValue, isNullOrUndefined, merge, remove, removeClass, select, setStyleAttribute, setValue } from '@syncfusion/ej2-base';
2
- import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnFreezeContentRenderer, ColumnFreezeHeaderRenderer, ColumnMenu, ColumnVirtualFreezeRenderer, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, FreezeContentRender, FreezeRender, FreezeRowModelGenerator, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualFreezeHdrRenderer, VirtualFreezeRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, setDebounce, templateCompiler } from '@syncfusion/ej2-grids';
2
+ import { Aggregate, Cell, CellRenderer, CellType, Clipboard, ColumnChooser, ColumnFreezeContentRenderer, ColumnFreezeHeaderRenderer, ColumnMenu, ColumnVirtualFreezeRenderer, CommandColumn, ContextMenu, DetailRow, Edit, ExcelExport, Filter, Freeze, FreezeContentRender, FreezeRender, FreezeRowModelGenerator, Grid, InfiniteScroll, InterSectionObserver, Logger, Page, PdfExport, Print, RenderType, Reorder, Resize, RowDD, RowDropSettings, RowRenderer, Scroll, Sort, Toolbar, VirtualContentRenderer, VirtualFreezeHdrRenderer, VirtualFreezeRenderer, VirtualHeaderRenderer, VirtualRowModelGenerator, VirtualScroll, appendChildren, calculateAggregate, detailLists, extend as extend$1, getActualProperties, getObject, getTransformValues, getUid, iterateArrayOrObject, parentsUntil, resetRowIndex, setDebounce, templateCompiler } from '@syncfusion/ej2-grids';
3
3
  import { createCheckBox } from '@syncfusion/ej2-buttons';
4
4
  import { CacheAdaptor, DataManager, DataUtil, Deferred, JsonAdaptor, ODataAdaptor, Predicate, Query, RemoteSaveAdaptor, UrlAdaptor, WebApiAdaptor, WebMethodAdaptor } from '@syncfusion/ej2-data';
5
5
  import { createSpinner, hideSpinner, showSpinner } from '@syncfusion/ej2-popups';
6
6
 
7
+ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
7
13
  /**
8
14
  * Represents TreeGrid `Column` model class.
9
15
  */
@@ -96,8 +102,21 @@ class Column {
96
102
  }
97
103
  }
98
104
  }
105
+ /**
106
+ * Defines TreeGrid column
107
+ */
108
+ class TreeGridColumn extends Column {
109
+ }
110
+ __decorate$1([
111
+ Property(null)
112
+ ], TreeGridColumn.prototype, "columns", void 0);
113
+ /**
114
+ * Defines stacked tree grid column
115
+ */
116
+ class StackedColumn extends TreeGridColumn {
117
+ }
99
118
 
100
- var __decorate$1 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
119
+ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
101
120
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
102
121
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
103
122
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -108,11 +127,11 @@ var __decorate$1 = (undefined && undefined.__decorate) || function (decorators,
108
127
  */
109
128
  class LoadingIndicator extends ChildProperty {
110
129
  }
111
- __decorate$1([
130
+ __decorate$2([
112
131
  Property('Spinner')
113
132
  ], LoadingIndicator.prototype, "indicatorType", void 0);
114
133
 
115
- var __decorate$2 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
134
+ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
116
135
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
117
136
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
118
137
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -123,40 +142,40 @@ var __decorate$2 = (undefined && undefined.__decorate) || function (decorators,
123
142
  */
124
143
  class Predicate$1 extends ChildProperty {
125
144
  }
126
- __decorate$2([
145
+ __decorate$3([
127
146
  Property()
128
147
  ], Predicate$1.prototype, "field", void 0);
129
- __decorate$2([
148
+ __decorate$3([
130
149
  Property()
131
150
  ], Predicate$1.prototype, "operator", void 0);
132
- __decorate$2([
151
+ __decorate$3([
133
152
  Property()
134
153
  ], Predicate$1.prototype, "value", void 0);
135
- __decorate$2([
154
+ __decorate$3([
136
155
  Property()
137
156
  ], Predicate$1.prototype, "matchCase", void 0);
138
- __decorate$2([
157
+ __decorate$3([
139
158
  Property()
140
159
  ], Predicate$1.prototype, "ignoreAccent", void 0);
141
- __decorate$2([
160
+ __decorate$3([
142
161
  Property()
143
162
  ], Predicate$1.prototype, "predicate", void 0);
144
- __decorate$2([
163
+ __decorate$3([
145
164
  Property({})
146
165
  ], Predicate$1.prototype, "actualFilterValue", void 0);
147
- __decorate$2([
166
+ __decorate$3([
148
167
  Property({})
149
168
  ], Predicate$1.prototype, "actualOperator", void 0);
150
- __decorate$2([
169
+ __decorate$3([
151
170
  Property()
152
171
  ], Predicate$1.prototype, "type", void 0);
153
- __decorate$2([
172
+ __decorate$3([
154
173
  Property()
155
174
  ], Predicate$1.prototype, "ejpredicate", void 0);
156
- __decorate$2([
175
+ __decorate$3([
157
176
  Property()
158
177
  ], Predicate$1.prototype, "uid", void 0);
159
- __decorate$2([
178
+ __decorate$3([
160
179
  Property()
161
180
  ], Predicate$1.prototype, "isForeignKey", void 0);
162
181
  /**
@@ -164,32 +183,32 @@ __decorate$2([
164
183
  */
165
184
  class FilterSettings extends ChildProperty {
166
185
  }
167
- __decorate$2([
186
+ __decorate$3([
168
187
  Collection([], Predicate$1)
169
188
  ], FilterSettings.prototype, "columns", void 0);
170
- __decorate$2([
189
+ __decorate$3([
171
190
  Property('FilterBar')
172
191
  ], FilterSettings.prototype, "type", void 0);
173
- __decorate$2([
192
+ __decorate$3([
174
193
  Property()
175
194
  ], FilterSettings.prototype, "mode", void 0);
176
- __decorate$2([
195
+ __decorate$3([
177
196
  Property(true)
178
197
  ], FilterSettings.prototype, "showFilterBarStatus", void 0);
179
- __decorate$2([
198
+ __decorate$3([
180
199
  Property(1500)
181
200
  ], FilterSettings.prototype, "immediateModeDelay", void 0);
182
- __decorate$2([
201
+ __decorate$3([
183
202
  Property()
184
203
  ], FilterSettings.prototype, "operators", void 0);
185
- __decorate$2([
204
+ __decorate$3([
186
205
  Property(false)
187
206
  ], FilterSettings.prototype, "ignoreAccent", void 0);
188
- __decorate$2([
207
+ __decorate$3([
189
208
  Property('Parent')
190
209
  ], FilterSettings.prototype, "hierarchyMode", void 0);
191
210
 
192
- var __decorate$3 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
211
+ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
193
212
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
194
213
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
195
214
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -200,7 +219,7 @@ var __decorate$3 = (undefined && undefined.__decorate) || function (decorators,
200
219
  */
201
220
  class TextWrapSettings extends ChildProperty {
202
221
  }
203
- __decorate$3([
222
+ __decorate$4([
204
223
  Property('Both')
205
224
  ], TextWrapSettings.prototype, "wrapMode", void 0);
206
225
 
@@ -1408,7 +1427,7 @@ class Print$1 {
1408
1427
  }
1409
1428
  }
1410
1429
 
1411
- var __decorate$4 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1430
+ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1412
1431
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1413
1432
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1414
1433
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1419,23 +1438,23 @@ var __decorate$4 = (undefined && undefined.__decorate) || function (decorators,
1419
1438
  */
1420
1439
  class SearchSettings extends ChildProperty {
1421
1440
  }
1422
- __decorate$4([
1441
+ __decorate$5([
1423
1442
  Property()
1424
1443
  ], SearchSettings.prototype, "fields", void 0);
1425
- __decorate$4([
1444
+ __decorate$5([
1426
1445
  Property(false)
1427
1446
  ], SearchSettings.prototype, "ignoreCase", void 0);
1428
- __decorate$4([
1447
+ __decorate$5([
1429
1448
  Property('contains')
1430
1449
  ], SearchSettings.prototype, "operator", void 0);
1431
- __decorate$4([
1450
+ __decorate$5([
1432
1451
  Property()
1433
1452
  ], SearchSettings.prototype, "key", void 0);
1434
- __decorate$4([
1453
+ __decorate$5([
1435
1454
  Property()
1436
1455
  ], SearchSettings.prototype, "hierarchyMode", void 0);
1437
1456
 
1438
- var __decorate$5 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1457
+ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
1439
1458
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
1440
1459
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
1441
1460
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -1446,25 +1465,25 @@ var __decorate$5 = (undefined && undefined.__decorate) || function (decorators,
1446
1465
  */
1447
1466
  class SelectionSettings extends ChildProperty {
1448
1467
  }
1449
- __decorate$5([
1468
+ __decorate$6([
1450
1469
  Property('Row')
1451
1470
  ], SelectionSettings.prototype, "mode", void 0);
1452
- __decorate$5([
1471
+ __decorate$6([
1453
1472
  Property('Flow')
1454
1473
  ], SelectionSettings.prototype, "cellSelectionMode", void 0);
1455
- __decorate$5([
1474
+ __decorate$6([
1456
1475
  Property('Single')
1457
1476
  ], SelectionSettings.prototype, "type", void 0);
1458
- __decorate$5([
1477
+ __decorate$6([
1459
1478
  Property(false)
1460
1479
  ], SelectionSettings.prototype, "persistSelection", void 0);
1461
- __decorate$5([
1480
+ __decorate$6([
1462
1481
  Property('Default')
1463
1482
  ], SelectionSettings.prototype, "checkboxMode", void 0);
1464
- __decorate$5([
1483
+ __decorate$6([
1465
1484
  Property(false)
1466
1485
  ], SelectionSettings.prototype, "checkboxOnly", void 0);
1467
- __decorate$5([
1486
+ __decorate$6([
1468
1487
  Property(true)
1469
1488
  ], SelectionSettings.prototype, "enableToggle", void 0);
1470
1489
 
@@ -1506,7 +1525,7 @@ class Render {
1506
1525
  if (collapsed$$1 && !isNullOrUndefined(args.row)) {
1507
1526
  args.row.style.display = 'none';
1508
1527
  const rowsObj = this.parent.grid.getRowsObject();
1509
- if (!isNullOrUndefined(args.row.getAttribute('data-uid'))) {
1528
+ if (!this.parent.grid.isFrozenGrid() && !isNullOrUndefined(args.row.getAttribute('data-uid'))) {
1510
1529
  rowsObj.filter((e) => e.uid === args.row.getAttribute('data-uid'))[0].visible = false;
1511
1530
  }
1512
1531
  }
@@ -1691,7 +1710,8 @@ class Render {
1691
1710
  }
1692
1711
  if (summaryRow) {
1693
1712
  addClass([args.cell], 'e-summarycell');
1694
- const summaryData = getObject(args.column.field, args.data);
1713
+ let summaryData = getObject(args.column.field, args.data);
1714
+ summaryData = isNullOrUndefined(summaryData) ? null : summaryData;
1695
1715
  if (args.cell.querySelector('.e-treecell') != null) {
1696
1716
  args.cell.querySelector('.e-treecell').innerHTML = summaryData;
1697
1717
  }
@@ -2190,7 +2210,18 @@ class DataManipulation {
2190
2210
  }
2191
2211
  result = resultChildData;
2192
2212
  }
2193
- rowDetails.record.childRecords = result;
2213
+ if (this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
2214
+ rowDetails.record.childRecords = [];
2215
+ for (let i = 0; i < result.length; i++) {
2216
+ if (rowDetails.record['' + this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + this.parent.idMapping] &&
2217
+ rowDetails.record['' + this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + this.parent.parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
2218
+ rowDetails.record.childRecords.push(result[parseInt(i.toString(), 10)]);
2219
+ }
2220
+ }
2221
+ }
2222
+ else {
2223
+ rowDetails.record.childRecords = result;
2224
+ }
2194
2225
  for (let r = 0; r < result.length; r++) {
2195
2226
  if (this.parent.enableVirtualization && result[parseInt(r.toString(), 10)][`${this.parent.idMapping}`] === rowDetails.record[`${this.parent.idMapping}`] && rowDetails.action === 'remoteExpand') {
2196
2227
  this.parent[`${remoteExpandedData}`].push(rowDetails.record);
@@ -2208,6 +2239,7 @@ class DataManipulation {
2208
2239
  if (result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`] === this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${this.parent.idMapping}`]) {
2209
2240
  result[parseInt(r.toString(), 10)].level = this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)][`${level}`] + 1;
2210
2241
  const parentData = this.parent[`${remoteExpandedData}`][parseInt(i.toString(), 10)];
2242
+ delete parentData.childRecords;
2211
2243
  result[parseInt(r.toString(), 10)].parentItem = parentData;
2212
2244
  result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
2213
2245
  }
@@ -2219,6 +2251,10 @@ class DataManipulation {
2219
2251
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
2220
2252
  if (isNullOrUndefined(result[parseInt(r.toString(), 10)][`${this.parent.parentIdMapping}`])) {
2221
2253
  result[parseInt(r.toString(), 10)].level = 0;
2254
+ if (rowDetails.action === 'remoteExpand') {
2255
+ result[parseInt(r.toString(), 10)].childRecords = [];
2256
+ result[parseInt(r.toString(), 10)].childRecords = rowDetails.record.childRecords;
2257
+ }
2222
2258
  }
2223
2259
  else {
2224
2260
  result[parseInt(r.toString(), 10)].level = rowDetails.record.level;
@@ -2662,7 +2698,7 @@ var ContextMenuItems;
2662
2698
  ContextMenuItems[ContextMenuItems["RowOutdent"] = 17] = "RowOutdent";
2663
2699
  })(ContextMenuItems || (ContextMenuItems = {}));
2664
2700
 
2665
- var __decorate$6 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2701
+ var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2666
2702
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2667
2703
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2668
2704
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2673,32 +2709,32 @@ var __decorate$6 = (undefined && undefined.__decorate) || function (decorators,
2673
2709
  */
2674
2710
  class PageSettings extends ChildProperty {
2675
2711
  }
2676
- __decorate$6([
2712
+ __decorate$7([
2677
2713
  Property(12)
2678
2714
  ], PageSettings.prototype, "pageSize", void 0);
2679
- __decorate$6([
2715
+ __decorate$7([
2680
2716
  Property(8)
2681
2717
  ], PageSettings.prototype, "pageCount", void 0);
2682
- __decorate$6([
2718
+ __decorate$7([
2683
2719
  Property(1)
2684
2720
  ], PageSettings.prototype, "currentPage", void 0);
2685
- __decorate$6([
2721
+ __decorate$7([
2686
2722
  Property()
2687
2723
  ], PageSettings.prototype, "totalRecordsCount", void 0);
2688
- __decorate$6([
2724
+ __decorate$7([
2689
2725
  Property(false)
2690
2726
  ], PageSettings.prototype, "enableQueryString", void 0);
2691
- __decorate$6([
2727
+ __decorate$7([
2692
2728
  Property(false)
2693
2729
  ], PageSettings.prototype, "pageSizes", void 0);
2694
- __decorate$6([
2730
+ __decorate$7([
2695
2731
  Property(null)
2696
2732
  ], PageSettings.prototype, "template", void 0);
2697
- __decorate$6([
2733
+ __decorate$7([
2698
2734
  Property('All')
2699
2735
  ], PageSettings.prototype, "pageSizeMode", void 0);
2700
2736
 
2701
- var __decorate$7 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2737
+ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2702
2738
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2703
2739
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2704
2740
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2774,34 +2810,34 @@ class AggregateColumn extends ChildProperty {
2774
2810
  this.setProperties(prop, true);
2775
2811
  }
2776
2812
  }
2777
- __decorate$7([
2813
+ __decorate$8([
2778
2814
  Property()
2779
2815
  ], AggregateColumn.prototype, "type", void 0);
2780
- __decorate$7([
2816
+ __decorate$8([
2781
2817
  Property()
2782
2818
  ], AggregateColumn.prototype, "footerTemplate", void 0);
2783
- __decorate$7([
2819
+ __decorate$8([
2784
2820
  Property()
2785
2821
  ], AggregateColumn.prototype, "field", void 0);
2786
- __decorate$7([
2822
+ __decorate$8([
2787
2823
  Property()
2788
2824
  ], AggregateColumn.prototype, "format", void 0);
2789
- __decorate$7([
2825
+ __decorate$8([
2790
2826
  Property()
2791
2827
  ], AggregateColumn.prototype, "columnName", void 0);
2792
- __decorate$7([
2828
+ __decorate$8([
2793
2829
  Property()
2794
2830
  ], AggregateColumn.prototype, "customAggregate", void 0);
2795
2831
  class AggregateRow extends ChildProperty {
2796
2832
  }
2797
- __decorate$7([
2833
+ __decorate$8([
2798
2834
  Collection([], AggregateColumn)
2799
2835
  ], AggregateRow.prototype, "columns", void 0);
2800
- __decorate$7([
2836
+ __decorate$8([
2801
2837
  Property(true)
2802
2838
  ], AggregateRow.prototype, "showChildSummary", void 0);
2803
2839
 
2804
- var __decorate$8 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2840
+ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2805
2841
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2806
2842
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2807
2843
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2812,41 +2848,41 @@ var __decorate$8 = (undefined && undefined.__decorate) || function (decorators,
2812
2848
  */
2813
2849
  class EditSettings extends ChildProperty {
2814
2850
  }
2815
- __decorate$8([
2851
+ __decorate$9([
2816
2852
  Property(false)
2817
2853
  ], EditSettings.prototype, "allowAdding", void 0);
2818
- __decorate$8([
2854
+ __decorate$9([
2819
2855
  Property(false)
2820
2856
  ], EditSettings.prototype, "allowEditing", void 0);
2821
- __decorate$8([
2857
+ __decorate$9([
2822
2858
  Property(false)
2823
2859
  ], EditSettings.prototype, "allowDeleting", void 0);
2824
- __decorate$8([
2860
+ __decorate$9([
2825
2861
  Property('Cell')
2826
2862
  ], EditSettings.prototype, "mode", void 0);
2827
- __decorate$8([
2863
+ __decorate$9([
2828
2864
  Property('Top')
2829
2865
  ], EditSettings.prototype, "newRowPosition", void 0);
2830
- __decorate$8([
2866
+ __decorate$9([
2831
2867
  Property(true)
2832
2868
  ], EditSettings.prototype, "allowEditOnDblClick", void 0);
2833
- __decorate$8([
2869
+ __decorate$9([
2834
2870
  Property(true)
2835
2871
  ], EditSettings.prototype, "showConfirmDialog", void 0);
2836
- __decorate$8([
2872
+ __decorate$9([
2837
2873
  Property(false)
2838
2874
  ], EditSettings.prototype, "showDeleteConfirmDialog", void 0);
2839
- __decorate$8([
2875
+ __decorate$9([
2840
2876
  Property('')
2841
2877
  ], EditSettings.prototype, "template", void 0);
2842
- __decorate$8([
2878
+ __decorate$9([
2843
2879
  Property({})
2844
2880
  ], EditSettings.prototype, "dialog", void 0);
2845
- __decorate$8([
2881
+ __decorate$9([
2846
2882
  Property(false)
2847
2883
  ], EditSettings.prototype, "allowNextRowEdit", void 0);
2848
2884
 
2849
- var __decorate$9 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2885
+ var __decorate$10 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
2850
2886
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
2851
2887
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
2852
2888
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -2857,10 +2893,10 @@ var __decorate$9 = (undefined && undefined.__decorate) || function (decorators,
2857
2893
  */
2858
2894
  class SortDescriptor extends ChildProperty {
2859
2895
  }
2860
- __decorate$9([
2896
+ __decorate$10([
2861
2897
  Property()
2862
2898
  ], SortDescriptor.prototype, "field", void 0);
2863
- __decorate$9([
2899
+ __decorate$10([
2864
2900
  Property()
2865
2901
  ], SortDescriptor.prototype, "direction", void 0);
2866
2902
  /**
@@ -2868,10 +2904,10 @@ __decorate$9([
2868
2904
  */
2869
2905
  class SortSettings extends ChildProperty {
2870
2906
  }
2871
- __decorate$9([
2907
+ __decorate$10([
2872
2908
  Collection([], SortDescriptor)
2873
2909
  ], SortSettings.prototype, "columns", void 0);
2874
- __decorate$9([
2910
+ __decorate$10([
2875
2911
  Property(true)
2876
2912
  ], SortSettings.prototype, "allowUnsort", void 0);
2877
2913
 
@@ -3275,7 +3311,7 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3275
3311
  }
3276
3312
  }
3277
3313
 
3278
- var __decorate$10 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3314
+ var __decorate$11 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
3279
3315
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3280
3316
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
3281
3317
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -3286,13 +3322,13 @@ var __decorate$10 = (undefined && undefined.__decorate) || function (decorators,
3286
3322
  */
3287
3323
  class InfiniteScrollSettings extends ChildProperty {
3288
3324
  }
3289
- __decorate$10([
3325
+ __decorate$11([
3290
3326
  Property(false)
3291
3327
  ], InfiniteScrollSettings.prototype, "enableCache", void 0);
3292
- __decorate$10([
3328
+ __decorate$11([
3293
3329
  Property(3)
3294
3330
  ], InfiniteScrollSettings.prototype, "maxBlocks", void 0);
3295
- __decorate$10([
3331
+ __decorate$11([
3296
3332
  Property(3)
3297
3333
  ], InfiniteScrollSettings.prototype, "initialBlocks", void 0);
3298
3334
 
@@ -5890,7 +5926,17 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
5890
5926
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
5891
5927
  }
5892
5928
  else {
5893
- record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
5929
+ if (this.enableVirtualization && this.isCollapseAll) {
5930
+ if (this.isExpandAll && row.rowIndex === -1) {
5931
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
5932
+ }
5933
+ else {
5934
+ record = this.grid.getCurrentViewRecords()[row.rowIndex];
5935
+ }
5936
+ }
5937
+ else {
5938
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
5939
+ }
5894
5940
  }
5895
5941
  }
5896
5942
  return record;
@@ -6113,10 +6159,17 @@ let TreeGrid = TreeGrid_1 = class TreeGrid extends Component {
6113
6159
  if (rows.length) {
6114
6160
  for (let i = 0; i < rows.length; i++) {
6115
6161
  if (action === 'collapse') {
6116
- this.collapseRow(rows[parseInt(i.toString(), 10)]);
6162
+ if (!isNullOrUndefined(this.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex])) {
6163
+ this.collapseRow(rows[parseInt(i.toString(), 10)]);
6164
+ }
6117
6165
  }
6118
6166
  else {
6119
- this.expandRow(rows[parseInt(i.toString(), 10)]);
6167
+ if (!this.enableVirtualization) {
6168
+ this.expandRow(rows[parseInt(i.toString(), 10)]);
6169
+ }
6170
+ else if (rows[0].getAttribute('aria-expanded') !== 'true') {
6171
+ this.expandRow(rows[0]);
6172
+ }
6120
6173
  }
6121
6174
  }
6122
6175
  }
@@ -8457,14 +8510,13 @@ class RowDD$1 {
8457
8510
  const childRecords = rec[0].childRecords;
8458
8511
  const droppedRecordIndex = childRecords.indexOf(droppedRecord) + 1;
8459
8512
  childRecords.splice(droppedRecordIndex, 0, draggedRecord);
8460
- if (this.parent.enableImmutableMode || this.parent['isIndentEnabled'] && !this.parent.parentIdMapping) {
8461
- draggedRecord.parentItem = droppedRecord.parentItem;
8462
- draggedRecord.level = droppedRecord.level;
8463
- }
8513
+ draggedRecord.parentItem = droppedRecord.parentItem;
8464
8514
  draggedRecord.parentUniqueID = droppedRecord.parentUniqueID;
8515
+ draggedRecord.level = droppedRecord.level;
8465
8516
  if (this.parent.parentIdMapping) {
8466
8517
  draggedRecord[this.parent.parentIdMapping] = droppedRecord[this.parent.parentIdMapping];
8467
- draggedRecord.parentUniqueID = droppedRecord.parentUniqueID;
8518
+ draggedRecord.parentItem = droppedRecord.parentItem;
8519
+ draggedRecord.level = droppedRecord.level;
8468
8520
  }
8469
8521
  }
8470
8522
  if (draggedRecord.hasChildRecords) {
@@ -8849,7 +8901,7 @@ class RowDD$1 {
8849
8901
  * Base export
8850
8902
  */
8851
8903
 
8852
- var __decorate$11 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
8904
+ var __decorate$12 = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
8853
8905
  var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
8854
8906
  if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
8855
8907
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
@@ -8860,7 +8912,7 @@ var __decorate$11 = (undefined && undefined.__decorate) || function (decorators,
8860
8912
  */
8861
8913
  class RowDropSettings$1 extends ChildProperty {
8862
8914
  }
8863
- __decorate$11([
8915
+ __decorate$12([
8864
8916
  Property()
8865
8917
  ], RowDropSettings$1.prototype, "targetID", void 0);
8866
8918
 
@@ -11122,6 +11174,9 @@ class Edit$1 {
11122
11174
  }
11123
11175
  gridDblClick(e) {
11124
11176
  this.doubleClickTarget = e.target;
11177
+ if (e.target.classList.contains('e-frame') && this.parent.getCurrentViewRecords().length === 0) {
11178
+ this.doubleClickTarget = null;
11179
+ }
11125
11180
  }
11126
11181
  getRowPosition(addArgs) {
11127
11182
  addArgs.newRowPosition = this.parent.editSettings.newRowPosition;
@@ -11129,7 +11184,9 @@ class Edit$1 {
11129
11184
  addArgs.dataRowIndex = +this.prevAriaRowIndex;
11130
11185
  }
11131
11186
  beforeStartEdit(args) {
11132
- this.parent.trigger(actionBegin, args);
11187
+ if (this.parent.editSettings.mode === 'Cell') {
11188
+ this.parent.trigger(actionBegin, args);
11189
+ }
11133
11190
  }
11134
11191
  beforeBatchCancel(args) {
11135
11192
  if (this.parent.editSettings.mode === 'Cell') {
@@ -11695,7 +11752,7 @@ class Edit$1 {
11695
11752
  index = index + batchChildCount;
11696
11753
  }
11697
11754
  }
11698
- else {
11755
+ else if (!this.parent.enableVirtualization) {
11699
11756
  index += findChildrenRecords(records[parseInt(index.toString(), 10)]).length;
11700
11757
  }
11701
11758
  }
@@ -12624,7 +12681,7 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12624
12681
  const currentViewData = this.parent.currentViewData;
12625
12682
  const indexValue = 'index';
12626
12683
  if (upScroll && (scrollArgs.direction !== 'right' && scrollArgs.direction !== 'left')) {
12627
- const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? this.parent.height :
12684
+ const vHeight = +(this.parent.height.toString().indexOf('%') < 0 ? parseInt(this.parent.height.toString(), 10) :
12628
12685
  this.parent.element.getBoundingClientRect().height);
12629
12686
  let index = (~~(content$$1.scrollTop / rowHeight)
12630
12687
  + Math.ceil(vHeight / rowHeight))
@@ -12683,6 +12740,11 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12683
12740
  }
12684
12741
  this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
12685
12742
  this.endIndex = lastIndex;
12743
+ if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords &&
12744
+ (this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) &&
12745
+ (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
12746
+ this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
12747
+ }
12686
12748
  if (currentViewData.length && this.startIndex > currentViewData[0][`${indexValue}`] &&
12687
12749
  ((this.startIndex - currentViewData[0][`${indexValue}`]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
12688
12750
  this.startIndex = currentViewData[0][`${indexValue}`] + (this.parent.pageSettings.pageSize / 2);
@@ -12695,7 +12757,12 @@ class VirtualTreeContentRenderer extends VirtualContentRenderer {
12695
12757
  this.translateY = scrollArgs.offset.top - rowHeight * 2;
12696
12758
  }
12697
12759
  else {
12698
- this.translateY = scrollArgs.offset.top;
12760
+ if (this.totalRecords == this.endIndex) {
12761
+ this.translateY = scrollArgs.offset.top - (rowHeight - outBuffer);
12762
+ }
12763
+ else {
12764
+ this.translateY = scrollArgs.offset.top;
12765
+ }
12699
12766
  }
12700
12767
  }
12701
12768
  }
@@ -13016,14 +13083,17 @@ class VirtualScroll$1 {
13016
13083
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
13017
13084
  this.parent.grid.notify(virtualActionArgs, { setTop: true });
13018
13085
  }
13019
- if (requestType === 'save' && this.parent.editSettings.newRowPosition === 'Bottom') {
13086
+ if (requestType === 'save') {
13087
+ startIndex = counts.startIndex + (counts.count - counts.endIndex);
13020
13088
  endIndex = counts.count;
13021
13089
  }
13022
13090
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
13023
13091
  //this.prevendIndex === endIndex && this.prevstartIndex === startIndex) {
13092
+ const virtualWrapperElement = this.parent.grid.contentModule.virtualEle.wrapper;
13093
+ const translateY = getTransformValues(virtualWrapperElement).height;
13024
13094
  if (!isNullOrUndefined(this.expandCollapseRec) && (pageingDetails.actionArgs.requestType === 'virtualscroll' ||
13025
13095
  (pageingDetails.actionArgs.requestType === 'refresh' && startIndex !== this.prevstartIndex)) &&
13026
- (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length)) {
13096
+ (startIndex < this.parent.getRows().length && endIndex <= startIndex + this.parent.getRows().length) && translateY === 0) {
13027
13097
  startIndex = 0;
13028
13098
  }
13029
13099
  if (!isNullOrUndefined(this.expandCollapseRec)) {
@@ -13099,7 +13169,7 @@ class TreeVirtual extends VirtualScroll {
13099
13169
  if (!isNullOrUndefined(parentGrid.height) && typeof (parentGrid.height) === 'string' && parentGrid.height.indexOf('%') !== -1) {
13100
13170
  parentGrid.element.style.height = parentGrid.height;
13101
13171
  }
13102
- const vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parentGrid.height :
13172
+ const vHeight = parentGrid.height.toString().indexOf('%') < 0 ? parseInt(parentGrid.height.toString(), 10) :
13103
13173
  parentGrid.element.getBoundingClientRect().height;
13104
13174
  const blockSize = ~~(vHeight / rowHeight);
13105
13175
  const height = blockSize * 2;
@@ -13750,5 +13820,5 @@ class InfiniteScroll$1 {
13750
13820
  * Export TreeGrid component
13751
13821
  */
13752
13822
 
13753
- export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, headerContent, movableContent, movableHeader, frozenContent, frozenHeader, content, table, leftRight, frozenRight, frozenLeft, dataColIndex, ariaColIndex, dataRowIndex, ariaRowIndex, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, LoadingIndicator, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
13823
+ export { TreeGrid, load, rowDataBound, dataBound, queryCellInfo, beforeDataBound, actionBegin, dataStateChange, actionComplete, rowSelecting, rowSelected, checkboxChange, rowDeselected, toolbarClick, beforeExcelExport, beforePdfExport, resizeStop, expanded, expanding, collapsed, collapsing, remoteExpand, localPagedExpandCollapse, pagingActions, printGridInit, contextMenuOpen, contextMenuClick, beforeCopy, beforePaste, savePreviousRowPosition, crudAction, beginEdit, beginAdd, recordDoubleClick, cellSave, cellSaved, cellEdit, batchDelete, batchCancel, batchAdd, beforeBatchDelete, beforeBatchAdd, beforeBatchSave, batchSave, keyPressed, updateData, doubleTap, virtualColumnIndex, virtualActionArgs, destroy, dataListener, indexModifier, beforeStartEdit, beforeBatchCancel, batchEditFormRendered, detailDataBound, rowDrag, rowDragStartHelper, rowDrop, rowDragStart, rowsAdd, rowsRemove, rowdraging, rowDropped, autoCol, rowDeselecting, headerContent, movableContent, movableHeader, frozenContent, frozenHeader, content, table, leftRight, frozenRight, frozenLeft, dataColIndex, ariaColIndex, dataRowIndex, ariaRowIndex, DataManipulation, Reorder$1 as Reorder, Resize$1 as Resize, RowDD$1 as RowDD, Column, TreeGridColumn, StackedColumn, EditSettings, Predicate$1 as Predicate, FilterSettings, PageSettings, SearchSettings, SelectionSettings, AggregateColumn, AggregateRow, SortDescriptor, SortSettings, RowDropSettings$1 as RowDropSettings, InfiniteScrollSettings, LoadingIndicator, Render, TreeVirtualRowModelGenerator, isRemoteData, isCountRequired, isCheckboxcolumn, isFilterChildHierarchy, findParentRecords, getExpandStatus, findChildrenRecords, isOffline, extendArray, getPlainData, getParentData, isHidden, ToolbarItem, ContextMenuItems, Filter$1 as Filter, ExcelExport$1 as ExcelExport, PdfExport$1 as PdfExport, Page$1 as Page, Toolbar$1 as Toolbar, Aggregate$1 as Aggregate, Sort$1 as Sort, TreeClipboard, ColumnMenu$1 as ColumnMenu, ContextMenu$1 as ContextMenu, Edit$1 as Edit, CommandColumn$1 as CommandColumn, Selection, DetailRow$1 as DetailRow, VirtualScroll$1 as VirtualScroll, TreeVirtual, Freeze$1 as Freeze, ColumnChooser$1 as ColumnChooser, Logger$1 as Logger, treeGridDetails, InfiniteScroll$1 as InfiniteScroll };
13754
13824
  //# sourceMappingURL=ej2-treegrid.es2015.js.map