@syncfusion/ej2-treegrid 19.4.52 → 19.4.54

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.
@@ -3103,6 +3103,11 @@ function updateParentRow(key, record, action, control, isSelfReference, child) {
3103
3103
  column: control.grid.getColumns()[control.treeColumnIndex],
3104
3104
  requestType: action
3105
3105
  });
3106
+ if (control.enableImmutableMode && control['action'] === 'indenting' || control['action'] === 'outdenting') {
3107
+ control.renderModule.RowModifier({
3108
+ data: record, row: row
3109
+ });
3110
+ }
3106
3111
  }
3107
3112
  }
3108
3113
  }
@@ -3860,6 +3865,9 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
3860
3865
  };
3861
3866
  this.grid.rowDeselected = function (args) {
3862
3867
  _this.selectedRowIndex = _this.grid.selectedRowIndex;
3868
+ if (!isNullOrUndefined(args.data)) {
3869
+ _this.notify(rowDeselected, args);
3870
+ }
3863
3871
  _this.trigger(rowDeselected, args);
3864
3872
  };
3865
3873
  this.grid.resizeStop = function (args) {
@@ -4178,7 +4186,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4178
4186
  _this.grid.query = _this.grid.query instanceof Query ? _this.grid.query : new Query();
4179
4187
  }
4180
4188
  }
4181
- if (_this.action !== 'indent' && _this.action !== 'outdent') {
4189
+ if (_this.action !== 'indenting' && _this.action !== 'outdenting') {
4182
4190
  var callBackPromise_2 = new Deferred();
4183
4191
  _this.trigger(actionBegin, args, function (actionArgs) {
4184
4192
  if (!actionArgs.cancel) {
@@ -4207,7 +4215,8 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4207
4215
  if (args.requestType === 'save' && _this.aggregates.map(function (ag) { return ag.showChildSummary === true; }).length) {
4208
4216
  _this.grid.refresh();
4209
4217
  }
4210
- if (_this.action === 'indent' || _this.action === 'outdent') {
4218
+ if (_this.action === 'indenting' || _this.action === 'outdenting') {
4219
+ _this.action = _this.action === 'indenting' ? 'indented' : 'outdented';
4211
4220
  var actionArgs = {
4212
4221
  requestType: _this.action,
4213
4222
  data: _this.selectedRecords,
@@ -4419,7 +4428,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4419
4428
  case ToolbarItem.RowIndent:
4420
4429
  tooltipText = this.l10n.getConstant('RowIndent');
4421
4430
  items.push({
4422
- text: tooltipText, tooltipText: tooltipText,
4431
+ text: tooltipText, tooltipText: tooltipText, disabled: true,
4423
4432
  prefixIcon: 'e-indent', id: this.element.id + '_gridcontrol_indent'
4424
4433
  });
4425
4434
  break;
@@ -4427,7 +4436,7 @@ var TreeGrid = /** @__PURE__ @class */ (function (_super) {
4427
4436
  case ToolbarItem.RowOutdent:
4428
4437
  tooltipText = this.l10n.getConstant('RowOutdent');
4429
4438
  items.push({
4430
- text: tooltipText, tooltipText: tooltipText,
4439
+ text: tooltipText, tooltipText: tooltipText, disabled: true,
4431
4440
  prefixIcon: 'e-outdent', id: this.element.id + '_gridcontrol_outdent'
4432
4441
  });
4433
4442
  break;
@@ -7082,6 +7091,7 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7082
7091
  */
7083
7092
  RowDD$$1.prototype.reorderRows = function (fromIndexes, toIndex, position) {
7084
7093
  var tObj = this.parent;
7094
+ var action = 'action';
7085
7095
  if (fromIndexes[0] !== toIndex && ['above', 'below', 'child'].indexOf(position) !== -1) {
7086
7096
  if (position === 'above') {
7087
7097
  this.dropPosition = 'topSegment';
@@ -7108,6 +7118,11 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7108
7118
  if (tObj.isLocalData) {
7109
7119
  tObj.flatData = this.orderToIndex(tObj.flatData);
7110
7120
  }
7121
+ if (this.parent[action] === 'outdenting') {
7122
+ if (!isNullOrUndefined(data[0].parentItem)) {
7123
+ data[0].level = data[0].parentItem.level + 1;
7124
+ }
7125
+ }
7111
7126
  this.parent.grid.refresh();
7112
7127
  if (this.parent.enableImmutableMode && this.dropPosition === 'middleSegment') {
7113
7128
  var index = this.parent.treeColumnIndex + 1;
@@ -7128,6 +7143,11 @@ var RowDD$1 = /** @__PURE__ @class */ (function () {
7128
7143
  column: this.parent.grid.getColumns()[this.parent.treeColumnIndex],
7129
7144
  requestType: 'rowDragAndDrop'
7130
7145
  });
7146
+ if (this.parent[action] === 'indenting' || this.parent[action] === 'outdenting') {
7147
+ this.parent.renderModule.RowModifier({
7148
+ data: totalRecord[i], row: rows[i]
7149
+ });
7150
+ }
7131
7151
  }
7132
7152
  }
7133
7153
  }
@@ -9140,6 +9160,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9140
9160
  */
9141
9161
  Toolbar$$1.prototype.addEventListener = function () {
9142
9162
  this.parent.on(rowSelected, this.refreshToolbar, this);
9163
+ this.parent.on(rowDeselected, this.refreshToolbar, this);
9143
9164
  this.parent.on(toolbarClick, this.toolbarClickHandler, this);
9144
9165
  };
9145
9166
  /**
@@ -9151,6 +9172,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9151
9172
  return;
9152
9173
  }
9153
9174
  this.parent.off(rowSelected, this.refreshToolbar);
9175
+ this.parent.off(rowDeselected, this.refreshToolbar);
9154
9176
  this.parent.off(toolbarClick, this.toolbarClickHandler);
9155
9177
  };
9156
9178
  Toolbar$$1.prototype.refreshToolbar = function (args) {
@@ -9158,7 +9180,7 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9158
9180
  if (args.row.rowIndex === 0 || tObj.getSelectedRecords().length > 1) {
9159
9181
  this.enableItems([tObj.element.id + '_gridcontrol_indent', tObj.element.id + '_gridcontrol_outdent'], false);
9160
9182
  }
9161
- else {
9183
+ else if (args['name'] !== "rowDeselected") {
9162
9184
  if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex])) {
9163
9185
  if (!isNullOrUndefined(tObj.getCurrentViewRecords()[args.row.rowIndex]) &&
9164
9186
  (tObj.getCurrentViewRecords()[args.row.rowIndex].level >
@@ -9180,6 +9202,14 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9180
9202
  }
9181
9203
  }
9182
9204
  }
9205
+ if (args['name'] === "rowDeselected") {
9206
+ if (this.parent.toolbar['includes']('Indent')) {
9207
+ this.enableItems([tObj.element.id + '_gridcontrol_indent'], false);
9208
+ }
9209
+ if (this.parent.toolbar['includes']('Outdent')) {
9210
+ this.enableItems([tObj.element.id + '_gridcontrol_outdent'], false);
9211
+ }
9212
+ }
9183
9213
  if (args.row.rowIndex === 0 && !isNullOrUndefined(args.data.parentItem)) {
9184
9214
  this.enableItems([tObj.element.id + '_gridcontrol_outdent'], true);
9185
9215
  }
@@ -9211,8 +9241,8 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9211
9241
  else {
9212
9242
  dropIndex = tObj.getSelectedRowIndexes()[0] - 1;
9213
9243
  }
9214
- this.parent[action] = 'indent';
9215
- this.eventTrigger('indent', dropIndex);
9244
+ this.parent[action] = 'indenting';
9245
+ this.eventTrigger('indenting', dropIndex);
9216
9246
  }
9217
9247
  if (args.item.id === tObj.grid.element.id + '_outdent' && tObj.getSelectedRecords().length) {
9218
9248
  var dropIndex = void 0;
@@ -9222,8 +9252,8 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9222
9252
  dropIndex = i;
9223
9253
  }
9224
9254
  }
9225
- this.parent[action] = 'outdent';
9226
- this.eventTrigger('outdent', dropIndex);
9255
+ this.parent[action] = 'outdenting';
9256
+ this.eventTrigger('outdenting', dropIndex);
9227
9257
  }
9228
9258
  };
9229
9259
  Toolbar$$1.prototype.eventTrigger = function (action, dropIndex) {
@@ -9240,10 +9270,10 @@ var Toolbar$1 = /** @__PURE__ @class */ (function () {
9240
9270
  };
9241
9271
  this.parent.trigger(actionBegin, actionArgs, function (actionArgs) {
9242
9272
  if (!actionArgs.cancel) {
9243
- if (actionArgs.requestType === 'indent') {
9273
+ if (actionArgs.requestType === 'indenting') {
9244
9274
  _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'child');
9245
9275
  }
9246
- else if (actionArgs.requestType === 'outdent') {
9276
+ else if (actionArgs.requestType === 'outdenting') {
9247
9277
  _this.parent.reorderRows([_this.parent.getSelectedRowIndexes()[0]], dropIndex, 'below');
9248
9278
  }
9249
9279
  }