igniteui-angular 12.3.27 → 12.3.28
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 +146 -148
- package/bundles/igniteui-angular.umd.js.map +1 -1
- package/esm2015/lib/grids/api.service.js +2 -2
- package/esm2015/lib/grids/columns/column.component.js +5 -5
- package/esm2015/lib/grids/grid/grid.component.js +11 -11
- package/esm2015/lib/grids/grid-base.directive.js +72 -76
- package/esm2015/lib/grids/grid-mrl-navigation.service.js +2 -2
- package/esm2015/lib/grids/grid-public-row.js +3 -3
- package/esm2015/lib/grids/grouping/group-by-area.directive.js +1 -1
- package/esm2015/lib/grids/grouping/tree-grid-group-by-area.component.js +6 -6
- package/esm2015/lib/grids/hierarchical-grid/hierarchical-grid-base.directive.js +4 -5
- package/esm2015/lib/grids/hierarchical-grid/hierarchical-grid.component.js +23 -14
- package/esm2015/lib/grids/hierarchical-grid/row-island.component.js +7 -11
- package/esm2015/lib/grids/state.directive.js +12 -9
- package/esm2015/lib/grids/summaries/grid-summary.service.js +5 -5
- package/esm2015/lib/grids/tree-grid/tree-grid.component.js +7 -7
- package/esm2015/lib/services/exporter-common/base-export-service.js +3 -3
- package/fesm2015/igniteui-angular.js +148 -144
- package/fesm2015/igniteui-angular.js.map +1 -1
- package/igniteui-angular.metadata.json +1 -1
- package/lib/grids/grid-base.directive.d.ts +9 -13
- 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
|
@@ -6,7 +6,7 @@ import { NG_VALUE_ACCESSOR, NG_VALIDATORS, CheckboxRequiredValidator, NgModel, F
|
|
|
6
6
|
import * as i2 from '@angular/common';
|
|
7
7
|
import { isPlatformBrowser, CommonModule, DOCUMENT, DatePipe, formatDate, FormatWidth, getLocaleDateFormat, getLocaleCurrencyCode, DecimalPipe, CurrencyPipe, PercentPipe, getLocaleNumberFormat, NumberFormatStyle, getCurrencySymbol } from '@angular/common';
|
|
8
8
|
import { Observable, noop, Subject, fromEvent, interval, animationFrameScheduler, merge, pipe, Subscription, timer } from 'rxjs';
|
|
9
|
-
import { throttleTime, takeUntil, filter, first as first$1, take, throttle, debounce, tap, switchMap, skipLast, map, shareReplay, takeWhile, debounceTime,
|
|
9
|
+
import { throttleTime, takeUntil, filter, first as first$1, take, throttle, debounce, tap, switchMap, skipLast, map, shareReplay, takeWhile, debounceTime, pluck } from 'rxjs/operators';
|
|
10
10
|
import mergeWith from 'lodash.mergewith';
|
|
11
11
|
import { ResizeObserver } from '@juggle/resize-observer';
|
|
12
12
|
import { __decorate, __awaiter } from 'tslib';
|
|
@@ -6885,7 +6885,7 @@ class GridBaseAPIService {
|
|
|
6885
6885
|
this.destroyMap = new Map();
|
|
6886
6886
|
}
|
|
6887
6887
|
get_column_by_name(name) {
|
|
6888
|
-
return this.grid.
|
|
6888
|
+
return this.grid.columns.find((col) => col.field === name);
|
|
6889
6889
|
}
|
|
6890
6890
|
get_summary_data() {
|
|
6891
6891
|
const grid = this.grid;
|
|
@@ -10627,8 +10627,7 @@ class IgxColumnComponent {
|
|
|
10627
10627
|
*/
|
|
10628
10628
|
move(index) {
|
|
10629
10629
|
let target;
|
|
10630
|
-
|
|
10631
|
-
let columns = grid.columnList.filter(c => c.visibleIndex > -1);
|
|
10630
|
+
let columns = this.grid.columns.filter(c => c.visibleIndex > -1);
|
|
10632
10631
|
// grid last visible index
|
|
10633
10632
|
const li = columns.map(c => c.visibleIndex).reduce((a, b) => Math.max(a, b));
|
|
10634
10633
|
const parent = this.parent;
|
|
@@ -10646,7 +10645,8 @@ class IgxColumnComponent {
|
|
|
10646
10645
|
/* eslint-enable max-len */
|
|
10647
10646
|
if (isPreceding) {
|
|
10648
10647
|
columns = columns.filter(c => c.visibleIndex > this.visibleIndex);
|
|
10649
|
-
target = columns.find(c => c.level === this.level &&
|
|
10648
|
+
target = columns.find(c => c.level === this.level &&
|
|
10649
|
+
c.visibleIndex + c.calcChildren() - this.calcChildren() === index);
|
|
10650
10650
|
}
|
|
10651
10651
|
else {
|
|
10652
10652
|
columns = columns.filter(c => c.visibleIndex < this.visibleIndex);
|
|
@@ -10656,7 +10656,7 @@ class IgxColumnComponent {
|
|
|
10656
10656
|
return;
|
|
10657
10657
|
}
|
|
10658
10658
|
const pos = isPreceding ? DropPosition.AfterDropTarget : DropPosition.BeforeDropTarget;
|
|
10659
|
-
grid.moveColumn(this, target, pos);
|
|
10659
|
+
this.grid.moveColumn(this, target, pos);
|
|
10660
10660
|
}
|
|
10661
10661
|
/**
|
|
10662
10662
|
* No children for the column, so will returns 1 or 0, if the column is hidden.
|
|
@@ -11570,7 +11570,7 @@ class IgxBaseExporter {
|
|
|
11570
11570
|
throw Error('No options provided!');
|
|
11571
11571
|
}
|
|
11572
11572
|
this.options = options;
|
|
11573
|
-
let columns = grid.
|
|
11573
|
+
let columns = grid.columns;
|
|
11574
11574
|
if (this.options.ignoreMultiColumnHeaders) {
|
|
11575
11575
|
columns = columns.filter(col => col.children === undefined);
|
|
11576
11576
|
}
|
|
@@ -12202,7 +12202,7 @@ class IgxBaseExporter {
|
|
|
12202
12202
|
columnList = this.getAutoGeneratedColumns(islandData);
|
|
12203
12203
|
}
|
|
12204
12204
|
else {
|
|
12205
|
-
const islandColumnList = island.
|
|
12205
|
+
const islandColumnList = island.columns;
|
|
12206
12206
|
columnList = this.getColumns(islandColumnList);
|
|
12207
12207
|
}
|
|
12208
12208
|
this._ownersMap.set(island, columnList);
|
|
@@ -44525,7 +44525,7 @@ class IgxGridSummaryService {
|
|
|
44525
44525
|
this.removeSummaries(rowID);
|
|
44526
44526
|
}
|
|
44527
44527
|
if (args.rowID !== undefined && args.rowID !== null) {
|
|
44528
|
-
let columnName = args.cellID ? this.grid.
|
|
44528
|
+
let columnName = args.cellID ? this.grid.columns.find(col => col.index === args.cellID.columnID).field : undefined;
|
|
44529
44529
|
if (columnName && this.grid.rowEditable) {
|
|
44530
44530
|
return;
|
|
44531
44531
|
}
|
|
@@ -44582,7 +44582,7 @@ class IgxGridSummaryService {
|
|
|
44582
44582
|
return this.summaryHeight = 0;
|
|
44583
44583
|
}
|
|
44584
44584
|
let maxSummaryLength = 0;
|
|
44585
|
-
this.grid.
|
|
44585
|
+
this.grid.columns.filter((col) => col.hasSummary && !col.hidden).forEach((column) => {
|
|
44586
44586
|
const getCurrentSummaryColumn = column.summaries.operate([], [], column.field).length;
|
|
44587
44587
|
if (getCurrentSummaryColumn) {
|
|
44588
44588
|
if (maxSummaryLength < getCurrentSummaryColumn) {
|
|
@@ -44603,7 +44603,7 @@ class IgxGridSummaryService {
|
|
|
44603
44603
|
if (!this.hasSummarizedColumns || !data) {
|
|
44604
44604
|
return rowSummaries;
|
|
44605
44605
|
}
|
|
44606
|
-
this.grid.
|
|
44606
|
+
this.grid.columns.filter(col => col.hasSummary).forEach((column) => {
|
|
44607
44607
|
if (!rowSummaries.get(column.field)) {
|
|
44608
44608
|
const summaryResult = column.summaries.operate(data.map(r => resolveNestedPath(r, column.field)), data, column.field, this.grid.locale, column.pipeArgs);
|
|
44609
44609
|
rowSummaries.set(column.field, summaryResult);
|
|
@@ -44637,7 +44637,7 @@ class IgxGridSummaryService {
|
|
|
44637
44637
|
this.groupingExpressions = groupingArgs.expressions.map(record => record.fieldName);
|
|
44638
44638
|
}
|
|
44639
44639
|
get hasSummarizedColumns() {
|
|
44640
|
-
const summarizedColumns = this.grid.
|
|
44640
|
+
const summarizedColumns = this.grid.columns.filter(col => col.hasSummary && !col.hidden);
|
|
44641
44641
|
return summarizedColumns.length > 0;
|
|
44642
44642
|
}
|
|
44643
44643
|
deleteSummaryCache(id, columnName) {
|
|
@@ -51028,8 +51028,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
51028
51028
|
get maxLevelHeaderDepth() {
|
|
51029
51029
|
if (this._maxLevelHeaderDepth === null) {
|
|
51030
51030
|
this._maxLevelHeaderDepth = this.hasColumnLayouts ?
|
|
51031
|
-
this.
|
|
51032
|
-
this.
|
|
51031
|
+
this._columns.reduce((acc, col) => Math.max(acc, col.rowStart), 0) :
|
|
51032
|
+
this._columns.reduce((acc, col) => Math.max(acc, col.level), 0);
|
|
51033
51033
|
}
|
|
51034
51034
|
return this._maxLevelHeaderDepth;
|
|
51035
51035
|
}
|
|
@@ -51042,7 +51042,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
51042
51042
|
* ``
|
|
51043
51043
|
*/
|
|
51044
51044
|
get hiddenColumnsCount() {
|
|
51045
|
-
return this.
|
|
51045
|
+
return this._columns.filter((col) => col.columnGroup === false && col.hidden === true).length;
|
|
51046
51046
|
}
|
|
51047
51047
|
/**
|
|
51048
51048
|
* Gets the number of pinned columns.
|
|
@@ -51724,13 +51724,13 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
51724
51724
|
* @internal
|
|
51725
51725
|
*/
|
|
51726
51726
|
resetColumnsCaches() {
|
|
51727
|
-
this.
|
|
51727
|
+
this._columns.forEach(column => column.resetCaches());
|
|
51728
51728
|
}
|
|
51729
51729
|
/**
|
|
51730
51730
|
* @hidden @internal
|
|
51731
51731
|
*/
|
|
51732
51732
|
generateRowID() {
|
|
51733
|
-
const primaryColumn = this.
|
|
51733
|
+
const primaryColumn = this._columns.find(col => col.field === this.primaryKey);
|
|
51734
51734
|
const idType = this.data.length ?
|
|
51735
51735
|
this.resolveDataTypes(this.data[0][this.primaryKey]) : primaryColumn ? primaryColumn.dataType : 'string';
|
|
51736
51736
|
return idType === 'string' ? v4() : FAKE_ROW_ID--;
|
|
@@ -51797,7 +51797,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
51797
51797
|
this.resetColumnCollections();
|
|
51798
51798
|
this.resetCachedWidths();
|
|
51799
51799
|
this.hasVisibleColumns = undefined;
|
|
51800
|
-
this._columnGroups = this.
|
|
51800
|
+
this._columnGroups = this._columns.some(col => col.columnGroup);
|
|
51801
51801
|
}
|
|
51802
51802
|
/**
|
|
51803
51803
|
* @hidden
|
|
@@ -52028,7 +52028,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52028
52028
|
* ```
|
|
52029
52029
|
*/
|
|
52030
52030
|
toggleColumnVisibility(args) {
|
|
52031
|
-
const col = args.column ? this.
|
|
52031
|
+
const col = args.column ? this._columns.find((c) => c === args.column) : undefined;
|
|
52032
52032
|
if (!col) {
|
|
52033
52033
|
return;
|
|
52034
52034
|
}
|
|
@@ -52265,13 +52265,6 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52265
52265
|
get summariesMargin() {
|
|
52266
52266
|
return this.featureColumnsWidth();
|
|
52267
52267
|
}
|
|
52268
|
-
/**
|
|
52269
|
-
* @hidden
|
|
52270
|
-
* @internal
|
|
52271
|
-
*/
|
|
52272
|
-
get columns() {
|
|
52273
|
-
return this._columns;
|
|
52274
|
-
}
|
|
52275
52268
|
/**
|
|
52276
52269
|
* Gets an array of `IgxColumnComponent`s.
|
|
52277
52270
|
*
|
|
@@ -52280,8 +52273,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52280
52273
|
* const colums = this.grid.columnsCollection.
|
|
52281
52274
|
* ```
|
|
52282
52275
|
*/
|
|
52283
|
-
get
|
|
52284
|
-
return this.
|
|
52276
|
+
get columns() {
|
|
52277
|
+
return this._columns || [];
|
|
52285
52278
|
}
|
|
52286
52279
|
/**
|
|
52287
52280
|
* Gets an array of the pinned `IgxColumnComponent`s.
|
|
@@ -52348,7 +52341,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52348
52341
|
* @param name
|
|
52349
52342
|
*/
|
|
52350
52343
|
getColumnByName(name) {
|
|
52351
|
-
return this.
|
|
52344
|
+
return this._columns.find((col) => col.field === name);
|
|
52352
52345
|
}
|
|
52353
52346
|
getColumnByVisibleIndex(index) {
|
|
52354
52347
|
return this.visibleColumns.find((col) => !col.columnGroup && !col.columnLayout &&
|
|
@@ -52366,7 +52359,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52366
52359
|
if (this._visibleColumns.length) {
|
|
52367
52360
|
return this._visibleColumns;
|
|
52368
52361
|
}
|
|
52369
|
-
this._visibleColumns = this.
|
|
52362
|
+
this._visibleColumns = this._columns.filter(c => !c.hidden);
|
|
52370
52363
|
return this._visibleColumns;
|
|
52371
52364
|
}
|
|
52372
52365
|
/**
|
|
@@ -52497,14 +52490,14 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52497
52490
|
* @internal
|
|
52498
52491
|
*/
|
|
52499
52492
|
get showAddButton() {
|
|
52500
|
-
return this.rowEditable && this.dataView.length === 0 && this.
|
|
52493
|
+
return this.rowEditable && this.dataView.length === 0 && this._columns.length > 0;
|
|
52501
52494
|
}
|
|
52502
52495
|
/**
|
|
52503
52496
|
* @hidden
|
|
52504
52497
|
* @internal
|
|
52505
52498
|
*/
|
|
52506
52499
|
get showDragIcons() {
|
|
52507
|
-
return this.rowDraggable && this.
|
|
52500
|
+
return this.rowDraggable && this._columns.length > this.hiddenColumnsCount;
|
|
52508
52501
|
}
|
|
52509
52502
|
/**
|
|
52510
52503
|
* Places a column before or after the specified target column.
|
|
@@ -52541,12 +52534,12 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52541
52534
|
const index = pos === DropPosition.AfterDropTarget ? unpinnedIndex + 1 : unpinnedIndex;
|
|
52542
52535
|
columnPinStateChanged = column.unpin(index);
|
|
52543
52536
|
}
|
|
52544
|
-
if (target.pinned && column.pinned && !columnPinStateChanged) {
|
|
52545
|
-
|
|
52546
|
-
}
|
|
52547
|
-
if (!target.pinned && !column.pinned && !columnPinStateChanged) {
|
|
52548
|
-
|
|
52549
|
-
}
|
|
52537
|
+
// if (target.pinned && column.pinned && !columnPinStateChanged) {
|
|
52538
|
+
// this._reorderColumns(column, target, pos, this._pinnedColumns);
|
|
52539
|
+
// }
|
|
52540
|
+
// if (!target.pinned && !column.pinned && !columnPinStateChanged) {
|
|
52541
|
+
// this._reorderColumns(column, target, pos, this._unpinnedColumns);
|
|
52542
|
+
// }
|
|
52550
52543
|
this._moveColumns(column, target, pos);
|
|
52551
52544
|
this._columnsReordered(column);
|
|
52552
52545
|
}
|
|
@@ -52664,7 +52657,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
52664
52657
|
*/
|
|
52665
52658
|
updateCell(value, rowSelector, column) {
|
|
52666
52659
|
if (this.isDefined(this.primaryKey)) {
|
|
52667
|
-
const col = this.
|
|
52660
|
+
const col = this._columns.find(c => c.field === column);
|
|
52668
52661
|
if (col) {
|
|
52669
52662
|
// Simplify
|
|
52670
52663
|
const rowData = this.gridAPI.getRowData(rowSelector);
|
|
@@ -53116,7 +53109,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53116
53109
|
* ```
|
|
53117
53110
|
*/
|
|
53118
53111
|
get hasSortableColumns() {
|
|
53119
|
-
return this.
|
|
53112
|
+
return this._columns.some((col) => col.sortable);
|
|
53120
53113
|
}
|
|
53121
53114
|
/**
|
|
53122
53115
|
* Returns if the `IgxGridComponent` has editable columns.
|
|
@@ -53127,7 +53120,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53127
53120
|
* ```
|
|
53128
53121
|
*/
|
|
53129
53122
|
get hasEditableColumns() {
|
|
53130
|
-
return this.
|
|
53123
|
+
return this._columns.some((col) => col.editable);
|
|
53131
53124
|
}
|
|
53132
53125
|
/**
|
|
53133
53126
|
* Returns if the `IgxGridComponent` has filterable columns.
|
|
@@ -53138,7 +53131,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53138
53131
|
* ```
|
|
53139
53132
|
*/
|
|
53140
53133
|
get hasFilterableColumns() {
|
|
53141
|
-
return this.
|
|
53134
|
+
return this._columns.some((col) => col.filterable);
|
|
53142
53135
|
}
|
|
53143
53136
|
/**
|
|
53144
53137
|
* Returns if the `IgxGridComponent` has summarized columns.
|
|
@@ -53149,7 +53142,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53149
53142
|
* ```
|
|
53150
53143
|
*/
|
|
53151
53144
|
get hasSummarizedColumns() {
|
|
53152
|
-
const summarizedColumns = this.
|
|
53145
|
+
const summarizedColumns = this._columns.filter(col => col.hasSummary && !col.hidden);
|
|
53153
53146
|
return summarizedColumns.length > 0;
|
|
53154
53147
|
}
|
|
53155
53148
|
/**
|
|
@@ -53163,7 +53156,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53163
53156
|
*/
|
|
53164
53157
|
get hasVisibleColumns() {
|
|
53165
53158
|
if (this._hasVisibleColumns === undefined) {
|
|
53166
|
-
return this.
|
|
53159
|
+
return this._columns ? this._columns.some(c => !c.hidden) : false;
|
|
53167
53160
|
}
|
|
53168
53161
|
return this._hasVisibleColumns;
|
|
53169
53162
|
}
|
|
@@ -53179,7 +53172,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53179
53172
|
* ```
|
|
53180
53173
|
*/
|
|
53181
53174
|
get hasMovableColumns() {
|
|
53182
|
-
return this.
|
|
53175
|
+
return this.columns && this.columns.some((col) => col.movable);
|
|
53183
53176
|
}
|
|
53184
53177
|
/**
|
|
53185
53178
|
* Returns if the `IgxGridComponent` has column groups.
|
|
@@ -53201,7 +53194,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53201
53194
|
* ```
|
|
53202
53195
|
*/
|
|
53203
53196
|
get hasColumnLayouts() {
|
|
53204
|
-
return !!this.
|
|
53197
|
+
return !!this._columns.some(col => col.columnLayout);
|
|
53205
53198
|
}
|
|
53206
53199
|
/**
|
|
53207
53200
|
* @hidden @internal
|
|
@@ -53656,7 +53649,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53656
53649
|
* ```
|
|
53657
53650
|
*/
|
|
53658
53651
|
selectAllColumns() {
|
|
53659
|
-
this.selectColumns(this.
|
|
53652
|
+
this.selectColumns(this._columns.filter(c => !c.columnGroup));
|
|
53660
53653
|
}
|
|
53661
53654
|
/**
|
|
53662
53655
|
*
|
|
@@ -53774,7 +53767,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53774
53767
|
var _a;
|
|
53775
53768
|
const totalItems = (_a = this.totalItemCount) !== null && _a !== void 0 ? _a : this.dataView.length - 1;
|
|
53776
53769
|
if (rowIndex < 0 || rowIndex > totalItems || (visibleColIndex !== -1
|
|
53777
|
-
&& this.
|
|
53770
|
+
&& this._columns.map(col => col.visibleIndex).indexOf(visibleColIndex) === -1)) {
|
|
53778
53771
|
return;
|
|
53779
53772
|
}
|
|
53780
53773
|
if (this.dataView.slice(rowIndex, rowIndex + 1).find(rec => rec.expression || rec.childGridsData)) {
|
|
@@ -53820,7 +53813,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53820
53813
|
* ```
|
|
53821
53814
|
*/
|
|
53822
53815
|
getNextCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
53823
|
-
const columns = this.
|
|
53816
|
+
const columns = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
53824
53817
|
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
53825
53818
|
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
53826
53819
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
@@ -53855,7 +53848,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
53855
53848
|
* ```
|
|
53856
53849
|
*/
|
|
53857
53850
|
getPreviousCell(currRowIndex, curVisibleColIndex, callback = null) {
|
|
53858
|
-
const columns = this.
|
|
53851
|
+
const columns = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0);
|
|
53859
53852
|
const dataViewIndex = this._getDataViewIndex(currRowIndex);
|
|
53860
53853
|
if (!this.isValidPosition(dataViewIndex, curVisibleColIndex)) {
|
|
53861
53854
|
return { rowIndex: currRowIndex, visibleColumnIndex: curVisibleColIndex };
|
|
@@ -54121,20 +54114,6 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54121
54114
|
console.warn('The row with the specified PK or index is outside of the current data view.');
|
|
54122
54115
|
}
|
|
54123
54116
|
}
|
|
54124
|
-
/**
|
|
54125
|
-
* Update internal column's collection.
|
|
54126
|
-
*
|
|
54127
|
-
* @hidden
|
|
54128
|
-
*/
|
|
54129
|
-
updateColumns(newColumns) {
|
|
54130
|
-
// update internal collections to retain order.
|
|
54131
|
-
this._pinnedColumns = newColumns
|
|
54132
|
-
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
|
|
54133
|
-
this._unpinnedColumns = newColumns.filter((c) => !c.pinned);
|
|
54134
|
-
this.columnList.reset(newColumns);
|
|
54135
|
-
this.columnList.notifyOnChanges();
|
|
54136
|
-
this._columns = this.columnList.toArray();
|
|
54137
|
-
}
|
|
54138
54117
|
/**
|
|
54139
54118
|
* Enters add mode by spawning the UI at the specified index.
|
|
54140
54119
|
*
|
|
@@ -54152,6 +54131,19 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54152
54131
|
}
|
|
54153
54132
|
return this.beginAddRowById(this.gridAPI.get_rec_id_by_index(index - 1, this.dataView));
|
|
54154
54133
|
}
|
|
54134
|
+
/**
|
|
54135
|
+
* Update internal column's collection.
|
|
54136
|
+
*
|
|
54137
|
+
* @hidden
|
|
54138
|
+
*/
|
|
54139
|
+
updateColumns(newColumns) {
|
|
54140
|
+
// update internal collections to retain order.
|
|
54141
|
+
this._pinnedColumns = newColumns
|
|
54142
|
+
.filter((c) => c.pinned);
|
|
54143
|
+
this._unpinnedColumns = newColumns.filter((c) => !c.pinned);
|
|
54144
|
+
this._columns = newColumns;
|
|
54145
|
+
this.resetCaches();
|
|
54146
|
+
}
|
|
54155
54147
|
beginAddRowForIndex(index, asChild = false) {
|
|
54156
54148
|
const row = index == null ?
|
|
54157
54149
|
null : this.rowList.find(r => r.index === index);
|
|
@@ -54291,7 +54283,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54291
54283
|
if (!this.columnWidthSetByUser) {
|
|
54292
54284
|
this._columnWidth = this.width !== null ? this.getPossibleColumnWidth() : MINIMUM_COLUMN_WIDTH + 'px';
|
|
54293
54285
|
}
|
|
54294
|
-
this.
|
|
54286
|
+
this._columns.forEach((column) => {
|
|
54295
54287
|
if (this.hasColumnLayouts && parseInt(this._columnWidth, 10)) {
|
|
54296
54288
|
const columnWidthCombined = parseInt(this._columnWidth, 10) * (column.colEnd ? column.colEnd - column.colStart : 1);
|
|
54297
54289
|
column.defaultWidth = columnWidthCombined + 'px';
|
|
@@ -54343,7 +54335,8 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54343
54335
|
* @hidden
|
|
54344
54336
|
*/
|
|
54345
54337
|
_moveColumns(from, to, pos) {
|
|
54346
|
-
const
|
|
54338
|
+
const orderedList = this._pinnedColumns.concat(this._unpinnedColumns);
|
|
54339
|
+
const list = orderedList;
|
|
54347
54340
|
this._reorderColumns(from, to, pos, list);
|
|
54348
54341
|
const newList = this._resetColumnList(list);
|
|
54349
54342
|
this.updateColumns(newList);
|
|
@@ -54353,7 +54346,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54353
54346
|
*/
|
|
54354
54347
|
_resetColumnList(list) {
|
|
54355
54348
|
if (!list) {
|
|
54356
|
-
list = this.
|
|
54349
|
+
list = this._columns;
|
|
54357
54350
|
}
|
|
54358
54351
|
let newList = [];
|
|
54359
54352
|
list.filter(c => c.level === 0).forEach(p => {
|
|
@@ -54398,7 +54391,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54398
54391
|
if (this.autoGenerate) {
|
|
54399
54392
|
this.autogenerateColumns();
|
|
54400
54393
|
}
|
|
54401
|
-
|
|
54394
|
+
else {
|
|
54395
|
+
this._columns = this.getColumnList();
|
|
54396
|
+
}
|
|
54397
|
+
this.initColumns(this._columns, (col) => this.columnInit.emit(col));
|
|
54402
54398
|
this.columnListDiffer.diff(this.columnList);
|
|
54403
54399
|
this.columnList.changes
|
|
54404
54400
|
.pipe(takeUntil(this.destroy$))
|
|
@@ -54406,6 +54402,9 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54406
54402
|
this.onColumnsChanged(change);
|
|
54407
54403
|
});
|
|
54408
54404
|
}
|
|
54405
|
+
getColumnList() {
|
|
54406
|
+
return this.columnList.toArray();
|
|
54407
|
+
}
|
|
54409
54408
|
/**
|
|
54410
54409
|
* @hidden
|
|
54411
54410
|
*/
|
|
@@ -54447,10 +54446,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54447
54446
|
*/
|
|
54448
54447
|
onColumnsChanged(change) {
|
|
54449
54448
|
const diff = this.columnListDiffer.diff(change);
|
|
54450
|
-
if (this.autoGenerate && this.
|
|
54449
|
+
if (this.autoGenerate && this._columns.length === 0 && this._autoGeneratedCols.length > 0) {
|
|
54451
54450
|
// In Ivy if there are nested conditional templates the content children are re-evaluated
|
|
54452
54451
|
// hence autogenerated columns are cleared and need to be reset.
|
|
54453
|
-
this.
|
|
54452
|
+
this.updateColumns(this._autoGeneratedCols);
|
|
54454
54453
|
return;
|
|
54455
54454
|
}
|
|
54456
54455
|
if (diff) {
|
|
@@ -54465,7 +54464,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54465
54464
|
this._unpinnedColumns.push(record.item);
|
|
54466
54465
|
}
|
|
54467
54466
|
});
|
|
54468
|
-
this.initColumns(this.columnList, (col) => this.columnInit.emit(col));
|
|
54467
|
+
this.initColumns(this.columnList.toArray(), (col) => this.columnInit.emit(col));
|
|
54469
54468
|
diff.forEachRemovedItem((record) => {
|
|
54470
54469
|
const isColumnGroup = record.item instanceof IgxColumnGroupComponent;
|
|
54471
54470
|
if (!isColumnGroup) {
|
|
@@ -54765,7 +54764,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54765
54764
|
columns.push(ref.instance);
|
|
54766
54765
|
});
|
|
54767
54766
|
this._autoGeneratedCols = columns;
|
|
54768
|
-
this.
|
|
54767
|
+
this.updateColumns(columns);
|
|
54769
54768
|
if (data && data.length > 0) {
|
|
54770
54769
|
this.shouldGenerate = false;
|
|
54771
54770
|
}
|
|
@@ -54791,10 +54790,10 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54791
54790
|
* @hidden
|
|
54792
54791
|
*/
|
|
54793
54792
|
initColumns(collection, cb = null) {
|
|
54794
|
-
this._columnGroups =
|
|
54793
|
+
this._columnGroups = collection.some(col => col.columnGroup);
|
|
54795
54794
|
if (this.hasColumnLayouts) {
|
|
54796
54795
|
// Set overall row layout size
|
|
54797
|
-
|
|
54796
|
+
collection.forEach((col) => {
|
|
54798
54797
|
if (col.columnLayout) {
|
|
54799
54798
|
const layoutSize = col.children ?
|
|
54800
54799
|
col.children.reduce((acc, val) => Math.max(val.rowStart + val.gridRowSpan - 1, acc), 1) :
|
|
@@ -54806,18 +54805,17 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54806
54805
|
if (this.hasColumnLayouts && this.hasColumnGroups) {
|
|
54807
54806
|
// invalid configuration - multi-row and column groups
|
|
54808
54807
|
// remove column groups
|
|
54809
|
-
const columnLayoutColumns =
|
|
54810
|
-
|
|
54808
|
+
const columnLayoutColumns = collection.filter((col) => col.columnLayout || col.columnLayoutChild);
|
|
54809
|
+
collection = columnLayoutColumns;
|
|
54811
54810
|
}
|
|
54812
54811
|
this._maxLevelHeaderDepth = null;
|
|
54813
|
-
this._columns = this.columnList.toArray();
|
|
54814
54812
|
collection.forEach((column) => {
|
|
54815
54813
|
column.defaultWidth = this.columnWidthSetByUser ? this._columnWidth : column.defaultWidth ? column.defaultWidth : '';
|
|
54816
54814
|
if (cb) {
|
|
54817
54815
|
cb(column);
|
|
54818
54816
|
}
|
|
54819
54817
|
});
|
|
54820
|
-
this.
|
|
54818
|
+
this.updateColumns(collection);
|
|
54821
54819
|
if (this.hasColumnLayouts) {
|
|
54822
54820
|
collection.forEach((column) => {
|
|
54823
54821
|
column.populateVisibleIndexes();
|
|
@@ -54828,13 +54826,11 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
54828
54826
|
* @hidden
|
|
54829
54827
|
*/
|
|
54830
54828
|
reinitPinStates() {
|
|
54831
|
-
this._pinnedColumns = this.
|
|
54832
|
-
.filter((c) => c.pinned)
|
|
54833
|
-
|
|
54834
|
-
|
|
54835
|
-
|
|
54836
|
-
.sort((a, b) => this._unpinnedColumns.findIndex(x => x.field === a.field) -
|
|
54837
|
-
this._unpinnedColumns.findIndex(x => x.field === b.field));
|
|
54829
|
+
this._pinnedColumns = this._columns
|
|
54830
|
+
.filter((c) => c.pinned).sort((a, b) => this._pinnedColumns.indexOf(a) - this._pinnedColumns.indexOf(b));
|
|
54831
|
+
this._unpinnedColumns = this.hasColumnGroups ? this._columns.filter((c) => !c.pinned) :
|
|
54832
|
+
this._columns.filter((c) => !c.pinned)
|
|
54833
|
+
.sort((a, b) => this._unpinnedColumns.indexOf(a) - this._unpinnedColumns.indexOf(b));
|
|
54838
54834
|
}
|
|
54839
54835
|
extractDataFromSelection(source, formatters = false, headers = false, columnData) {
|
|
54840
54836
|
var _a;
|
|
@@ -55133,7 +55129,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55133
55129
|
_columnsReordered(column) {
|
|
55134
55130
|
this.notifyChanges();
|
|
55135
55131
|
if (this.hasColumnLayouts) {
|
|
55136
|
-
this.
|
|
55132
|
+
this._columns.filter(x => x.columnLayout).forEach(x => x.populateVisibleIndexes());
|
|
55137
55133
|
}
|
|
55138
55134
|
// after reordering is done reset cached column collections.
|
|
55139
55135
|
this.resetColumnCollections();
|
|
@@ -55296,7 +55292,7 @@ class IgxGridBaseDirective extends DisplayDensityBase {
|
|
|
55296
55292
|
}
|
|
55297
55293
|
isValidPosition(rowIndex, colIndex) {
|
|
55298
55294
|
const rows = this.summariesRowList.filter(s => s.index !== 0).concat(this.rowList.toArray()).length;
|
|
55299
|
-
const cols = this.
|
|
55295
|
+
const cols = this._columns.filter(col => !col.columnGroup && col.visibleIndex >= 0 && !col.hidden).length;
|
|
55300
55296
|
if (rows < 1 || cols < 1) {
|
|
55301
55297
|
return false;
|
|
55302
55298
|
}
|
|
@@ -55856,7 +55852,7 @@ class BaseRow {
|
|
|
55856
55852
|
*/
|
|
55857
55853
|
get cells() {
|
|
55858
55854
|
const res = [];
|
|
55859
|
-
this.grid.
|
|
55855
|
+
this.grid.columns.forEach(col => {
|
|
55860
55856
|
const cell = new IgxGridCell(this.grid, this.index, col.field);
|
|
55861
55857
|
res.push(cell);
|
|
55862
55858
|
});
|
|
@@ -56167,7 +56163,7 @@ class IgxHierarchicalGridRow extends BaseRow {
|
|
|
56167
56163
|
*/
|
|
56168
56164
|
get cells() {
|
|
56169
56165
|
const res = [];
|
|
56170
|
-
this.grid.
|
|
56166
|
+
this.grid.columns.forEach(col => {
|
|
56171
56167
|
const cell = new IgxGridCell(this.grid, this.index, col.field);
|
|
56172
56168
|
res.push(cell);
|
|
56173
56169
|
});
|
|
@@ -61603,7 +61599,7 @@ class IgxGridMRLNavigationService extends IgxGridNavigationService {
|
|
|
61603
61599
|
col.visibleIndex > this.activeNode.column && col.colStart > this.activeNode.layout.colStart);
|
|
61604
61600
|
if (!column || (previous && this.activeNode.layout.colStart === 1)) {
|
|
61605
61601
|
const index = previous ? parent.visibleIndex - 1 : parent.visibleIndex + 1;
|
|
61606
|
-
const children = this.grid.
|
|
61602
|
+
const children = this.grid.columns.find(cols => cols.columnLayout && cols.visibleIndex === index).children;
|
|
61607
61603
|
column = previous ? children.toArray().reverse().find(child => child.rowStart <= this.activeNode.layout.rowStart) :
|
|
61608
61604
|
children.find(child => this.rowEnd(child) > this.activeNode.layout.rowStart && child.colStart === 1);
|
|
61609
61605
|
}
|
|
@@ -62039,7 +62035,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62039
62035
|
// setter called before grid is registered in grid API service
|
|
62040
62036
|
this.sortingExpressions.unshift.apply(this.sortingExpressions, this._groupingExpressions);
|
|
62041
62037
|
}
|
|
62042
|
-
if (!this._init && JSON.stringify(oldExpressions) !== JSON.stringify(newExpressions) && this.
|
|
62038
|
+
if (!this._init && JSON.stringify(oldExpressions) !== JSON.stringify(newExpressions) && this._columns) {
|
|
62043
62039
|
const groupedCols = [];
|
|
62044
62040
|
const ungroupedCols = [];
|
|
62045
62041
|
const groupedColsArr = newExpressions.filter((obj) => !oldExpressions.some((obj2) => obj.fieldName === obj2.fieldName));
|
|
@@ -62103,7 +62099,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62103
62099
|
else {
|
|
62104
62100
|
this.groupingDiffer = null;
|
|
62105
62101
|
}
|
|
62106
|
-
if (this.
|
|
62102
|
+
if (this._columns && this.groupingExpressions) {
|
|
62107
62103
|
this._setGroupColsVisibility(value);
|
|
62108
62104
|
}
|
|
62109
62105
|
this._hideGroupedColumns = value;
|
|
@@ -62158,7 +62154,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62158
62154
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
62159
62155
|
var _a;
|
|
62160
62156
|
const row = this.getRowByIndex(rowIndex);
|
|
62161
|
-
const column = this.
|
|
62157
|
+
const column = this._columns.find((col) => col.visibleIndex === index);
|
|
62162
62158
|
if (row && row instanceof IgxGridRow && !((_a = row.data) === null || _a === void 0 ? void 0 : _a.detailsData) && column) {
|
|
62163
62159
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
62164
62160
|
}
|
|
@@ -62428,7 +62424,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62428
62424
|
* ```
|
|
62429
62425
|
*/
|
|
62430
62426
|
get hasGroupableColumns() {
|
|
62431
|
-
return this.
|
|
62427
|
+
return this._columns.some((col) => col.groupable && !col.columnGroup);
|
|
62432
62428
|
}
|
|
62433
62429
|
/**
|
|
62434
62430
|
* Returns whether the `IgxGridComponent` has group area.
|
|
@@ -62553,7 +62549,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62553
62549
|
this._groupRowTemplate = this.groupTemplate.template;
|
|
62554
62550
|
}
|
|
62555
62551
|
this.detailTemplate.changes.subscribe(() => this.trackChanges = (_, rec) => ((rec === null || rec === void 0 ? void 0 : rec.detailsData) !== undefined ? rec.detailsData : rec));
|
|
62556
|
-
if (this.hideGroupedColumns && this.
|
|
62552
|
+
if (this.hideGroupedColumns && this._columns && this.groupingExpressions) {
|
|
62557
62553
|
this._setGroupColsVisibility(this.hideGroupedColumns);
|
|
62558
62554
|
}
|
|
62559
62555
|
this._setupNavigationService();
|
|
@@ -62601,9 +62597,9 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62601
62597
|
* @hidden @internal
|
|
62602
62598
|
*/
|
|
62603
62599
|
ngDoCheck() {
|
|
62604
|
-
if (this.groupingDiffer && this.
|
|
62600
|
+
if (this.groupingDiffer && this._columns && !this.hasColumnLayouts) {
|
|
62605
62601
|
const changes = this.groupingDiffer.diff(this.groupingExpressions);
|
|
62606
|
-
if (changes && this.
|
|
62602
|
+
if (changes && this._columns.length > 0) {
|
|
62607
62603
|
changes.forEachAddedItem((rec) => {
|
|
62608
62604
|
const col = this.getColumnByName(rec.item.fieldName);
|
|
62609
62605
|
if (col) {
|
|
@@ -62737,7 +62733,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62737
62733
|
getCellByColumn(rowIndex, columnField) {
|
|
62738
62734
|
var _a;
|
|
62739
62735
|
const row = this.getRowByIndex(rowIndex);
|
|
62740
|
-
const column = this.
|
|
62736
|
+
const column = this._columns.find((col) => col.field === columnField);
|
|
62741
62737
|
if (row && row instanceof IgxGridRow && !((_a = row.data) === null || _a === void 0 ? void 0 : _a.detailsData) && column) {
|
|
62742
62738
|
if (this.pagingMode === 1 && this.gridAPI.grid.page !== 0) {
|
|
62743
62739
|
row.index = rowIndex + this.paginator.perPage * this.paginator.page;
|
|
@@ -62759,7 +62755,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62759
62755
|
*/
|
|
62760
62756
|
getCellByKey(rowSelector, columnField) {
|
|
62761
62757
|
const row = this.getRowByKey(rowSelector);
|
|
62762
|
-
const column = this.
|
|
62758
|
+
const column = this._columns.find((col) => col.field === columnField);
|
|
62763
62759
|
if (row && column) {
|
|
62764
62760
|
return new IgxGridCell(this, row.index, columnField);
|
|
62765
62761
|
}
|
|
@@ -62860,7 +62856,7 @@ class IgxGridComponent extends IgxGridBaseDirective {
|
|
|
62860
62856
|
return !expression.fieldName;
|
|
62861
62857
|
}
|
|
62862
62858
|
_setGroupColsVisibility(value) {
|
|
62863
|
-
if (this.
|
|
62859
|
+
if (this._columns.length > 0 && !this.hasColumnLayouts) {
|
|
62864
62860
|
this.groupingExpressions.forEach((expr) => {
|
|
62865
62861
|
const col = this.getColumnByName(expr.fieldName);
|
|
62866
62862
|
col.hidden = value;
|
|
@@ -63051,6 +63047,9 @@ class IgxGridStateDirective {
|
|
|
63051
63047
|
}
|
|
63052
63048
|
});
|
|
63053
63049
|
context.grid.updateColumns(newColumns);
|
|
63050
|
+
newColumns.forEach(col => {
|
|
63051
|
+
context.grid.columnInit.emit(col);
|
|
63052
|
+
});
|
|
63054
63053
|
}
|
|
63055
63054
|
},
|
|
63056
63055
|
groupBy: {
|
|
@@ -63292,13 +63291,11 @@ class IgxGridStateDirective {
|
|
|
63292
63291
|
// TODO Notify the grid that columnList.changes is triggered by the state directive
|
|
63293
63292
|
// instead of piping it like below
|
|
63294
63293
|
const columns = 'columns';
|
|
63295
|
-
this.grid.columnList.changes.pipe(delay(0), take(1)).subscribe(() => {
|
|
63296
|
-
this.featureKeys = this.featureKeys.filter(f => f !== columns);
|
|
63297
|
-
this.restoreFeatures(state);
|
|
63298
|
-
});
|
|
63299
63294
|
this.applyFeatures(features);
|
|
63300
63295
|
if (this.featureKeys.includes(columns) && this.options[columns] && state[columns]) {
|
|
63301
63296
|
this.getFeature(columns).restoreFeatureState(this, state[columns]);
|
|
63297
|
+
this.featureKeys = this.featureKeys.filter(f => f !== columns);
|
|
63298
|
+
this.restoreFeatures(state);
|
|
63302
63299
|
}
|
|
63303
63300
|
else {
|
|
63304
63301
|
this.restoreFeatures(state);
|
|
@@ -63349,8 +63346,8 @@ class IgxGridStateDirective {
|
|
|
63349
63346
|
else {
|
|
63350
63347
|
const expr = item;
|
|
63351
63348
|
let dataType;
|
|
63352
|
-
if (this.currGrid.
|
|
63353
|
-
dataType = this.currGrid.
|
|
63349
|
+
if (this.currGrid.columns.length > 0) {
|
|
63350
|
+
dataType = this.currGrid.columns.find(c => c.field === expr.fieldName).dataType;
|
|
63354
63351
|
}
|
|
63355
63352
|
else if (this.state.columns) {
|
|
63356
63353
|
dataType = this.state.columns.find(c => c.field === expr.fieldName).dataType;
|
|
@@ -63389,6 +63386,9 @@ class IgxGridStateDirective {
|
|
|
63389
63386
|
case GridColumnDataType.Date:
|
|
63390
63387
|
filters = IgxDateFilteringOperand.instance();
|
|
63391
63388
|
break;
|
|
63389
|
+
case GridColumnDataType.DateTime:
|
|
63390
|
+
filters = IgxDateTimeFilteringOperand.instance();
|
|
63391
|
+
break;
|
|
63392
63392
|
case GridColumnDataType.String:
|
|
63393
63393
|
default:
|
|
63394
63394
|
filters = IgxStringFilteringOperand.instance();
|
|
@@ -65414,13 +65414,13 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
65414
65414
|
return this._hideGroupedColumns;
|
|
65415
65415
|
}
|
|
65416
65416
|
set hideGroupedColumns(value) {
|
|
65417
|
-
if (this.grid.
|
|
65417
|
+
if (this.grid.columns && this.expressions) {
|
|
65418
65418
|
this.setColumnsVisibility(value);
|
|
65419
65419
|
}
|
|
65420
65420
|
this._hideGroupedColumns = value;
|
|
65421
65421
|
}
|
|
65422
65422
|
ngAfterContentInit() {
|
|
65423
|
-
if (this.grid.
|
|
65423
|
+
if (this.grid.columns && this.expressions) {
|
|
65424
65424
|
this.groupingDiffer = this.differs.find(this.expressions).create();
|
|
65425
65425
|
this.updateColumnsVisibility();
|
|
65426
65426
|
}
|
|
@@ -65499,9 +65499,9 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
65499
65499
|
}
|
|
65500
65500
|
}
|
|
65501
65501
|
updateColumnsVisibility() {
|
|
65502
|
-
if (this.groupingDiffer && this.grid.
|
|
65502
|
+
if (this.groupingDiffer && this.grid.columns && !this.grid.hasColumnLayouts) {
|
|
65503
65503
|
const changes = this.groupingDiffer.diff(this.expressions);
|
|
65504
|
-
if (changes && this.grid.
|
|
65504
|
+
if (changes && this.grid.columns.length > 0) {
|
|
65505
65505
|
changes.forEachAddedItem((rec) => {
|
|
65506
65506
|
const col = this.grid.getColumnByName(rec.item.fieldName);
|
|
65507
65507
|
col.hidden = this.hideGroupedColumns;
|
|
@@ -65514,7 +65514,7 @@ class IgxTreeGridGroupByAreaComponent extends IgxGroupByAreaDirective {
|
|
|
65514
65514
|
}
|
|
65515
65515
|
}
|
|
65516
65516
|
setColumnsVisibility(value) {
|
|
65517
|
-
if (this.grid.
|
|
65517
|
+
if (this.grid.columns.length > 0 && !this.grid.hasColumnLayouts) {
|
|
65518
65518
|
this.expressions.forEach((expr) => {
|
|
65519
65519
|
const col = this.grid.getColumnByName(expr.fieldName);
|
|
65520
65520
|
col.hidden = value;
|
|
@@ -65738,7 +65738,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
65738
65738
|
*/
|
|
65739
65739
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
65740
65740
|
const row = this.getRowByIndex(rowIndex);
|
|
65741
|
-
const column = this.
|
|
65741
|
+
const column = this.columns.find((col) => col.visibleIndex === index);
|
|
65742
65742
|
if (row && row instanceof IgxTreeGridRow && column) {
|
|
65743
65743
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
65744
65744
|
}
|
|
@@ -66075,7 +66075,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
66075
66075
|
*/
|
|
66076
66076
|
getCellByColumn(rowIndex, columnField) {
|
|
66077
66077
|
const row = this.getRowByIndex(rowIndex);
|
|
66078
|
-
const column = this.
|
|
66078
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
66079
66079
|
if (row && row instanceof IgxTreeGridRow && column) {
|
|
66080
66080
|
return new IgxGridCell(this, rowIndex, columnField);
|
|
66081
66081
|
}
|
|
@@ -66094,7 +66094,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
66094
66094
|
*/
|
|
66095
66095
|
getCellByKey(rowSelector, columnField) {
|
|
66096
66096
|
const row = this.getRowByKey(rowSelector);
|
|
66097
|
-
const column = this.
|
|
66097
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
66098
66098
|
if (row && column) {
|
|
66099
66099
|
return new IgxGridCell(this, row.index, columnField);
|
|
66100
66100
|
}
|
|
@@ -66152,7 +66152,7 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
66152
66152
|
* ```
|
|
66153
66153
|
*/
|
|
66154
66154
|
get hasGroupableColumns() {
|
|
66155
|
-
return this.
|
|
66155
|
+
return this.columns.some((col) => col.groupable && !col.columnGroup);
|
|
66156
66156
|
}
|
|
66157
66157
|
transactionStatusUpdate(event) {
|
|
66158
66158
|
let actions = [];
|
|
@@ -66232,8 +66232,8 @@ class IgxTreeGridComponent extends IgxGridBaseDirective {
|
|
|
66232
66232
|
if (this.hasColumnLayouts) {
|
|
66233
66233
|
// invalid configuration - tree grid should not allow column layouts
|
|
66234
66234
|
// remove column layouts
|
|
66235
|
-
const nonColumnLayoutColumns = this.
|
|
66236
|
-
this.
|
|
66235
|
+
const nonColumnLayoutColumns = this.columns.filter((col) => !col.columnLayout && !col.columnLayoutChild);
|
|
66236
|
+
this.updateColumns(nonColumnLayoutColumns);
|
|
66237
66237
|
}
|
|
66238
66238
|
super.initColumns(collection, cb);
|
|
66239
66239
|
}
|
|
@@ -67767,7 +67767,7 @@ class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirective {
|
|
|
67767
67767
|
*/
|
|
67768
67768
|
get maxLevelHeaderDepth() {
|
|
67769
67769
|
if (this._maxLevelHeaderDepth === null) {
|
|
67770
|
-
this._maxLevelHeaderDepth = this.
|
|
67770
|
+
this._maxLevelHeaderDepth = this.columns.reduce((acc, col) => Math.max(acc, col.level), 0);
|
|
67771
67771
|
}
|
|
67772
67772
|
return this._maxLevelHeaderDepth;
|
|
67773
67773
|
}
|
|
@@ -67810,13 +67810,12 @@ class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirective {
|
|
|
67810
67810
|
columns.push(ref.instance);
|
|
67811
67811
|
});
|
|
67812
67812
|
const result = flatten(columns);
|
|
67813
|
-
this.
|
|
67814
|
-
this.columnList.notifyOnChanges();
|
|
67813
|
+
this.updateColumns(result);
|
|
67815
67814
|
this.initPinning();
|
|
67816
67815
|
const factoryColumn = this.resolver.resolveComponentFactory(IgxColumnComponent);
|
|
67817
67816
|
const outputs = factoryColumn.outputs.filter(o => o.propName !== 'columnChange');
|
|
67818
67817
|
outputs.forEach(output => {
|
|
67819
|
-
this.
|
|
67818
|
+
this.columns.forEach(column => {
|
|
67820
67819
|
if (column[output.propName]) {
|
|
67821
67820
|
column[output.propName].pipe(takeUntil(column.destroy$)).subscribe((args) => {
|
|
67822
67821
|
const rowIslandColumn = this.parentIsland.childColumns.find(col => col.field === column.field);
|
|
@@ -68168,6 +68167,7 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68168
68167
|
* @hidden
|
|
68169
68168
|
*/
|
|
68170
68169
|
this.rootGrid = null;
|
|
68170
|
+
this._childColumns = [];
|
|
68171
68171
|
this.layout_id = `igx-row-island-`;
|
|
68172
68172
|
this.isInit = false;
|
|
68173
68173
|
this.hgridAPI = gridAPI;
|
|
@@ -68260,7 +68260,8 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68260
68260
|
const nestedColumns = this.children.map((layout) => layout.columnList.toArray());
|
|
68261
68261
|
const colsArray = [].concat.apply([], nestedColumns);
|
|
68262
68262
|
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
68263
|
-
this.
|
|
68263
|
+
this._childColumns = topCols;
|
|
68264
|
+
this.updateColumns(this._childColumns);
|
|
68264
68265
|
this.columnList.changes.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
68265
68266
|
Promise.resolve().then(() => {
|
|
68266
68267
|
this.updateColumnList();
|
|
@@ -68268,7 +68269,7 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68268
68269
|
});
|
|
68269
68270
|
// handle column changes so that they are passed to child grid instances when columnChange is emitted.
|
|
68270
68271
|
this.ri_columnListDiffer.diff(this.childColumns);
|
|
68271
|
-
this.
|
|
68272
|
+
this._childColumns.forEach(x => x.columnChange.pipe(takeUntil(x.destroy$)).subscribe(() => this.updateColumnList()));
|
|
68272
68273
|
this.childColumns.changes.pipe(takeUntil(this.destroy$)).subscribe((change) => {
|
|
68273
68274
|
const diff = this.ri_columnListDiffer.diff(change);
|
|
68274
68275
|
if (diff) {
|
|
@@ -68360,15 +68361,9 @@ class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68360
68361
|
}
|
|
68361
68362
|
return false;
|
|
68362
68363
|
});
|
|
68363
|
-
this.
|
|
68364
|
-
if (this.parentIsland) {
|
|
68365
|
-
this.parentIsland.columnList.notifyOnChanges();
|
|
68366
|
-
}
|
|
68367
|
-
else {
|
|
68368
|
-
this.rootGrid.columnList.notifyOnChanges();
|
|
68369
|
-
}
|
|
68364
|
+
this._childColumns = topCols;
|
|
68370
68365
|
this.rowIslandAPI.getChildGrids().forEach((grid) => {
|
|
68371
|
-
grid.createColumnsList(this.
|
|
68366
|
+
grid.createColumnsList(this._childColumns);
|
|
68372
68367
|
if (!document.body.contains(grid.nativeElement)) {
|
|
68373
68368
|
grid.updateOnRender = true;
|
|
68374
68369
|
}
|
|
@@ -68604,7 +68599,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68604
68599
|
*/
|
|
68605
68600
|
getCellByColumnVisibleIndex(rowIndex, index) {
|
|
68606
68601
|
const row = this.getRowByIndex(rowIndex);
|
|
68607
|
-
const column = this.
|
|
68602
|
+
const column = this.columns.find((col) => col.visibleIndex === index);
|
|
68608
68603
|
if (row && row instanceof IgxHierarchicalGridRow && column) {
|
|
68609
68604
|
return new IgxGridCell(this, rowIndex, column.field);
|
|
68610
68605
|
}
|
|
@@ -68826,7 +68821,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68826
68821
|
*/
|
|
68827
68822
|
getCellByColumn(rowIndex, columnField) {
|
|
68828
68823
|
const row = this.getRowByIndex(rowIndex);
|
|
68829
|
-
const column = this.
|
|
68824
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
68830
68825
|
if (row && row instanceof IgxHierarchicalGridRow && column) {
|
|
68831
68826
|
return new IgxGridCell(this, rowIndex, columnField);
|
|
68832
68827
|
}
|
|
@@ -68845,7 +68840,7 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
68845
68840
|
*/
|
|
68846
68841
|
getCellByKey(rowSelector, columnField) {
|
|
68847
68842
|
const row = this.getRowByKey(rowSelector);
|
|
68848
|
-
const column = this.
|
|
68843
|
+
const column = this.columns.find((col) => col.field === columnField);
|
|
68849
68844
|
if (row && column) {
|
|
68850
68845
|
return new IgxGridCell(this, row.index, columnField);
|
|
68851
68846
|
}
|
|
@@ -69120,8 +69115,8 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
69120
69115
|
if (this.hasColumnLayouts) {
|
|
69121
69116
|
// invalid configuration - hierarchical grid should not allow column layouts
|
|
69122
69117
|
// remove column layouts
|
|
69123
|
-
const nonColumnLayoutColumns = this.
|
|
69124
|
-
this.
|
|
69118
|
+
const nonColumnLayoutColumns = this.columns.filter((col) => !col.columnLayout && !col.columnLayoutChild);
|
|
69119
|
+
this.updateColumns(nonColumnLayoutColumns);
|
|
69125
69120
|
}
|
|
69126
69121
|
super.initColumns(collection, cb);
|
|
69127
69122
|
}
|
|
@@ -69129,16 +69124,25 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
69129
69124
|
if (this.parentIsland && this.parentIsland.childColumns.length > 0 && !this.autoGenerate) {
|
|
69130
69125
|
this.createColumnsList(this.parentIsland.childColumns.toArray());
|
|
69131
69126
|
}
|
|
69132
|
-
|
|
69127
|
+
else {
|
|
69128
|
+
super.setupColumns();
|
|
69129
|
+
}
|
|
69130
|
+
}
|
|
69131
|
+
getColumnList() {
|
|
69132
|
+
const childLayouts = this.parent ? this.childLayoutList : this.allLayoutList;
|
|
69133
|
+
const nestedColumns = childLayouts.map((layout) => layout.columnList.toArray());
|
|
69134
|
+
const colsArray = [].concat.apply([], nestedColumns);
|
|
69135
|
+
if (colsArray.length > 0) {
|
|
69136
|
+
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
69137
|
+
return topCols;
|
|
69138
|
+
}
|
|
69139
|
+
else {
|
|
69140
|
+
return this.columnList.toArray();
|
|
69141
|
+
}
|
|
69133
69142
|
}
|
|
69134
69143
|
onColumnsChanged(change) {
|
|
69135
69144
|
Promise.resolve().then(() => {
|
|
69136
69145
|
this.updateColumnList();
|
|
69137
|
-
const cols = change.filter(c => c.gridAPI.grid === this);
|
|
69138
|
-
if (cols.length > 0 || this.autoGenerate) {
|
|
69139
|
-
this.columnList.reset(cols);
|
|
69140
|
-
super.onColumnsChanged(this.columnList);
|
|
69141
|
-
}
|
|
69142
69146
|
});
|
|
69143
69147
|
}
|
|
69144
69148
|
_shouldAutoSize(renderedHeight) {
|
|
@@ -69154,8 +69158,8 @@ class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirective {
|
|
|
69154
69158
|
const colLength = this.columnList.length;
|
|
69155
69159
|
if (colsArray.length > 0) {
|
|
69156
69160
|
const topCols = this.columnList.filter((item) => colsArray.indexOf(item) === -1);
|
|
69157
|
-
this.
|
|
69158
|
-
if (recalcColSizes && this.
|
|
69161
|
+
this.updateColumns(topCols);
|
|
69162
|
+
if (recalcColSizes && this.columns.length !== colLength) {
|
|
69159
69163
|
this.calculateGridSizes(false);
|
|
69160
69164
|
}
|
|
69161
69165
|
}
|