@syncfusion/ej2-treegrid 21.2.5 → 21.2.8

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,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 21.2.5
3
+ * version : 21.2.8
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-treegrid@*",
3
- "_id": "@syncfusion/ej2-treegrid@21.2.4",
3
+ "_id": "@syncfusion/ej2-treegrid@21.2.6",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-NpKOhZ2iXKUVktbOJarp6RNqk6nazOQnlrVSmDxL5BFnM/0TdyM0R64+eynPJiF4IpIB7rat9MkCtTTiCnL4xA==",
5
+ "_integrity": "sha512-NzafL9al8nE1C5t5twJkJtbE+e1fPfPbrQ9XMsTtRK5lbwH4oC5L1jvd9zVi64dyIcg/pZ+8D4azfp4VH2WPug==",
6
6
  "_location": "/@syncfusion/ej2-treegrid",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -24,8 +24,8 @@
24
24
  "/@syncfusion/ej2-react-treegrid",
25
25
  "/@syncfusion/ej2-vue-treegrid"
26
26
  ],
27
- "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-21.2.4.tgz",
28
- "_shasum": "828522ae3a9455dbab9dc3d5d7d46cb6c510e995",
27
+ "_resolved": "https://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-21.2.6.tgz",
28
+ "_shasum": "d690fce46ba8b43ebec06238d4c494093b9833b1",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/elease-automation_release_21.1.1/packages/included",
31
31
  "author": {
@@ -37,8 +37,8 @@
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
39
  "@syncfusion/ej2-base": "~21.2.3",
40
- "@syncfusion/ej2-data": "~21.2.4",
41
- "@syncfusion/ej2-grids": "~21.2.5",
40
+ "@syncfusion/ej2-data": "~21.2.8",
41
+ "@syncfusion/ej2-grids": "~21.2.8",
42
42
  "@syncfusion/ej2-popups": "~21.2.4"
43
43
  },
44
44
  "deprecated": false,
@@ -66,6 +66,6 @@
66
66
  "url": "git+https://github.com/syncfusion/ej2-treegrid.git"
67
67
  },
68
68
  "typings": "index.d.ts",
69
- "version": "21.2.5",
69
+ "version": "21.2.8",
70
70
  "sideEffects": false
71
71
  }
@@ -644,7 +644,7 @@ var Edit = /** @class */ (function () {
644
644
  index = index + batchChildCount;
645
645
  }
646
646
  }
647
- else {
647
+ else if (!this.parent.enableVirtualization) {
648
648
  index += findChildrenRecords(records[parseInt(index.toString(), 10)]).length;
649
649
  }
650
650
  }
@@ -124,7 +124,7 @@ var VirtualScroll = /** @class */ (function () {
124
124
  this.parent.grid.getContent().firstElementChild.scrollTop = 0;
125
125
  this.parent.grid.notify(events.virtualActionArgs, { setTop: true });
126
126
  }
127
- if (requestType === 'save' && this.parent.editSettings.newRowPosition === 'Bottom') {
127
+ if (requestType === 'save') {
128
128
  endIndex = counts.count;
129
129
  }
130
130
  //if ((this.prevendIndex !== -1 && this.prevstartIndex !== -1) &&
@@ -396,7 +396,18 @@ var DataManipulation = /** @class */ (function () {
396
396
  }
397
397
  result = resultChildData;
398
398
  }
399
- rowDetails.record.childRecords = result;
399
+ if (_this.parent.enableVirtualization && rowDetails.action === 'remoteExpand') {
400
+ rowDetails.record.childRecords = [];
401
+ for (var i = 0; i < result.length; i++) {
402
+ if (rowDetails.record['' + _this.parent.idMapping] !== result[parseInt(i.toString(), 10)]['' + _this.parent.idMapping] &&
403
+ rowDetails.record['' + _this.parent.idMapping] === result[parseInt(i.toString(), 10)]['' + _this.parent.parentIdMapping] && Object.prototype.hasOwnProperty.call(result, i)) {
404
+ rowDetails.record.childRecords.push(result[parseInt(i.toString(), 10)]);
405
+ }
406
+ }
407
+ }
408
+ else {
409
+ rowDetails.record.childRecords = result;
410
+ }
400
411
  for (var r = 0; r < result.length; r++) {
401
412
  if (_this.parent.enableVirtualization && result[parseInt(r.toString(), 10)]["" + _this.parent.idMapping] === rowDetails.record["" + _this.parent.idMapping] && rowDetails.action === 'remoteExpand') {
402
413
  _this.parent["" + remoteExpandedData].push(rowDetails.record);
@@ -414,6 +425,7 @@ var DataManipulation = /** @class */ (function () {
414
425
  if (result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping] === _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + _this.parent.idMapping]) {
415
426
  result[parseInt(r.toString(), 10)].level = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)]["" + level] + 1;
416
427
  var parentData = _this.parent["" + remoteExpandedData][parseInt(i.toString(), 10)];
428
+ delete parentData.childRecords;
417
429
  result[parseInt(r.toString(), 10)].parentItem = parentData;
418
430
  result[parseInt(r.toString(), 10)].parentUniqueID = rowDetails.record.uniqueID;
419
431
  }
@@ -425,6 +437,10 @@ var DataManipulation = /** @class */ (function () {
425
437
  && !(haveChild && !haveChild[parseInt(r.toString(), 10)])) {
426
438
  if (isNullOrUndefined(result[parseInt(r.toString(), 10)]["" + _this.parent.parentIdMapping])) {
427
439
  result[parseInt(r.toString(), 10)].level = 0;
440
+ if (rowDetails.action === 'remoteExpand') {
441
+ result[parseInt(r.toString(), 10)].childRecords = [];
442
+ result[parseInt(r.toString(), 10)].childRecords = rowDetails.record.childRecords;
443
+ }
428
444
  }
429
445
  else {
430
446
  result[parseInt(r.toString(), 10)].level = rowDetails.record.level;
@@ -28,6 +28,7 @@ export interface TreeGridModel extends ComponentModel{
28
28
  * * EllipsisWithTooltip :- Displays ellipsis when the cell content overflows its area,
29
29
  * ```
30
30
  * also it will display the tooltip while hover on ellipsis is applied.
31
+ *
31
32
  * @default Syncfusion.EJ2.Grids.ClipMode.Ellipsis
32
33
  * @aspType Syncfusion.EJ2.Grids.ClipMode
33
34
  * @isEnumeration true
@@ -131,6 +132,7 @@ export interface TreeGridModel extends ComponentModel{
131
132
  * * AllPages :- Prints all pages of the TreeGrid.
132
133
  * * CurrentPage :- Prints the current page of the TreeGrid.
133
134
  * ```
135
+ *
134
136
  * @default Syncfusion.EJ2.Grids.PrintMode.AllPages
135
137
  * @isEnumeration true
136
138
  * @aspType Syncfusion.EJ2.Grids.PrintMode
@@ -329,6 +331,7 @@ export interface TreeGridModel extends ComponentModel{
329
331
  * * Vertical :- Displays the vertical TreeGrid lines only.
330
332
  * * Default :- Displays TreeGrid lines based on the theme.
331
333
  * ```
334
+ *
332
335
  * @default Syncfusion.EJ2.Grids.GridLine.Default
333
336
  * @isEnumeration true
334
337
  * @aspType Syncfusion.EJ2.Grids.GridLine
@@ -174,6 +174,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
174
174
  * * EllipsisWithTooltip :- Displays ellipsis when the cell content overflows its area,
175
175
  * ```
176
176
  * also it will display the tooltip while hover on ellipsis is applied.
177
+ *
177
178
  * @default Syncfusion.EJ2.Grids.ClipMode.Ellipsis
178
179
  * @aspType Syncfusion.EJ2.Grids.ClipMode
179
180
  * @isEnumeration true
@@ -291,6 +292,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
291
292
  * * AllPages :- Prints all pages of the TreeGrid.
292
293
  * * CurrentPage :- Prints the current page of the TreeGrid.
293
294
  * ```
295
+ *
294
296
  * @default Syncfusion.EJ2.Grids.PrintMode.AllPages
295
297
  * @isEnumeration true
296
298
  * @aspType Syncfusion.EJ2.Grids.PrintMode
@@ -465,6 +467,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
465
467
  * * Vertical :- Displays the vertical TreeGrid lines only.
466
468
  * * Default :- Displays TreeGrid lines based on the theme.
467
469
  * ```
470
+ *
468
471
  * @default Syncfusion.EJ2.Grids.GridLine.Default
469
472
  * @isEnumeration true
470
473
  * @aspType Syncfusion.EJ2.Grids.GridLine
@@ -2657,7 +2657,12 @@ var TreeGrid = /** @class */ (function (_super) {
2657
2657
  record = this.grid.getCurrentViewRecords()[row.getAttribute('data-rowindex')];
2658
2658
  }
2659
2659
  else {
2660
- record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
2660
+ if (this.enableVirtualization && this.isCollapseAll) {
2661
+ record = this.grid.getCurrentViewRecords()[row.rowIndex];
2662
+ }
2663
+ else {
2664
+ record = this.grid.getCurrentViewRecords()[parseInt(row.getAttribute('data-rowindex'), 10)];
2665
+ }
2661
2666
  }
2662
2667
  }
2663
2668
  return record;
@@ -2887,7 +2892,9 @@ var TreeGrid = /** @class */ (function (_super) {
2887
2892
  if (rows.length) {
2888
2893
  for (var i = 0; i < rows.length; i++) {
2889
2894
  if (action === 'collapse') {
2890
- this.collapseRow(rows[parseInt(i.toString(), 10)]);
2895
+ if (!isNullOrUndefined(this.getCurrentViewRecords()[rows[parseInt(i.toString(), 10)].rowIndex])) {
2896
+ this.collapseRow(rows[parseInt(i.toString(), 10)]);
2897
+ }
2891
2898
  }
2892
2899
  else {
2893
2900
  this.expandRow(rows[parseInt(i.toString(), 10)]);
@@ -3335,7 +3342,7 @@ var TreeGrid = /** @class */ (function (_super) {
3335
3342
  }
3336
3343
  }
3337
3344
  if (cRow.length && childRecord.expanded) {
3338
- this.collapseRemoteChild({ record: childRecord, rows: cRow }, true);
3345
+ this.collapseRemoteChild({ record: childRecord, rows: cRow }, false);
3339
3346
  }
3340
3347
  }
3341
3348
  }
@@ -24,6 +24,7 @@ export declare type FilterHierarchyMode = 'Parent' | 'Child' | 'Both' | 'None';
24
24
  * * CsvExport :- Export the TreeGrid to Csv.
25
25
  * * Print :- Print the TreeGrid.
26
26
  * ```
27
+ *
27
28
  * @hidden
28
29
  */
29
30
  export declare type ToolbarItems = 'Add' | 'Delete' | 'Update' | 'Cancel' | 'Edit' | 'Search' | 'ExpandAll' | 'CollapseAll' | 'ExcelExport' | 'PdfExport' | 'CsvExport' | 'Print';
@@ -75,6 +76,7 @@ export declare type PageSizeMode = 'All' | 'Root';
75
76
  * * LastPage :- Go to the last page.
76
77
  * * NextPage :- Go to the next page.
77
78
  * ```
79
+ *
78
80
  * @hidden
79
81
  */
80
82
  export declare type ContextMenuItem = 'AutoFitAll' | 'AutoFit' | 'SortAscending' | 'SortDescending' | 'Edit' | 'Delete' | 'Save' | 'Cancel' | 'PdfExport' | 'ExcelExport' | 'CsvExport' | 'FirstPage' | 'PrevPage' | 'LastPage' | 'NextPage' | 'AddRow' | 'Indent' | 'Outdent';
@@ -165,6 +165,7 @@ export interface FilterSettingsModel {
165
165
  * * OnEnter :- Initiates filter operation after Enter key is pressed.
166
166
  * * Immediate :- Initiates filter operation after a certain time interval. By default, time interval is 1500 ms.
167
167
  * ```
168
+ *
168
169
  * @default Syncfusion.EJ2.Grids.FilterBarMode.OnEnter
169
170
  * @isEnumeration true
170
171
  * @aspType Syncfusion.EJ2.Grids.FilterBarMode
@@ -150,6 +150,7 @@ export declare class FilterSettings extends ChildProperty<FilterSettings> {
150
150
  * * OnEnter :- Initiates filter operation after Enter key is pressed.
151
151
  * * Immediate :- Initiates filter operation after a certain time interval. By default, time interval is 1500 ms.
152
152
  * ```
153
+ *
153
154
  * @default Syncfusion.EJ2.Grids.FilterBarMode.OnEnter
154
155
  * @isEnumeration true
155
156
  * @aspType Syncfusion.EJ2.Grids.FilterBarMode
@@ -26,6 +26,7 @@ export interface SelectionSettingsModel {
26
26
  * * Flow :- Selects the range of cells between start index and end index that also includes the other cells of the selected rows.
27
27
  * * Box :- Selects the range of cells within the start and end column indexes that includes in between cells of rows within the range.
28
28
  * ```
29
+ *
29
30
  * @default Syncfusion.EJ2.Grids.CellSelectionMode.Flow
30
31
  * @isEnumeration true
31
32
  * @aspType Syncfusion.EJ2.Grids.CellSelectionMode
@@ -38,6 +39,7 @@ export interface SelectionSettingsModel {
38
39
  * * Single :- Allows selection of only a row or a cell.
39
40
  * * Multiple :- Allows selection of multiple rows or cells.
40
41
  * ```
42
+ *
41
43
  * @default Syncfusion.EJ2.Grids.SelectionType.Single
42
44
  * @isEnumeration true
43
45
  * @aspType Syncfusion.EJ2.Grids.SelectionType
@@ -24,6 +24,7 @@ export declare class SelectionSettings extends ChildProperty<SelectionSettings>
24
24
  * * Flow :- Selects the range of cells between start index and end index that also includes the other cells of the selected rows.
25
25
  * * Box :- Selects the range of cells within the start and end column indexes that includes in between cells of rows within the range.
26
26
  * ```
27
+ *
27
28
  * @default Syncfusion.EJ2.Grids.CellSelectionMode.Flow
28
29
  * @isEnumeration true
29
30
  * @aspType Syncfusion.EJ2.Grids.CellSelectionMode
@@ -35,6 +36,7 @@ export declare class SelectionSettings extends ChildProperty<SelectionSettings>
35
36
  * * Single :- Allows selection of only a row or a cell.
36
37
  * * Multiple :- Allows selection of multiple rows or cells.
37
38
  * ```
39
+ *
38
40
  * @default Syncfusion.EJ2.Grids.SelectionType.Single
39
41
  * @isEnumeration true
40
42
  * @aspType Syncfusion.EJ2.Grids.SelectionType
@@ -402,7 +402,7 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
402
402
  this.startIndex = (this.startIndex - remains) < 0 ? 0 : (this.startIndex - remains);
403
403
  }
404
404
  if (currentViewData.length && (currentViewData[0]["" + indexValue] >= this.parent.pageSettings.pageSize / 2) &&
405
- ((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2))) {
405
+ ((currentViewData[0]["" + indexValue] - this.startIndex) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
406
406
  this.startIndex = currentViewData[0]["" + indexValue] - (this.parent.pageSettings.pageSize / 2);
407
407
  this.endIndex = this.startIndex + this.parent.pageSettings.pageSize;
408
408
  }
@@ -443,8 +443,11 @@ var VirtualTreeContentRenderer = /** @class */ (function (_super) {
443
443
  }
444
444
  this.startIndex = !isLastBlock ? lastIndex - this.parent.pageSettings.pageSize : nextSetResIndex;
445
445
  this.endIndex = lastIndex;
446
+ if ((nextSetResIndex + this.parent.pageSettings.pageSize) > this.totalRecords && (this.endIndex - this.startIndex) < (this.parent.pageSettings.pageSize / 2) && (this.endIndex - nextSetResIndex) < (this.parent.pageSettings.pageSize / 2)) {
447
+ this.startIndex = lastIndex - (this.parent.pageSettings.pageSize / 2);
448
+ }
446
449
  if (currentViewData.length && this.startIndex > currentViewData[0]["" + indexValue] &&
447
- ((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2))) {
450
+ ((this.startIndex - currentViewData[0]["" + indexValue]) < (this.parent.pageSettings.pageSize / 2)) && this.parent.selectionModule.isRowSelected) {
448
451
  this.startIndex = currentViewData[0]["" + indexValue] + (this.parent.pageSettings.pageSize / 2);
449
452
  }
450
453
  if (scrollArgs.offset.top > (rowHeight * this.totalRecords)) {