UNPKG

3.98 kBTypeScriptView Raw
1import { EventEmitter, TemplateRef } from '@angular/core';
2import { CalendarEvent } from 'calendar-utils';
3import { Subject } from 'rxjs';
4import { CalendarEventTimesChangedEvent } from '../common/calendar-event-times-changed-event.interface';
5import { PlacementArray } from 'positioning';
6import { CalendarWeekViewBeforeRenderEvent } from '../week/calendar-week.module';
7export declare type CalendarDayViewBeforeRenderEvent = CalendarWeekViewBeforeRenderEvent;
8/**
9 * Shows all events on a given day. Example usage:
10 *
11 * ```typescript
12 * <mwl-calendar-day-view
13 * [viewDate]="viewDate"
14 * [events]="events">
15 * </mwl-calendar-day-view>
16 * ```
17 */
18export declare class CalendarDayViewComponent {
19 /**
20 * The current view date
21 */
22 viewDate: Date;
23 /**
24 * An array of events to display on view
25 * The schema is available here: https://github.com/mattlewis92/calendar-utils/blob/c51689985f59a271940e30bc4e2c4e1fee3fcb5c/src/calendarUtils.ts#L49-L63
26 */
27 events: CalendarEvent[];
28 /**
29 * The number of segments in an hour. Must divide equally into 60.
30 */
31 hourSegments: number;
32 /**
33 * The height in pixels of each hour segment
34 */
35 hourSegmentHeight: number;
36 /**
37 * The day start hours in 24 hour time. Must be 0-23
38 */
39 dayStartHour: number;
40 /**
41 * The day start minutes. Must be 0-59
42 */
43 dayStartMinute: number;
44 /**
45 * The day end hours in 24 hour time. Must be 0-23
46 */
47 dayEndHour: number;
48 /**
49 * The day end minutes. Must be 0-59
50 */
51 dayEndMinute: number;
52 /**
53 * An observable that when emitted on will re-render the current view
54 */
55 refresh: Subject<any>;
56 /**
57 * The locale used to format dates
58 */
59 locale: string;
60 /**
61 * The grid size to snap resizing and dragging of events to
62 */
63 eventSnapSize: number;
64 /**
65 * The placement of the event tooltip
66 */
67 tooltipPlacement: PlacementArray;
68 /**
69 * A custom template to use for the event tooltips
70 */
71 tooltipTemplate: TemplateRef<any>;
72 /**
73 * Whether to append tooltips to the body or next to the trigger element
74 */
75 tooltipAppendToBody: boolean;
76 /**
77 * The delay in milliseconds before the tooltip should be displayed. If not provided the tooltip
78 * will be displayed immediately.
79 */
80 tooltipDelay: number | null;
81 /**
82 * A custom template to use to replace the hour segment
83 */
84 hourSegmentTemplate: TemplateRef<any>;
85 /**
86 * A custom template to use for day view events
87 */
88 eventTemplate: TemplateRef<any>;
89 /**
90 * A custom template to use for event titles
91 */
92 eventTitleTemplate: TemplateRef<any>;
93 /**
94 * A custom template to use for event actions
95 */
96 eventActionsTemplate: TemplateRef<any>;
97 /**
98 * Whether to snap events to a grid when dragging
99 */
100 snapDraggedEvents: boolean;
101 /**
102 * A custom template to use for the all day events label text
103 */
104 allDayEventsLabelTemplate: TemplateRef<any>;
105 /**
106 * A custom template to use for the current time marker
107 */
108 currentTimeMarkerTemplate: TemplateRef<any>;
109 /**
110 * Called when an event title is clicked
111 */
112 eventClicked: EventEmitter<{
113 event: CalendarEvent<any>;
114 sourceEvent: any;
115 }>;
116 /**
117 * Called when an hour segment is clicked
118 */
119 hourSegmentClicked: EventEmitter<{
120 date: Date;
121 sourceEvent: MouseEvent;
122 }>;
123 /**
124 * Called when an event is resized or dragged and dropped
125 */
126 eventTimesChanged: EventEmitter<CalendarEventTimesChangedEvent<any>>;
127 /**
128 * An output that will be called before the view is rendered for the current day.
129 * If you add the `cssClass` property to an hour grid segment it will add that class to the hour segment in the template
130 */
131 beforeViewRender: EventEmitter<CalendarWeekViewBeforeRenderEvent>;
132}