@syncfusion/ej2-treegrid 20.3.49 → 20.3.50

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 : 20.3.49
3
+ * version : 20.3.50
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@20.3.48",
3
+ "_id": "@syncfusion/ej2-treegrid@20.3.49",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-FntkOlAYV9IljTx9G3tCA8gbjuc/dBLSHI8BT8KxgljA9j9KWzRAO0yPQ0PHiZfMXcEt3ypWcntHwh9TvcfYKA==",
5
+ "_integrity": "sha512-48n9ELayHVf9o6D/gd4RUFkaaZLi8jbQw9ayr7xU+9E5iTtIzjzM+MagsBcmi3g6cGX9ia+ZA1jAMgVAbZkuSA==",
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": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.3.48.tgz",
28
- "_shasum": "2170f2614a8c447a00d8ed7f29c0cefa3e7a09bd",
27
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-20.3.49.tgz",
28
+ "_shasum": "a830c8b6226e2b1d86a1ba0b50b1d9879604fbc2",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
- "@syncfusion/ej2-base": "~20.3.49",
40
- "@syncfusion/ej2-data": "~20.3.47",
41
- "@syncfusion/ej2-grids": "~20.3.49",
42
- "@syncfusion/ej2-popups": "~20.3.49"
39
+ "@syncfusion/ej2-base": "~20.3.50",
40
+ "@syncfusion/ej2-data": "~20.3.50",
41
+ "@syncfusion/ej2-grids": "~20.3.50",
42
+ "@syncfusion/ej2-popups": "~20.3.50"
43
43
  },
44
44
  "deprecated": false,
45
45
  "description": "Essential JS 2 TreeGrid Component",
@@ -60,6 +60,6 @@
60
60
  "url": "git+https://github.com/syncfusion/ej2-treegrid.git"
61
61
  },
62
62
  "typings": "index.d.ts",
63
- "version": "20.3.49",
63
+ "version": "20.3.50",
64
64
  "sideEffects": false
65
65
  }
@@ -223,7 +223,7 @@ var DataManipulation = /** @class */ (function () {
223
223
  }
224
224
  }
225
225
  else {
226
- if (!isNullOrUndefined(records)) {
226
+ if (!isNullOrUndefined(records) && !((this.parent.loadChildOnDemand) && isCountRequired(this.parent) && !isNullOrUndefined(this.parent['dataResults']['expandRecord']))) {
227
227
  this.convertToFlatData(records);
228
228
  }
229
229
  }
@@ -377,8 +377,8 @@ var DataManipulation = /** @class */ (function () {
377
377
  if (!Object.prototype.hasOwnProperty.call(currentData, 'index')) {
378
378
  currentData.index = this.storedIndex;
379
379
  }
380
- if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) || ((currentData[this.parent.hasChildMapping]) &&
381
- isCountRequired(this.parent) && (this.parent.initialRender || isNullOrUndefined(this.parent['dataResults'].result) || this.parent.enableInfiniteScrolling))) {
380
+ if ((!isNullOrUndefined(currentData[this.parent.childMapping]) && !isCountRequired(this.parent)) ||
381
+ ((currentData[this.parent.hasChildMapping]) && isCountRequired(this.parent))) {
382
382
  currentData.hasChildRecords = true;
383
383
  if (this.parent.enableCollapseAll || !isNullOrUndefined(this.parent.dataStateChange)
384
384
  && isNullOrUndefined(currentData[this.parent.childMapping])) {
@@ -1752,6 +1752,7 @@ export declare class TreeGrid extends Component<HTMLElement> implements INotifyP
1752
1752
  collapseAll(): void;
1753
1753
  private expandCollapseAll;
1754
1754
  private expandCollapse;
1755
+ private updateGridRowsVisible;
1755
1756
  private updateChildOnDemand;
1756
1757
  private remoteExpand;
1757
1758
  private localExpand;
@@ -1096,7 +1096,7 @@ var TreeGrid = /** @class */ (function (_super) {
1096
1096
  }
1097
1097
  _this.notify('actionBegin', { editAction: args });
1098
1098
  if (!isRemoteData(_this) && !isNullOrUndefined(_this.filterModule) && !isCountRequired(_this)
1099
- && (_this.grid.filterSettings.columns.length === 0 || _this.grid.searchSettings.key.length === 0)) {
1099
+ && (_this.grid.filterSettings.columns.length === 0 && _this.grid.searchSettings.key.length === 0)) {
1100
1100
  _this.notify('clearFilters', { flatData: _this.grid.dataSource });
1101
1101
  _this.grid.setProperties({ dataSource: _this.dataResults.result }, true);
1102
1102
  if (isNullOrUndefined(_this.grid['changedProperties'].dataSource)) {
@@ -2807,11 +2807,13 @@ var TreeGrid = /** @class */ (function (_super) {
2807
2807
  }
2808
2808
  });
2809
2809
  if (rows.length) {
2810
- if (action === 'collapse') {
2811
- this.collapseRow(rows[0]);
2812
- }
2813
- else {
2814
- this.expandRow(rows[0]);
2810
+ for (var i = 0; i < rows.length; i++) {
2811
+ if (action === 'collapse') {
2812
+ this.collapseRow(rows[i]);
2813
+ }
2814
+ else {
2815
+ this.expandRow(rows[i]);
2816
+ }
2815
2817
  }
2816
2818
  }
2817
2819
  else if (this.allowPaging) {
@@ -2840,7 +2842,7 @@ var TreeGrid = /** @class */ (function (_super) {
2840
2842
  return e.parentUniqueID === record.uniqueID;
2841
2843
  });
2842
2844
  var targetEle;
2843
- if (!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) {
2845
+ if ((!isRemoteData(this) && action === 'expand' && this.isSelfReference && isCountRequired(this) && !childRecords.length) || (action === 'collapse' || (this.isExpandAll && this.loadChildOnDemand) && !isRemoteData(this) && this.isSelfReference && isCountRequired(this))) {
2844
2846
  this.updateChildOnDemand(expandingArgs);
2845
2847
  }
2846
2848
  var gridRows = this.getRows();
@@ -2934,10 +2936,34 @@ var TreeGrid = /** @class */ (function (_super) {
2934
2936
  }
2935
2937
  this.notify('rowExpandCollapse', { detailrows: detailrows, action: displayAction, record: record, row: row });
2936
2938
  this.updateAltRow(gridRows);
2939
+ this.updateGridRowsVisible();
2940
+ }
2941
+ };
2942
+ TreeGrid.prototype.updateGridRowsVisible = function () {
2943
+ var rowsToRefresh = this.grid.getRowsObject();
2944
+ var rows = this.getRows();
2945
+ for (var i = 0; i < rows.length; i++) {
2946
+ for (var j = 0; j < rowsToRefresh.length; j++) {
2947
+ if (rows[i].dataset.uid === rowsToRefresh[j].uid) {
2948
+ rowsToRefresh[j].visible = rows[i].style.display === 'none' ? false : true;
2949
+ }
2950
+ }
2937
2951
  }
2952
+ this.grid.notify('refresh-Expand-and-Collapse', { rows: rowsToRefresh });
2938
2953
  };
2939
2954
  TreeGrid.prototype.updateChildOnDemand = function (expandingArgs) {
2940
2955
  var _this = this;
2956
+ if (expandingArgs.requestType === 'collapse' && isCountRequired(this)) {
2957
+ var flatDataRecords = this.flatData.slice();
2958
+ for (var i = 0; i < flatDataRecords.length; i++) {
2959
+ if (flatDataRecords[i]['parentUniqueID'] === expandingArgs.data['uniqueID']) {
2960
+ flatDataRecords.splice(i, 1);
2961
+ i = i - 1;
2962
+ }
2963
+ }
2964
+ this.dataResults.result = flatDataRecords;
2965
+ return;
2966
+ }
2941
2967
  var deff = new Deferred();
2942
2968
  var childDataBind = 'childDataBind';
2943
2969
  expandingArgs[childDataBind] = deff.resolve;
@@ -2945,7 +2971,12 @@ var TreeGrid = /** @class */ (function (_super) {
2945
2971
  this.trigger(events.dataStateChange, expandingArgs);
2946
2972
  deff.promise.then(function () {
2947
2973
  if (expandingArgs.childData.length) {
2948
- _this.flatData = _this.infiniteScrollData;
2974
+ if (isCountRequired(_this)) {
2975
+ _this.flatData = _this.dataResults.result;
2976
+ }
2977
+ if (_this.enableInfiniteScrolling && isCountRequired(_this)) {
2978
+ _this.flatData = _this.infiniteScrollData;
2979
+ }
2949
2980
  var currentData = (_this.flatData);
2950
2981
  var index = 0;
2951
2982
  for (var i = 0; i < currentData.length; i++) {
@@ -2980,7 +3011,13 @@ var TreeGrid = /** @class */ (function (_super) {
2980
3011
  (childData[i][_this.hasChildMapping] && isCountRequired(_this))) {
2981
3012
  childData[i].hasChildRecords = true;
2982
3013
  }
2983
- currentData.splice(index + 1 + i, record[_this.childMapping] && record[_this.childMapping][i] ? 1 : 0, childData[i]);
3014
+ if (isCountRequired(_this) && record[_this.childMapping] && record[_this.childMapping][i]) {
3015
+ currentData.splice(index + 1 + i, 0, childData[i]);
3016
+ }
3017
+ else {
3018
+ currentData.splice(index + 1 + i, record[_this.childMapping] &&
3019
+ record[_this.childMapping][i] ? 1 : 0, childData[i]);
3020
+ }
2984
3021
  }
2985
3022
  else {
2986
3023
  currentData.splice(index + 1 + i, 1);
@@ -2994,6 +3031,10 @@ var TreeGrid = /** @class */ (function (_super) {
2994
3031
  data_1.push(expandingArgs.childData[j]);
2995
3032
  }
2996
3033
  }
3034
+ if (isCountRequired(_this) && _this.loadChildOnDemand && expandingArgs.requestType === 'expand') {
3035
+ _this.dataResults['expandRecord'] = {};
3036
+ _this.dataResults['expandRecord'] = expandingArgs.data;
3037
+ }
2997
3038
  _this.isExpandRefresh = true;
2998
3039
  var scrollHeightBeforeRefresh = _this.getContentTable().parentElement.scrollTop;
2999
3040
  _this.grid.refresh();
@@ -217,8 +217,9 @@ var Render = /** @class */ (function () {
217
217
  if (args.column.template) {
218
218
  args.cell.innerHTML = null;
219
219
  }
220
- else
220
+ else {
221
221
  args.cell.innerHTML = summaryData;
222
+ }
222
223
  }
223
224
  }
224
225
  if (isNullOrUndefined(this.parent.rowTemplate)) {
@@ -586,7 +586,7 @@ var TreeInterSectionObserver = /** @class */ (function (_super) {
586
586
  var movableEle = 'movableEle';
587
587
  var element = 'element';
588
588
  var fromWheel = 'fromWheel';
589
- var debounced100 = debounce(callback, delay);
589
+ //const debounced100: Function = debounce(callback, delay);
590
590
  var debounced50 = debounce(callback, 50);
591
591
  this[options].prevTop = this[options].prevLeft = 0;
592
592
  return function (e) {
@@ -635,9 +635,12 @@ var TreeInterSectionObserver = /** @class */ (function (_super) {
635
635
  fn({ direction: direction, sentinel: current, offset: { top: top, left: left },
636
636
  focusElement: document.activeElement });
637
637
  }
638
- else
639
- callback({ direction: direction, sentinel: current, offset: { top: top, left: left },
640
- focusElement: document.activeElement });
638
+ else {
639
+ callback({
640
+ direction: direction, sentinel: current, offset: { top: top, left: left },
641
+ focusElement: document.activeElement
642
+ });
643
+ }
641
644
  }
642
645
  }
643
646
  _this[fromWheel] = false;