Skip to content

Commit b90c428

Browse files
authored
Merge branch '20.0.x' into dkamburov/fix-37933
2 parents 56f2611 + cac0138 commit b90c428

File tree

7 files changed

+72
-13
lines changed

7 files changed

+72
-13
lines changed

projects/igniteui-angular/src/lib/core/styles/components/grid/_grid-theme.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,12 @@
456456

457457
@if not($grid-shadow) {
458458
$grid-elevation: map.get($grid-schema, 'grid-elevation');
459-
$grid-shadow: elevation(var(--grid-elevation));
459+
$grid-shadow: elevation($grid-elevation);
460460
}
461461

462462
@if not($drag-shadow) {
463463
$drag-elevation: map.get($grid-schema, 'drag-elevation');
464-
$drag-shadow: elevation(var(--drag-elevation));
464+
$drag-shadow: elevation($drag-elevation);
465465
}
466466

467467
@if not($drop-area-border-radius) {

projects/igniteui-angular/src/lib/core/styles/components/input/_input-group-theme.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,7 @@
19281928
}
19291929

19301930
%indigo--box-focused {
1931-
background: var-get($theme, 'box-background-hover');
1931+
background: var-get($theme, 'box-background-focus');
19321932
}
19331933

19341934
%form-group-bundle--indigo--disabled {

projects/igniteui-angular/src/lib/grids/common/strategy.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export class IgxSorting implements IGridSortingStrategy {
7676
grid: GridType = null,
7777
groupsRecords: any[] = [],
7878
fullResult: IGroupByResult = { data: [], metadata: [] }
79-
): any[] {
79+
): IGroupByResult {
8080
const expressions = state.expressions;
8181
const expansion = state.expansion;
8282
let i = 0;
@@ -117,23 +117,24 @@ export class IgxSorting implements IGridSortingStrategy {
117117
fullResult.metadata.push(null);
118118
if (level < expressions.length - 1) {
119119
recursiveResult = this.groupDataRecursive(group, state, level + 1, groupRow,
120-
expanded ? metadata : [], grid, groupsRecords, fullResult);
120+
[], grid, groupsRecords, fullResult);
121121
if (expanded) {
122-
result = result.concat(recursiveResult);
122+
result = result.concat(recursiveResult.data);
123+
metadata = metadata.concat(recursiveResult.metadata);
123124
}
124125
} else {
125126
for (const groupItem of group) {
126127
fullResult.metadata.push(groupRow);
127128
fullResult.data.push(groupItem);
128129
}
129130
if (expanded) {
130-
metadata.push(...fullResult.metadata.slice(fullResult.metadata.length - group.length));
131-
result.push(...fullResult.data.slice(fullResult.data.length - group.length));
131+
metadata = metadata.concat(fullResult.metadata.slice(fullResult.metadata.length - group.length));
132+
result = result.concat(fullResult.data.slice(fullResult.data.length - group.length));
132133
}
133134
}
134135
i += group.length;
135136
}
136-
return result;
137+
return { data: result, metadata };
137138
}
138139

139140
/**
@@ -264,8 +265,8 @@ export class IgxGrouping extends IgxSorting implements IGridGroupingStrategy {
264265
const grouping = this.groupDataRecursive(data, state, 0, null, metadata, grid, groupsRecords, fullResult);
265266
grid?.groupingPerformedSubject.next();
266267
return {
267-
data: grouping,
268-
metadata
268+
data: grouping.data,
269+
metadata: grouping.metadata
269270
};
270271
}
271272
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3813,7 +3813,7 @@ export abstract class IgxGridBaseDirective implements GridType,
38133813

38143814
// notifier for column autosize requests
38153815
this._autoSizeColumnsNotify.pipe(
3816-
throttleTime(0, animationFrameScheduler, { leading: false, trailing: true }),
3816+
throttleTime(0, this.platform.isBrowser ? animationFrameScheduler : undefined, { leading: false, trailing: true }),
38173817
destructor
38183818
)
38193819
.subscribe(() => {

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

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3822,6 +3822,32 @@ describe('IgxGrid - GroupBy #grid', () => {
38223822
}
38233823
});
38243824

3825+
it('should be able to build groups with 100 000+ records', () => {
3826+
const fix = TestBed.createComponent(GroupableGridComponent);
3827+
const grid = fix.componentInstance.instance;
3828+
3829+
const data = [];
3830+
for (let i = 0; i < 1000000; i++) {
3831+
data.push({
3832+
Downloads: i,
3833+
ID: 1,
3834+
ProductName: 'Test'
3835+
});
3836+
}
3837+
3838+
fix.componentInstance.data = data;
3839+
fix.detectChanges();
3840+
3841+
grid.groupBy({
3842+
fieldName: 'ProductName',
3843+
dir: SortingDirection.Asc
3844+
});
3845+
fix.detectChanges();
3846+
3847+
let groupRows = grid.groupsRowList.toArray();
3848+
checkGroups(groupRows, ['Test']);
3849+
});
3850+
38253851
describe('GroupBy with state directive', () => {
38263852
let fix: ComponentFixture<GridGroupByStateComponent>;
38273853
let state: IgxGridStateDirective;

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,33 @@ describe('Basic IgxHierarchicalGrid #hGrid', () => {
16851685

16861686
});
16871687

1688+
it('should allow changing row islands runtime in nested child grid.', () => {
1689+
const row = hierarchicalGrid.gridAPI.get_row_by_index(0) as IgxHierarchicalRowComponent;
1690+
UIInteractions.simulateClickAndSelectEvent(row.expander);
1691+
fixture.detectChanges();
1692+
1693+
let childGrid = hierarchicalGrid.gridAPI.getChildGrids()[0];
1694+
const childRow = childGrid.gridAPI.get_row_by_index(0) as IgxHierarchicalRowComponent;
1695+
UIInteractions.simulateClickAndSelectEvent(childRow.expander);
1696+
fixture.detectChanges();
1697+
1698+
let hGrids = fixture.debugElement.queryAll(By.css('igx-hierarchical-grid'));
1699+
expect(hGrids.length).toBe(3);
1700+
expect(childGrid.gridAPI.getChildGrids().length).toBe(1);
1701+
1702+
fixture.componentInstance.toggleRINested = true;
1703+
fixture.detectChanges();
1704+
1705+
const nestedChildGrid = childGrid.gridAPI.getChildGrids()[0];
1706+
const nestedChildRow = nestedChildGrid.gridAPI.get_row_by_index(0) as IgxHierarchicalRowComponent;
1707+
UIInteractions.simulateClickAndSelectEvent(nestedChildRow.expander);
1708+
fixture.detectChanges();
1709+
1710+
hGrids = fixture.debugElement.queryAll(By.css('igx-hierarchical-grid'));
1711+
expect(hGrids.length).toBe(4);
1712+
expect(nestedChildGrid.gridAPI.getChildGrids().length).toBe(1);
1713+
});
1714+
16881715
it(`Should apply template to both parent and child grids`, () => {
16891716
const customFixture = TestBed.createComponent(IgxHierarchicalGridCustomRowEditOverlayComponent);
16901717
customFixture.detectChanges();
@@ -2146,6 +2173,10 @@ export class IgxHierarchicalGridSizingComponent {
21462173
<igx-row-island key="childData" [autoGenerate]="true">
21472174
@if (toggleChildRI) {
21482175
<igx-row-island key="childData" [autoGenerate]="true">
2176+
@if (toggleRINested) {
2177+
<igx-row-island [key]="'childData'" [autoGenerate]="true">
2178+
</igx-row-island>
2179+
}
21492180
</igx-row-island>
21502181
}
21512182
</igx-row-island>
@@ -2156,6 +2187,7 @@ export class IgxHierarchicalGridSizingComponent {
21562187
export class IgxHierarchicalGridToggleRIComponent extends IgxHierarchicalGridTestBaseComponent {
21572188
public toggleRI = true;
21582189
public toggleChildRI = true;
2190+
public toggleRINested = false;
21592191
}
21602192

21612193
@Component({

projects/igniteui-angular/src/lib/grids/hierarchical-grid/row-island.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ export class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective
438438
.subscribe(() => {
439439
this.updateChildren();
440440
// update existing grids since their child ri have been changed.
441-
this.getGridsForIsland(this.key).forEach(grid => {
441+
this.rowIslandAPI.getChildGrids(false).forEach(grid => {
442442
(grid as any).onRowIslandChange(this.children);
443443
});
444444
});

0 commit comments

Comments
 (0)