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.
- package/bundles/igniteui-angular.umd.js +64 -23
- package/bundles/igniteui-angular.umd.js.map +1 -1
- package/esm2015/lib/grids/cell.component.js +5 -2
- package/esm2015/lib/grids/filtering/excel-style/excel-style-custom-dialog.component.js +3 -1
- package/esm2015/lib/grids/grid/grid.component.js +2 -2
- package/esm2015/lib/grids/grid-base.directive.js +48 -16
- package/esm2015/lib/grids/grid-navigation.service.js +8 -4
- package/esm2015/lib/grids/hierarchical-grid/hierarchical-grid.component.js +3 -3
- package/esm2015/lib/grids/tree-grid/tree-grid.component.js +2 -2
- package/fesm2015/igniteui-angular.js +64 -23
- package/fesm2015/igniteui-angular.js.map +1 -1
- package/igniteui-angular.metadata.json +1 -1
- package/lib/grids/grid-base.directive.d.ts +10 -0
- package/package.json +1 -1
|
@@ -41404,6 +41404,7 @@ class IgxExcelStyleCustomDialogComponent {
|
|
|
41404
41404
|
this.grid.rootGrid ? this.grid.rootGrid.nativeElement : this.grid.nativeElement :
|
|
41405
41405
|
esf;
|
|
41406
41406
|
this.toggle.open(this._customDialogOverlaySettings);
|
|
41407
|
+
this.overlayComponentId = this.toggle.overlayId;
|
|
41407
41408
|
}
|
|
41408
41409
|
onClearButtonClick() {
|
|
41409
41410
|
this.filteringService.clearFilter(this.column.field);
|
|
@@ -41413,6 +41414,7 @@ class IgxExcelStyleCustomDialogComponent {
|
|
|
41413
41414
|
closeDialog() {
|
|
41414
41415
|
if (this.overlayComponentId) {
|
|
41415
41416
|
this.overlayService.hide(this.overlayComponentId);
|
|
41417
|
+
this.overlayComponentId = null;
|
|
41416
41418
|
}
|
|
41417
41419
|
else {
|
|
41418
41420
|
this.toggle.close();
|
|
@@ -43920,7 +43922,8 @@ class IgxGridNavigationService {
|
|
|
43920
43922
|
if (rowIndex < 0 || rowIndex > this.grid.dataView.length - 1) {
|
|
43921
43923
|
curRow = this.grid.dataView[rowIndex - this.grid.virtualizationState.startIndex];
|
|
43922
43924
|
if (!curRow) {
|
|
43923
|
-
|
|
43925
|
+
// if data is remote, record might not be in the view yet.
|
|
43926
|
+
return this.grid.verticalScrollContainer.isRemote && rowIndex >= 0 && rowIndex <= this.grid.totalItemCount - 1;
|
|
43924
43927
|
}
|
|
43925
43928
|
}
|
|
43926
43929
|
else {
|
|
@@ -44192,8 +44195,11 @@ class IgxGridNavigationService {
|
|
|
44192
44195
|
event.preventDefault();
|
|
44193
44196
|
if ((this.grid.crudService.rowInEditMode && this.grid.rowEditTabs.length) &&
|
|
44194
44197
|
(this.activeNode.row !== next.rowIndex || this.isActiveNode(next.rowIndex, next.visibleColumnIndex))) {
|
|
44195
|
-
this.grid.crudService.updateCell(true, event);
|
|
44196
|
-
if (
|
|
44198
|
+
const args = this.grid.crudService.updateCell(true, event);
|
|
44199
|
+
if (args.cancel) {
|
|
44200
|
+
return;
|
|
44201
|
+
}
|
|
44202
|
+
else if (shift) {
|
|
44197
44203
|
this.grid.rowEditTabs.last.element.nativeElement.focus();
|
|
44198
44204
|
}
|
|
44199
44205
|
else {
|
|
@@ -53750,22 +53756,24 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53750
53756
|
*/
|
|
53751
53757
|
getNextCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
53752
53758
|
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
53753
|
-
|
|
53759
|
+
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
53760
|
+
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
53754
53761
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
53755
53762
|
}
|
|
53756
53763
|
const colIndexes = callback ? columns.filter((col) => callback(col)).map(editCol => editCol.visibleIndex).sort((a, b) => a - b) :
|
|
53757
53764
|
columns.map(editCol => editCol.visibleIndex).sort((a, b) => a - b);
|
|
53758
53765
|
const nextCellIndex = colIndexes.find(index => index > curVisibleColIndex);
|
|
53759
|
-
if (this.dataView.slice(
|
|
53766
|
+
if (this.dataView.slice(dataViewIndex, dataViewIndex + 1)
|
|
53760
53767
|
.find(rec => !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData) && nextCellIndex !== undefined) {
|
|
53761
53768
|
return { rowIndex: currRowIndex, visibleColumnIndex: nextCellIndex };
|
|
53762
53769
|
}
|
|
53763
53770
|
else {
|
|
53764
|
-
|
|
53771
|
+
const nextIndex = this.getNextDataRowIndex(currRowIndex);
|
|
53772
|
+
if (colIndexes.length === 0 || nextIndex === currRowIndex) {
|
|
53765
53773
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
53766
53774
|
}
|
|
53767
53775
|
else {
|
|
53768
|
-
return { rowIndex:
|
|
53776
|
+
return { rowIndex: nextIndex, visibleColumnIndex: colIndexes[0] };
|
|
53769
53777
|
}
|
|
53770
53778
|
}
|
|
53771
53779
|
}
|
|
@@ -53783,22 +53791,24 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53783
53791
|
*/
|
|
53784
53792
|
getPreviousCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
53785
53793
|
const columns = this.columnList.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
53786
|
-
|
|
53794
|
+
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
53795
|
+
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
53787
53796
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
53788
53797
|
}
|
|
53789
53798
|
const colIndexes = callback ? columns.filter((col) => callback(col)).map(editCol => editCol.visibleIndex).sort((a, b) => b - a) :
|
|
53790
53799
|
columns.map(editCol => editCol.visibleIndex).sort((a, b) => b - a);
|
|
53791
53800
|
const prevCellIndex = colIndexes.find(index => index < curVisibleColIndex);
|
|
53792
|
-
if (this.dataView.slice(
|
|
53801
|
+
if (this.dataView.slice(dataViewIndex, dataViewIndex + 1)
|
|
53793
53802
|
.find(rec => !rec.expression && !rec.summaries && !rec.childGridsData && !rec.detailsData) && prevCellIndex !== undefined) {
|
|
53794
53803
|
return { rowIndex: currRowIndex, visibleColumnIndex: prevCellIndex };
|
|
53795
53804
|
}
|
|
53796
53805
|
else {
|
|
53797
|
-
|
|
53806
|
+
const prevIndex = this.getNextDataRowIndex(currRowIndex, true);
|
|
53807
|
+
if (colIndexes.length === 0 || prevIndex === currRowIndex) {
|
|
53798
53808
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
53799
53809
|
}
|
|
53800
53810
|
else {
|
|
53801
|
-
return { rowIndex:
|
|
53811
|
+
return { rowIndex: prevIndex, visibleColumnIndex: colIndexes[0] };
|
|
53802
53812
|
}
|
|
53803
53813
|
}
|
|
53804
53814
|
}
|
|
@@ -54382,7 +54392,6 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54382
54392
|
let added = false;
|
|
54383
54393
|
let removed = false;
|
|
54384
54394
|
diff.forEachAddedItem((record) => {
|
|
54385
|
-
this.columnInit.emit(record.item);
|
|
54386
54395
|
added = true;
|
|
54387
54396
|
if (record.item.pinned) {
|
|
54388
54397
|
this._pinnedColumns.push(record.item);
|
|
@@ -54391,7 +54400,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54391
54400
|
this._unpinnedColumns.push(record.item);
|
|
54392
54401
|
}
|
|
54393
54402
|
});
|
|
54394
|
-
this.initColumns(this.columnList);
|
|
54403
|
+
this.initColumns(this.columnList, (col) => this.columnInit.emit(col));
|
|
54395
54404
|
diff.forEachRemovedItem((record) => {
|
|
54396
54405
|
const isColumnGroup = record.item instanceof IgxColumnGroupComponent;
|
|
54397
54406
|
if (!isColumnGroup) {
|
|
@@ -55012,6 +55021,31 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55012
55021
|
}
|
|
55013
55022
|
directive.scrollTo(goal);
|
|
55014
55023
|
}
|
|
55024
|
+
/**
|
|
55025
|
+
* @hidden
|
|
55026
|
+
* @internal
|
|
55027
|
+
*/
|
|
55028
|
+
_getDataViewIndex(index) {
|
|
55029
|
+
let newIndex = index;
|
|
55030
|
+
if ((index < 0 || index >= this.dataView.length) && this.pagingMode === 1 && this.paginator.page !== 0) {
|
|
55031
|
+
newIndex = index - this.paginator.perPage * this.paginator.page;
|
|
55032
|
+
}
|
|
55033
|
+
else if (this.gridAPI.grid.verticalScrollContainer.isRemote) {
|
|
55034
|
+
newIndex = index - this.gridAPI.grid.virtualizationState.startIndex;
|
|
55035
|
+
}
|
|
55036
|
+
return newIndex;
|
|
55037
|
+
}
|
|
55038
|
+
/**
|
|
55039
|
+
* @hidden
|
|
55040
|
+
* @internal
|
|
55041
|
+
*/
|
|
55042
|
+
getDataIndex(dataViewIndex) {
|
|
55043
|
+
let newIndex = dataViewIndex;
|
|
55044
|
+
if (this.gridAPI.grid.verticalScrollContainer.isRemote) {
|
|
55045
|
+
newIndex = dataViewIndex + this.gridAPI.grid.virtualizationState.startIndex;
|
|
55046
|
+
}
|
|
55047
|
+
return newIndex;
|
|
55048
|
+
}
|
|
55015
55049
|
getColumnWidthSum() {
|
|
55016
55050
|
let colSum = 0;
|
|
55017
55051
|
const cols = this.hasColumnLayouts ?
|
|
@@ -55111,7 +55145,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55111
55145
|
cb(cbArgs);
|
|
55112
55146
|
});
|
|
55113
55147
|
}
|
|
55114
|
-
|
|
55148
|
+
const dataViewIndex = this._getDataViewIndex(rowIndex);
|
|
55149
|
+
if (this.dataView[dataViewIndex].detailsData) {
|
|
55115
55150
|
this.navigation.setActiveNode({ row: rowIndex });
|
|
55116
55151
|
this.cdr.detectChanges();
|
|
55117
55152
|
}
|
|
@@ -55145,13 +55180,15 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55145
55180
|
return { targetType, target };
|
|
55146
55181
|
}
|
|
55147
55182
|
getNextDataRowIndex(currentRowIndex, previous = false) {
|
|
55148
|
-
|
|
55183
|
+
const resolvedIndex = this._getDataViewIndex(currentRowIndex);
|
|
55184
|
+
if (currentRowIndex < 0 || (currentRowIndex === 0 && previous) || (resolvedIndex >= this.dataView.length - 1 && !previous)) {
|
|
55149
55185
|
return currentRowIndex;
|
|
55150
55186
|
}
|
|
55151
55187
|
// find next/prev record that is editable.
|
|
55152
55188
|
const nextRowIndex = previous ? this.findPrevEditableDataRowIndex(currentRowIndex) :
|
|
55153
|
-
this.dataView.findIndex((rec, index) => index >
|
|
55154
|
-
|
|
55189
|
+
this.dataView.findIndex((rec, index) => index > resolvedIndex && this.isEditableDataRecordAtIndex(index));
|
|
55190
|
+
const nextDataIndex = this.getDataIndex(nextRowIndex);
|
|
55191
|
+
return nextDataIndex !== -1 ? nextDataIndex : currentRowIndex;
|
|
55155
55192
|
}
|
|
55156
55193
|
/**
|
|
55157
55194
|
* Returns the previous editable row index or -1 if no such row is found.
|
|
@@ -55160,8 +55197,9 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55160
55197
|
*/
|
|
55161
55198
|
findPrevEditableDataRowIndex(currentIndex) {
|
|
55162
55199
|
let i = this.dataView.length;
|
|
55200
|
+
const resolvedIndex = this._getDataViewIndex(currentIndex);
|
|
55163
55201
|
while (i--) {
|
|
55164
|
-
if (i <
|
|
55202
|
+
if (i < resolvedIndex && this.isEditableDataRecordAtIndex(i)) {
|
|
55165
55203
|
return i;
|
|
55166
55204
|
}
|
|
55167
55205
|
}
|
|
@@ -56933,7 +56971,10 @@ class IgxGridCellComponent {
|
|
|
56933
56971
|
const node = this.selectionNode;
|
|
56934
56972
|
const shouldEmitSelection = !this.selectionService.isActiveNode(node);
|
|
56935
56973
|
if (this.selectionService.primaryButton) {
|
|
56936
|
-
this._updateCRUDStatus(event);
|
|
56974
|
+
const cancel = this._updateCRUDStatus(event);
|
|
56975
|
+
if (cancel) {
|
|
56976
|
+
return;
|
|
56977
|
+
}
|
|
56937
56978
|
const activeElement = this.selectionService.activeElement;
|
|
56938
56979
|
const row = activeElement ? this.gridAPI.get_row_by_index(activeElement.row) : null;
|
|
56939
56980
|
if ((this.grid.crudService.rowEditingBlocked && row && this.intRow.rowID !== row.rowID) ||
|
|
@@ -62663,7 +62704,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62663
62704
|
*/
|
|
62664
62705
|
createRow(index, data) {
|
|
62665
62706
|
let row;
|
|
62666
|
-
const dataIndex = this.
|
|
62707
|
+
const dataIndex = this._getDataViewIndex(index);
|
|
62667
62708
|
const rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
|
|
62668
62709
|
if (rec && this.isGroupByRecord(rec)) {
|
|
62669
62710
|
row = new IgxGroupByRow(this, index, rec);
|
|
@@ -66008,7 +66049,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
66008
66049
|
*/
|
|
66009
66050
|
createRow(index, data) {
|
|
66010
66051
|
let row;
|
|
66011
|
-
const dataIndex = this.
|
|
66052
|
+
const dataIndex = this._getDataViewIndex(index);
|
|
66012
66053
|
const rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
|
|
66013
66054
|
if (this.isSummaryRow(rec)) {
|
|
66014
66055
|
row = new IgxSummaryRow(this, index, rec.summaries, GridInstanceType.TreeGrid);
|
|
@@ -68798,7 +68839,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68798
68839
|
*/
|
|
68799
68840
|
isChildGridRecord(record) {
|
|
68800
68841
|
// Can be null when there is defined layout but no child data was found
|
|
68801
|
-
return record.childGridsData !== undefined;
|
|
68842
|
+
return (record === null || record === void 0 ? void 0 : record.childGridsData) !== undefined;
|
|
68802
68843
|
}
|
|
68803
68844
|
/**
|
|
68804
68845
|
* @hidden
|
|
@@ -68992,7 +69033,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68992
69033
|
*/
|
|
68993
69034
|
createRow(index, data) {
|
|
68994
69035
|
let row;
|
|
68995
|
-
const dataIndex = this.
|
|
69036
|
+
const dataIndex = this._getDataViewIndex(index);
|
|
68996
69037
|
const rec = data !== null && data !== void 0 ? data : this.dataView[dataIndex];
|
|
68997
69038
|
if (!row && rec && !rec.childGridsData) {
|
|
68998
69039
|
row = new IgxHierarchicalGridRow(this, index, rec);
|