@syncfusion/ej2-treegrid 19.4.52 → 19.4.56

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 : 19.4.52
3
+ * version : 19.4.56
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@19.4.48",
3
+ "_id": "@syncfusion/ej2-treegrid@19.4.55",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-H/Y2ah0xNhYjWj/A6X4sS8uZIdJPP/8RQyyDjr3ArzAzJZkrOPFtUrcEuAQRHjqSKRs9OOXME9xVgRbHETuBZw==",
5
+ "_integrity": "sha512-f5xJV2acBAMJnQ/C9b+HxofLqJ3odAXUN/kaRyqz+3sMlYdAaIW1f77i7Z8FUY7e9Gl5M5BgPtTr2WQXAH/mmQ==",
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-19.4.48.tgz",
28
- "_shasum": "dc2917a172129e2d1ec9ac1fdccf78b9812cf09d",
27
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-treegrid/-/ej2-treegrid-19.4.55.tgz",
28
+ "_shasum": "e711adbf22a3859e37b6d823c0914732c323754d",
29
29
  "_spec": "@syncfusion/ej2-treegrid@*",
30
30
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
31
31
  "author": {
@@ -37,9 +37,9 @@
37
37
  "bundleDependencies": false,
38
38
  "dependencies": {
39
39
  "@syncfusion/ej2-base": "~19.4.52",
40
- "@syncfusion/ej2-data": "~19.4.52",
41
- "@syncfusion/ej2-grids": "~19.4.52",
42
- "@syncfusion/ej2-popups": "~19.4.52"
40
+ "@syncfusion/ej2-data": "~19.4.54",
41
+ "@syncfusion/ej2-grids": "~19.4.56",
42
+ "@syncfusion/ej2-popups": "~19.4.53"
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": "19.4.52",
63
+ "version": "19.4.56",
64
64
  "sideEffects": false
65
65
  }
@@ -381,6 +381,11 @@ export function updateParentRow(key, record, action, control, isSelfReference, c
381
381
  column: control.grid.getColumns()[control.treeColumnIndex],
382
382
  requestType: action
383
383
  });
384
+ if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {
385
+ control.renderModule.RowModifier({
386
+ data: record, row: row
387
+ });
388
+ }
384
389
  }
385
390
  }
386
391
  }
@@ -275,7 +275,7 @@ var Edit = /** @class */ (function () {
275
275
  var promise = 'promise';
276
276
  var prom = args[promise];
277
277
  delete args[promise];
278
- if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex)) {
278
+ if (this.parent.enableVirtualization && !isNullOrUndefined(this.prevAriaRowIndex) && this.prevAriaRowIndex !== '-1') {
279
279
  args.row.setAttribute('aria-rowindex', this.prevAriaRowIndex);
280
280
  this.prevAriaRowIndex = undefined;
281
281
  }
@@ -60,6 +60,7 @@ var RowDD = /** @class */ (function () {
60
60
  */
61
61
  RowDD.prototype.reorderRows = function (fromIndexes, toIndex, position) {
62
62
  var tObj = this.parent;
63
+ var action = 'action';
63
64
  if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
64
65
  if (position === 'above') {
65
66
  this.dropPosition = 'topSegment';
@@ -86,6 +87,11 @@ var RowDD = /** @class */ (function () {
86
87
  if (tObj.isLocalData) {
87
88
  tObj.flatData = this.orderToIndex(tObj.flatData);
88
89
  }
90
+ if (this.parent[action] === 'outdenting') {
91
+ if (!isNullOrUndefined(data[0].parentItem)) {
92
+ data[0].level = data[0].parentItem.level + 1;
93
+ }
94
+ }
89
95
  this.parent.grid.refresh();
90
96
  if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
91
97
  var index = this.parent.treeColumnIndex + 1;
@@ -106,6 +112,11 @@ var RowDD = /** @class */ (function () {
106
112
  column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
107
113
  requestType: 'rowDragAndDrop'
108
114
  });
115
+ if (this.parent[action] === 'indenting' || this.parent[action] === 'outdenting') {
116
+ this.parent.renderModule.RowModifier({
117
+ data: totalRecord[i], row: rows[i]
118
+ });
119
+ }
109
120
  }
110
121
  }
111
122
  }
@@ -254,7 +265,8 @@ var RowDD = /** @class */ (function () {
254
265
  }
255
266
  // eslint-disable-next-line max-len
256
267
  if (tempDataSource && (!isNullOrUndefined(droppedRecord) && !droppedRecord.parentItem) && !isNullOrUndefined(droppedRecord.taskData)) {
257
- for (var i = 0; i < Object.keys(tempDataSource).length; i++) {
268
+ var keys = Object.keys(tempDataSource);
269
+ for (var i = 0; i < keys.length; i++) {
258
270
  if (tempDataSource[i][this.parent.childMapping] === droppedRecord.taskData[this.parent.childMapping]) {
259
271
  idx = i;
260
272
  }
@@ -27,6 +27,7 @@ var Toolbar = /** @class */ (function () {
27
27
  */
28
28
  Toolbar.prototype.addEventListener = function () {
29
29
  this.parent.on(events.rowSelected, this.refreshToolbar, this);
30
+ this.parent.on(events.rowDeselected, this.refreshToolbar, this);
30
31
  this.parent.on(events.toolbarClick, this.toolbarClickHandler, this);
31
32
  };
32
33
  /**
@@ -38,6 +39,7 @@ var Toolbar = /** @class */ (function () {
38
39
  return;
39
40
  }
40
41
  this.parent.off(events.rowSelected, this.refreshToolbar);
42
+ this.parent.off(events.rowDeselected, this.refreshToolbar);
41
43
  this.parent.off(events.toolbarClick, this.toolbarClickHandler);
42
44
  };
43
45
  Toolbar.prototype.refreshToolbar = function (args) {
@@ -45,7 +47,7 @@ var Toolbar = /** @class */ (function () {
45
47
  if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
46
48
  this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
47
49
  }
48
- else {
50
+ else if (args['name'] !== "rowDeselected") {
49
51
  if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
50
52
  if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
51
53
  (tObj.getCurrentViewRecords()[args.row.rowIndex].level >
@@ -67,6 +69,14 @@ var Toolbar = /** @class */ (function () {
67
69
  }
68
70
  }
69
71
  }
72
+ if (args['name'] === "rowDeselected") {
73
+ if (this.parent.toolbar['includes']('Indent')) {
74
+ this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
75
+ }
76
+ if (this.parent.toolbar['includes']('Outdent')) {
77
+ this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
78
+ }
79
+ }
70
80
  if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
71
81
  this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
72
82
  }
@@ -98,8 +108,8 @@ var Toolbar = /** @class */ (function () {
98
108
  else {
99
109
  dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
100
110
  }
101
- this.parent[action] = 'indent';
102
- this.eventTrigger('indent', dropIndex);
111
+ this.parent[action] = 'indenting';
112
+ this.eventTrigger('indenting', dropIndex);
103
113
  }
104
114
  if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {
105
115
  var dropIndex = void 0;
@@ -109,8 +119,8 @@ var Toolbar = /** @class */ (function () {
109
119
  dropIndex = i;
110
120
  }
111
121
  }
112
- this.parent[action] = 'outdent';
113
- this.eventTrigger('outdent', dropIndex);
122
+ this.parent[action] = 'outdenting';
123
+ this.eventTrigger('outdenting', dropIndex);
114
124
  }
115
125
  };
116
126
  Toolbar.prototype.eventTrigger = function (action, dropIndex) {
@@ -127,10 +137,10 @@ var Toolbar = /** @class */ (function () {
127
137
  };
128
138
  this.parent.trigger(events.actionBegin, actionArgs, function (actionArgs) {
129
139
  if (!actionArgs.cancel) {
130
- if (actionArgs.requestType === 'indent') {
140
+ if (actionArgs.requestType === 'indenting') {
131
141
  _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
132
142
  }
133
- else if (actionArgs.requestType === 'outdent') {
143
+ else if (actionArgs.requestType === 'outdenting') {
134
144
  _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
135
145
  }
136
146
  }
@@ -127,7 +127,8 @@ var DataManipulation = /** @class */ (function () {
127
127
  this.hierarchyData = data;
128
128
  }
129
129
  else {
130
- for (var i = 0; i < Object.keys(data).length; i++) {
130
+ var keys = Object.keys(data);
131
+ for (var i = 0; i < keys.length; i++) {
131
132
  var tempData = data[i];
132
133
  this.hierarchyData.push(extend({}, tempData));
133
134
  if (!isNullOrUndefined(tempData[this.parent.idMapping])) {
@@ -367,7 +368,8 @@ var DataManipulation = /** @class */ (function () {
367
368
  };
368
369
  DataManipulation.prototype.createRecords = function (data, parentRecords) {
369
370
  var treeGridData = [];
370
- for (var i = 0, len = Object.keys(data).length; i < len; i++) {
371
+ var keys = Object.keys(data);
372
+ for (var i = 0, len = keys.length; i < len; i++) {
371
373
  var currentData = extend({}, data[i]);
372
374
  currentData.taskData = data[i];
373
375
  var level = 0;
@@ -743,6 +743,9 @@ var TreeGrid = /** @class */ (function (_super) {
743
743
  };
744
744
  this.grid.rowDeselected = function (args) {
745
745
  _this.selectedRowIndex = _this.grid.selectedRowIndex;
746
+ if (!isNullOrUndefined(args.data)) {
747
+ _this.notify(events.rowDeselected, args);
748
+ }
746
749
  _this.trigger(events.rowDeselected, args);
747
750
  };
748
751
  this.grid.resizeStop = function (args) {
@@ -1061,7 +1064,7 @@ var TreeGrid = /** @class */ (function (_super) {
1061
1064
  _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
1062
1065
  }
1063
1066
  }
1064
- if (_this.action !== 'indent' && _this.action !== 'outdent') {
1067
+ if (_this.action !== 'indenting' && _this.action !== 'outdenting') {
1065
1068
  var callBackPromise_2 = new Deferred();
1066
1069
  _this.trigger(events.actionBegin, args, function (actionArgs) {
1067
1070
  if (!actionArgs.cancel) {
@@ -1090,7 +1093,8 @@ var TreeGrid = /** @class */ (function (_super) {
1090
1093
  if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
1091
1094
  _this.grid.refresh();
1092
1095
  }
1093
- if (_this.action === 'indent' || _this.action === 'outdent') {
1096
+ if (_this.action === 'indenting' || _this.action === 'outdenting') {
1097
+ _this.action = _this.action === 'indenting' ? 'indented' : 'outdented';
1094
1098
  var actionArgs = {
1095
1099
  requestType: _this.action,
1096
1100
  data: _this.selectedRecords,
@@ -1302,7 +1306,7 @@ var TreeGrid = /** @class */ (function (_super) {
1302
1306
  case ToolbarItem.RowIndent:
1303
1307
  tooltipText = this.l10n.getConstant('RowIndent');
1304
1308
  items.push({
1305
- text: tooltipText, tooltipText: tooltipText,
1309
+ text: tooltipText, tooltipText: tooltipText, disabled: true,
1306
1310
  prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'
1307
1311
  });
1308
1312
  break;
@@ -1310,7 +1314,7 @@ var TreeGrid = /** @class */ (function (_super) {
1310
1314
  case ToolbarItem.RowOutdent:
1311
1315
  tooltipText = this.l10n.getConstant('RowOutdent');
1312
1316
  items.push({
1313
- text: tooltipText, tooltipText: tooltipText,
1317
+ text: tooltipText, tooltipText: tooltipText, disabled: true,
1314
1318
  prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'
1315
1319
  });
1316
1320
  break;
@@ -1354,7 +1358,7 @@ var TreeGrid = /** @class */ (function (_super) {
1354
1358
  gridColumn[prop] = this.getGridColumns(column[i][prop], false, index);
1355
1359
  treeGridColumn[prop] = column[i][prop];
1356
1360
  }
1357
- else {
1361
+ else if (!(treeColumn) || prop !== 'sortComparer') {
1358
1362
  gridColumn[prop] = treeGridColumn[prop] = column[i][prop];
1359
1363
  }
1360
1364
  }
@@ -122,7 +122,8 @@ export function findChildrenRecords(records) {
122
122
  }
123
123
  if (!isNullOrUndefined(records.childRecords)) {
124
124
  var childRecords = records.childRecords;
125
- for (var i = 0, len = Object.keys(childRecords).length; i < len; i++) {
125
+ var keys = Object.keys(childRecords);
126
+ for (var i = 0, len = keys.length; i < len; i++) {
126
127
  datas.push(childRecords[i]);
127
128
  if (childRecords[i].hasChildRecords || (!isNullOrUndefined(childRecords[i].childRecords) &&
128
129
  childRecords[i].childRecords.length)) {