igniteui-angular 13.2.2 → 13.2.3
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/esm2020/lib/grids/api.service.mjs +2 -2
- package/esm2020/lib/grids/columns/column-layout.component.mjs +3 -3
- package/esm2020/lib/grids/columns/column.component.mjs +4 -4
- package/esm2020/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.mjs +2 -2
- package/esm2020/lib/grids/filtering/grid-filtering.service.mjs +7 -7
- package/esm2020/lib/grids/grid/grid.component.mjs +11 -11
- package/esm2020/lib/grids/grid-base.directive.mjs +61 -56
- package/esm2020/lib/grids/grid-mrl-navigation.service.mjs +2 -2
- package/esm2020/lib/grids/grid-public-row.mjs +3 -3
- package/esm2020/lib/grids/grouping/group-by-area.directive.mjs +2 -2
- package/esm2020/lib/grids/grouping/tree-grid-group-by-area.component.mjs +6 -6
- package/esm2020/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.mjs +4 -5
- package/esm2020/lib/grids/hierarchical-grid/hierarchical-grid.component.mjs +23 -14
- package/esm2020/lib/grids/hierarchical-grid/row-island.component.mjs +7 -11
- package/esm2020/lib/grids/pivot-grid/pivot-grid.component.mjs +3 -3
- package/esm2020/lib/grids/state.directive.mjs +9 -9
- package/esm2020/lib/grids/summaries/grid-summary.service.mjs +5 -5
- package/esm2020/lib/grids/tree-grid/tree-grid.component.mjs +7 -7
- package/esm2020/lib/services/exporter-common/base-export-service.mjs +3 -3
- package/fesm2015/igniteui-angular.mjs +146 -136
- package/fesm2015/igniteui-angular.mjs.map +1 -1
- package/fesm2020/igniteui-angular.mjs +146 -136
- package/fesm2020/igniteui-angular.mjs.map +1 -1
- package/lib/core/styles/themes/schemas/dark/_stepper.scss +6 -1
- package/lib/grids/grid-base.directive.d.ts +2 -1
- package/lib/grids/hierarchical-grid/hierarchical-grid.component.d.ts +2 -1
- package/lib/grids/hierarchical-grid/row-island.component.d.ts +1 -0
- package/lib/grids/tree-grid/tree-grid.component.d.ts +2 -2
- package/package.json +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
|
@@ -7,7 +7,7 @@ import { NgModel, FormControlName, NG_VALUE_ACCESSOR, NG_VALIDATORS, CheckboxReq
|
|
|
7
7
|
import * as i4 from '@angular/common';
|
|
8
8
|
import { isPlatformBrowser, formatDate as formatDate$1, CurrencyPipe, formatPercent, formatNumber, getLocaleCurrencyCode, DatePipe, DOCUMENT, CommonModule, FormatWidth, getLocaleDateFormat, getLocaleNumberFormat, NumberFormatStyle, getCurrencySymbol } from '@angular/common';
|
|
9
9
|
import { Observable, Subject, fromEvent, interval, animationFrameScheduler, noop, merge, Subscription, timer, pipe } from 'rxjs';
|
|
10
|
-
import { takeUntil, filter, first as first$1, throttleTime, take, throttle, debounce, tap, switchMap, skipLast, map, debounceTime, shareReplay, takeWhile,
|
|
10
|
+
import { takeUntil, filter, first as first$1, throttleTime, take, throttle, debounce, tap, switchMap, skipLast, map, debounceTime, shareReplay, takeWhile, pluck } from 'rxjs/operators';
|
|
11
11
|
import mergeWith from 'lodash.mergewith';
|
|
12
12
|
import { __awaiter, __decorate, __param } from 'tslib';
|
|
13
13
|
import * as JSZip from 'jszip';
|
|
@@ -2600,7 +2600,7 @@ class IgxBaseExporter {
|
|
|
2600
2600
|
throw Error('No options provided!');
|
|
2601
2601
|
}
|
|
2602
2602
|
this.options = options;
|
|
2603
|
-
let columns = grid.
|
|
2603
|
+
let columns = grid.columns;
|
|
2604
2604
|
if (this.options.ignoreMultiColumnHeaders) {
|
|
2605
2605
|
columns = columns.filter(col => col.children === undefined);
|
|
2606
2606
|
}
|
|
@@ -3233,7 +3233,7 @@ class IgxBaseExporter {
|
|
|
3233
3233
|
columnList = this.getAutoGeneratedColumns(islandData);
|
|
3234
3234
|
}
|
|
3235
3235
|
else {
|
|
3236
|
-
const islandColumnList = island.
|
|
3236
|
+
const islandColumnList = island.columns;
|
|
3237
3237
|
columnList = this.getColumns(islandColumnList);
|
|
3238
3238
|
}
|
|
3239
3239
|
this._ownersMap.set(island, columnList);
|
|
@@ -47802,7 +47802,7 @@ class GridBaseAPIService {
|
|
|
47802
47802
|
this.destroyMap = new Map();
|
|
47803
47803
|
}
|
|
47804
47804
|
get_column_by_name(name) {
|
|
47805
|
-
return this.grid.
|
|
47805
|
+
return this.grid.columns.find((col) => col.field === name);
|
|
47806
47806
|
}
|
|
47807
47807
|
get_summary_data() {
|
|
47808
47808
|
const grid = this.grid;
|
|
@@ -50243,7 +50243,7 @@ class IgxColumnComponent {
|
|
|
50243
50243
|
grid.resetCaches();
|
|
50244
50244
|
grid.notifyChanges();
|
|
50245
50245
|
if (this.columnLayoutChild) {
|
|
50246
|
-
this.grid.
|
|
50246
|
+
this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
|
|
50247
50247
|
}
|
|
50248
50248
|
this.grid.filteringService.refreshExpressions();
|
|
50249
50249
|
const eventArgs = { column: this, insertAtIndex: index, isPinned: true };
|
|
@@ -50310,7 +50310,7 @@ class IgxColumnComponent {
|
|
|
50310
50310
|
grid.resetCaches();
|
|
50311
50311
|
grid.notifyChanges();
|
|
50312
50312
|
if (this.columnLayoutChild) {
|
|
50313
|
-
this.grid.
|
|
50313
|
+
this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
|
|
50314
50314
|
}
|
|
50315
50315
|
this.grid.filteringService.refreshExpressions();
|
|
50316
50316
|
this.grid.columnPinned.emit({ column: this, insertAtIndex: index, isPinned: false });
|
|
@@ -50329,7 +50329,7 @@ class IgxColumnComponent {
|
|
|
50329
50329
|
*/
|
|
50330
50330
|
move(index) {
|
|
50331
50331
|
let target;
|
|
50332
|
-
let columns = this.grid.
|
|
50332
|
+
let columns = this.grid.columns.filter(c => c.visibleIndex > -1);
|
|
50333
50333
|
// grid last visible index
|
|
50334
50334
|
const li = columns.map(c => c.visibleIndex).reduce((a, b) => Math.max(a, b));
|
|
50335
50335
|
const parent = this.parent;
|
|
@@ -51903,7 +51903,7 @@ class BaseRow {
|
|
|
51903
51903
|
*/
|
|
51904
51904
|
get cells() {
|
|
51905
51905
|
const res = [];
|
|
51906
|
-
this.grid.
|
|
51906
|
+
this.grid.columns.forEach(col => {
|
|
51907
51907
|
const cell = new IgxGridCell(this.grid, this.index, col.field);
|
|
51908
51908
|
res.push(cell);
|
|
51909
51909
|
});
|
|
@@ -52214,7 +52214,7 @@ class IgxHierarchicalGridRow extends BaseRow {
|
|
|
52214
52214
|
*/
|
|
52215
52215
|
get cells() {
|
|
52216
52216
|
const res = [];
|
|
52217
|
-
this.grid.
|
|
52217
|
+
this.grid.columns.forEach(col => {
|
|
52218
52218
|
const cell = new IgxGridCell(this.grid, this.index, col.field);
|
|
52219
52219
|
res.push(cell);
|
|
52220
52220
|
});
|
|
@@ -53533,7 +53533,7 @@ class IgxGroupByAreaDirective {
|
|
|
53533
53533
|
const drag = event.detail.owner;
|
|
53534
53534
|
if (drag instanceof IgxColumnMovingDragDirective) {
|
|
53535
53535
|
const column = drag.column;
|
|
53536
|
-
if (!this.grid.
|
|
53536
|
+
if (!this.grid.columns.find(c => c === column)) {
|
|
53537
53537
|
return;
|
|
53538
53538
|
}
|
|
53539
53539
|
const isGrouped = this.expressions.findIndex((item) => item.fieldName === column.field) !== -1;
|
|
@@ -54035,7 +54035,7 @@ class IgxAdvancedFilteringDialogComponent {
|
|
|
54035
54035
|
* @hidden @internal
|
|
54036
54036
|
*/
|
|
54037
54037
|
get filterableColumns() {
|
|
54038
|
-
return this.grid.
|
|
54038
|
+
return this.grid.columns.filter((col) => !col.columnGroup && col.filterable);
|
|
54039
54039
|
}
|
|
54040
54040
|
/**
|
|
54041
54041
|
* @hidden @internal
|
|
@@ -55874,7 +55874,7 @@ class IgxFilteringService {
|
|
|
55874
55874
|
grid.paginator.page = 0;
|
|
55875
55875
|
}
|
|
55876
55876
|
filteringTree.filteringOperands = [];
|
|
55877
|
-
for (const column of grid.
|
|
55877
|
+
for (const column of grid.columns) {
|
|
55878
55878
|
this.prepare_filtering_expression(filteringTree, column.field, term, condition, ignoreCase || column.filteringIgnoreCase);
|
|
55879
55879
|
}
|
|
55880
55880
|
grid.filteringExpressionsTree = filteringTree;
|
|
@@ -55908,7 +55908,7 @@ class IgxFilteringService {
|
|
|
55908
55908
|
expressions.length = 0;
|
|
55909
55909
|
}
|
|
55910
55910
|
else {
|
|
55911
|
-
this.grid.
|
|
55911
|
+
this.grid.columns.forEach(c => {
|
|
55912
55912
|
const expressions = this.getExpressions(c.field);
|
|
55913
55913
|
expressions.length = 0;
|
|
55914
55914
|
});
|
|
@@ -55938,7 +55938,7 @@ class IgxFilteringService {
|
|
|
55938
55938
|
const grid = this.grid;
|
|
55939
55939
|
const filteringTree = grid.filteringExpressionsTree;
|
|
55940
55940
|
const newFilteringTree = new FilteringExpressionsTree(filteringTree.operator, filteringTree.fieldName);
|
|
55941
|
-
for (const column of grid.
|
|
55941
|
+
for (const column of grid.columns) {
|
|
55942
55942
|
this.prepare_filtering_expression(newFilteringTree, column.field, value, condition, ignoreCase || column.filteringIgnoreCase);
|
|
55943
55943
|
}
|
|
55944
55944
|
const eventArgs = { owner: grid, filteringExpressions: newFilteringTree, cancel: false };
|
|
@@ -55968,7 +55968,7 @@ class IgxFilteringService {
|
|
|
55968
55968
|
*/
|
|
55969
55969
|
getExpressions(columnId) {
|
|
55970
55970
|
if (!this.columnToExpressionsMap.has(columnId)) {
|
|
55971
|
-
const column = this.grid.
|
|
55971
|
+
const column = this.grid.columns.find((col) => col.field === columnId);
|
|
55972
55972
|
const expressionUIs = new Array();
|
|
55973
55973
|
if (column) {
|
|
55974
55974
|
this.generateExpressionsList(column.filteringExpressionsTree, this.grid.filteringExpressionsTree.operator, expressionUIs);
|
|
@@ -55985,7 +55985,7 @@ class IgxFilteringService {
|
|
|
55985
55985
|
if (!this.isFiltering) {
|
|
55986
55986
|
this.columnsWithComplexFilter.clear();
|
|
55987
55987
|
this.columnToExpressionsMap.forEach((value, key) => {
|
|
55988
|
-
const column = this.grid.
|
|
55988
|
+
const column = this.grid.columns.find((col) => col.field === key);
|
|
55989
55989
|
if (column) {
|
|
55990
55990
|
value.length = 0;
|
|
55991
55991
|
this.generateExpressionsList(column.filteringExpressionsTree, this.grid.filteringExpressionsTree.operator, value);
|
|
@@ -56058,7 +56058,7 @@ class IgxFilteringService {
|
|
|
56058
56058
|
if (this.columnsWithComplexFilter.has(columnId)) {
|
|
56059
56059
|
return true;
|
|
56060
56060
|
}
|
|
56061
|
-
const column = this.grid.
|
|
56061
|
+
const column = this.grid.columns.find((col) => col.field === columnId);
|
|
56062
56062
|
const isComplex = column && this.isFilteringTreeComplex(column.filteringExpressionsTree);
|
|
56063
56063
|
if (isComplex) {
|
|
56064
56064
|
this.columnsWithComplexFilter.add(columnId);
|
|
@@ -58973,7 +58973,7 @@ class IgxGridSummaryService {
|
|
|
58973
58973
|
this.removeSummaries(rowID);
|
|
58974
58974
|
}
|
|
58975
58975
|
if (args.rowID !== undefined && args.rowID !== null) {
|
|
58976
|
-
let columnName = args.cellID ? this.grid.
|
|
58976
|
+
let columnName = args.cellID ? this.grid.columns.find(col => col.index === args.cellID.columnID).field : undefined;
|
|
58977
58977
|
if (columnName && this.grid.rowEditable) {
|
|
58978
58978
|
return;
|
|
58979
58979
|
}
|
|
@@ -59030,7 +59030,7 @@ class IgxGridSummaryService {
|
|
|
59030
59030
|
return this.summaryHeight = 0;
|
|
59031
59031
|
}
|
|
59032
59032
|
let maxSummaryLength = 0;
|
|
59033
|
-
this.grid.
|
|
59033
|
+
this.grid.columns.filter((col) => col.hasSummary && !col.hidden).forEach((column) => {
|
|
59034
59034
|
const getCurrentSummaryColumn = column.summaries.operate([], [], column.field).length;
|
|
59035
59035
|
if (getCurrentSummaryColumn) {
|
|
59036
59036
|
if (maxSummaryLength < getCurrentSummaryColumn) {
|
|
@@ -59051,7 +59051,7 @@ class IgxGridSummaryService {
|
|
|
59051
59051
|
if (!this.hasSummarizedColumns || !data) {
|
|
59052
59052
|
return rowSummaries;
|
|
59053
59053
|
}
|
|
59054
|
-
this.grid.
|
|
59054
|
+
this.grid.columns.filter(col => col.hasSummary).forEach((column) => {
|
|
59055
59055
|
if (!rowSummaries.get(column.field)) {
|
|
59056
59056
|
const summaryResult = column.summaries.operate(data.map(r => resolveNestedPath(r, column.field)), data, column.field, this.grid.locale, column.pipeArgs);
|
|
59057
59057
|
rowSummaries.set(column.field, summaryResult);
|
|
@@ -59084,7 +59084,7 @@ class IgxGridSummaryService {
|
|
|
59084
59084
|
this.groupingExpressions = groupingArgs.expressions.map(record => record.fieldName);
|
|
59085
59085
|
}
|
|
59086
59086
|
get hasSummarizedColumns() {
|
|
59087
|
-
const summarizedColumns = this.grid.
|
|
59087
|
+
const summarizedColumns = this.grid.columns.filter(col => col.hasSummary && !col.hidden);
|
|
59088
59088
|
return summarizedColumns.length > 0;
|
|
59089
59089
|
}
|
|
59090
59090
|
deleteSummaryCache(id, columnName) {
|
|
@@ -61026,8 +61026,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
61026
61026
|
get maxLevelHeaderDepth() {
|
|
61027
61027
|
if (this._maxLevelHeaderDepth === null) {
|
|
61028
61028
|
this._maxLevelHeaderDepth = this.hasColumnLayouts ?
|
|
61029
|
-
this.
|
|
61030
|
-
this.
|
|
61029
|
+
this._columns.reduce((acc, col) => Math.max(acc, col.rowStart), 0) :
|
|
61030
|
+
this._columns.reduce((acc, col) => Math.max(acc, col.level), 0);
|
|
61031
61031
|
}
|
|
61032
61032
|
return this._maxLevelHeaderDepth;
|
|
61033
61033
|
}
|
|
@@ -61040,7 +61040,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
61040
61040
|
* ``
|
|
61041
61041
|
*/
|
|
61042
61042
|
get hiddenColumnsCount() {
|
|
61043
|
-
return this.
|
|
61043
|
+
return this._columns.filter((col) => col.columnGroup === false && col.hidden === true).length;
|
|
61044
61044
|
}
|
|
61045
61045
|
/**
|
|
61046
61046
|
* Gets the number of pinned columns.
|
|
@@ -61559,13 +61559,13 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
61559
61559
|
* @internal
|
|
61560
61560
|
*/
|
|
61561
61561
|
resetColumnsCaches() {
|
|
61562
|
-
this.
|
|
61562
|
+
this._columns.forEach(column => column.resetCaches());
|
|
61563
61563
|
}
|
|
61564
61564
|
/**
|
|
61565
61565
|
* @hidden @internal
|
|
61566
61566
|
*/
|
|
61567
61567
|
generateRowID() {
|
|
61568
|
-
const primaryColumn = this.
|
|
61568
|
+
const primaryColumn = this._columns.find(col => col.field === this.primaryKey);
|
|
61569
61569
|
const idType = this.data.length ?
|
|
61570
61570
|
this.resolveDataTypes(this.data[0][this.primaryKey]) : primaryColumn ? primaryColumn.dataType : 'string';
|
|
61571
61571
|
return idType === 'string' ? v4() : FAKE_ROW_ID--;
|
|
@@ -61632,7 +61632,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
61632
61632
|
this.resetColumnCollections();
|
|
61633
61633
|
this.resetCachedWidths();
|
|
61634
61634
|
this.hasVisibleColumns = undefined;
|
|
61635
|
-
this._columnGroups = this.
|
|
61635
|
+
this._columnGroups = this._columns.some(col => col.columnGroup);
|
|
61636
61636
|
}
|
|
61637
61637
|
/**
|
|
61638
61638
|
* @hidden
|
|
@@ -61898,7 +61898,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
61898
61898
|
* ```
|
|
61899
61899
|
*/
|
|
61900
61900
|
toggleColumnVisibility(args) {
|
|
61901
|
-
const col = args.column ? this.
|
|
61901
|
+
const col = args.column ? this._columns.find((c) => c === args.column) : undefined;
|
|
61902
61902
|
if (!col) {
|
|
61903
61903
|
return;
|
|
61904
61904
|
}
|
|
@@ -62159,7 +62159,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62159
62159
|
* ```
|
|
62160
62160
|
*/
|
|
62161
62161
|
get columns() {
|
|
62162
|
-
return this.
|
|
62162
|
+
return this._columns || [];
|
|
62163
62163
|
}
|
|
62164
62164
|
/**
|
|
62165
62165
|
* Gets an array of the pinned `IgxColumnComponent`s.
|
|
@@ -62220,7 +62220,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62220
62220
|
* @param name
|
|
62221
62221
|
*/
|
|
62222
62222
|
getColumnByName(name) {
|
|
62223
|
-
return this.
|
|
62223
|
+
return this._columns.find((col) => col.field === name);
|
|
62224
62224
|
}
|
|
62225
62225
|
getColumnByVisibleIndex(index) {
|
|
62226
62226
|
return this.visibleColumns.find((col) => !col.columnGroup && !col.columnLayout &&
|
|
@@ -62238,7 +62238,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62238
62238
|
if (this._visibleColumns.length) {
|
|
62239
62239
|
return this._visibleColumns;
|
|
62240
62240
|
}
|
|
62241
|
-
this._visibleColumns = this.
|
|
62241
|
+
this._visibleColumns = this._columns.filter(c => !c.hidden);
|
|
62242
62242
|
return this._visibleColumns;
|
|
62243
62243
|
}
|
|
62244
62244
|
/**
|
|
@@ -62371,14 +62371,14 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62371
62371
|
* @internal
|
|
62372
62372
|
*/
|
|
62373
62373
|
get showAddButton() {
|
|
62374
|
-
return this.rowEditable && this.dataView.length === 0 && this.
|
|
62374
|
+
return this.rowEditable && this.dataView.length === 0 && this._columns.length > 0;
|
|
62375
62375
|
}
|
|
62376
62376
|
/**
|
|
62377
62377
|
* @hidden
|
|
62378
62378
|
* @internal
|
|
62379
62379
|
*/
|
|
62380
62380
|
get showDragIcons() {
|
|
62381
|
-
return this.rowDraggable && this.
|
|
62381
|
+
return this.rowDraggable && this._columns.length > this.hiddenColumnsCount;
|
|
62382
62382
|
}
|
|
62383
62383
|
/**
|
|
62384
62384
|
* @hidden
|
|
@@ -62440,12 +62440,12 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62440
62440
|
const index = pos === DropPosition.AfterDropTarget ? unpinnedIndex + 1 : unpinnedIndex;
|
|
62441
62441
|
columnPinStateChanged = column.unpin(index);
|
|
62442
62442
|
}
|
|
62443
|
-
if (target.pinned && column.pinned && !columnPinStateChanged) {
|
|
62444
|
-
|
|
62445
|
-
}
|
|
62446
|
-
if (!target.pinned && !column.pinned && !columnPinStateChanged) {
|
|
62447
|
-
|
|
62448
|
-
}
|
|
62443
|
+
// if (target.pinned && column.pinned && !columnPinStateChanged) {
|
|
62444
|
+
// this._reorderColumns(column, target, pos, this._pinnedColumns);
|
|
62445
|
+
// }
|
|
62446
|
+
// if (!target.pinned && !column.pinned && !columnPinStateChanged) {
|
|
62447
|
+
// this._reorderColumns(column, target, pos, this._unpinnedColumns);
|
|
62448
|
+
// }
|
|
62449
62449
|
this._moveColumns(column, target, pos);
|
|
62450
62450
|
this._columnsReordered(column);
|
|
62451
62451
|
}
|
|
@@ -62564,7 +62564,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62564
62564
|
*/
|
|
62565
62565
|
updateCell(value, rowSelector, column) {
|
|
62566
62566
|
if (this.isDefined(this.primaryKey)) {
|
|
62567
|
-
const col = this.
|
|
62567
|
+
const col = this._columns.find(c => c.field === column);
|
|
62568
62568
|
if (col) {
|
|
62569
62569
|
// Simplify
|
|
62570
62570
|
const rowData = this.gridAPI.getRowData(rowSelector);
|
|
@@ -62655,7 +62655,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
62655
62655
|
}
|
|
62656
62656
|
else {
|
|
62657
62657
|
if (this._sortingOptions.mode === 'single') {
|
|
62658
|
-
this.
|
|
62658
|
+
this._columns.forEach((col) => {
|
|
62659
62659
|
if (!(col.field === expression.fieldName)) {
|
|
62660
62660
|
this.clearSort(col.field);
|
|
62661
62661
|
}
|
|
@@ -63017,7 +63017,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63017
63017
|
* ```
|
|
63018
63018
|
*/
|
|
63019
63019
|
get hasSortableColumns() {
|
|
63020
|
-
return this.
|
|
63020
|
+
return this._columns.some((col) => col.sortable);
|
|
63021
63021
|
}
|
|
63022
63022
|
/**
|
|
63023
63023
|
* Returns if the `IgxGridComponent` has editable columns.
|
|
@@ -63028,7 +63028,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63028
63028
|
* ```
|
|
63029
63029
|
*/
|
|
63030
63030
|
get hasEditableColumns() {
|
|
63031
|
-
return this.
|
|
63031
|
+
return this._columns.some((col) => col.editable);
|
|
63032
63032
|
}
|
|
63033
63033
|
/**
|
|
63034
63034
|
* Returns if the `IgxGridComponent` has filterable columns.
|
|
@@ -63039,7 +63039,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63039
63039
|
* ```
|
|
63040
63040
|
*/
|
|
63041
63041
|
get hasFilterableColumns() {
|
|
63042
|
-
return this.
|
|
63042
|
+
return this._columns.some((col) => col.filterable);
|
|
63043
63043
|
}
|
|
63044
63044
|
/**
|
|
63045
63045
|
* Returns if the `IgxGridComponent` has summarized columns.
|
|
@@ -63050,7 +63050,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63050
63050
|
* ```
|
|
63051
63051
|
*/
|
|
63052
63052
|
get hasSummarizedColumns() {
|
|
63053
|
-
const summarizedColumns = this.
|
|
63053
|
+
const summarizedColumns = this._columns.filter(col => col.hasSummary && !col.hidden);
|
|
63054
63054
|
return summarizedColumns.length > 0;
|
|
63055
63055
|
}
|
|
63056
63056
|
/**
|
|
@@ -63064,7 +63064,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63064
63064
|
*/
|
|
63065
63065
|
get hasVisibleColumns() {
|
|
63066
63066
|
if (this._hasVisibleColumns === undefined) {
|
|
63067
|
-
return this.
|
|
63067
|
+
return this._columns ? this._columns.some(c => !c.hidden) : false;
|
|
63068
63068
|
}
|
|
63069
63069
|
return this._hasVisibleColumns;
|
|
63070
63070
|
}
|
|
@@ -63105,7 +63105,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63105
63105
|
* ```
|
|
63106
63106
|
*/
|
|
63107
63107
|
get hasColumnLayouts() {
|
|
63108
|
-
return !!this.
|
|
63108
|
+
return !!this._columns.some(col => col.columnLayout);
|
|
63109
63109
|
}
|
|
63110
63110
|
/**
|
|
63111
63111
|
* @hidden @internal
|
|
@@ -63561,7 +63561,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63561
63561
|
* ```
|
|
63562
63562
|
*/
|
|
63563
63563
|
selectAllColumns() {
|
|
63564
|
-
this.selectColumns(this.
|
|
63564
|
+
this.selectColumns(this._columns.filter(c => !c.columnGroup));
|
|
63565
63565
|
}
|
|
63566
63566
|
/**
|
|
63567
63567
|
*
|
|
@@ -63671,7 +63671,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63671
63671
|
var _a;
|
|
63672
63672
|
const totalItems = (_a = this.totalItemCount) !== null && _a !== void 0 ? _a : this.dataView.length - 1;
|
|
63673
63673
|
if (rowIndex < 0 || rowIndex > totalItems || (visibleColIndex !== -1
|
|
63674
|
-
&& this.
|
|
63674
|
+
&& this._columns.map(col => col.visibleIndex).indexOf(visibleColIndex) === -1)) {
|
|
63675
63675
|
return;
|
|
63676
63676
|
}
|
|
63677
63677
|
if (this.dataView.slice(rowIndex, rowIndex + 1).find(rec => rec.expression || rec.childGridsData)) {
|
|
@@ -63717,7 +63717,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63717
63717
|
* ```
|
|
63718
63718
|
*/
|
|
63719
63719
|
getNextCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
63720
|
-
const columns = this.
|
|
63720
|
+
const columns = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
63721
63721
|
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
63722
63722
|
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
63723
63723
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
@@ -63752,7 +63752,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
63752
63752
|
* ```
|
|
63753
63753
|
*/
|
|
63754
63754
|
getPreviousCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
63755
|
-
const columns = this.
|
|
63755
|
+
const columns = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
63756
63756
|
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
63757
63757
|
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
63758
63758
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
@@ -64174,7 +64174,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64174
64174
|
if (!this.columnWidthSetByUser) {
|
|
64175
64175
|
this._columnWidth = this.width !== null ? this.getPossibleColumnWidth() : MINIMUM_COLUMN_WIDTH$2 + 'px';
|
|
64176
64176
|
}
|
|
64177
|
-
this.
|
|
64177
|
+
this._columns.forEach((column) => {
|
|
64178
64178
|
if (this.hasColumnLayouts && parseInt(this._columnWidth, 10)) {
|
|
64179
64179
|
const columnWidthCombined = parseInt(this._columnWidth, 10) * (column.colEnd ? column.colEnd - column.colStart : 1);
|
|
64180
64180
|
column.defaultWidth = columnWidthCombined + 'px';
|
|
@@ -64227,7 +64227,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64227
64227
|
* @hidden
|
|
64228
64228
|
*/
|
|
64229
64229
|
_moveColumns(from, to, pos) {
|
|
64230
|
-
const
|
|
64230
|
+
const orderedList = this._pinnedColumns.concat(this._unpinnedColumns);
|
|
64231
|
+
const list = orderedList;
|
|
64231
64232
|
this._reorderColumns(from, to, pos, list);
|
|
64232
64233
|
const newList = this._resetColumnList(list);
|
|
64233
64234
|
this.updateColumns(newList);
|
|
@@ -64239,18 +64240,17 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64239
64240
|
updateColumns(newColumns) {
|
|
64240
64241
|
// update internal collections to retain order.
|
|
64241
64242
|
this._pinnedColumns = newColumns
|
|
64242
|
-
.filter((c) => c.pinned)
|
|
64243
|
+
.filter((c) => c.pinned);
|
|
64243
64244
|
this._unpinnedColumns = newColumns.filter((c) => !c.pinned);
|
|
64244
|
-
this.
|
|
64245
|
-
this.
|
|
64246
|
-
this._columns = this.columnList.toArray();
|
|
64245
|
+
this._columns = newColumns;
|
|
64246
|
+
this.resetCaches();
|
|
64247
64247
|
}
|
|
64248
64248
|
/**
|
|
64249
64249
|
* @hidden
|
|
64250
64250
|
*/
|
|
64251
64251
|
_resetColumnList(list) {
|
|
64252
64252
|
if (!list) {
|
|
64253
|
-
list = this.
|
|
64253
|
+
list = this._columns;
|
|
64254
64254
|
}
|
|
64255
64255
|
let newList = [];
|
|
64256
64256
|
list.filter(c => c.level === 0).forEach(p => {
|
|
@@ -64298,7 +64298,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64298
64298
|
if (this.autoGenerate) {
|
|
64299
64299
|
this.autogenerateColumns();
|
|
64300
64300
|
}
|
|
64301
|
-
|
|
64301
|
+
else {
|
|
64302
|
+
this._columns = this.getColumnList();
|
|
64303
|
+
}
|
|
64304
|
+
this.initColumns(this._columns, (col) => this.columnInit.emit(col));
|
|
64302
64305
|
this.columnListDiffer.diff(this.columnList);
|
|
64303
64306
|
this.columnList.changes
|
|
64304
64307
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -64306,6 +64309,9 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64306
64309
|
this.onColumnsChanged(change);
|
|
64307
64310
|
});
|
|
64308
64311
|
}
|
|
64312
|
+
getColumnList() {
|
|
64313
|
+
return this.columnList.toArray();
|
|
64314
|
+
}
|
|
64309
64315
|
/**
|
|
64310
64316
|
* @hidden
|
|
64311
64317
|
*/
|
|
@@ -64347,10 +64353,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64347
64353
|
*/
|
|
64348
64354
|
onColumnsChanged(change) {
|
|
64349
64355
|
const diff = this.columnListDiffer.diff(change);
|
|
64350
|
-
if (this.autoGenerate && this.
|
|
64356
|
+
if (this.autoGenerate && this._columns.length === 0 && this._autoGeneratedCols.length > 0) {
|
|
64351
64357
|
// In Ivy if there are nested conditional templates the content children are re-evaluated
|
|
64352
64358
|
// hence autogenerated columns are cleared and need to be reset.
|
|
64353
|
-
this.
|
|
64359
|
+
this.updateColumns(this._autoGeneratedCols);
|
|
64354
64360
|
return;
|
|
64355
64361
|
}
|
|
64356
64362
|
if (diff) {
|
|
@@ -64365,7 +64371,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64365
64371
|
this._unpinnedColumns.push(record.item);
|
|
64366
64372
|
}
|
|
64367
64373
|
});
|
|
64368
|
-
this.initColumns(this.columnList, (col) => this.columnInit.emit(col));
|
|
64374
|
+
this.initColumns(this.columnList.toArray(), (col) => this.columnInit.emit(col));
|
|
64369
64375
|
diff.forEachRemovedItem((record) => {
|
|
64370
64376
|
const isColumnGroup = record.item instanceof IgxColumnGroupComponent;
|
|
64371
64377
|
if (!isColumnGroup) {
|
|
@@ -64661,7 +64667,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64661
64667
|
columns.push(ref.instance);
|
|
64662
64668
|
});
|
|
64663
64669
|
this._autoGeneratedCols = columns;
|
|
64664
|
-
this.
|
|
64670
|
+
this.updateColumns(columns);
|
|
64665
64671
|
if (data && data.length > 0) {
|
|
64666
64672
|
this.shouldGenerate = false;
|
|
64667
64673
|
}
|
|
@@ -64673,10 +64679,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64673
64679
|
* @hidden
|
|
64674
64680
|
*/
|
|
64675
64681
|
initColumns(collection, cb = null) {
|
|
64676
|
-
this._columnGroups =
|
|
64682
|
+
this._columnGroups = collection.some(col => col.columnGroup);
|
|
64677
64683
|
if (this.hasColumnLayouts) {
|
|
64678
64684
|
// Set overall row layout size
|
|
64679
|
-
|
|
64685
|
+
collection.forEach((col) => {
|
|
64680
64686
|
if (col.columnLayout) {
|
|
64681
64687
|
const layoutSize = col.children ?
|
|
64682
64688
|
col.children.reduce((acc, val) => Math.max(val.rowStart + val.gridRowSpan - 1, acc), 1) :
|
|
@@ -64688,18 +64694,17 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64688
64694
|
if (this.hasColumnLayouts && this.hasColumnGroups) {
|
|
64689
64695
|
// invalid configuration - multi-row and column groups
|
|
64690
64696
|
// remove column groups
|
|
64691
|
-
const columnLayoutColumns =
|
|
64692
|
-
|
|
64697
|
+
const columnLayoutColumns = collection.filter((col) => col.columnLayout || col.columnLayoutChild);
|
|
64698
|
+
collection = columnLayoutColumns;
|
|
64693
64699
|
}
|
|
64694
64700
|
this._maxLevelHeaderDepth = null;
|
|
64695
|
-
this._columns = this.columnList.toArray();
|
|
64696
64701
|
collection.forEach((column) => {
|
|
64697
64702
|
column.defaultWidth = this.columnWidthSetByUser ? this._columnWidth : column.defaultWidth ? column.defaultWidth : '';
|
|
64698
64703
|
if (cb) {
|
|
64699
64704
|
cb(column);
|
|
64700
64705
|
}
|
|
64701
64706
|
});
|
|
64702
|
-
this.
|
|
64707
|
+
this.updateColumns(collection);
|
|
64703
64708
|
if (this.hasColumnLayouts) {
|
|
64704
64709
|
collection.forEach((column) => {
|
|
64705
64710
|
column.populateVisibleIndexes();
|
|
@@ -64710,11 +64715,11 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64710
64715
|
* @hidden
|
|
64711
64716
|
*/
|
|
64712
64717
|
reinitPinStates() {
|
|
64713
|
-
this._pinnedColumns = this.
|
|
64718
|
+
this._pinnedColumns = this._columns
|
|
64714
64719
|
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
|
|
64715
|
-
this._unpinnedColumns = this.hasColumnGroups ? this.
|
|
64716
|
-
this.
|
|
64717
|
-
.sort((a, b) => this._unpinnedColumns.
|
|
64720
|
+
this._unpinnedColumns = this.hasColumnGroups ? this._columns.filter((c) => !c.pinned) :
|
|
64721
|
+
this._columns.filter((c) => !c.pinned)
|
|
64722
|
+
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));
|
|
64718
64723
|
}
|
|
64719
64724
|
extractDataFromSelection(source, formatters = false, headers = false, columnData) {
|
|
64720
64725
|
var _a;
|
|
@@ -64894,7 +64899,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64894
64899
|
// Make sure we don't exceed unpinned area min width and get pinned and unpinned col collections.
|
|
64895
64900
|
// We take into account top level columns (top level groups and non groups).
|
|
64896
64901
|
// If top level is unpinned the pinning handles all children to be unpinned as well.
|
|
64897
|
-
for (const column of this.
|
|
64902
|
+
for (const column of this._columns) {
|
|
64898
64903
|
if (column.pinned && !column.parent) {
|
|
64899
64904
|
pinnedColumns.push(column);
|
|
64900
64905
|
}
|
|
@@ -64987,7 +64992,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
64987
64992
|
_columnsReordered(column) {
|
|
64988
64993
|
this.notifyChanges();
|
|
64989
64994
|
if (this.hasColumnLayouts) {
|
|
64990
|
-
this.
|
|
64995
|
+
this._columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
|
|
64991
64996
|
}
|
|
64992
64997
|
// after reordering is done reset cached column collections.
|
|
64993
64998
|
this.resetColumnCollections();
|
|
@@ -65150,7 +65155,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
65150
65155
|
}
|
|
65151
65156
|
isValidPosition(rowIndex, colIndex) {
|
|
65152
65157
|
const rows = this.summariesRowList.filter(s => s.index !== 0).concat(this.rowList.toArray()).length;
|
|
65153
|
-
const cols = this.
|
|
65158
|
+
const cols = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0 && !col.hidden).length;
|
|
65154
65159
|
if (rows < 1 || cols < 1) {
|
|
65155
65160
|
return false;
|
|
65156
65161
|
}
|
|
@@ -66235,7 +66240,7 @@ class IgxGridMRLNavigationService extends IgxGridNavigationService {
|
|
|
66235
66240
|
col.visibleIndex > this.activeNode.column && col.colStart > this.activeNode.layout.colStart);
|
|
66236
66241
|
if (!column || (previous && this.activeNode.layout.colStart === 1)) {
|
|
66237
66242
|
const index = previous ? parent.visibleIndex - 1 : parent.visibleIndex + 1;
|
|
66238
|
-
const children = this.grid.
|
|
66243
|
+
const children = this.grid.columns.find(cols => cols.columnLayout && cols.visibleIndex === index).children;
|
|
66239
66244
|
column = previous ? children.toArray().reverse().find(child => child.rowStart <= this.activeNode.layout.rowStart) :
|
|
66240
66245
|
children.find(child => this.rowEnd(child) > this.activeNode.layout.rowStart && child.colStart === 1);
|
|
66241
66246
|
}
|
|
@@ -68131,7 +68136,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68131
68136
|
this._applyGrouping();
|
|
68132
68137
|
this.notifyChanges();
|
|
68133
68138
|
}
|
|
68134
|
-
if (!this._init && JSON.stringify(oldExpressions) !== JSON.stringify(newExpressions) && this.
|
|
68139
|
+
if (!this._init && JSON.stringify(oldExpressions) !== JSON.stringify(newExpressions) && this._columns) {
|
|
68135
68140
|
const groupedCols = [];
|
|
68136
68141
|
const ungroupedCols = [];
|
|
68137
68142
|
const groupedColsArr = newExpressions.filter((obj) => !oldExpressions.some((obj2) => obj.fieldName === obj2.fieldName));
|
|
@@ -68195,7 +68200,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68195
68200
|
else {
|
|
68196
68201
|
this.groupingDiffer = null;
|
|
68197
68202
|
}
|
|
68198
|
-
if (this.
|
|
68203
|
+
if (this._columns && this.groupingExpressions) {
|
|
68199
68204
|
this._setGroupColsVisibility(value);
|
|
68200
68205
|
}
|
|
68201
68206
|
this._hideGroupedColumns = value;
|
|
@@ -68250,7 +68255,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68250
68255
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
68251
68256
|
var _a;
|
|
68252
68257
|
const row = this.getRowByIndex(rowIndex);
|
|
68253
|
-
const column = this.
|
|
68258
|
+
const column = this._columns.find((col) => col.visibleIndex === index);
|
|
68254
68259
|
if (row && row instanceof IgxGridRow && !((_a = row.data) === null || _a === void 0 ? void 0 : _a.detailsData) && column) {
|
|
68255
68260
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
68256
68261
|
}
|
|
@@ -68514,7 +68519,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68514
68519
|
* ```
|
|
68515
68520
|
*/
|
|
68516
68521
|
get hasGroupableColumns() {
|
|
68517
|
-
return this.
|
|
68522
|
+
return this._columns.some((col) => col.groupable && !col.columnGroup);
|
|
68518
68523
|
}
|
|
68519
68524
|
/**
|
|
68520
68525
|
* Returns whether the `IgxGridComponent` has group area.
|
|
@@ -68639,7 +68644,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68639
68644
|
this._groupRowTemplate = this.groupTemplate.template;
|
|
68640
68645
|
}
|
|
68641
68646
|
this.detailTemplate.changes.subscribe(() => this.trackChanges = (_, rec) => ((rec === null || rec === void 0 ? void 0 : rec.detailsData) !== undefined ? rec.detailsData : rec));
|
|
68642
|
-
if (this.hideGroupedColumns && this.
|
|
68647
|
+
if (this.hideGroupedColumns && this._columns && this.groupingExpressions) {
|
|
68643
68648
|
this._setGroupColsVisibility(this.hideGroupedColumns);
|
|
68644
68649
|
}
|
|
68645
68650
|
this._setupNavigationService();
|
|
@@ -68687,9 +68692,9 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68687
68692
|
* @hidden @internal
|
|
68688
68693
|
*/
|
|
68689
68694
|
ngDoCheck() {
|
|
68690
|
-
if (this.groupingDiffer && this.
|
|
68695
|
+
if (this.groupingDiffer && this._columns && !this.hasColumnLayouts) {
|
|
68691
68696
|
const changes = this.groupingDiffer.diff(this.groupingExpressions);
|
|
68692
|
-
if (changes && this.
|
|
68697
|
+
if (changes && this._columns.length > 0) {
|
|
68693
68698
|
changes.forEachAddedItem((rec) => {
|
|
68694
68699
|
const col = this.getColumnByName(rec.item.fieldName);
|
|
68695
68700
|
if (col) {
|
|
@@ -68820,7 +68825,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68820
68825
|
getCellByColumn(rowIndex, columnField) {
|
|
68821
68826
|
var _a;
|
|
68822
68827
|
const row = this.getRowByIndex(rowIndex);
|
|
68823
|
-
const column = this.
|
|
68828
|
+
const column = this._columns.find((col) => col.field === columnField);
|
|
68824
68829
|
if (row && row instanceof IgxGridRow && !((_a = row.data) === null || _a === void 0 ? void 0 : _a.detailsData) && column) {
|
|
68825
68830
|
if (this.pagingMode === 1 && this.gridAPI.grid.page !== 0) {
|
|
68826
68831
|
row.index = rowIndex + this.paginator.perPage * this.paginator.page;
|
|
@@ -68842,7 +68847,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68842
68847
|
*/
|
|
68843
68848
|
getCellByKey(rowSelector, columnField) {
|
|
68844
68849
|
const row = this.getRowByKey(rowSelector);
|
|
68845
|
-
const column = this.
|
|
68850
|
+
const column = this._columns.find((col) => col.field === columnField);
|
|
68846
68851
|
if (row && column) {
|
|
68847
68852
|
return new IgxGridCell(this, row.index, columnField);
|
|
68848
68853
|
}
|
|
@@ -68944,7 +68949,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
68944
68949
|
return !expression.fieldName;
|
|
68945
68950
|
}
|
|
68946
68951
|
_setGroupColsVisibility(value) {
|
|
68947
|
-
if (this.
|
|
68952
|
+
if (this._columns.length > 0 && !this.hasColumnLayouts) {
|
|
68948
68953
|
this.groupingExpressions.forEach((expr) => {
|
|
68949
68954
|
const col = this.getColumnByName(expr.fieldName);
|
|
68950
68955
|
col.hidden = value;
|
|
@@ -69119,7 +69124,7 @@ class IgxGridStateDirective {
|
|
|
69119
69124
|
},
|
|
69120
69125
|
columns: {
|
|
69121
69126
|
getFeatureState: (context) => {
|
|
69122
|
-
const gridColumns = context.currGrid.
|
|
69127
|
+
const gridColumns = context.currGrid.columns.map((c) => ({
|
|
69123
69128
|
pinned: c.pinned,
|
|
69124
69129
|
sortable: c.sortable,
|
|
69125
69130
|
filterable: c.filterable,
|
|
@@ -69179,6 +69184,9 @@ class IgxGridStateDirective {
|
|
|
69179
69184
|
}
|
|
69180
69185
|
});
|
|
69181
69186
|
context.grid.updateColumns(newColumns);
|
|
69187
|
+
newColumns.forEach(col => {
|
|
69188
|
+
context.grid.columnInit.emit(col);
|
|
69189
|
+
});
|
|
69182
69190
|
}
|
|
69183
69191
|
},
|
|
69184
69192
|
groupBy: {
|
|
@@ -69428,13 +69436,11 @@ class IgxGridStateDirective {
|
|
|
69428
69436
|
// TODO Notify the grid that columnList.changes is triggered by the state directive
|
|
69429
69437
|
// instead of piping it like below
|
|
69430
69438
|
const columns = 'columns';
|
|
69431
|
-
this.grid.columnList.changes.pipe(delay(0), take(1)).subscribe(() => {
|
|
69432
|
-
this.featureKeys = this.featureKeys.filter(f => f !== columns);
|
|
69433
|
-
this.restoreFeatures(state);
|
|
69434
|
-
});
|
|
69435
69439
|
this.applyFeatures(features);
|
|
69436
69440
|
if (this.featureKeys.includes(columns) && this.options[columns] && state[columns]) {
|
|
69437
69441
|
this.getFeature(columns).restoreFeatureState(this, state[columns]);
|
|
69442
|
+
this.featureKeys = this.featureKeys.filter(f => f !== columns);
|
|
69443
|
+
this.restoreFeatures(state);
|
|
69438
69444
|
}
|
|
69439
69445
|
else {
|
|
69440
69446
|
this.restoreFeatures(state);
|
|
@@ -69485,8 +69491,8 @@ class IgxGridStateDirective {
|
|
|
69485
69491
|
else {
|
|
69486
69492
|
const expr = item;
|
|
69487
69493
|
let dataType;
|
|
69488
|
-
if (this.currGrid.
|
|
69489
|
-
dataType = this.currGrid.
|
|
69494
|
+
if (this.currGrid.columns.length > 0) {
|
|
69495
|
+
dataType = this.currGrid.columns.find(c => c.field === expr.fieldName).dataType;
|
|
69490
69496
|
}
|
|
69491
69497
|
else if (this.state.columns) {
|
|
69492
69498
|
dataType = this.state.columns.find(c => c.field === expr.fieldName).dataType;
|
|
@@ -69823,14 +69829,14 @@ class IgxColumnLayoutComponent extends IgxColumnGroupComponent {
|
|
|
69823
69829
|
set hidden(value) {
|
|
69824
69830
|
this._hidden = value;
|
|
69825
69831
|
this.children.forEach(child => child.hidden = value);
|
|
69826
|
-
if (this.grid && this.grid.
|
|
69832
|
+
if (this.grid && this.grid.columns && this.grid.columns.length > 0) {
|
|
69827
69833
|
// reset indexes in case columns are hidden/shown runtime
|
|
69828
69834
|
const columns = this.grid && this.grid.pinnedColumns && this.grid.unpinnedColumns ?
|
|
69829
69835
|
this.grid.pinnedColumns.concat(this.grid.unpinnedColumns) : [];
|
|
69830
69836
|
if (!this._hidden && !columns.find(c => c.field === this.field)) {
|
|
69831
69837
|
this.grid.resetColumnCollections();
|
|
69832
69838
|
}
|
|
69833
|
-
this.grid.
|
|
69839
|
+
this.grid.columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
|
|
69834
69840
|
}
|
|
69835
69841
|
}
|
|
69836
69842
|
/**
|
|
@@ -71779,13 +71785,13 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
71779
71785
|
return this._hideGroupedColumns;
|
|
71780
71786
|
}
|
|
71781
71787
|
set hideGroupedColumns(value) {
|
|
71782
|
-
if (this.grid.
|
|
71788
|
+
if (this.grid.columns && this.expressions) {
|
|
71783
71789
|
this.setColumnsVisibility(value);
|
|
71784
71790
|
}
|
|
71785
71791
|
this._hideGroupedColumns = value;
|
|
71786
71792
|
}
|
|
71787
71793
|
ngAfterContentInit() {
|
|
71788
|
-
if (this.grid.
|
|
71794
|
+
if (this.grid.columns && this.expressions) {
|
|
71789
71795
|
this.groupingDiffer = this.differs.find(this.expressions).create();
|
|
71790
71796
|
this.updateColumnsVisibility();
|
|
71791
71797
|
}
|
|
@@ -71836,9 +71842,9 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
71836
71842
|
this.updateColumnsVisibility();
|
|
71837
71843
|
}
|
|
71838
71844
|
updateColumnsVisibility() {
|
|
71839
|
-
if (this.groupingDiffer && this.grid.
|
|
71845
|
+
if (this.groupingDiffer && this.grid.columns && !this.grid.hasColumnLayouts) {
|
|
71840
71846
|
const changes = this.groupingDiffer.diff(this.expressions);
|
|
71841
|
-
if (changes && this.grid.
|
|
71847
|
+
if (changes && this.grid.columns.length > 0) {
|
|
71842
71848
|
changes.forEachAddedItem((rec) => {
|
|
71843
71849
|
const col = this.grid.getColumnByName(rec.item.fieldName);
|
|
71844
71850
|
col.hidden = this.hideGroupedColumns;
|
|
@@ -71851,7 +71857,7 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
71851
71857
|
}
|
|
71852
71858
|
}
|
|
71853
71859
|
setColumnsVisibility(value) {
|
|
71854
|
-
if (this.grid.
|
|
71860
|
+
if (this.grid.columns.length > 0 && !this.grid.hasColumnLayouts) {
|
|
71855
71861
|
this.expressions.forEach((expr) => {
|
|
71856
71862
|
const col = this.grid.getColumnByName(expr.fieldName);
|
|
71857
71863
|
col.hidden = value;
|
|
@@ -73351,7 +73357,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
73351
73357
|
*/
|
|
73352
73358
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
73353
73359
|
const row = this.getRowByIndex(rowIndex);
|
|
73354
|
-
const column = this.
|
|
73360
|
+
const column = this.columns.find((col) => col.visibleIndex === index);
|
|
73355
73361
|
if (row && row instanceof IgxTreeGridRow && column) {
|
|
73356
73362
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
73357
73363
|
}
|
|
@@ -73688,7 +73694,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
73688
73694
|
*/
|
|
73689
73695
|
getCellByColumn(rowIndex, columnField) {
|
|
73690
73696
|
const row = this.getRowByIndex(rowIndex);
|
|
73691
|
-
const column = this.
|
|
73697
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
73692
73698
|
if (row && row instanceof IgxTreeGridRow && column) {
|
|
73693
73699
|
return new IgxGridCell(this, rowIndex, columnField);
|
|
73694
73700
|
}
|
|
@@ -73707,7 +73713,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
73707
73713
|
*/
|
|
73708
73714
|
getCellByKey(rowSelector, columnField) {
|
|
73709
73715
|
const row = this.getRowByKey(rowSelector);
|
|
73710
|
-
const column = this.
|
|
73716
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
73711
73717
|
if (row && column) {
|
|
73712
73718
|
return new IgxGridCell(this, row.index, columnField);
|
|
73713
73719
|
}
|
|
@@ -73765,7 +73771,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
73765
73771
|
* ```
|
|
73766
73772
|
*/
|
|
73767
73773
|
get hasGroupableColumns() {
|
|
73768
|
-
return this.
|
|
73774
|
+
return this.columns.some((col) => col.groupable && !col.columnGroup);
|
|
73769
73775
|
}
|
|
73770
73776
|
generateDataFields(data) {
|
|
73771
73777
|
return super.generateDataFields(data).filter(field => field !== this.childDataKey);
|
|
@@ -73848,8 +73854,8 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
73848
73854
|
if (this.hasColumnLayouts) {
|
|
73849
73855
|
// invalid configuration - tree grid should not allow column layouts
|
|
73850
73856
|
// remove column layouts
|
|
73851
|
-
const nonColumnLayoutColumns = this.
|
|
73852
|
-
this.
|
|
73857
|
+
const nonColumnLayoutColumns = this.columns.filter((col) => !col.columnLayout && !col.columnLayoutChild);
|
|
73858
|
+
this.updateColumns(nonColumnLayoutColumns);
|
|
73853
73859
|
}
|
|
73854
73860
|
super.initColumns(collection, cb);
|
|
73855
73861
|
}
|
|
@@ -74760,7 +74766,7 @@ class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirective {
|
|
|
74760
74766
|
*/
|
|
74761
74767
|
get maxLevelHeaderDepth() {
|
|
74762
74768
|
if (this._maxLevelHeaderDepth === null) {
|
|
74763
|
-
this._maxLevelHeaderDepth = this.
|
|
74769
|
+
this._maxLevelHeaderDepth = this.columns.reduce((acc, col) => Math.max(acc, col.level), 0);
|
|
74764
74770
|
}
|
|
74765
74771
|
return this._maxLevelHeaderDepth;
|
|
74766
74772
|
}
|
|
@@ -74803,13 +74809,12 @@ class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirective {
|
|
|
74803
74809
|
columns.push(ref.instance);
|
|
74804
74810
|
});
|
|
74805
74811
|
const result = flatten(columns);
|
|
74806
|
-
this.
|
|
74807
|
-
this.columnList.notifyOnChanges();
|
|
74812
|
+
this.updateColumns(result);
|
|
74808
74813
|
this.initPinning();
|
|
74809
74814
|
const factoryColumn = this.resolver.resolveComponentFactory(IgxColumnComponent);
|
|
74810
74815
|
const outputs = factoryColumn.outputs.filter(o => o.propName !== 'columnChange');
|
|
74811
74816
|
outputs.forEach(output => {
|
|
74812
|
-
this.
|
|
74817
|
+
this.columns.forEach(column => {
|
|
74813
74818
|
if (column[output.propName]) {
|
|
74814
74819
|
column[output.propName].pipe(takeUntil(column.destroy$)).subscribe((args) => {
|
|
74815
74820
|
const rowIslandColumn = this.parentIsland.childColumns.find(col => col.field === column.field);
|
|
@@ -75052,6 +75057,7 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
75052
75057
|
this.rootGrid = null;
|
|
75053
75058
|
this.layout_id = `igx-row-island-`;
|
|
75054
75059
|
this.isInit = false;
|
|
75060
|
+
this._childColumns = [];
|
|
75055
75061
|
}
|
|
75056
75062
|
/**
|
|
75057
75063
|
* Sets if all immediate children of the grids for this `IgxRowIslandComponent` should be expanded/collapsed.
|
|
@@ -75141,7 +75147,8 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
75141
75147
|
const nestedColumns = this.children.map((layout) => layout.columnList.toArray());
|
|
75142
75148
|
const colsArray = [].concat.apply([], nestedColumns);
|
|
75143
75149
|
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
75144
|
-
this.
|
|
75150
|
+
this._childColumns = topCols;
|
|
75151
|
+
this.updateColumns(this._childColumns);
|
|
75145
75152
|
this.columnList.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
75146
75153
|
Promise.resolve().then(() => {
|
|
75147
75154
|
this.updateColumnList();
|
|
@@ -75149,7 +75156,7 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
75149
75156
|
});
|
|
75150
75157
|
// handle column changes so that they are passed to child grid instances when columnChange is emitted.
|
|
75151
75158
|
this.ri_columnListDiffer.diff(this.childColumns);
|
|
75152
|
-
this.
|
|
75159
|
+
this._childColumns.forEach(x => x.columnChange.pipe(takeUntil(x.destroy$)).subscribe(() => this.updateColumnList()));
|
|
75153
75160
|
this.childColumns.changes.pipe(takeUntil(this.destroy$)).subscribe((change) => {
|
|
75154
75161
|
const diff = this.ri_columnListDiffer.diff(change);
|
|
75155
75162
|
if (diff) {
|
|
@@ -75236,15 +75243,9 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
75236
75243
|
}
|
|
75237
75244
|
return false;
|
|
75238
75245
|
});
|
|
75239
|
-
this.
|
|
75240
|
-
if (this.parentIsland) {
|
|
75241
|
-
this.parentIsland.columnList.notifyOnChanges();
|
|
75242
|
-
}
|
|
75243
|
-
else {
|
|
75244
|
-
this.rootGrid.columnList.notifyOnChanges();
|
|
75245
|
-
}
|
|
75246
|
+
this._childColumns = topCols;
|
|
75246
75247
|
this.rowIslandAPI.getChildGrids().forEach((grid) => {
|
|
75247
|
-
grid.createColumnsList(this.
|
|
75248
|
+
grid.createColumnsList(this._childColumns);
|
|
75248
75249
|
if (!document.body.contains(grid.nativeElement)) {
|
|
75249
75250
|
grid.updateOnRender = true;
|
|
75250
75251
|
}
|
|
@@ -75945,7 +75946,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
75945
75946
|
*/
|
|
75946
75947
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
75947
75948
|
const row = this.getRowByIndex(rowIndex);
|
|
75948
|
-
const column = this.
|
|
75949
|
+
const column = this.columns.find((col) => col.visibleIndex === index);
|
|
75949
75950
|
if (row && row instanceof IgxHierarchicalGridRow && column) {
|
|
75950
75951
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
75951
75952
|
}
|
|
@@ -76169,7 +76170,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
76169
76170
|
*/
|
|
76170
76171
|
getCellByColumn(rowIndex, columnField) {
|
|
76171
76172
|
const row = this.getRowByIndex(rowIndex);
|
|
76172
|
-
const column = this.
|
|
76173
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
76173
76174
|
if (row && row instanceof IgxHierarchicalGridRow && column) {
|
|
76174
76175
|
return new IgxGridCell(this, rowIndex, columnField);
|
|
76175
76176
|
}
|
|
@@ -76188,7 +76189,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
76188
76189
|
*/
|
|
76189
76190
|
getCellByKey(rowSelector, columnField) {
|
|
76190
76191
|
const row = this.getRowByKey(rowSelector);
|
|
76191
|
-
const column = this.
|
|
76192
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
76192
76193
|
if (row && column) {
|
|
76193
76194
|
return new IgxGridCell(this, row.index, columnField);
|
|
76194
76195
|
}
|
|
@@ -76464,8 +76465,8 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
76464
76465
|
if (this.hasColumnLayouts) {
|
|
76465
76466
|
// invalid configuration - hierarchical grid should not allow column layouts
|
|
76466
76467
|
// remove column layouts
|
|
76467
|
-
const nonColumnLayoutColumns = this.
|
|
76468
|
-
this.
|
|
76468
|
+
const nonColumnLayoutColumns = this.columns.filter((col) => !col.columnLayout && !col.columnLayoutChild);
|
|
76469
|
+
this.updateColumns(nonColumnLayoutColumns);
|
|
76469
76470
|
}
|
|
76470
76471
|
super.initColumns(collection, cb);
|
|
76471
76472
|
}
|
|
@@ -76473,16 +76474,25 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
76473
76474
|
if (this.parentIsland && this.parentIsland.childColumns.length > 0 && !this.autoGenerate) {
|
|
76474
76475
|
this.createColumnsList(this.parentIsland.childColumns.toArray());
|
|
76475
76476
|
}
|
|
76476
|
-
|
|
76477
|
+
else {
|
|
76478
|
+
super.setupColumns();
|
|
76479
|
+
}
|
|
76480
|
+
}
|
|
76481
|
+
getColumnList() {
|
|
76482
|
+
const childLayouts = this.parent ? this.childLayoutList : this.allLayoutList;
|
|
76483
|
+
const nestedColumns = childLayouts.map((layout) => layout.columnList.toArray());
|
|
76484
|
+
const colsArray = [].concat.apply([], nestedColumns);
|
|
76485
|
+
if (colsArray.length > 0) {
|
|
76486
|
+
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
76487
|
+
return topCols;
|
|
76488
|
+
}
|
|
76489
|
+
else {
|
|
76490
|
+
return this.columnList.toArray();
|
|
76491
|
+
}
|
|
76477
76492
|
}
|
|
76478
76493
|
onColumnsChanged(change) {
|
|
76479
76494
|
Promise.resolve().then(() => {
|
|
76480
76495
|
this.updateColumnList();
|
|
76481
|
-
const cols = change.filter(c => c.grid === this);
|
|
76482
|
-
if (cols.length > 0 || this.autoGenerate) {
|
|
76483
|
-
this.columnList.reset(cols);
|
|
76484
|
-
super.onColumnsChanged(this.columnList);
|
|
76485
|
-
}
|
|
76486
76496
|
});
|
|
76487
76497
|
}
|
|
76488
76498
|
_shouldAutoSize(renderedHeight) {
|
|
@@ -76498,8 +76508,8 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
76498
76508
|
const colLength = this.columnList.length;
|
|
76499
76509
|
if (colsArray.length > 0) {
|
|
76500
76510
|
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
76501
|
-
this.
|
|
76502
|
-
if (recalcColSizes && this.
|
|
76511
|
+
this.updateColumns(topCols);
|
|
76512
|
+
if (recalcColSizes && this.columns.length !== colLength) {
|
|
76503
76513
|
this.calculateGridSizes(false);
|
|
76504
76514
|
}
|
|
76505
76515
|
}
|
|
@@ -86442,7 +86452,7 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
|
|
|
86442
86452
|
*/
|
|
86443
86453
|
ngAfterContentInit() {
|
|
86444
86454
|
// ignore any user defined columns and auto-generate based on pivot config.
|
|
86445
|
-
this.
|
|
86455
|
+
this.updateColumns([]);
|
|
86446
86456
|
Promise.resolve().then(() => {
|
|
86447
86457
|
this.setupColumns();
|
|
86448
86458
|
});
|
|
@@ -87320,8 +87330,8 @@ class IgxPivotGridComponent extends IgxGridBaseDirective {
|
|
|
87320
87330
|
}
|
|
87321
87331
|
}
|
|
87322
87332
|
});
|
|
87333
|
+
this.updateColumns(columns);
|
|
87323
87334
|
this.reflow();
|
|
87324
|
-
this.columnList.reset(columns);
|
|
87325
87335
|
if (data && data.length > 0) {
|
|
87326
87336
|
this.shouldGenerate = false;
|
|
87327
87337
|
}
|