angular-calendar
Version:
A calendar component that can display events on a month, week or day view
123 lines (122 loc) • 3.03 kB
TypeScript
import { OnChanges, EventEmitter, ChangeDetectorRef, OnInit, OnDestroy } from '@angular/core';
import { CalendarEvent, DayView, DayViewHour } from 'calendar-utils';
import { Subject } from 'rxjs/Subject';
import { Subscription } from 'rxjs/Subscription';
import { CalendarEventTimesChangedEvent } from '../../interfaces/calendarEventTimesChangedEvent.interface';
/**
* Shows all events on a given day. Example usage:
*
* ```
* <mwl-calendar-day-view
* [viewDate]="viewDate"
* [events]="events">
* </mwl-calendar-day-view>
* ```
*/
export declare class CalendarDayViewComponent implements OnChanges, OnInit, OnDestroy {
private cdr;
/**
* The current view date
*/
viewDate: Date;
/**
* An array of events to display on view
*/
events: CalendarEvent[];
/**
* The number of segments in an hour. Must be <= 6
*/
hourSegments: number;
/**
* The day start hours in 24 hour time. Must be 0-23
*/
dayStartHour: number;
/**
* The day start minutes. Must be 0-59
*/
dayStartMinute: number;
/**
* The day end hours in 24 hour time. Must be 0-23
*/
dayEndHour: number;
/**
* The day end minutes. Must be 0-59
*/
dayEndMinute: number;
/**
* The width in pixels of each event on the view
*/
eventWidth: number;
/**
* An observable that when emitted on will re-render the current view
*/
refresh: Subject<any>;
/**
* The locale used to format dates
*/
locale: string;
/**
* A function that will be called before each hour segment is called. The first argument will contain the hour segment.
* If you add the `cssClass` property to the segment it will add that class to the hour segment in the template
*/
hourSegmentModifier: Function;
/**
* The grid size to snap resizing and dragging of events to
*/
eventSnapSize: number;
/**
* The placement of the event tooltip
*/
tooltipPlacement: string;
/**
* Called when an event title is clicked
*/
eventClicked: EventEmitter<{
event: CalendarEvent;
}>;
/**
* Called when an hour segment is clicked
*/
hourSegmentClicked: EventEmitter<{
date: Date;
}>;
/**
* Called when an event is resized or dragged and dropped
*/
eventTimesChanged: EventEmitter<CalendarEventTimesChangedEvent>;
/**
* @hidden
*/
hours: DayViewHour[];
/**
* @hidden
*/
view: DayView;
/**
* @hidden
*/
width: number;
/**
* @hidden
*/
refreshSubscription: Subscription;
/**
* @hidden
*/
constructor(cdr: ChangeDetectorRef, locale: string);
/**
* @hidden
*/
ngOnInit(): void;
/**
* @hidden
*/
ngOnDestroy(): void;
/**
* @hidden
*/
ngOnChanges(changes: any): void;
private refreshHourGrid();
private refreshView();
private refreshAll();
}