Skip to content

Commit 2d5db67

Browse files
committed
fix(columns): type errors from untyped parent code
1 parent 367c2e3 commit 2d5db67

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

projects/igniteui-angular/grids/core/src/columns/column.component.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { IColumnVisibilityChangingEventArgs, IPinColumnCancellableEventArgs, IPi
2525
import { IgxGridCell } from '../grid-public-cell';
2626
import { NG_VALIDATORS, Validator } from '@angular/forms';
2727
import { ColumnPinningPosition, ColumnType, DefaultSortingStrategy, ExpressionsTreeUtil, FilteringExpressionsTree, GridColumnDataType, IColumnEditorOptions, IColumnPipeArgs, IgxBooleanFilteringOperand, IgxDateFilteringOperand, IgxDateTimeFilteringOperand, IgxFilteringOperand, IgxNumberFilteringOperand, IgxStringFilteringOperand, IgxSummaryResult, IgxTimeFilteringOperand, isConstructor, ISortingStrategy, MRLColumnSizeInfo, MRLResizeColumnInfo, PlatformUtil, ɵSize } from 'igniteui-angular/core';
28+
import type { IgxColumnLayoutComponent } from './column-layout.component';
2829

2930
const DEFAULT_DATE_FORMAT = 'mediumDate';
3031
const DEFAULT_TIME_FORMAT = 'mediumTime';
@@ -1525,8 +1526,6 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
15251526
* ```typescript
15261527
* let visibleColumnIndex = this.column.visibleIndex;
15271528
* ```
1528-
*
1529-
* @memberof IgxColumnComponent
15301529
*/
15311530
public get visibleIndex(): number {
15321531
if (!isNaN(this._vIndex)) {
@@ -1543,7 +1542,8 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
15431542
col = this.allChildren.filter(c => !c.columnGroup && !c.hidden)[0] as any;
15441543
}
15451544
if (this.columnLayoutChild) {
1546-
return this.parent.childrenVisibleIndexes.find(x => x.column === this).index;
1545+
// TODO: Refactor/redo/remove this
1546+
return (this.parent as IgxColumnLayoutComponent).childrenVisibleIndexes.find(x => x.column === this).index;
15471547
}
15481548

15491549
if (!this.pinned) {
@@ -1668,7 +1668,8 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
16681668
this._visibleWhenCollapsed = value;
16691669
this.visibleWhenCollapsedChange.emit(this._visibleWhenCollapsed);
16701670
if (this.parent) {
1671-
this.parent?.setExpandCollapseState?.();
1671+
// TODO: Refactor/redo/remove this
1672+
(this.parent as IgxColumnLayoutComponent)?.setExpandCollapseState?.();
16721673
}
16731674
}
16741675

@@ -2197,7 +2198,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
21972198
return [{ target: this, spanUsed: 1 }];
21982199
}
21992200

2200-
const columnSized = this.getInitialChildColumnSizes(this.parent.children);
2201+
const columnSized = this.getInitialChildColumnSizes(this.parent.children as QueryList<IgxColumnComponent>);
22012202
const targets: MRLResizeColumnInfo[] = [];
22022203
const colEnd = this.colEnd ? this.colEnd : this.colStart + 1;
22032204

projects/igniteui-angular/grids/grid/src/grid-base.directive.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,7 +3161,7 @@ export abstract class IgxGridBaseDirective implements GridType,
31613161
protected _batchEditing = false;
31623162
protected _sortingOptions: ISortingOptions = { mode: 'multiple' };
31633163
protected _filterStrategy: IFilteringStrategy = new FilteringStrategy();
3164-
protected _autoGeneratedCols = [];
3164+
protected _autoGeneratedCols: ColumnType[] = [];
31653165
protected _autoGeneratedColsRefs: ComponentRef<IgxColumnComponent>[] = [];
31663166
protected _dataView = [];
31673167
protected _lastSearchInfo: ISearchInfo = {
@@ -4803,7 +4803,7 @@ export abstract class IgxGridBaseDirective implements GridType,
48034803
}
48044804

48054805
if (column.level) {
4806-
this._moveChildColumns(column.parent, column, target, pos);
4806+
this._moveChildColumns(column.parent as IgxColumnComponent, column, target, pos);
48074807
}
48084808

48094809
// let columnPinStateChanged;
@@ -6952,7 +6952,7 @@ export abstract class IgxGridBaseDirective implements GridType,
69526952
if (this.autoGenerate && this._columns.length === 0 && this._autoGeneratedCols.length > 0) {
69536953
// In Ivy if there are nested conditional templates the content children are re-evaluated
69546954
// hence autogenerated columns are cleared and need to be reset.
6955-
this.updateColumns(this._autoGeneratedCols);
6955+
this.updateColumns(this._autoGeneratedCols as IgxColumnComponent[]);
69566956
return;
69576957
}
69586958
if (diff) {

projects/igniteui-angular/grids/pivot-grid/src/pivot-grid.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2014,7 +2014,7 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
20142014
return activeHeader ? `${this.id}_${activeHeader.title}` : null;
20152015
}
20162016

2017-
protected resolveToggle(groupColumn: IgxColumnComponent, state: boolean) {
2017+
protected resolveToggle(groupColumn: ColumnType, state: boolean) {
20182018
if (!groupColumn) return;
20192019
groupColumn.hidden = state;
20202020
this.columnGroupStates.set(groupColumn.field, state);

0 commit comments

Comments
 (0)