Skip to content

Commit 88af9f0

Browse files
committed
refactor(grids): make the type prop public for external integrations
1 parent 56e2713 commit 88af9f0

7 files changed

Lines changed: 21 additions & 8 deletions

File tree

projects/igniteui-angular/core/src/data-operations/grid-types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ export interface GridTypeBase {
9494
primaryKey?: string;
9595
id?: string;
9696
data: any[] | null;
97+
/* csSuppress */
98+
/** The type of the grid: `'flat'`, `'tree'`, `'hierarchical'`, or `'pivot'`. */
99+
readonly type: 'flat' | 'tree' | 'hierarchical' | 'pivot';
97100
[key: string]: any;
98101
}
99102

projects/igniteui-angular/grids/core/src/common/grid.interface.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -896,8 +896,6 @@ export interface GridType extends IGridDataBindable {
896896
selectedRows: any[];
897897
/** @hidden @internal */
898898
activeDescendant?: string;
899-
/** @hidden @internal */
900-
readonly type: 'flat' | 'tree' | 'hierarchical' | 'pivot';
901899

902900
toggleGroup?(groupRow: IGroupByRecord): void;
903901
clearGrouping?(field: string): void;

projects/igniteui-angular/grids/core/src/services/excel/excel-exporter-grid.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import { IgxHierarchicalRowComponent } from 'igniteui-angular/grids/hierarchical
4444
import { IgxTreeGridComponent } from 'igniteui-angular/grids/tree-grid';
4545
import { IgxPivotGridComponent } from 'igniteui-angular/grids/pivot-grid';
4646
import { IgxGridNavigationService, IgxPivotNumericAggregate, PivotRowLayoutType } from 'igniteui-angular/grids/core';
47-
import { IgxHierarchicalGridComponent } from 'igniteui-angular/grids/hierarchical-grid';
4847
import { IgxGridComponent } from 'igniteui-angular/grids/grid';
4948
import { FileContentData } from './test-data.service.spec';
5049
import { ZipWrapper } from './zip-verification-wrapper.spec';
@@ -1729,7 +1728,7 @@ describe('Excel Exporter', () => {
17291728
};
17301729

17311730
const exportAndVerify = async (component, exportOptions, expectedData, exportTable = true) => {
1732-
const isHGrid = component instanceof IgxHierarchicalGridComponent;
1731+
const isHGrid = component.type === 'hierarchical';
17331732
const shouldNotExportTable = isHGrid || !exportTable;
17341733

17351734
const wrapper = await getExportedData(component, exportOptions);

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3097,7 +3097,10 @@ export abstract class IgxGridBaseDirective implements GridType,
30973097
*/
30983098
public EMPTY_DATA = [];
30993099

3100-
/** @hidden @internal */
3100+
/* csSuppress */
3101+
/**
3102+
* Returns the type of the grid.
3103+
*/
31013104
public get type(): GridType["type"] {
31023105
return 'flat';
31033106
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ export abstract class IgxHierarchicalGridBaseDirective extends IgxGridBaseDirect
7676
@Output()
7777
public dataPreLoad = new EventEmitter<IForOfState>();
7878

79-
/** @hidden @internal */
79+
/* csSuppress */
80+
/**
81+
* Returns the type of the grid.
82+
*/
8083
public override get type(): GridType["type"] {
8184
return 'hierarchical';
8285
}

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,11 @@ export class IgxPivotGridComponent extends IgxGridBaseDirective implements OnIni
614614
public get pivotKeys() {
615615
return this.pivotConfiguration.pivotKeys || DEFAULT_PIVOT_KEYS;
616616
}
617-
/** @hidden @internal */
617+
618+
/* csSuppress */
619+
/**
620+
* Returns the type of the grid.
621+
*/
618622
public override get type(): GridType["type"] {
619623
return 'pivot';
620624
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,10 @@ export class IgxTreeGridComponent extends IgxGridBaseDirective implements GridTy
357357
this.cdr.markForCheck();
358358
}
359359

360-
/** @hidden @internal */
360+
/* csSuppress */
361+
/**
362+
* Returns the type of the grid.
363+
*/
361364
public override get type(): GridType["type"] {
362365
return 'tree';
363366
}

0 commit comments

Comments
 (0)