igniteui-angular 12.3.21 → 12.3.22

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.
@@ -46028,6 +46028,7 @@
46028
46028
  this.grid.rootGrid ? this.grid.rootGrid.nativeElement : this.grid.nativeElement :
46029
46029
  esf;
46030
46030
  this.toggle.open(this._customDialogOverlaySettings);
46031
+ this.overlayComponentId = this.toggle.overlayId;
46031
46032
  };
46032
46033
  IgxExcelStyleCustomDialogComponent.prototype.onClearButtonClick = function () {
46033
46034
  this.filteringService.clearFilter(this.column.field);
@@ -46037,6 +46038,7 @@
46037
46038
  IgxExcelStyleCustomDialogComponent.prototype.closeDialog = function () {
46038
46039
  if (this.overlayComponentId) {
46039
46040
  this.overlayService.hide(this.overlayComponentId);
46041
+ this.overlayComponentId = null;
46040
46042
  }
46041
46043
  else {
46042
46044
  this.toggle.close();
@@ -48826,7 +48828,8 @@
48826
48828
  if (rowIndex < 0 || rowIndex > this.grid.dataView.length - 1) {
48827
48829
  curRow = this.grid.dataView[rowIndex - this.grid.virtualizationState.startIndex];
48828
48830
  if (!curRow) {
48829
- return false;
48831
+ // if data is remote, record might not be in the view yet.
48832
+ return this.grid.verticalScrollContainer.isRemote && rowIndex >= 0 && rowIndex <= this.grid.totalItemCount - 1;
48830
48833
  }
48831
48834
  }
48832
48835
  else {
@@ -49139,8 +49142,11 @@
49139
49142
  event.preventDefault();
49140
49143
  if ((this.grid.crudService.rowInEditMode && this.grid.rowEditTabs.length) &&
49141
49144
  (this.activeNode.row !== next.rowIndex || this.isActiveNode(next.rowIndex, next.visibleColumnIndex))) {
49142
- this.grid.crudService.updateCell(true, event);
49143
- if (shift) {
49145
+ var args = this.grid.crudService.updateCell(true, event);
49146
+ if (args.cancel) {
49147
+ return;
49148
+ }
49149
+ else if (shift) {
49144
49150
  this.grid.rowEditTabs.last.element.nativeElement.focus();
49145
49151
  }
49146
49152
  else {
@@ -60265,22 +60271,24 @@
60265
60271
  IgxGridBaseDirective.prototype.getNextCell = function (currRowIndex, curVisibleColIndex, callback) {
60266
60272
  if (callback === void 0) { callback = null; }
60267
60273
  var columns = this.columnList.filter(function (col) { return !col.columnGroup && col.visibleIndex >= 0; });
60268
- if (!this.isValidPosition(currRowIndex, curVisibleColIndex)) {
60274
+ var dataViewIndex = this._getDataViewIndex(currRowIndex);
60275
+ if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
60269
60276
  return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
60270
60277
  }
60271
60278
  var colIndexes = callback ? columns.filter(function (col) { return callback(col); }).map(function (editCol) { return editCol.visibleIndex; }).sort(function (a, b) { return a - b; }) :
60272
60279
  columns.map(function (editCol) { return editCol.visibleIndex; }).sort(function (a, b) { return a - b; });
60273
60280
  var nextCellIndex = colIndexes.find(function (index) { return index > curVisibleColIndex; });
60274
- if (this.dataView.slice(currRowIndex, currRowIndex + 1)
60281
+ if (this.dataView.slice(dataViewIndex, dataViewIndex + 1)
60275
60282
  .find(function (rec) { return !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData; }) && nextCellIndex !== undefined) {
60276
60283
  return { rowIndex: currRowIndex, visibleColumnIndex: nextCellIndex };
60277
60284
  }
60278
60285
  else {
60279
- if (colIndexes.length === 0 || this.getNextDataRowIndex(currRowIndex) === currRowIndex) {
60286
+ var nextIndex = this.getNextDataRowIndex(currRowIndex);
60287
+ if (colIndexes.length === 0 || nextIndex === currRowIndex) {
60280
60288
  return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
60281
60289
  }
60282
60290
  else {
60283
- return { rowIndex: this.getNextDataRowIndex(currRowIndex), visibleColumnIndex: colIndexes[0] };
60291
+ return { rowIndex: nextIndex, visibleColumnIndex: colIndexes[0] };
60284
60292
  }
60285
60293
  }
60286
60294
  };
@@ -60299,22 +60307,24 @@
60299
60307
  IgxGridBaseDirective.prototype.getPreviousCell = function (currRowIndex, curVisibleColIndex, callback) {
60300
60308
  if (callback === void 0) { callback = null; }
60301
60309
  var columns = this.columnList.filter(function (col) { return !col.columnGroup && col.visibleIndex >= 0; });
60302
- if (!this.isValidPosition(currRowIndex, curVisibleColIndex)) {
60310
+ var dataViewIndex = this._getDataViewIndex(currRowIndex);
60311
+ if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
60303
60312
  return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
60304
60313
  }
60305
60314
  var colIndexes = callback ? columns.filter(function (col) { return callback(col); }).map(function (editCol) { return editCol.visibleIndex; }).sort(function (a, b) { return b - a; }) :
60306
60315
  columns.map(function (editCol) { return editCol.visibleIndex; }).sort(function (a, b) { return b - a; });
60307
60316
  var prevCellIndex = colIndexes.find(function (index) { return index < curVisibleColIndex; });
60308
- if (this.dataView.slice(currRowIndex, currRowIndex + 1)
60317
+ if (this.dataView.slice(dataViewIndex, dataViewIndex + 1)
60309
60318
  .find(function (rec) { return !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData; }) && prevCellIndex !== undefined) {
60310
60319
  return { rowIndex: currRowIndex, visibleColumnIndex: prevCellIndex };
60311
60320
  }
60312
60321
  else {
60313
- if (colIndexes.length === 0 || this.getNextDataRowIndex(currRowIndex, true) === currRowIndex) {
60322
+ var prevIndex = this.getNextDataRowIndex(currRowIndex, true);
60323
+ if (colIndexes.length === 0 || prevIndex === currRowIndex) {
60314
60324
  return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
60315
60325
  }
60316
60326
  else {
60317
- return { rowIndex: this.getNextDataRowIndex(currRowIndex, true), visibleColumnIndex: colIndexes[0] };
60327
+ return { rowIndex: prevIndex, visibleColumnIndex: colIndexes[0] };
60318
60328
  }
60319
60329
  }
60320
60330
  };
@@ -60920,7 +60930,6 @@
60920
60930
  var added_1 = false;
60921
60931
  var removed_1 = false;
60922
60932
  diff.forEachAddedItem(function (record) {
60923
- _this.columnInit.emit(record.item);
60924
60933
  added_1 = true;
60925
60934
  if (record.item.pinned) {
60926
60935
  _this._pinnedColumns.push(record.item);
@@ -60929,7 +60938,7 @@
60929
60938
  _this._unpinnedColumns.push(record.item);
60930
60939
  }
60931
60940
  });
60932
- this.initColumns(this.columnList);
60941
+ this.initColumns(this.columnList, function (col) { return _this.columnInit.emit(col); });
60933
60942
  diff.forEachRemovedItem(function (record) {
60934
60943
  var isColumnGroup = record.item instanceof IgxColumnGroupComponent;
60935
60944
  if (!isColumnGroup) {
@@ -61649,6 +61658,31 @@
61649
61658
  }
61650
61659
  directive.scrollTo(goal);
61651
61660
  };
61661
+ /**
61662
+ * @hidden
61663
+ * @internal
61664
+ */
61665
+ IgxGridBaseDirective.prototype._getDataViewIndex = function (index) {
61666
+ var newIndex = index;
61667
+ if ((index < 0 || index >= this.dataView.length) && this.pagingMode === 1 && this.paginator.page !== 0) {
61668
+ newIndex = index - this.paginator.perPage * this.paginator.page;
61669
+ }
61670
+ else if (this.gridAPI.grid.verticalScrollContainer.isRemote) {
61671
+ newIndex = index - this.gridAPI.grid.virtualizationState.startIndex;
61672
+ }
61673
+ return newIndex;
61674
+ };
61675
+ /**
61676
+ * @hidden
61677
+ * @internal
61678
+ */
61679
+ IgxGridBaseDirective.prototype.getDataIndex = function (dataViewIndex) {
61680
+ var newIndex = dataViewIndex;
61681
+ if (this.gridAPI.grid.verticalScrollContainer.isRemote) {
61682
+ newIndex = dataViewIndex + this.gridAPI.grid.virtualizationState.startIndex;
61683
+ }
61684
+ return newIndex;
61685
+ };
61652
61686
  IgxGridBaseDirective.prototype.getColumnWidthSum = function () {
61653
61687
  var colSum = 0;
61654
61688
  var cols = this.hasColumnLayouts ?
@@ -61751,7 +61785,8 @@
61751
61785
  cb(cbArgs);
61752
61786
  });
61753
61787
  }
61754
- if (this.dataView[rowIndex].detailsData) {
61788
+ var dataViewIndex = this._getDataViewIndex(rowIndex);
61789
+ if (this.dataView[dataViewIndex].detailsData) {
61755
61790
  this.navigation.setActiveNode({ row: rowIndex });
61756
61791
  this.cdr.detectChanges();
61757
61792
  }
@@ -61787,13 +61822,15 @@
61787
61822
  IgxGridBaseDirective.prototype.getNextDataRowIndex = function (currentRowIndex, previous) {
61788
61823
  var _this = this;
61789
61824
  if (previous === void 0) { previous = false; }
61790
- if (currentRowIndex < 0 || (currentRowIndex === 0 && previous) || (currentRowIndex >= this.dataView.length - 1 && !previous)) {
61825
+ var resolvedIndex = this._getDataViewIndex(currentRowIndex);
61826
+ if (currentRowIndex < 0 || (currentRowIndex === 0 && previous) || (resolvedIndex >= this.dataView.length - 1 && !previous)) {
61791
61827
  return currentRowIndex;
61792
61828
  }
61793
61829
  // find next/prev record that is editable.
61794
61830
  var nextRowIndex = previous ? this.findPrevEditableDataRowIndex(currentRowIndex) :
61795
- this.dataView.findIndex(function (rec, index) { return index > currentRowIndex && _this.isEditableDataRecordAtIndex(index); });
61796
- return nextRowIndex !== -1 ? nextRowIndex : currentRowIndex;
61831
+ this.dataView.findIndex(function (rec, index) { return index > resolvedIndex && _this.isEditableDataRecordAtIndex(index); });
61832
+ var nextDataIndex = this.getDataIndex(nextRowIndex);
61833
+ return nextDataIndex !== -1 ? nextDataIndex : currentRowIndex;
61797
61834
  };
61798
61835
  /**
61799
61836
  * Returns the previous editable row index or -1 if no such row is found.
@@ -61802,8 +61839,9 @@
61802
61839
  */
61803
61840
  IgxGridBaseDirective.prototype.findPrevEditableDataRowIndex = function (currentIndex) {
61804
61841
  var i = this.dataView.length;
61842
+ var resolvedIndex = this._getDataViewIndex(currentIndex);
61805
61843
  while (i--) {
61806
- if (i < currentIndex && this.isEditableDataRecordAtIndex(i)) {
61844
+ if (i < resolvedIndex && this.isEditableDataRecordAtIndex(i)) {
61807
61845
  return i;
61808
61846
  }
61809
61847
  }
@@ -63887,7 +63925,10 @@
63887
63925
  var node = this.selectionNode;
63888
63926
  var shouldEmitSelection = !this.selectionService.isActiveNode(node);
63889
63927
  if (this.selectionService.primaryButton) {
63890
- this._updateCRUDStatus(event);
63928
+ var cancel = this._updateCRUDStatus(event);
63929
+ if (cancel) {
63930
+ return;
63931
+ }
63891
63932
  var activeElement = this.selectionService.activeElement;
63892
63933
  var row = activeElement ? this.gridAPI.get_row_by_index(activeElement.row) : null;
63893
63934
  if ((this.grid.crudService.rowEditingBlocked && row && this.intRow.rowID !== row.rowID) ||
@@ -70314,7 +70355,7 @@
70314
70355
  */
70315
70356
  IgxGridComponent.prototype.createRow = function (index, data) {
70316
70357
  var row;
70317
- var dataIndex = this._getResolvedDataIndex(index);
70358
+ var dataIndex = this._getDataViewIndex(index);
70318
70359
  var rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
70319
70360
  if (rec && this.isGroupByRecord(rec)) {
70320
70361
  row = new IgxGroupByRow(this, index, rec);
@@ -74060,7 +74101,7 @@
74060
74101
  */
74061
74102
  IgxTreeGridComponent.prototype.createRow = function (index, data) {
74062
74103
  var row;
74063
- var dataIndex = this._getResolvedDataIndex(index);
74104
+ var dataIndex = this._getDataViewIndex(index);
74064
74105
  var rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
74065
74106
  if (this.isSummaryRow(rec)) {
74066
74107
  row = new IgxSummaryRow(this, index, rec.summaries, exports.GridInstanceType.TreeGrid);
@@ -77225,7 +77266,7 @@
77225
77266
  */
77226
77267
  IgxHierarchicalGridComponent.prototype.isChildGridRecord = function (record) {
77227
77268
  // Can be null when there is defined layout but no child data was found
77228
- return record.childGridsData !== undefined;
77269
+ return (record === null || record === void 0 ? void 0 : record.childGridsData) !== undefined;
77229
77270
  };
77230
77271
  /**
77231
77272
  * @hidden
@@ -77428,7 +77469,7 @@
77428
77469
  */
77429
77470
  IgxHierarchicalGridComponent.prototype.createRow = function (index, data) {
77430
77471
  var row;
77431
- var dataIndex = this._getResolvedDataIndex(index);
77472
+ var dataIndex = this._getDataViewIndex(index);
77432
77473
  var rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
77433
77474
  if (!row && rec && !rec.childGridsData) {
77434
77475
  row = new IgxHierarchicalGridRow(this, index, rec);