Skip to content

Commit da4a3a8

Browse files
authored
Merge branch 'master' into mpopov/indigo-calendar-updates
2 parents 9dd1b9f + 3c19be2 commit da4a3a8

20 files changed

+2176
-89
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ All notable changes for each version of this project will be documented in this
77
- `IgxPivotGrid`
88
- Added horizontal layout for row dimensions. Can be configured through the `pivotUI` `rowLayout` property.
99
- Added `horizontalSummary` property for each IPivotDimension, enabling summary row when using horizontal layout.
10+
- Added `horizontalSummariesPosition` property to the `pivotUI`, configuring horizontal summaries position.
1011
- Keyboard navigation now can move in to row headers back and forth from any row dimension headers or column headers.
1112
- Added keyboard interactions for row dimension collapse using `Alt + Arrows` and row headers sorting using `Ctrl + Arrow Up/Down`.
1213

1314
### General
1415
- `ColumnType`, `IgxColumn`, `IgxColumnGroup`, `IgxColumnLayout`
1516
- The `children` query property has been deprecated and replaced by `childColumns` getter directly returning columns array.
17+
- Several properties have been hidden from the public API, considered internal and not recommended for use. Those include:
18+
`filterCell`, `headerCell`, `headerGroup`, `defaultMinWidth`, `gridRowSpan`, `gridColumnSpan` and `cells`.
1619
- `IgxPaginator`
1720
- The `isFirstPageDisabled` and `isLastPageDisabled` have been deprecated in favor of the identical `isFirstPage` and `isLastPage` getter.
1821

projects/igniteui-angular/src/lib/directives/for-of/for_of.directive.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,6 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
802802
|| containerSize && endTopOffset - containerSize > 5;
803803
}
804804

805-
806805
/**
807806
* @hidden
808807
* Function that recalculates and updates cache sizes.
@@ -831,13 +830,13 @@ export class IgxForOfDirective<T, U extends T[] = T[]> extends IgxForOfToken<T,U
831830
const currDiff = newVal - oldVal;
832831
diffs.push(currDiff);
833832
totalDiff += currDiff;
834-
this.sizesCache[index + 1] += totalDiff;
833+
this.sizesCache[index + 1] = (this.sizesCache[index] || 0) + newVal;
835834
}
836835
}
837836
// update cache
838837
if (Math.abs(totalDiff) > 0) {
839838
for (let j = this.state.startIndex + this.state.chunkSize + 1; j < this.sizesCache.length; j++) {
840-
this.sizesCache[j] += totalDiff;
839+
this.sizesCache[j] = (this.sizesCache[j] || 0) + totalDiff;
841840
}
842841

843842
// update scrBar heights/widths

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
186186
*/
187187
public override set inlineEditorTemplate(template: TemplateRef<any>) { }
188188
/**
189-
* Will return empty array. Use this.children.toArray()[index].cells to get the cells for a column that is part of the column group.
190-
* ```typescript
191-
* let columnCells = this.columnGroup.cells;
192-
* ```
193-
*
194-
* @memberof IgxColumnGroupComponent
189+
* @hidden @internal
195190
*/
196191
public override get cells(): CellType[] {
197192
return [];

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

Lines changed: 10 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,12 +1130,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
11301130
this._groupingComparer = funcRef;
11311131
}
11321132
/**
1133-
* Gets the default minimum `width` of the column.
1134-
* ```typescript
1135-
* let defaultMinWidth = this.column.defaultMinWidth;
1136-
* ```
1137-
*
1138-
* @memberof IgxColumnComponent
1133+
* @hidden @internal
11391134
*/
11401135
public get defaultMinWidth(): string {
11411136
if (!this.grid) {
@@ -1351,11 +1346,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
13511346
}
13521347

13531348
/**
1354-
* Gets the cells of the column.
1355-
* ```typescript
1356-
* let columnCells = this.column.cells;
1357-
* ```
1358-
*
1349+
* @hidden @internal
13591350
*/
13601351
public get cells(): CellType[] {
13611352
return this.grid.dataView
@@ -1455,7 +1446,7 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
14551446
*
14561447
* @memberof IgxColumnComponent
14571448
*/
1458-
public get columnLayoutChild() {
1449+
public get columnLayoutChild(): boolean {
14591450
return this.parent && this.parent.columnLayout;
14601451
}
14611452

@@ -1510,9 +1501,11 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
15101501
null;
15111502
}
15121503

1504+
/** @hidden @internal **/
15131505
public get gridRowSpan(): number {
15141506
return this.rowEnd && this.rowStart ? this.rowEnd - this.rowStart : 1;
15151507
}
1508+
/** @hidden @internal **/
15161509
public get gridColumnSpan(): number {
15171510
return this.colEnd && this.colStart ? this.colEnd - this.colStart : 1;
15181511
}
@@ -2296,47 +2289,31 @@ export class IgxColumnComponent implements AfterContentInit, OnDestroy, ColumnTy
22962289
* ```typescript
22972290
* let topLevelParent = this.column.topLevelParent;
22982291
* ```
2299-
*
2300-
* @memberof IgxColumnComponent
23012292
*/
2302-
public get topLevelParent() {
2293+
public get topLevelParent(): ColumnType | undefined {
23032294
let parent = this.parent;
23042295
while (parent && parent.parent) {
23052296
parent = parent.parent;
23062297
}
2307-
return parent;
2298+
return parent ?? undefined;
23082299
}
23092300

23102301
/**
2311-
* Returns a reference to the header of the column.
2312-
* ```typescript
2313-
* let column = this.grid.columnList.filter(c => c.field === 'ID')[0];
2314-
* let headerCell = column.headerCell;
2315-
* ```
2316-
*
2317-
* @memberof IgxColumnComponent
2302+
* @hidden @internal
23182303
*/
23192304
public get headerCell(): IgxGridHeaderComponent {
23202305
return this.grid.headerCellList.find((header) => header.column === this);
23212306
}
23222307

23232308
/**
2324-
* Returns a reference to the filter cell of the column.
2325-
* ```typescript
2326-
* let column = this.grid.columnList.filter(c => c.field === 'ID')[0];
2327-
* let filterell = column.filterell;
2328-
* ```
2329-
*
2330-
* @memberof IgxColumnComponent
2309+
* @hidden @internal
23312310
*/
23322311
public get filterCell(): IgxGridFilteringCellComponent {
23332312
return this.grid.filterCellList.find((filterCell) => filterCell.column === this);
23342313
}
23352314

23362315
/**
2337-
* Returns a reference to the header group of the column.
2338-
*
2339-
* @memberof IgxColumnComponent
2316+
* @hidden @internal
23402317
*/
23412318
public get headerGroup(): IgxGridHeaderGroupComponent {
23422319
return this.grid.headerGroupsList.find(group => group.column === this);

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

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -311,17 +311,9 @@ export interface ColumnType extends FieldType {
311311
get childColumns(): ColumnType[];
312312
/** @hidden @internal */
313313
allChildren: ColumnType[];
314-
/**
315-
* The header group component associated with this column.
316-
* Could be of any type
317-
*/
318-
// TYPE
314+
/** @hidden @internal */
319315
headerGroup: any;
320-
/**
321-
* The header cell component associated with this column.
322-
* Could be of any type
323-
*/
324-
// TYPE
316+
/** @hidden @internal */
325317
headerCell: any;
326318
validators: any[];
327319

@@ -418,6 +410,7 @@ export interface ColumnType extends FieldType {
418410
* If the value is true, the result will not depend on the case (example: `E` will match `e`)
419411
*/
420412
sortingIgnoreCase: boolean;
413+
/** @hidden @internal */
421414
filterCell: any;
422415
filteringIgnoreCase: boolean;
423416
/**
@@ -447,7 +440,9 @@ export interface ColumnType extends FieldType {
447440
rowEnd: number;
448441
colStart: number;
449442
colEnd: number;
443+
/** @hidden @internal */
450444
gridRowSpan: number;
445+
/** @hidden @internal */
451446
gridColumnSpan: number;
452447
columnLayoutChild: boolean;
453448
width: string;

projects/igniteui-angular/src/lib/grids/grid/column-group.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ describe('IgxGrid - multi-column headers #grid', () => {
958958
expect(grid.columnList.filter(col => col.columnGroup).length).toEqual(7);
959959

960960
// Get topLevelParent of column with no group
961-
expect(grid.getColumnByName('ID').topLevelParent).toBeNull();
961+
expect(grid.getColumnByName('ID').topLevelParent).toBeUndefined();
962962

963963
// Get topLevelParent of column
964964
const addressGroupedColumn = getColGroup(grid, 'Address Information');
@@ -971,8 +971,8 @@ describe('IgxGrid - multi-column headers #grid', () => {
971971
expect(grid.getColumnByName('CompanyName').topLevelParent).toEqual(genInfGroupedColumn);
972972

973973
// Get topLevelParent of top group
974-
expect(genInfGroupedColumn.topLevelParent).toBeNull();
975-
expect(addressGroupedColumn.topLevelParent).toBeNull();
974+
expect(genInfGroupedColumn.topLevelParent).toBeUndefined();
975+
expect(addressGroupedColumn.topLevelParent).toBeUndefined();
976976

977977
// Get topLevelParent of group
978978
expect(getColGroup(grid, 'Person Details').topLevelParent).toEqual(genInfGroupedColumn);

projects/igniteui-angular/src/lib/grids/grid/column-moving.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { configureTestSuite } from '../../test-utils/configure-suite';
1616
import { IgxGridComponent } from './grid.component';
1717
import { GridSelectionFunctions, GridFunctions } from '../../test-utils/grid-functions.spec';
1818
import { SortingDirection } from '../../data-operations/sorting-strategy';
19-
import { IgxColumnComponent } from '../public_api';
19+
import { ColumnType, IgxColumnComponent } from '../public_api';
2020

2121
describe('IgxGrid - Column Moving #grid', () => {
2222
const CELL_CSS_CLASS = '.igx-grid__td';
@@ -1588,7 +1588,7 @@ describe('IgxGrid - Column Moving #grid', () => {
15881588
}));
15891589

15901590
it('MCH - should not move group column to last position', (async () => {
1591-
let column = grid.getColumnByName('Missing');
1591+
let column: ColumnType = grid.getColumnByName('Missing');
15921592
column.move(3);
15931593
await wait();
15941594
fixture.detectChanges();
@@ -1610,8 +1610,7 @@ describe('IgxGrid - Column Moving #grid', () => {
16101610
}));
16111611

16121612
it('MCH - should be able to move group column to position lastIndex - group.children.length', (async () => {
1613-
1614-
let column = grid.getColumnByName('Missing');
1613+
let column: ColumnType = grid.getColumnByName('Missing');
16151614
column.move(3);
16161615
await wait();
16171616
fixture.detectChanges();

projects/igniteui-angular/src/lib/grids/grid/grid.master-detail.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,13 +590,14 @@ describe('IgxGrid Master Detail #grid', () => {
590590
setupGridScrollDetection(fix, grid);
591591
const targetCellElement = grid.gridAPI.get_cell_by_index(0, 'ContactName');
592592
UIInteractions.simulateClickAndSelectEvent(targetCellElement);
593+
await wait(DEBOUNCETIME);
593594
fix.detectChanges();
594595

595596
UIInteractions.triggerEventHandlerKeyDown('End', gridContent, false, false, true);
596-
await wait(DEBOUNCETIME);
597597
fix.detectChanges();
598598
await wait(DEBOUNCETIME);
599599
fix.detectChanges();
600+
await wait(DEBOUNCETIME);
600601

601602
const lastRow = grid.gridAPI.get_row_by_index(52);
602603
expect(lastRow).not.toBeUndefined();

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.virtualization.spec.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { IgxStringFilteringOperand } from '../../data-operations/filtering-condi
1414
import { GridFunctions } from '../../test-utils/grid-functions.spec';
1515
import { HierarchicalGridFunctions } from '../../test-utils/hierarchical-grid-functions.spec';
1616
import { IgxHierarchicalRowComponent } from './hierarchical-row.component';
17+
import { IgxHierarchicalGridDefaultComponent } from '../../test-utils/hierarchical-grid-components.spec';
1718

1819
describe('IgxHierarchicalGrid Virtualization #hGrid', () => {
1920
let fixture;
@@ -22,7 +23,8 @@ describe('IgxHierarchicalGrid Virtualization #hGrid', () => {
2223
return TestBed.configureTestingModule({
2324
imports: [
2425
NoopAnimationsModule,
25-
IgxHierarchicalGridTestBaseComponent
26+
IgxHierarchicalGridTestBaseComponent,
27+
IgxHierarchicalGridDefaultComponent
2628
]
2729
});
2830
}));
@@ -393,6 +395,43 @@ describe('IgxHierarchicalGrid Virtualization #hGrid', () => {
393395
expect(ri.gridScroll.emit).toHaveBeenCalled();
394396
expect(ri.dataPreLoad.emit).toHaveBeenCalled();
395397
});
398+
399+
it('should recalculate and update content correctly after filter is cleared, ensuring no empty areas post-filtering and scrolling', async () => {
400+
// eslint-disable-next-line @typescript-eslint/no-shadow
401+
const fixture = TestBed.createComponent(IgxHierarchicalGridDefaultComponent);
402+
fixture.detectChanges();
403+
// eslint-disable-next-line @typescript-eslint/no-shadow
404+
const hierarchicalGrid = fixture.componentInstance.hierarchicalGrid;
405+
fixture.detectChanges();
406+
await wait(50);
407+
408+
hierarchicalGrid.filter('Artist', 'd', IgxStringFilteringOperand.instance().condition('contains'));
409+
fixture.detectChanges();
410+
await wait(50);
411+
412+
hierarchicalGrid.expandRow(6);
413+
fixture.detectChanges();
414+
await wait(50);
415+
416+
hierarchicalGrid.verticalScrollContainer.getScroll().scrollTop = 2000;
417+
fixture.detectChanges();
418+
await wait(50);
419+
420+
hierarchicalGrid.clearFilter();
421+
fixture.detectChanges();
422+
await wait(50);
423+
424+
hierarchicalGrid.verticalScrollContainer.getScroll().scrollTop = 2000;
425+
fixture.detectChanges();
426+
await wait(50);
427+
428+
const hierarchicalGridRect = hierarchicalGrid.tbody.nativeElement.getBoundingClientRect();
429+
const lastRowRect = hierarchicalGrid.dataRowList.last.nativeElement.getBoundingClientRect();
430+
431+
const emptySpace = hierarchicalGridRect.bottom - lastRowRect.bottom;
432+
433+
expect(emptySpace).toBeLessThan(5);
434+
});
396435
});
397436

398437
describe('IgxHierarchicalGrid Virtualization Custom Scenarios #hGrid', () => {

0 commit comments

Comments
 (0)