Skip to content

Commit 260c3f8

Browse files
authored
Merge branch '19.2.x' into rivanova/fix-15848-19.2.x
2 parents 63392d3 + 233b5b4 commit 260c3f8

File tree

15 files changed

+190
-56
lines changed

15 files changed

+190
-56
lines changed

projects/igniteui-angular/src/lib/carousel/carousel-base.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,14 @@ export abstract class IgxCarouselComponentBase implements OnDestroy {
5252
}
5353

5454
public ngOnDestroy(): void {
55-
this.enterAnimationPlayer?.destroy();
56-
this.leaveAnimationPlayer?.destroy();
55+
if (this.enterAnimationPlayer) {
56+
this.enterAnimationPlayer.destroy();
57+
this.enterAnimationPlayer = null;
58+
}
59+
if (this.leaveAnimationPlayer) {
60+
this.leaveAnimationPlayer.destroy();
61+
this.leaveAnimationPlayer = null;
62+
}
5763
}
5864

5965
/** @hidden */

projects/igniteui-angular/src/lib/carousel/carousel.component.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,17 @@ describe('Carousel', () => {
745745
expect(carousel.get(1).nativeElement.classList.contains(HelperTestFunctions.ACTIVE_SLIDE_CLASS)).toBeTruthy();
746746
expect(carousel.get(0).nativeElement.classList.contains(HelperTestFunctions.PREVIOUS_SLIDE_CLASS)).toBeFalsy();
747747
});
748+
749+
it('should not throw an error when playing an animation and destroying the component - #15976', () => {
750+
expect(() => {
751+
carousel.next();
752+
carousel.ngOnDestroy();
753+
fixture.detectChanges();
754+
}).not.toThrow();
755+
756+
expect(carousel['enterAnimationPlayer']).toBe(null);
757+
expect(carousel['leaveAnimationPlayer']).toBe(null);
758+
});
748759
});
749760

750761
describe('Dynamic Slides: ', () => {

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

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -737,8 +737,7 @@
737737
igx-time-picker {
738738
position: relative;
739739
height: calc(100% - #{$editing-outline-width * 2});
740-
width: calc(100% - #{$editing-outline-width * 2}) !important;
741-
inset-inline-start: $editing-outline-width;
740+
width: 100% !important;
742741
overflow: hidden;
743742
}
744743

@@ -1514,6 +1513,9 @@
15141513
}
15151514

15161515
%igx-grid__td--bool {
1516+
display: flex;
1517+
flex-grow: 1;
1518+
15171519
igx-icon {
15181520
--component-size: #{if($variant == 'indigo', 2, 1)};
15191521
}
@@ -1783,7 +1785,6 @@
17831785
padding-inline-end: rem(4px) !important;
17841786

17851787
> igx-icon {
1786-
margin-inline-start: auto;
17871788
color: color($color: 'error');
17881789
width: var(--igx-icon-size, rem(18px));
17891790
height: var(--igx-icon-size, rem(18px));
@@ -1889,11 +1890,10 @@
18891890
%igx-grid__td--editing {
18901891
background: var-get($theme, 'cell-editing-background') !important;
18911892
box-shadow: inset 0 0 0 $editing-outline-width var-get($theme, 'edit-mode-color');
1892-
padding: 0 !important;
1893+
padding-inline: rem(4px);
18931894

18941895
&.igx-grid__td--invalid {
18951896
box-shadow: inset 0 0 0 rem(2px) color($color: 'error') !important;
1896-
padding-inline-end: rem(4px) !important;
18971897
}
18981898

18991899
&%grid-cell-number {
@@ -2084,7 +2084,7 @@
20842084

20852085
.sort-icon {
20862086
color: var-get($theme, 'header-selected-text-color');
2087-
2087+
20882088
::after {
20892089
background: var-get($theme, 'header-selected-background');
20902090
}
@@ -2112,15 +2112,15 @@
21122112
&%igx-grid-th--sorted {
21132113
.sort-icon {
21142114
color: var-get($theme, 'header-selected-text-color');
2115-
2115+
21162116
> igx-icon {
21172117
color: inherit;
21182118
}
21192119

21202120
&:focus,
21212121
&:hover {
21222122
color: var-get($theme, 'header-selected-text-color');
2123-
2123+
21242124
> igx-icon {
21252125
color: inherit;
21262126
}
@@ -2177,14 +2177,14 @@
21772177
.sort-icon {
21782178
opacity: 1;
21792179
color: var-get($theme, 'sorted-header-icon-color');
2180-
2180+
21812181
> igx-icon {
21822182
color: inherit;
21832183
}
21842184

21852185
&:hover {
21862186
color: var-get($theme, 'sortable-header-icon-hover-color');
2187-
2187+
21882188
> igx-icon {
21892189
color: inherit;
21902190
}
@@ -2220,6 +2220,7 @@
22202220
%grid-cell-number {
22212221
text-align: $grid-cell-align-num;
22222222
justify-content: flex-end;
2223+
flex-grow: 1;
22232224

22242225
%grid-cell-header-icons {
22252226
justify-content: flex-start;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3780,7 +3780,7 @@ export abstract class IgxGridBaseDirective implements GridType,
37803780

37813781
// notifier for column autosize requests
37823782
this._autoSizeColumnsNotify.pipe(
3783-
throttleTime(0, animationFrameScheduler, { leading: false, trailing: true }),
3783+
throttleTime(0, this.platform.isBrowser ? animationFrameScheduler : undefined, { leading: false, trailing: true }),
37843784
destructor
37853785
)
37863786
.subscribe(() => {
@@ -6136,7 +6136,7 @@ export abstract class IgxGridBaseDirective implements GridType,
61366136
* @hidden @internal
61376137
*/
61386138
public trackColumnChanges(_index, col) {
6139-
return col.field + col._calcWidth;
6139+
return col.field + col._calcWidth.toString();
61406140
}
61416141

61426142
/**

projects/igniteui-angular/src/lib/grids/grid/expandable-cell.component.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<div
99
igxTextHighlight class="igx-grid__td-text"
1010
[cssClass]="highlightClass"
11+
[class.igx-grid__td--number]="column.dataType === 'number' || column.dataType === 'percent' || column.dataType === 'currency'"
1112
[activeCssClass]="activeHighlightClass"
1213
[groupName]="gridID"
1314
[value]="formatter ? (value | columnFormatter:formatter:rowData)
@@ -32,11 +33,13 @@
3233
}
3334

3435
@if (column.dataType === 'boolean' && !this.formatter) {
36+
<div [class.igx-grid__td--bool]="column.dataType === 'boolean'">
3537
<igx-icon
3638
family="default"
3739
[name]="value ? 'confirm' : 'close'"
3840
[ngClass]="{ 'igx-icon--success': value, 'igx-icon--error': !value }">
3941
</igx-icon>
42+
</div>
4043
}
4144
@if (column.dataType === 'image') {
4245
<img [src]="value" [alt]="value | igxCellImageAlt" />

projects/igniteui-angular/src/lib/grids/grid/grid-validation.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export class IgxGridValidationService {
3636
owner: this.grid
3737
};
3838
this.grid.formGroupCreated.emit(args);
39+
formGroup.patchValue(data);
3940
this.add(rowId, formGroup);
4041
} else {
4142
// reset to pristine.

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
@@ -422,7 +422,7 @@ export class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective
422422
.subscribe(() => {
423423
this.updateChildren();
424424
// update existing grids since their child ri have been changed.
425-
this.getGridsForIsland(this.key).forEach(grid => {
425+
this.rowIslandAPI.getChildGrids(false).forEach(grid => {
426426
(grid as any).onRowIslandChange(this.children);
427427
});
428428
});

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import { IgxIconComponent } from "../../icon/icon.component";
4747
import { IgxInputGroupComponent } from "../../input-group/input-group.component";
4848
import { fadeIn, fadeOut } from 'igniteui-angular/animations';
4949
import { Size } from '../common/enums';
50+
import { GridColumnDataType } from '../../data-operations/data-util';
5051

5152
interface IDataSelectorPanel {
5253
name: string;
@@ -541,8 +542,13 @@ export class IgxPivotDataSelectorComponent {
541542
* @internal
542543
*/
543544
public onAggregationChange(event: ISelectionEventArgs) {
545+
544546
if (!this.isSelected(event.newSelection.value)) {
545547
this.value.aggregate = event.newSelection.value;
548+
const isSingleValue = this.grid.values.length === 1;
549+
550+
PivotUtil.updateColumnTypeByAggregator(this.grid.columns, this.value, isSingleValue);
551+
546552
this.grid.pipeTrigger++;
547553
this.grid.cdr.markForCheck();
548554
}

0 commit comments

Comments
 (0)