UNPKG

novo-elements

Version:

Bullhorn's NOVO Element Repository for Angular 2

38 lines (31 loc) 1.38 kB
import { Component, Input, Output, EventEmitter, TemplateRef } from '@angular/core'; import { WeekViewEvent } from '../../../utils/calendar-utils/CalendarUtils'; @Component({ selector: 'novo-calendar-week-event', template: ` <ng-template #defaultTemplate> <div class="cal-event" [class.cal-starts-within-week]="!weekEvent.startsBeforeWeek" [class.cal-ends-within-week]="!weekEvent.endsAfterWeek" [ngClass]="weekEvent.event?.cssClass" [tooltip]="weekEvent.event.description" [tooltipPosition]="tooltipPosition" (click)="eventClicked.emit({event: weekEvent.event})"> <div class="cal-event-ribbon" [style.backgroundColor]="weekEvent.event.color.primary"></div> <div class="cal-event-title">{{weekEvent.event?.title}}</div> <div class="cal-event-description">{{weekEvent.event?.description}}</div> </div> </ng-template> <ng-template [ngTemplateOutlet]="customTemplate || defaultTemplate" [ngOutletContext]="{weekEvent: weekEvent, tooltipPosition: tooltipPosition, eventClicked: eventClicked}"> </ng-template> ` }) export class NovoCalendarWeekEventElement { @Input() weekEvent: WeekViewEvent; @Input() tooltipPosition: string; @Input() customTemplate: TemplateRef<any>; @Output() eventClicked: EventEmitter<any> = new EventEmitter(); }