Skip to content

Commit 8a862d7

Browse files
Merge branch '19.2.x' into mkirkova/fix-16262-19.2.x
2 parents e88c448 + 35c5258 commit 8a862d7

File tree

7 files changed

+50
-14
lines changed

7 files changed

+50
-14
lines changed

projects/igniteui-angular/src/lib/directives/toggle/toggle.directive.ts

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ import {
33
Directive,
44
ElementRef,
55
EventEmitter,
6-
HostBinding,
76
HostListener,
87
Inject,
98
Input,
109
OnDestroy,
1110
OnInit,
1211
Optional,
13-
Output
12+
Output,
1413
} from '@angular/core';
1514
import { AbsoluteScrollStrategy } from '../../services/overlay/scroll/absolute-scroll-strategy';
1615
import { CancelableBrowserEventArgs, IBaseEventArgs, PlatformUtil } from '../../core/utils';
@@ -34,7 +33,13 @@ export interface ToggleViewCancelableEventArgs extends ToggleViewEventArgs, Canc
3433
@Directive({
3534
exportAs: 'toggle',
3635
selector: '[igxToggle]',
37-
standalone: true
36+
standalone: true,
37+
host: {
38+
'[class.igx-toggle--hidden]': 'hiddenClass',
39+
'[attr.aria-hidden]': 'hiddenClass',
40+
'[class.igx-toggle--hidden-webkit]': 'hiddenWebkitClass',
41+
'[class.igx-toggle]': 'defaultClass'
42+
}
3843
})
3944
export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
4045
/**
@@ -159,13 +164,13 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
159164
/**
160165
* @hidden
161166
*/
162-
@HostBinding('class.igx-toggle--hidden')
163-
@HostBinding('attr.aria-hidden')
164167
public get hiddenClass() {
165168
return this.collapsed;
166169
}
167170

168-
@HostBinding('class.igx-toggle--hidden-webkit')
171+
/**
172+
* @hidden
173+
*/
169174
public get hiddenWebkitClass() {
170175
const isSafari = this.platform?.isSafari;
171176
const browserVersion = this.platform?.browserVersion;
@@ -176,7 +181,6 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
176181
/**
177182
* @hidden
178183
*/
179-
@HostBinding('class.igx-toggle')
180184
public get defaultClass() {
181185
return !this.collapsed;
182186
}
@@ -224,6 +228,16 @@ export class IgxToggleDirective implements IToggleView, OnInit, OnDestroy {
224228
}
225229

226230
this._collapsed = false;
231+
232+
// TODO: this is a workaround for the issue introduced by Angular's with Ivy renderer.
233+
// When calling detectChanges(), Angular marks the element for check, but does not update the classes
234+
// immediately, which causes the overlay to calculate incorrect dimensions of target element.
235+
// Overlay show should be called in the next tick to ensure the classes are updated and target element is measured correctly.
236+
// Note: across the codebase, each host binding should be checked and similar fix applied if needed!!!
237+
this.elementRef.nativeElement.className = this.elementRef.nativeElement.className.replace('igx-toggle--hidden', 'igx-toggle');
238+
this.elementRef.nativeElement.className = this.elementRef.nativeElement.className.replace('igx-toggle--hidden-webkit', 'igx-toggle');
239+
this.elementRef.nativeElement.removeAttribute('aria-hidden');
240+
227241
this.cdr.detectChanges();
228242

229243
if (!info) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ export class IgxRowIslandComponent extends IgxHierarchicalGridBaseDirective
139139
@ContentChildren(IgxColumnComponent, { read: IgxColumnComponent, descendants: false })
140140
public childColumns = new QueryList<IgxColumnComponent>();
141141

142-
@ContentChild(IgxGridToolbarDirective, { read: TemplateRef })
142+
@ContentChild(IgxGridToolbarDirective, { read: TemplateRef, descendants: false })
143143
protected toolbarDirectiveTemplate: TemplateRef<IgxGridToolbarTemplateContext>;
144144

145-
@ContentChild(IgxPaginatorDirective, { read: TemplateRef })
145+
@ContentChild(IgxPaginatorDirective, { read: TemplateRef, descendants: false })
146146
protected paginatorDirectiveTemplate: TemplateRef<any>;
147147

148148
/* csSuppress */

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -807,6 +807,22 @@ describe('IgxPivotGrid #pivotGrid', () => {
807807
expect(pivotGrid.nativeElement.clientWidth - expectedSize).toBeLessThan(50, "should take sum of columns as width.");
808808
});
809809

810+
it('should render cell values for dimension columns containing dots - issue #16445', () => {
811+
let data = fixture.componentInstance.data;
812+
data = data.map(item => {
813+
return {
814+
...item,
815+
Country: `${item['Country']}.Test`
816+
};
817+
});
818+
819+
fixture.componentInstance.data = [...data];
820+
fixture.detectChanges();
821+
822+
const cell = fixture.componentInstance.pivotGrid.gridAPI.get_cell_by_index(0, 'Bulgaria.Test-UnitsSold');
823+
expect(cell.value).not.toBeUndefined();
824+
});
825+
810826
describe('IgxPivotGrid Features #pivotGrid', () => {
811827
it('should show excel style filtering via dimension chip.', async () => {
812828
const pivotGrid = fixture.componentInstance.pivotGrid;

projects/igniteui-angular/src/lib/grids/pivot-grid/pivot-row.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[rowData]="data" [columnData]='getColumnData(col)'
1515
[style.min-width]="col.resolvedWidth" [style.max-width]="col.resolvedWidth"
1616
[style.flex-basis]="col.resolvedWidth" [width]="col.getCellWidth()" [visibleColumnIndex]="col.visibleIndex"
17-
[value]="pivotAggregationData[col.field] | dataMapper:col.field:grid.pipeTrigger:pivotAggregationData[col.field]:col.hasNestedPath"
17+
[value]="pivotAggregationData[col.field]"
1818
[cellTemplate]="col.bodyTemplate" [lastSearchInfo]="grid.lastSearchInfo"
1919
[cellSelectionMode]="grid.cellSelection" [displayPinnedChip]="shouldDisplayPinnedChip(col.visibleIndex)"
2020
(pointerdown)="grid.navigation.focusOutRowHeader($event)">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { IgxGridSelectionService } from '../selection/selection.service';
1313
import { IPivotGridColumn, IPivotGridRecord } from './pivot-grid.interface';
1414
import { PivotUtil } from './pivot-util';
1515
import { IgxPivotGridCellStyleClassesPipe } from './pivot-grid.pipes';
16-
import { IgxGridNotGroupedPipe, IgxGridCellStylesPipe, IgxGridDataMapperPipe, IgxGridTransactionStatePipe } from '../common/pipes';
16+
import { IgxGridNotGroupedPipe, IgxGridCellStylesPipe, IgxGridTransactionStatePipe } from '../common/pipes';
1717
import { IgxCheckboxComponent } from '../../checkbox/checkbox.component';
1818
import { NgClass, NgStyle } from '@angular/common';
1919
import { IgxGridCellComponent } from '../cell.component';
@@ -24,7 +24,7 @@ import { IgxGridForOfDirective } from '../../directives/for-of/for_of.directive'
2424
selector: 'igx-pivot-row',
2525
templateUrl: './pivot-row.component.html',
2626
providers: [{ provide: IgxRowDirective, useExisting: forwardRef(() => IgxPivotRowComponent) }],
27-
imports: [IgxGridForOfDirective, IgxGridCellComponent, NgClass, NgStyle, IgxCheckboxComponent, IgxGridNotGroupedPipe, IgxGridCellStylesPipe, IgxGridDataMapperPipe, IgxGridTransactionStatePipe, IgxPivotGridCellStyleClassesPipe]
27+
imports: [IgxGridForOfDirective, IgxGridCellComponent, NgClass, NgStyle, IgxCheckboxComponent, IgxGridNotGroupedPipe, IgxGridCellStylesPipe, IgxGridTransactionStatePipe, IgxPivotGridCellStyleClassesPipe]
2828
})
2929
export class IgxPivotRowComponent extends IgxRowDirective {
3030
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { IgxColumnActionsComponent } from '../column-actions/column-actions.comp
99
import { IgxToggleDirective, ToggleViewCancelableEventArgs, ToggleViewEventArgs } from '../../directives/toggle/toggle.directive';
1010
import { HorizontalAlignment, OverlaySettings, VerticalAlignment } from '../../services/overlay/utilities';
1111
import { IgxToolbarToken } from './token';
12-
import { ConnectedPositioningStrategy } from '../../services/overlay/position/connected-positioning-strategy';
12+
import { AutoPositionStrategy } from '../../services/overlay/position/auto-position-strategy';
1313

1414
/* blazorInclude */
1515
/* blazorElement */
@@ -88,7 +88,7 @@ export abstract class BaseToolbarDirective implements OnDestroy {
8888
private $sub: Subscription;
8989

9090
private _overlaySettings: OverlaySettings = {
91-
positionStrategy: new ConnectedPositioningStrategy({
91+
positionStrategy: new AutoPositionStrategy({
9292
horizontalDirection: HorizontalAlignment.Left,
9393
horizontalStartPoint: HorizontalAlignment.Right,
9494
verticalDirection: VerticalAlignment.Bottom,

projects/igniteui-angular/src/lib/services/overlay/overlay.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,18 @@ export class IgxOverlayService implements OnDestroy {
431431
}
432432
}
433433
this.updateSize(info);
434+
const openAnimation = info.settings.positionStrategy.settings.openAnimation;
435+
const closeAnimation = info.settings.positionStrategy.settings.closeAnimation;
434436
info.settings.positionStrategy.position(
435437
info.elementRef.nativeElement.parentElement,
436438
{ width: info.initialSize.width, height: info.initialSize.height },
437439
this._document,
438440
true,
439441
info.settings.target);
442+
if (openAnimation !== info.settings.positionStrategy.settings.openAnimation ||
443+
closeAnimation !== info.settings.positionStrategy.settings.closeAnimation){
444+
this.buildAnimationPlayers(info);
445+
}
440446
this.addModalClasses(info);
441447
if (info.settings.positionStrategy.settings.openAnimation) {
442448
// TODO: should we build players again. This was already done in attach!!!

0 commit comments

Comments
 (0)