novo-elements
Version:
Bullhorn's NOVO Element Repository for Angular 2
38 lines (31 loc) • 1.38 kB
text/typescript
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
<div
class="cal-event"
[]="!weekEvent.startsBeforeWeek"
[]="!weekEvent.endsAfterWeek"
[]="weekEvent.event?.cssClass"
[]="weekEvent.event.description"
[]="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
[]="customTemplate || defaultTemplate"
[]="{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();
}