Skip to content

Commit eebb3f9

Browse files
wnvkodamyanpetev
andauthored
refactor(overlay): stop moving to body container & deprecate outlet (#16989)
Co-authored-by: Damyan Petev <damyanpetev@users.noreply.github.com>
1 parent e16eeed commit eebb3f9

File tree

46 files changed

+1346
-900
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1346
-900
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,21 @@ All notable changes for each version of this project will be documented in this
66

77
### New Features
88

9+
- `IgxOverlayService`
10+
- `IgxOverlayService.createAbsoluteOverlaySettings` - Added a new overload accepting `useContainerStrategy?: boolean` as the second parameter. When `true`, uses `ContainerPositionStrategy`; otherwise defaults to `GlobalPositionStrategy`. The previous overload accepting `outlet?: IgxOverlayOutletDirective | ElementRef` is still supported but deprecated.
11+
12+
- `IgxSnackbarComponent`, `IgxToastComponent`
13+
- Added a new `positioning` input property. When set to `container`, the components is displayed inside its nearest positioned ancestor in place of the now deprecated `outlet` property .
14+
915
- `IgxCombo`, `IgxSimpleCombo`
1016
- Introduced the `selectionChanged` event for both components. The event is not cancelable and is emitted after the selection is committed and the component state is updated.
1117
- Added `disableClear` input that allows hiding the clear button even when items are selected. Defaults to `false`.
1218

19+
### General
20+
21+
- `IgxOverlayService`
22+
- **Deprecation** - The `outlet` property in `OverlaySettings`, `IgxOverlayOutletDirective`, and `igxToggleOutlet` input on `IgxToggleActionDirective` are deprecated and will be removed in a future version. As overlay service now integrates the HTML Popover API and prefers rendering content in place / in the top layer, significantly reducing the need for outlet containers, new code should rely on the default in-place / top-layer rendering behavior instead of custom outlet containers.
23+
1324
## 21.1.3
1425

1526
### Security Fixes

projects/igniteui-angular/calendar/src/calendar/calendar-multi-view.component.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ describe('Multi-View Calendar - ', () => {
10451045
tick(400);
10461046
fixture.detectChanges();
10471047

1048-
let overlay = document.querySelector(HelperTestFunctions.OVERLAY_CSSCLASS);
1048+
let overlay = document.querySelector(HelperTestFunctions.CALENDAR_WRAPPER_CLASS);
10491049
HelperTestFunctions.verifyMonthsViewNumber(overlay, 3);
10501050
HelperTestFunctions.verifyCalendarSubHeaders(overlay, [ymd('2019-09-16'), ymd('2019-10-16'), ymd('2019-11-16')]);
10511051

@@ -1064,7 +1064,7 @@ describe('Multi-View Calendar - ', () => {
10641064
tick(400);
10651065
fixture.detectChanges();
10661066

1067-
overlay = document.querySelector(HelperTestFunctions.OVERLAY_CSSCLASS);
1067+
overlay = document.querySelector(HelperTestFunctions.CALENDAR_WRAPPER_CLASS);
10681068
HelperTestFunctions.verifyMonthsViewNumber(overlay, 2);
10691069
HelperTestFunctions.verifyCalendarSubHeaders(overlay, [ymd('2019-09-16'), ymd('2019-10-16')]);
10701070

@@ -1079,7 +1079,7 @@ describe('Multi-View Calendar - ', () => {
10791079
fixture.detectChanges();
10801080

10811081
expect(datePicker.hideOutsideDays).toBe(true);
1082-
let overlay = document.querySelector(HelperTestFunctions.OVERLAY_CSSCLASS);
1082+
let overlay = document.querySelector(HelperTestFunctions.CALENDAR_WRAPPER_CLASS);
10831083
expect(HelperTestFunctions.getHiddenDays(overlay, 0).length).toBe(HelperTestFunctions.getInactiveDays(overlay, 0).length);
10841084
expect(HelperTestFunctions.getHiddenDays(overlay, 1).length).toBe(HelperTestFunctions.getInactiveDays(overlay, 1).length);
10851085
expect(HelperTestFunctions.getHiddenDays(overlay, 2).length).toBe(HelperTestFunctions.getInactiveDays(overlay, 2).length);
@@ -1098,7 +1098,7 @@ describe('Multi-View Calendar - ', () => {
10981098
fixture.detectChanges();
10991099

11001100
expect(datePicker.hideOutsideDays).toBe(false);
1101-
overlay = document.querySelector(HelperTestFunctions.OVERLAY_CSSCLASS);
1101+
overlay = document.querySelector(HelperTestFunctions.CALENDAR_WRAPPER_CLASS);
11021102
expect(HelperTestFunctions.getHiddenDays(overlay, 0).length).toBe(12);
11031103
expect(HelperTestFunctions.getHiddenDays(overlay, 1).length).toBe(11);
11041104
expect(HelperTestFunctions.getHiddenDays(overlay, 2).length).toBe(5);

projects/igniteui-angular/core/src/services/overlay/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,12 @@ this.overlay.show(component, overlaySettings);
7373

7474
| Name | Type | Description |
7575
| :--- | :--- | :---------- |
76-
| target | Point | HTMLElement | Attaching target for the component to show |
76+
| target | Point | HTMLElement | Attaching target for the component to show. |
7777
| positionStrategy | IPositionStrategy | Position strategy to use with this settings |
7878
| scrollStrategy | IScrollStrategy | Scroll strategy to use with this settings |
7979
| modal | boolean | Set if the overlay should be in modal mode |
8080
| closeOnOutsideClick | boolean | Set if the overlay should closed on outside click |
81-
| outlet | IgxOverlayOutletDirective or ElementRef | Set the outlet container to attach the overlay to |
81+
| outlet | IgxOverlayOutletDirective or ElementRef | **Deprecated.** Set the outlet container to attach the overlay to |
8282

8383
###### PositionSettings
8484

@@ -135,8 +135,8 @@ this.overlay.show(component, overlaySettings);
135135
| Name | Description | Parameters |
136136
|-----------------|---------------------------------------------------------------------------------|------------|
137137
|getPointFromPositionsSettings| Calculates the point from which the overlay should start showing |settings |
138-
|createAbsoluteOverlaySettings| Creates overlay settings with global or container position strategy based on a preset position settings |position?, outlet?|
139-
|createRelativeOverlaySettings| Creates overlay settings with auto, connected or elastic position strategy based on a preset position settings |target, strategy?, position?|
138+
|createAbsoluteOverlaySettings| Creates overlay settings with global or container position strategy based on a preset position settings |position?, useContainerStrategy?|
139+
|createRelativeOverlaySettings| Creates overlay settings with auto, connected or elastic position strategy based on a preset position settings |target, strategy?, position?|
140140

141141

142142
##### Events

0 commit comments

Comments
 (0)