global-context/features/time-context/interval-picker/interval-picker.component.ts
| changeDetection | ChangeDetectionStrategy.OnPush |
||||||||||
| providers |
)
|
||||||||||
| selector | c8y-interval-picker |
||||||||||
| standalone | true |
||||||||||
| imports |
A11yModule
BsDropdownModule
PopoverModule
C8yTranslatePipe
|
||||||||||
| templateVariables |
|
||||||||||
| templateUrl | ./interval-picker.component.html |
No results matching.
CommonModule
FormsModule
A11yModule
ReactiveFormsModule
BsDropdownModule
IconDirective
PopoverModule
C8yTranslatePipe
)
ControlValueAccessor
@for (interval of INTERVALS; track interval.id) {
@let isSelected = interval.id === value;
@let checkVisibility = isSelected ? 'visible' : 'hidden';
@let isIntervalDisabled = shouldDisableInterval?.isDisabled;
@let isIntervalDisabledMsg = shouldDisableInterval?.msg;
@let isCustom = interval.id === 'custom';
<li [class.active]="isSelected">
<div
[ngStyle]="{
display: 'flex',
flexDirection: 'row',
alignItems: 'center'
}"
>
<button
class="mr-2"
type="button"
[attr.data-cy]="'global-context--interval-' + interval.id"
(click)="onIntervalSelect(interval.id)"
[disabled]="isCustom && isIntervalDisabled"
>
<span [class.text-primary]="isSelected">
<span
[c8yIcon]="'check'"
[style.visibility]="checkVisibility"
></span>
{{ interval.title | translate }}
</span>
</button>
</div>
</li>
}