Skip to content

Commit 572a468

Browse files
chore(*): use switch, reorder imports, update changelog, and fix table format
1 parent a68a410 commit 572a468

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ All notable changes for each version of this project will be documented in this
1414
- Added templatable row dimension headers displayed on the top, above all row headers.
1515
- Replace the `showPivotConfigurationUI` property with `pivotUI` property, adding ability now to enable/disable the configuration UI and/or the new row dimension headers.
1616
- Added `sortable` property for each IPivotDimension.
17+
- `IgxOverlayService`, `IgxToggleDirective`:
18+
- Added an optional `offsetMode` parameter to the `setOffset` method that determines whether to add (by default) or set the offset values using `OffsetMode.Add` and `OffsetMode.Set`.
19+
1720
### Changes
1821
- With the removal of the Display Density token, components now get their default sizes from the theme. Default sizes have changed for most components, with it now being medium (previously large). Here's an exhaustive list of all sizable components and their default sizes by theme:
1922
- `Avatar` - Small (All Themes)
@@ -158,8 +161,6 @@ All notable changes for each version of this project will be documented in this
158161
### General
159162
- `IgxButtonGroup`:
160163
- Reverted cancellable on `selected` and `deselected` events (added in 15.1.24) as it was breaking firing order and related handling.
161-
- `IgxOverlayService`:
162-
- **Breaking Change** The `setOffset` function now directly sets the specified values instead of incrementing them.
163164

164165
## 16.1.4
165166
### New Features

projects/igniteui-angular/src/lib/directives/toggle/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ handlers when the toggle is opened and respectively closed.
5252
| `close` | --- | `void` | Closes the toggle. |
5353
| `toggle` | overlaySettings?: `OverlaySettings` | `void` | Closes the toggle. |
5454
| `reposition` | --- | `void` | Repositions the toggle. |
55-
| `setOffset` | Offsets the content along the corresponding axis by the provided amount with optional offsetMode that determines whether to add (by default) or set the offset values with OffsetMode.Add and OffsetMode.Set. | deltaX, deltaY, offsetMode? |
55+
| `setOffset` | deltaX: `number`, deltaY: `number`, offsetMode?: `OffsetMode` | `void` | Offsets the content along the corresponding axis by the provided amount with optional offsetMode that determines whether to add (by default) or set the offset values with OffsetMode.Add and OffsetMode.Set. |
5656

5757

5858

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import { NoOpScrollStrategy } from './scroll/NoOpScrollStrategy';
3232
import {
3333
AbsolutePosition,
3434
HorizontalAlignment,
35+
OffsetMode,
3536
OverlayAnimationEventArgs,
3637
OverlayCancelableEventArgs,
3738
OverlayClosingEventArgs,
@@ -42,8 +43,7 @@ import {
4243
PositionSettings,
4344
RelativePosition,
4445
RelativePositionStrategy,
45-
VerticalAlignment,
46-
OffsetMode
46+
VerticalAlignment
4747
} from './utilities';
4848
import { fadeIn, fadeOut, IAnimationParams, scaleInHorLeft, scaleInHorRight, scaleInVerBottom, scaleInVerTop, scaleOutHorLeft, scaleOutHorRight, scaleOutVerBottom, scaleOutVerTop, slideInBottom, slideInTop, slideOutBottom, slideOutTop } from 'igniteui-angular/animations';
4949

@@ -507,12 +507,16 @@ export class IgxOverlayService implements OnDestroy {
507507
return;
508508
}
509509

510-
if (offsetMode === OffsetMode.Set) {
511-
info.transformX = deltaX;
512-
info.transformY = deltaY;
513-
} else {
514-
info.transformX += deltaX;
515-
info.transformY += deltaY;
510+
switch (offsetMode) {
511+
case OffsetMode.Set:
512+
info.transformX = deltaX;
513+
info.transformY = deltaY;
514+
break;
515+
case OffsetMode.Add:
516+
default:
517+
info.transformX += deltaX;
518+
info.transformY += deltaY;
519+
break;
516520
}
517521

518522
const transformX = info.transformX;

0 commit comments

Comments
 (0)