1- import { ChangeDetectionStrategy , Component , EventEmitter , NgZone , Output } from '@angular/core' ;
1+ import { ChangeDetectionStrategy , Component , EventEmitter , Input , NgZone , Output } from '@angular/core' ;
22import { IconType } from '@hypertrace/assets-library' ;
33import {
44 FixedTimeRange ,
@@ -12,6 +12,7 @@ import { concat, EMPTY, interval, Observable, of, timer } from 'rxjs';
1212import { map , startWith } from 'rxjs/operators' ;
1313import { ButtonRole , ButtonSize } from '../button/button' ;
1414import { IconSize } from '../icon/icon-size' ;
15+ import { PopoverRelativePositionLocation } from '../popover/popover' ;
1516import { PopoverRef } from '../popover/popover-ref' ;
1617
1718@Component ( {
@@ -21,7 +22,11 @@ import { PopoverRef } from '../popover/popover-ref';
2122 template : `
2223 <div class="time-range" *ngIf="this.timeRange$ | async as timeRange">
2324 <div class="time-range-selector">
24- <ht-popover (popoverOpen)="this.onPopoverOpen($event)" [closeOnNavigate]="false">
25+ <ht-popover
26+ (popoverOpen)="this.onPopoverOpen($event)"
27+ [closeOnNavigate]="false"
28+ [locationPreferences]="this.dropdownLocationPreference"
29+ >
2530 <ht-popover-trigger>
2631 <div class="trigger">
2732 <ht-icon class="trigger-icon" icon="${ IconType . Calendar } " size="${ IconSize . Medium } "></ht-icon>
@@ -67,6 +72,14 @@ import { PopoverRef } from '../popover/popover-ref';
6772 `
6873} )
6974export class TimeRangeComponent {
75+ @Input ( )
76+ public dropdownLocationPreference : PopoverRelativePositionLocation [ ] = [
77+ PopoverRelativePositionLocation . BelowLeftAligned ,
78+ PopoverRelativePositionLocation . BelowRightAligned ,
79+ PopoverRelativePositionLocation . AboveLeftAligned ,
80+ PopoverRelativePositionLocation . AboveRightAligned
81+ ] ;
82+
7083 public timeRange$ : Observable < TimeRange > = this . timeRangeService . getTimeRangeAndChanges ( ) ;
7184
7285 private popoverRef : PopoverRef | undefined ;
0 commit comments