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

Lines changed: 8 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 0 deletions
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

Lines changed: 2 additions & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 5 additions & 3 deletions
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

Lines changed: 7 additions & 9 deletions
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

Lines changed: 3 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 0 additions & 1 deletion
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' } }),

0 commit comments

Comments
 (0)