Skip to content

Commit 5283bf1

Browse files
authored
Merge branch 'master' into mkirova/fix-8076
2 parents d387557 + 8fe7bd1 commit 5283bf1

34 files changed

+165
-176
lines changed

CHANGELOG.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ All notable changes for each version of this project will be documented in this
55

66
### General
77
- `IgxInputGroup`
8-
- **Breaking Chage** - Removed `fluent`, `fluent_search`, `bootstrap`, and `indigo` as possible values for the `type` input property.
8+
- **Breaking Change** - Removed `fluent`, `fluent_search`, `bootstrap`, and `indigo` as possible values for the `type` input property.
99
- **Behavioral Change** - The styling of the input group is now dictated by the theme being used. The remaining `types` - `line`, `border`, and `box` will only have effect on the styling when used with the `material` theme. The `search` type will affect styling when used with all themes. Changing the theme at runtime will not change the styling of the input group, a page refresh is required.
10+
- `IgxOverlay`
11+
- **Breaking Change** - `target` property in `PositionSettings` has been deprecated. You can set the attaching target for the component to show in `OverlaySettings` instead.
1012
- `IgxSelect`
1113
- Added `aria-labelledby` property for the items list container(marked as `role="listbox"`). This will ensure the users of assistive technologies will also know what the list items container is used for, upon opening.
1214
- `IgxDatePicker`
1315
- **Breaking Change** - Deprecated the `label` and `labelVisibility` properties.
1416

17+
1518
### New Features
1619
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
1720
- When triggering an export of the grid via the toolbar and the export takes more than 500 milliseconds, the export button becomes disabled and an indeterminate progress bar is shown at the bottom of the toolbar until the export is finished.
@@ -24,7 +27,10 @@ All notable changes for each version of this project will be documented in this
2427
- `IgxTimePicker`
2528
- Added a custom label functionality.
2629
- `IgxCalendar` and `IgxDatePicker` - new `showWeekNumbers` input, that allows showing of the week number at left side of content area.
27-
30+
- `IgxOverlay`
31+
- The `PositionSettings` `target` property has been deprecated and moved to `OverlaySettings`.
32+
- An optional Point/HTML Element parameter `target` has been added to the `position()` method
33+
2834
## 10.1.0
2935

3036
### General

projects/igniteui-angular/src/lib/combo/combo.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1228,7 +1228,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
12281228
*/
12291229
public ngOnInit() {
12301230
this.ngControl = this._injector.get<NgControl>(NgControl, null);
1231-
this._overlaySettings.positionStrategy.settings.target = this.elementRef.nativeElement;
1231+
this._overlaySettings.target = this.elementRef.nativeElement;
12321232
this.selection.set(this.id, new Set());
12331233
this._iconService.addSvgIconFromText(caseSensitiveIcon.name, caseSensitiveIcon.value, 'case-sensitive');
12341234
}

projects/igniteui-angular/src/lib/date-picker/date-picker.component.spec.ts

+3
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,7 @@ describe('IgxDatePicker', () => {
14821482
const datePicker = new IgxDatePickerComponent(overlay, element, cdr, moduleRef, injector);
14831483
datePicker['_inputGroup'] = inputGroup;
14841484
datePicker['_inputDirectiveUserTemplates'] = new QueryList();
1485+
spyOnProperty(datePicker, 'inputGroupElement').and.returnValue(null);
14851486
ngModel.control.validator = () => ({ required: true });
14861487
datePicker.ngOnInit();
14871488
datePicker.ngAfterViewInit();
@@ -1495,6 +1496,7 @@ describe('IgxDatePicker', () => {
14951496
const datePicker = new IgxDatePickerComponent(overlay, element, cdr, moduleRef, injector);
14961497
datePicker['_inputGroupUserTemplate'] = inputGroup;
14971498
datePicker['_inputDirectiveUserTemplates'] = new QueryList();
1499+
spyOnProperty(datePicker, 'inputGroupElement').and.returnValue(null);
14981500
ngModel.control.validator = () => ({ required: true });
14991501
datePicker.ngOnInit();
15001502
datePicker.ngAfterViewInit();
@@ -1508,6 +1510,7 @@ describe('IgxDatePicker', () => {
15081510
const datePicker = new IgxDatePickerComponent(overlay, element, cdr, moduleRef, injector);
15091511
datePicker['_inputGroup'] = inputGroup;
15101512
datePicker['_inputDirectiveUserTemplates'] = new QueryList();
1513+
spyOnProperty(datePicker, 'inputGroupElement').and.returnValue(null);
15111514
datePicker.ngOnInit();
15121515
datePicker.ngAfterViewInit();
15131516
datePicker.ngAfterViewChecked();

projects/igniteui-angular/src/lib/date-picker/date-picker.component.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -841,6 +841,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
841841
};
842842

843843
this._defaultDropDownOverlaySettings = {
844+
target: this.inputGroupElement,
844845
closeOnOutsideClick: true,
845846
modal: false,
846847
scrollStrategy: new AbsoluteScrollStrategy(),
@@ -1050,7 +1051,7 @@ export class IgxDatePickerComponent implements IDatePicker, ControlValueAccessor
10501051
this.hasHeader = false;
10511052
const target = this.inputGroupElement;
10521053
if (target) {
1053-
this.dropDownOverlaySettings.positionStrategy.settings.target = target;
1054+
this.dropDownOverlaySettings.target = target;
10541055
}
10551056
this._componentID = this._overlayService.attach(IgxCalendarContainerComponent,
10561057
this.dropDownOverlaySettings, this._moduleRef);

projects/igniteui-angular/src/lib/date-range-picker/date-range-picker.component.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -927,10 +927,10 @@ export class IgxDateRangePickerComponent extends DisplayDensityBase
927927
private configPositionStrategy(): void {
928928
this._positionSettings = {
929929
openAnimation: fadeIn,
930-
closeAnimation: fadeOut,
931-
target: this.element.nativeElement
930+
closeAnimation: fadeOut
932931
};
933932
this._dropDownOverlaySettings.positionStrategy = new AutoPositionStrategy(this._positionSettings);
933+
this.dropdownOverlaySettings.target = this.element.nativeElement;
934934
}
935935

936936
private configOverlaySettings(): void {

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

+5-3
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ export class IgxAutocompleteDirective extends IgxDropDownItemNavigationDirective
8888
private destroy$ = new Subject();
8989

9090
private defaultSettings: OverlaySettings = {
91+
target: this.parentElement,
9192
modal: false,
9293
scrollStrategy: new AbsoluteScrollStrategy(),
93-
positionStrategy: new AutoPositionStrategy({ target: this.parentElement }),
94+
positionStrategy: new AutoPositionStrategy(),
9495
excludePositionTarget: true
9596
};
9697

@@ -111,9 +112,10 @@ export class IgxAutocompleteDirective extends IgxDropDownItemNavigationDirective
111112

112113
private get settings(): OverlaySettings {
113114
const settings = Object.assign({}, this.defaultSettings, this.autocompleteSettings);
114-
if (!settings.positionStrategy.settings.target) {
115+
const target = settings.target || settings.positionStrategy.settings.target;
116+
if (!target) {
115117
const positionStrategyClone: IPositionStrategy = settings.positionStrategy.clone();
116-
positionStrategyClone.settings.target = this.parentElement;
118+
settings.target = this.parentElement;
117119
settings.positionStrategy = positionStrategyClone;
118120
}
119121
return settings;

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

+7-9
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,10 @@ describe('IgxToggle', () => {
470470
const fixture = TestBed.createComponent(IgxToggleActionTestComponent);
471471
fixture.detectChanges();
472472
spyOn(IgxToggleDirective.prototype, 'toggle');
473+
const button = fixture.debugElement.query(By.directive(IgxToggleActionDirective)).nativeElement;
473474

474475
const defaults: OverlaySettings = {
476+
target: button,
475477
positionStrategy: jasmine.any(ConnectedPositioningStrategy) as any,
476478
closeOnOutsideClick: true,
477479
modal: false,
@@ -493,8 +495,10 @@ describe('IgxToggle', () => {
493495
const fixture = TestBed.createComponent(IgxToggleActionTestComponent);
494496
fixture.detectChanges();
495497
spyOn(IgxToggleDirective.prototype, 'toggle');
498+
const button = fixture.debugElement.query(By.directive(IgxToggleActionDirective)).nativeElement;
496499

497500
const settings: OverlaySettings = {
501+
target: button,
498502
positionStrategy: jasmine.any(ConnectedPositioningStrategy) as any,
499503
closeOnOutsideClick: true,
500504
modal: false,
@@ -540,16 +544,8 @@ describe('IgxToggle', () => {
540544
fixture.detectChanges();
541545

542546
fixture.componentInstance.toggleAction.onClick();
547+
settings.target = button;
543548
expect(toggleSpy).toHaveBeenCalledWith(settings);
544-
let positionStrategy = toggleSpy.calls.mostRecent().args[0].positionStrategy as IPositionStrategy;
545-
expect(positionStrategy.settings.target).toBe(button);
546-
547-
fixture.componentInstance.settings.positionStrategy = new ConnectedPositioningStrategy({ target: document.body });
548-
fixture.detectChanges();
549-
550-
fixture.componentInstance.toggleAction.onClick();
551-
positionStrategy = toggleSpy.calls.mostRecent().args[0].positionStrategy as IPositionStrategy;
552-
expect(positionStrategy.settings.target).toBe(button);
553549
});
554550

555551
it('Should fire toggle "onClosing" event when closing through closeOnOutsideClick', fakeAsync(() => {
@@ -585,9 +581,11 @@ describe('IgxToggle', () => {
585581
const fixture = TestBed.createComponent(IgxToggleOutletComponent);
586582
const outlet = fixture.debugElement.query(By.css('.outlet-container')).nativeElement;
587583
const toggleSpy = spyOn(IgxToggleDirective.prototype, 'toggle');
584+
const button = fixture.debugElement.query(By.directive(IgxToggleActionDirective)).nativeElement;
588585
fixture.detectChanges();
589586

590587
const settings: OverlaySettings = {
588+
target: button,
591589
positionStrategy: jasmine.any(ConnectedPositioningStrategy) as any,
592590
closeOnOutsideClick: true,
593591
modal: false,

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,8 @@ export class IgxToggleActionDirective implements OnInit {
425425
*/
426426
public ngOnInit() {
427427
this._overlayDefaults = {
428-
positionStrategy: new ConnectedPositioningStrategy({ target: this.element.nativeElement }),
428+
target: this.element.nativeElement,
429+
positionStrategy: new ConnectedPositioningStrategy(),
429430
scrollStrategy: new AbsoluteScrollStrategy(),
430431
closeOnOutsideClick: true,
431432
modal: false,
@@ -455,7 +456,7 @@ export class IgxToggleActionDirective implements OnInit {
455456
protected updateOverlaySettings(settings: OverlaySettings): OverlaySettings {
456457
if (settings && settings.positionStrategy) {
457458
const positionStrategyClone: IPositionStrategy = settings.positionStrategy.clone();
458-
positionStrategyClone.settings.target = this.element.nativeElement;
459+
settings.target = this.element.nativeElement;
459460
settings.positionStrategy = positionStrategyClone;
460461
}
461462

projects/igniteui-angular/src/lib/directives/tooltip/tooltip.directive.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ describe('IgxTooltip', () => {
215215

216216
// Use custom overlaySettings.
217217
tooltipTarget.overlaySettings = /*<OverlaySettings>*/ {
218+
target: tooltipTarget.nativeElement,
218219
positionStrategy: new AutoPositionStrategy({
219-
target: tooltipTarget.nativeElement,
220220
horizontalStartPoint: HorizontalAlignment.Right,
221221
verticalStartPoint: VerticalAlignment.Bottom,
222222
horizontalDirection: HorizontalAlignment.Right,

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

-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ export class IgxTooltipTargetDirective extends IgxToggleActionDirective implemen
191191
super.ngOnInit();
192192

193193
const positionSettings: PositionSettings = {
194-
target: this.nativeElement,
195194
horizontalDirection: HorizontalAlignment.Center,
196195
horizontalStartPoint: HorizontalAlignment.Center,
197196
openAnimation: useAnimation(scaleInCenter, { params: { duration: '150ms' } }),

projects/igniteui-angular/src/lib/grids/filtering/advanced-filtering/advanced-filtering-dialog.component.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -657,8 +657,10 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
657657

658658
this.cdr.detectChanges();
659659

660-
this.columnSelectOverlaySettings.positionStrategy = new AutoPositionStrategy({ target: this.columnSelect.element });
661-
this.conditionSelectOverlaySettings.positionStrategy = new AutoPositionStrategy({ target: this.conditionSelect.element });
660+
this.columnSelectOverlaySettings.target = this.columnSelect.element;
661+
this.columnSelectOverlaySettings.positionStrategy = new AutoPositionStrategy();
662+
this.conditionSelectOverlaySettings.target = this.conditionSelect.element;
663+
this.conditionSelectOverlaySettings.positionStrategy = new AutoPositionStrategy();
662664

663665
if (!this.selectedColumn) {
664666
this.columnSelect.input.nativeElement.focus();
@@ -920,7 +922,7 @@ export class IgxAdvancedFilteringDialogComponent implements AfterViewInit, OnDes
920922
Math.max(r, c.elementRef.nativeElement.getBoundingClientRect().right), 0);
921923
maxRight = Math.max(maxRight, containerRect.left);
922924
maxRight = Math.min(maxRight, containerRect.right);
923-
this._overlaySettings.positionStrategy.settings.target = new Point(maxRight, minTop);
925+
this._overlaySettings.target = new Point(maxRight, minTop);
924926
}
925927

926928
private scrollElementIntoView(target: HTMLElement) {

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -489,15 +489,15 @@ export class IgxGridFilteringRowComponent implements AfterViewInit {
489489
* Opens the conditions dropdown.
490490
*/
491491
public toggleConditionsDropDown(target: any) {
492-
this._conditionsOverlaySettings.positionStrategy.settings.target = target;
492+
this._conditionsOverlaySettings.target = target;
493493
this.dropDownConditions.toggle(this._conditionsOverlaySettings);
494494
}
495495

496496
/**
497497
* Opens the logic operators dropdown.
498498
*/
499499
public toggleOperatorsDropDown(eventArgs, index) {
500-
this._operatorsOverlaySettings.positionStrategy.settings.target = eventArgs.target.parentElement;
500+
this._operatorsOverlaySettings.target = eventArgs.target.parentElement;
501501
this.dropDownOperators.toArray()[index].toggle(this._operatorsOverlaySettings);
502502
}
503503

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-conditional-filter.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ export class IgxExcelStyleConditionalFilterComponent implements OnDestroy {
7777
*/
7878
public onTextFilterClick(eventArgs) {
7979
if (this.shouldOpenSubMenu) {
80-
this._subMenuOverlaySettings.positionStrategy.settings.target = eventArgs.currentTarget;
80+
this._subMenuOverlaySettings.target = eventArgs.currentTarget;
8181

8282
const gridRect = this.esf.grid.nativeElement.getBoundingClientRect();
8383
const dropdownRect = this.esf.mainDropdown.nativeElement.getBoundingClientRect();

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-custom-dialog.component.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class IgxExcelStyleCustomDialogComponent implements AfterViewInit {
130130
}
131131

132132
public open(esf) {
133-
this._customDialogOverlaySettings.positionStrategy.settings.target =
133+
this._customDialogOverlaySettings.target =
134134
this.overlayComponentId ?
135135
this.grid.rootGrid ? this.grid.rootGrid.nativeElement : this.grid.nativeElement :
136136
esf;

projects/igniteui-angular/src/lib/grids/filtering/excel-style/excel-style-default-expression.component.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ export class IgxExcelStyleDefaultExpressionComponent implements AfterViewInit {
117117

118118
ngAfterViewInit(): void {
119119
this.dropDownOverlaySettings.outlet = this.overlayOutlet;
120-
this.dropDownOverlaySettings.positionStrategy = new ConnectedPositioningStrategy({
121-
target : this.dropdownConditions.inputGroup.element.nativeElement
122-
});
120+
this.dropDownOverlaySettings.target = this.dropdownConditions.inputGroup.element.nativeElement;
121+
this.dropDownOverlaySettings.positionStrategy = new ConnectedPositioningStrategy();
123122
}
124123

125124
public focus() {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export class IgxFilteringService implements OnDestroy {
7474
const filterIcon = this.column.filteringExpressionsTree ? 'igx-excel-filter__icon--filtered' : 'igx-excel-filter__icon';
7575
const filterIconTarget = element.querySelector('.' + filterIcon);
7676

77-
this._filterMenuOverlaySettings.positionStrategy.settings.target = filterIconTarget;
77+
this._filterMenuOverlaySettings.target = filterIconTarget;
7878
this._filterMenuOverlaySettings.outlet = (this.grid as any).outlet;
7979

8080
if (this.grid.excelStyleFilteringComponent) {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -2685,7 +2685,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
26852685
closeAnimation: null
26862686
});
26872687

2688-
private rowEditSettings = {
2688+
private rowEditSettings: OverlaySettings = {
26892689
scrollStrategy: new AbsoluteScrollStrategy(),
26902690
modal: false,
26912691
closeOnOutsideClick: false,
@@ -6332,7 +6332,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
63326332
if (!targetRow) {
63336333
return;
63346334
}
6335-
this.rowEditPositioningStrategy.settings.target = targetRow.element.nativeElement;
6335+
this.rowEditSettings.target = targetRow.element.nativeElement;
63366336
this.toggleRowEditingOverlay(true);
63376337
}
63386338

@@ -6562,7 +6562,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
65626562
*/
65636563
public openAdvancedFilteringDialog() {
65646564
if (!this._advancedFilteringOverlayId) {
6565-
this._advancedFilteringOverlaySettings.positionStrategy.settings.target =
6565+
this._advancedFilteringOverlaySettings.target =
65666566
(this as any).rootGrid ? (this as any).rootGrid.nativeElement : this.nativeElement;
65676567
this._advancedFilteringOverlaySettings.outlet = this.outlet;
65686568

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

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Directive } from '@angular/core';
22
import { ConnectedPositioningStrategy } from '../services/public_api';
3-
import { VerticalAlignment, PositionSettings } from '../services/overlay/utilities';
3+
import { VerticalAlignment, PositionSettings, Point } from '../services/overlay/utilities';
44
import { scaleInVerBottom, scaleInVerTop } from '../animations/main';
55
import { IgxForOfSyncService } from '../directives/for-of/for_of.sync.service';
66
import { ColumnPinningPosition, RowPinningPosition } from './common/enums';
@@ -35,9 +35,10 @@ export class RowEditPositionStrategy extends ConnectedPositioningStrategy {
3535
isTop = false;
3636
isTopInitialPosition = null;
3737
public settings: RowEditPositionSettings;
38-
position(contentElement: HTMLElement, size: { width: number, height: number }, document?: Document, initialCall?: boolean): void {
38+
position(contentElement: HTMLElement, size: { width: number, height: number }, document?: Document, initialCall?: boolean,
39+
target?: Point | HTMLElement): void {
3940
const container = this.settings.container; // grid.tbody
40-
const target = <HTMLElement>this.settings.target; // current grid.row
41+
const targetElement = <HTMLElement>target || <HTMLElement>this.settings.target; // current grid.row
4142

4243
// Position of the overlay depends on the available space in the grid.
4344
// If the bottom space is not enough then the the row overlay will show at the top of the row.
@@ -46,13 +47,14 @@ export class RowEditPositionStrategy extends ConnectedPositioningStrategy {
4647
this.isTop = this.isTopInitialPosition !== null ?
4748
this.isTopInitialPosition :
4849
container.getBoundingClientRect().bottom <
49-
target.getBoundingClientRect().bottom + contentElement.getBoundingClientRect().height;
50+
targetElement.getBoundingClientRect().bottom + contentElement.getBoundingClientRect().height;
5051

5152
// Set width of the row editing overlay to equal row width, otherwise it fits 100% of the grid.
52-
contentElement.style.width = target.clientWidth + 'px';
53+
contentElement.style.width = targetElement.clientWidth + 'px';
5354
this.settings.verticalStartPoint = this.settings.verticalDirection = this.isTop ? VerticalAlignment.Top : VerticalAlignment.Bottom;
5455
this.settings.openAnimation = this.isTop ? scaleInVerBottom : scaleInVerTop;
5556

56-
super.position(contentElement, { width: target.clientWidth, height: target.clientHeight }, document, initialCall);
57+
super.position(contentElement, { width: targetElement.clientWidth, height: targetElement.clientHeight },
58+
document, initialCall, targetElement);
5759
}
5860
}

0 commit comments

Comments
 (0)