1
- import { ChangeDetectionStrategy , Component , EventEmitter , NgZone , Output } from '@angular/core' ;
1
+ import { ChangeDetectionStrategy , Component , EventEmitter , Input , NgZone , Output } from '@angular/core' ;
2
2
import { IconType } from '@hypertrace/assets-library' ;
3
3
import {
4
4
FixedTimeRange ,
@@ -12,6 +12,7 @@ import { concat, EMPTY, interval, Observable, of, timer } from 'rxjs';
12
12
import { map , startWith } from 'rxjs/operators' ;
13
13
import { ButtonRole , ButtonSize } from '../button/button' ;
14
14
import { IconSize } from '../icon/icon-size' ;
15
+ import { PopoverRelativePositionLocation } from '../popover/popover' ;
15
16
import { PopoverRef } from '../popover/popover-ref' ;
16
17
17
18
@Component ( {
@@ -21,7 +22,11 @@ import { PopoverRef } from '../popover/popover-ref';
21
22
template : `
22
23
<div class="time-range" *ngIf="this.timeRange$ | async as timeRange">
23
24
<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
+ >
25
30
<ht-popover-trigger>
26
31
<div class="trigger">
27
32
<ht-icon class="trigger-icon" icon="${ IconType . Calendar } " size="${ IconSize . Medium } "></ht-icon>
@@ -67,6 +72,14 @@ import { PopoverRef } from '../popover/popover-ref';
67
72
`
68
73
} )
69
74
export class TimeRangeComponent {
75
+ @Input ( )
76
+ public dropdownLocationPreference : PopoverRelativePositionLocation [ ] = [
77
+ PopoverRelativePositionLocation . BelowLeftAligned ,
78
+ PopoverRelativePositionLocation . BelowRightAligned ,
79
+ PopoverRelativePositionLocation . AboveLeftAligned ,
80
+ PopoverRelativePositionLocation . AboveRightAligned
81
+ ] ;
82
+
70
83
public timeRange$ : Observable < TimeRange > = this . timeRangeService . getTimeRangeAndChanges ( ) ;
71
84
72
85
private popoverRef : PopoverRef | undefined ;
0 commit comments