UNPKG

249 kBJavaScriptView Raw
1(function (global, factory) {
2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('positioning'), require('calendar-utils'), require('angular-draggable-droppable'), require('@angular/animations'), require('angular-resizable-element')) :
3 typeof define === 'function' && define.amd ? define('angular-calendar', ['exports', '@angular/core', '@angular/common', 'rxjs', 'rxjs/operators', 'positioning', 'calendar-utils', 'angular-draggable-droppable', '@angular/animations', 'angular-resizable-element'], factory) :
4 (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['angular-calendar'] = {}, global.ng.core, global.ng.common, global.rxjs, global.rxjs.operators, global.positioning, global.calendarUtils, global['angular-draggable-droppable'], global.ng.animations, global['angular-resizable-element']));
5}(this, (function (exports, i0, i1, rxjs, operators, positioning, calendarUtils, i2, animations, i9) { 'use strict';
6
7 function _interopNamespace(e) {
8 if (e && e.__esModule) return e;
9 var n = Object.create(null);
10 if (e) {
11 Object.keys(e).forEach(function (k) {
12 if (k !== 'default') {
13 var d = Object.getOwnPropertyDescriptor(e, k);
14 Object.defineProperty(n, k, d.get ? d : {
15 enumerable: true,
16 get: function () {
17 return e[k];
18 }
19 });
20 }
21 });
22 }
23 n['default'] = e;
24 return Object.freeze(n);
25 }
26
27 var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28 var i1__namespace = /*#__PURE__*/_interopNamespace(i1);
29 var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
30 var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
31
32 var ClickDirective = /** @class */ (function () {
33 function ClickDirective(renderer, elm, document) {
34 this.renderer = renderer;
35 this.elm = elm;
36 this.document = document;
37 this.clickListenerDisabled = false;
38 this.click = new i0.EventEmitter(); // eslint-disable-line
39 this.destroy$ = new rxjs.Subject();
40 }
41 ClickDirective.prototype.ngOnInit = function () {
42 var _this = this;
43 if (!this.clickListenerDisabled) {
44 this.listen()
45 .pipe(operators.takeUntil(this.destroy$))
46 .subscribe(function (event) {
47 event.stopPropagation();
48 _this.click.emit(event);
49 });
50 }
51 };
52 ClickDirective.prototype.ngOnDestroy = function () {
53 this.destroy$.next();
54 };
55 ClickDirective.prototype.listen = function () {
56 var _this = this;
57 return new rxjs.Observable(function (observer) {
58 return _this.renderer.listen(_this.elm.nativeElement, 'click', function (event) {
59 observer.next(event);
60 });
61 });
62 };
63 return ClickDirective;
64 }());
65 ClickDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: ClickDirective, deps: [{ token: i0__namespace.Renderer2 }, { token: i0__namespace.ElementRef }, { token: i1.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Directive });
66 ClickDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: ClickDirective, selector: "[mwlClick]", inputs: { clickListenerDisabled: "clickListenerDisabled" }, outputs: { click: "mwlClick" }, ngImport: i0__namespace });
67 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: ClickDirective, decorators: [{
68 type: i0.Directive,
69 args: [{
70 selector: '[mwlClick]',
71 }]
72 }], ctorParameters: function () {
73 return [{ type: i0__namespace.Renderer2 }, { type: i0__namespace.ElementRef }, { type: undefined, decorators: [{
74 type: i0.Inject,
75 args: [i1.DOCUMENT]
76 }] }];
77 }, propDecorators: { clickListenerDisabled: [{
78 type: i0.Input
79 }], click: [{
80 type: i0.Output,
81 args: ['mwlClick']
82 }] } });
83
84 var KeydownEnterDirective = /** @class */ (function () {
85 function KeydownEnterDirective(host, ngZone, renderer) {
86 this.host = host;
87 this.ngZone = ngZone;
88 this.renderer = renderer;
89 this.keydown = new i0.EventEmitter(); // eslint-disable-line
90 this.keydownListener = null;
91 }
92 KeydownEnterDirective.prototype.ngOnInit = function () {
93 var _this = this;
94 this.ngZone.runOutsideAngular(function () {
95 _this.keydownListener = _this.renderer.listen(_this.host.nativeElement, 'keydown', function (event) {
96 if (event.keyCode === 13 ||
97 event.which === 13 ||
98 event.key === 'Enter') {
99 event.preventDefault();
100 event.stopPropagation();
101 _this.ngZone.run(function () {
102 _this.keydown.emit(event);
103 });
104 }
105 });
106 });
107 };
108 KeydownEnterDirective.prototype.ngOnDestroy = function () {
109 if (this.keydownListener !== null) {
110 this.keydownListener();
111 this.keydownListener = null;
112 }
113 };
114 return KeydownEnterDirective;
115 }());
116 KeydownEnterDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: KeydownEnterDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.NgZone }, { token: i0__namespace.Renderer2 }], target: i0__namespace.ɵɵFactoryTarget.Directive });
117 KeydownEnterDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: KeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: { keydown: "mwlKeydownEnter" }, ngImport: i0__namespace });
118 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: KeydownEnterDirective, decorators: [{
119 type: i0.Directive,
120 args: [{
121 selector: '[mwlKeydownEnter]',
122 }]
123 }], ctorParameters: function () { return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.NgZone }, { type: i0__namespace.Renderer2 }]; }, propDecorators: { keydown: [{
124 type: i0.Output,
125 args: ['mwlKeydownEnter']
126 }] } });
127
128 /**
129 * This class is responsible for adding accessibility to the calendar.
130 * You may override any of its methods via angulars DI to suit your requirements.
131 * For example:
132 *
133 * ```typescript
134 * import { A11yParams, CalendarA11y } from 'angular-calendar';
135 * import { formatDate, I18nPluralPipe } from '@angular/common';
136 * import { Injectable } from '@angular/core';
137 *
138 * // adding your own a11y params
139 * export interface CustomA11yParams extends A11yParams {
140 * isDrSuess?: boolean;
141 * }
142 *
143 * @Injectable()
144 * export class CustomCalendarA11y extends CalendarA11y {
145 * constructor(protected i18nPlural: I18nPluralPipe) {
146 * super(i18nPlural);
147 * }
148 *
149 * // overriding a function
150 * public openDayEventsLandmark({ date, locale, isDrSuess }: CustomA11yParams): string {
151 * if (isDrSuess) {
152 * return `
153 * ${formatDate(date, 'EEEE MMMM d', locale)}
154 * Today you are you! That is truer than true! There is no one alive
155 * who is you-er than you!
156 * `;
157 * }
158 * }
159 * }
160 *
161 * // in your component that uses the calendar
162 * providers: [{
163 * provide: CalendarA11y,
164 * useClass: CustomCalendarA11y
165 * }]
166 * ```
167 */
168 var CalendarA11y = /** @class */ (function () {
169 function CalendarA11y(i18nPlural) {
170 this.i18nPlural = i18nPlural;
171 }
172 /**
173 * Aria label for the badges/date of a cell
174 * @example: `Saturday October 19 1 event click to expand`
175 */
176 CalendarA11y.prototype.monthCell = function (_a) {
177 var day = _a.day, locale = _a.locale;
178 if (day.badgeTotal > 0) {
179 return "\n " + i1.formatDate(day.date, 'EEEE MMMM d', locale) + ",\n " + this.i18nPlural.transform(day.badgeTotal, {
180 '=0': 'No events',
181 '=1': 'One event',
182 other: '# events',
183 }) + ",\n click to expand\n ";
184 }
185 else {
186 return "" + i1.formatDate(day.date, 'EEEE MMMM d', locale);
187 }
188 };
189 /**
190 * Aria label for the open day events start landmark
191 * @example: `Saturday October 19 expanded view`
192 */
193 CalendarA11y.prototype.openDayEventsLandmark = function (_a) {
194 var date = _a.date, locale = _a.locale;
195 return "\n Beginning of expanded view for " + i1.formatDate(date, 'EEEE MMMM dd', locale) + "\n ";
196 };
197 /**
198 * Aria label for alert that a day in the month view was expanded
199 * @example: `Saturday October 19 expanded`
200 */
201 CalendarA11y.prototype.openDayEventsAlert = function (_a) {
202 var date = _a.date, locale = _a.locale;
203 return i1.formatDate(date, 'EEEE MMMM dd', locale) + " expanded";
204 };
205 /**
206 * Descriptive aria label for an event
207 * @example: `Saturday October 19th, Scott's Pizza Party, from 11:00am to 5:00pm`
208 */
209 CalendarA11y.prototype.eventDescription = function (_a) {
210 var event = _a.event, locale = _a.locale;
211 if (event.allDay === true) {
212 return this.allDayEventDescription({ event: event, locale: locale });
213 }
214 var aria = "\n " + i1.formatDate(event.start, 'EEEE MMMM dd', locale) + ",\n " + event.title + ", from " + i1.formatDate(event.start, 'hh:mm a', locale) + "\n ";
215 if (event.end) {
216 return aria + (" to " + i1.formatDate(event.end, 'hh:mm a', locale));
217 }
218 return aria;
219 };
220 /**
221 * Descriptive aria label for an all day event
222 * @example:
223 * `Scott's Party, event spans multiple days: start time October 19 5:00pm, no stop time`
224 */
225 CalendarA11y.prototype.allDayEventDescription = function (_a) {
226 var event = _a.event, locale = _a.locale;
227 var aria = "\n " + event.title + ", event spans multiple days:\n start time " + i1.formatDate(event.start, 'MMMM dd hh:mm a', locale) + "\n ";
228 if (event.end) {
229 return (aria + (", stop time " + i1.formatDate(event.end, 'MMMM d hh:mm a', locale)));
230 }
231 return aria + ", no stop time";
232 };
233 /**
234 * Aria label for the calendar event actions icons
235 * @returns 'Edit' for fa-pencil icons, and 'Delete' for fa-times icons
236 */
237 CalendarA11y.prototype.actionButtonLabel = function (_a) {
238 var action = _a.action;
239 return action.a11yLabel;
240 };
241 /**
242 * @returns {number} Tab index to be given to month cells
243 */
244 CalendarA11y.prototype.monthCellTabIndex = function () {
245 return 0;
246 };
247 /**
248 * @returns true if the events inside the month cell should be aria-hidden
249 */
250 CalendarA11y.prototype.hideMonthCellEvents = function () {
251 return true;
252 };
253 /**
254 * @returns true if event titles should be aria-hidden (global)
255 */
256 CalendarA11y.prototype.hideEventTitle = function () {
257 return true;
258 };
259 /**
260 * @returns true if hour segments in the week view should be aria-hidden
261 */
262 CalendarA11y.prototype.hideWeekHourSegment = function () {
263 return true;
264 };
265 /**
266 * @returns true if hour segments in the day view should be aria-hidden
267 */
268 CalendarA11y.prototype.hideDayHourSegment = function () {
269 return true;
270 };
271 return CalendarA11y;
272 }());
273 CalendarA11y.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11y, deps: [{ token: i1__namespace.I18nPluralPipe }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
274 CalendarA11y.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11y });
275 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11y, decorators: [{
276 type: i0.Injectable
277 }], ctorParameters: function () { return [{ type: i1__namespace.I18nPluralPipe }]; } });
278
279 /**
280 * This pipe is primarily for rendering aria labels. Example usage:
281 * ```typescript
282 * // where `myEvent` is a `CalendarEvent` and myLocale is a locale identifier
283 * {{ { event: myEvent, locale: myLocale } | calendarA11y: 'eventDescription' }}
284 * ```
285 */
286 var CalendarA11yPipe = /** @class */ (function () {
287 function CalendarA11yPipe(calendarA11y, locale) {
288 this.calendarA11y = calendarA11y;
289 this.locale = locale;
290 }
291 CalendarA11yPipe.prototype.transform = function (a11yParams, method) {
292 a11yParams.locale = a11yParams.locale || this.locale;
293 if (typeof this.calendarA11y[method] === 'undefined') {
294 var allowedMethods = Object.getOwnPropertyNames(Object.getPrototypeOf(CalendarA11y.prototype)).filter(function (iMethod) { return iMethod !== 'constructor'; });
295 throw new Error(method + " is not a valid a11y method. Can only be one of " + allowedMethods.join(', '));
296 }
297 return this.calendarA11y[method](a11yParams);
298 };
299 return CalendarA11yPipe;
300 }());
301 CalendarA11yPipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11yPipe, deps: [{ token: CalendarA11y }, { token: i0.LOCALE_ID }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
302 CalendarA11yPipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11yPipe, name: "calendarA11y" });
303 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarA11yPipe, decorators: [{
304 type: i0.Pipe,
305 args: [{
306 name: 'calendarA11y',
307 }]
308 }], ctorParameters: function () {
309 return [{ type: CalendarA11y }, { type: undefined, decorators: [{
310 type: i0.Inject,
311 args: [i0.LOCALE_ID]
312 }] }];
313 } });
314
315 var CalendarEventActionsComponent = /** @class */ (function () {
316 function CalendarEventActionsComponent() {
317 this.trackByActionId = function (index, action) { return action.id ? action.id : action; };
318 }
319 return CalendarEventActionsComponent;
320 }());
321 CalendarEventActionsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventActionsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
322 CalendarEventActionsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarEventActionsComponent, selector: "mwl-calendar-event-actions", inputs: { event: "event", customTemplate: "customTemplate" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-event=\"event\"\n let-trackByActionId=\"trackByActionId\"\n >\n <span *ngIf=\"event.actions\" class=\"cal-event-actions\">\n <a\n class=\"cal-event-action\"\n href=\"javascript:;\"\n *ngFor=\"let action of event.actions; trackBy: trackByActionId\"\n (mwlClick)=\"action.onClick({ event: event, sourceEvent: $event })\"\n (mwlKeydownEnter)=\"\n action.onClick({ event: event, sourceEvent: $event })\n \"\n [ngClass]=\"action.cssClass\"\n [innerHtml]=\"action.label\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"\n { action: action } | calendarA11y: 'actionButtonLabel'\n \"\n >\n </a>\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n event: event,\n trackByActionId: trackByActionId\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: KeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: ["mwlKeydownEnter"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarA11y": CalendarA11yPipe } });
323 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventActionsComponent, decorators: [{
324 type: i0.Component,
325 args: [{
326 selector: 'mwl-calendar-event-actions',
327 template: "\n <ng-template\n #defaultTemplate\n let-event=\"event\"\n let-trackByActionId=\"trackByActionId\"\n >\n <span *ngIf=\"event.actions\" class=\"cal-event-actions\">\n <a\n class=\"cal-event-action\"\n href=\"javascript:;\"\n *ngFor=\"let action of event.actions; trackBy: trackByActionId\"\n (mwlClick)=\"action.onClick({ event: event, sourceEvent: $event })\"\n (mwlKeydownEnter)=\"\n action.onClick({ event: event, sourceEvent: $event })\n \"\n [ngClass]=\"action.cssClass\"\n [innerHtml]=\"action.label\"\n tabindex=\"0\"\n role=\"button\"\n [attr.aria-label]=\"\n { action: action } | calendarA11y: 'actionButtonLabel'\n \"\n >\n </a>\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n event: event,\n trackByActionId: trackByActionId\n }\"\n >\n </ng-template>\n ",
328 }]
329 }], propDecorators: { event: [{
330 type: i0.Input
331 }], customTemplate: [{
332 type: i0.Input
333 }] } });
334
335 /**
336 * This class is responsible for displaying all event titles within the calendar. You may override any of its methods via angulars DI to suit your requirements. For example:
337 *
338 * ```typescript
339 * import { Injectable } from '@angular/core';
340 * import { CalendarEventTitleFormatter, CalendarEvent } from 'angular-calendar';
341 *
342 * @Injectable()
343 * class CustomEventTitleFormatter extends CalendarEventTitleFormatter {
344 *
345 * month(event: CalendarEvent): string {
346 * return `Custom prefix: ${event.title}`;
347 * }
348 *
349 * }
350 *
351 * // in your component
352 * providers: [{
353 * provide: CalendarEventTitleFormatter,
354 * useClass: CustomEventTitleFormatter
355 * }]
356 * ```
357 */
358 var CalendarEventTitleFormatter = /** @class */ (function () {
359 function CalendarEventTitleFormatter() {
360 }
361 /**
362 * The month view event title.
363 */
364 CalendarEventTitleFormatter.prototype.month = function (event, title) {
365 return event.title;
366 };
367 /**
368 * The month view event tooltip. Return a falsey value from this to disable the tooltip.
369 */
370 CalendarEventTitleFormatter.prototype.monthTooltip = function (event, title) {
371 return event.title;
372 };
373 /**
374 * The week view event title.
375 */
376 CalendarEventTitleFormatter.prototype.week = function (event, title) {
377 return event.title;
378 };
379 /**
380 * The week view event tooltip. Return a falsey value from this to disable the tooltip.
381 */
382 CalendarEventTitleFormatter.prototype.weekTooltip = function (event, title) {
383 return event.title;
384 };
385 /**
386 * The day view event title.
387 */
388 CalendarEventTitleFormatter.prototype.day = function (event, title) {
389 return event.title;
390 };
391 /**
392 * The day view event tooltip. Return a falsey value from this to disable the tooltip.
393 */
394 CalendarEventTitleFormatter.prototype.dayTooltip = function (event, title) {
395 return event.title;
396 };
397 return CalendarEventTitleFormatter;
398 }());
399
400 var CalendarEventTitlePipe = /** @class */ (function () {
401 function CalendarEventTitlePipe(calendarEventTitle) {
402 this.calendarEventTitle = calendarEventTitle;
403 }
404 CalendarEventTitlePipe.prototype.transform = function (title, titleType, event) {
405 return this.calendarEventTitle[titleType](event, title);
406 };
407 return CalendarEventTitlePipe;
408 }());
409 CalendarEventTitlePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventTitlePipe, deps: [{ token: CalendarEventTitleFormatter }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
410 CalendarEventTitlePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventTitlePipe, name: "calendarEventTitle" });
411 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventTitlePipe, decorators: [{
412 type: i0.Pipe,
413 args: [{
414 name: 'calendarEventTitle',
415 }]
416 }], ctorParameters: function () { return [{ type: CalendarEventTitleFormatter }]; } });
417
418 var CalendarEventTitleComponent = /** @class */ (function () {
419 function CalendarEventTitleComponent() {
420 }
421 return CalendarEventTitleComponent;
422 }());
423 CalendarEventTitleComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventTitleComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
424 CalendarEventTitleComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarEventTitleComponent, selector: "mwl-calendar-event-title", inputs: { event: "event", customTemplate: "customTemplate", view: "view" }, ngImport: i0__namespace, template: "\n <ng-template #defaultTemplate let-event=\"event\" let-view=\"view\">\n <span\n class=\"cal-event-title\"\n [innerHTML]=\"event.title | calendarEventTitle: view:event\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideEventTitle'\"\n >\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n event: event,\n view: view\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarEventTitle": CalendarEventTitlePipe, "calendarA11y": CalendarA11yPipe } });
425 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarEventTitleComponent, decorators: [{
426 type: i0.Component,
427 args: [{
428 selector: 'mwl-calendar-event-title',
429 template: "\n <ng-template #defaultTemplate let-event=\"event\" let-view=\"view\">\n <span\n class=\"cal-event-title\"\n [innerHTML]=\"event.title | calendarEventTitle: view:event\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideEventTitle'\"\n >\n </span>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n event: event,\n view: view\n }\"\n >\n </ng-template>\n ",
430 }]
431 }], propDecorators: { event: [{
432 type: i0.Input
433 }], customTemplate: [{
434 type: i0.Input
435 }], view: [{
436 type: i0.Input
437 }] } });
438
439 /*! *****************************************************************************
440 Copyright (c) Microsoft Corporation.
441
442 Permission to use, copy, modify, and/or distribute this software for any
443 purpose with or without fee is hereby granted.
444
445 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
446 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
447 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
448 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
449 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
450 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
451 PERFORMANCE OF THIS SOFTWARE.
452 ***************************************************************************** */
453 /* global Reflect, Promise */
454 var extendStatics = function (d, b) {
455 extendStatics = Object.setPrototypeOf ||
456 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
457 function (d, b) { for (var p in b)
458 if (Object.prototype.hasOwnProperty.call(b, p))
459 d[p] = b[p]; };
460 return extendStatics(d, b);
461 };
462 function __extends(d, b) {
463 if (typeof b !== "function" && b !== null)
464 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
465 extendStatics(d, b);
466 function __() { this.constructor = d; }
467 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
468 }
469 var __assign = function () {
470 __assign = Object.assign || function __assign(t) {
471 for (var s, i = 1, n = arguments.length; i < n; i++) {
472 s = arguments[i];
473 for (var p in s)
474 if (Object.prototype.hasOwnProperty.call(s, p))
475 t[p] = s[p];
476 }
477 return t;
478 };
479 return __assign.apply(this, arguments);
480 };
481 function __rest(s, e) {
482 var t = {};
483 for (var p in s)
484 if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
485 t[p] = s[p];
486 if (s != null && typeof Object.getOwnPropertySymbols === "function")
487 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
488 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
489 t[p[i]] = s[p[i]];
490 }
491 return t;
492 }
493 function __decorate(decorators, target, key, desc) {
494 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
495 if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
496 r = Reflect.decorate(decorators, target, key, desc);
497 else
498 for (var i = decorators.length - 1; i >= 0; i--)
499 if (d = decorators[i])
500 r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
501 return c > 3 && r && Object.defineProperty(target, key, r), r;
502 }
503 function __param(paramIndex, decorator) {
504 return function (target, key) { decorator(target, key, paramIndex); };
505 }
506 function __metadata(metadataKey, metadataValue) {
507 if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
508 return Reflect.metadata(metadataKey, metadataValue);
509 }
510 function __awaiter(thisArg, _arguments, P, generator) {
511 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
512 return new (P || (P = Promise))(function (resolve, reject) {
513 function fulfilled(value) { try {
514 step(generator.next(value));
515 }
516 catch (e) {
517 reject(e);
518 } }
519 function rejected(value) { try {
520 step(generator["throw"](value));
521 }
522 catch (e) {
523 reject(e);
524 } }
525 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
526 step((generator = generator.apply(thisArg, _arguments || [])).next());
527 });
528 }
529 function __generator(thisArg, body) {
530 var _ = { label: 0, sent: function () { if (t[0] & 1)
531 throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
532 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
533 function verb(n) { return function (v) { return step([n, v]); }; }
534 function step(op) {
535 if (f)
536 throw new TypeError("Generator is already executing.");
537 while (_)
538 try {
539 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
540 return t;
541 if (y = 0, t)
542 op = [op[0] & 2, t.value];
543 switch (op[0]) {
544 case 0:
545 case 1:
546 t = op;
547 break;
548 case 4:
549 _.label++;
550 return { value: op[1], done: false };
551 case 5:
552 _.label++;
553 y = op[1];
554 op = [0];
555 continue;
556 case 7:
557 op = _.ops.pop();
558 _.trys.pop();
559 continue;
560 default:
561 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
562 _ = 0;
563 continue;
564 }
565 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
566 _.label = op[1];
567 break;
568 }
569 if (op[0] === 6 && _.label < t[1]) {
570 _.label = t[1];
571 t = op;
572 break;
573 }
574 if (t && _.label < t[2]) {
575 _.label = t[2];
576 _.ops.push(op);
577 break;
578 }
579 if (t[2])
580 _.ops.pop();
581 _.trys.pop();
582 continue;
583 }
584 op = body.call(thisArg, _);
585 }
586 catch (e) {
587 op = [6, e];
588 y = 0;
589 }
590 finally {
591 f = t = 0;
592 }
593 if (op[0] & 5)
594 throw op[1];
595 return { value: op[0] ? op[1] : void 0, done: true };
596 }
597 }
598 var __createBinding = Object.create ? (function (o, m, k, k2) {
599 if (k2 === undefined)
600 k2 = k;
601 Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
602 }) : (function (o, m, k, k2) {
603 if (k2 === undefined)
604 k2 = k;
605 o[k2] = m[k];
606 });
607 function __exportStar(m, o) {
608 for (var p in m)
609 if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
610 __createBinding(o, m, p);
611 }
612 function __values(o) {
613 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
614 if (m)
615 return m.call(o);
616 if (o && typeof o.length === "number")
617 return {
618 next: function () {
619 if (o && i >= o.length)
620 o = void 0;
621 return { value: o && o[i++], done: !o };
622 }
623 };
624 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
625 }
626 function __read(o, n) {
627 var m = typeof Symbol === "function" && o[Symbol.iterator];
628 if (!m)
629 return o;
630 var i = m.call(o), r, ar = [], e;
631 try {
632 while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
633 ar.push(r.value);
634 }
635 catch (error) {
636 e = { error: error };
637 }
638 finally {
639 try {
640 if (r && !r.done && (m = i["return"]))
641 m.call(i);
642 }
643 finally {
644 if (e)
645 throw e.error;
646 }
647 }
648 return ar;
649 }
650 /** @deprecated */
651 function __spread() {
652 for (var ar = [], i = 0; i < arguments.length; i++)
653 ar = ar.concat(__read(arguments[i]));
654 return ar;
655 }
656 /** @deprecated */
657 function __spreadArrays() {
658 for (var s = 0, i = 0, il = arguments.length; i < il; i++)
659 s += arguments[i].length;
660 for (var r = Array(s), k = 0, i = 0; i < il; i++)
661 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
662 r[k] = a[j];
663 return r;
664 }
665 function __spreadArray(to, from, pack) {
666 if (pack || arguments.length === 2)
667 for (var i = 0, l = from.length, ar; i < l; i++) {
668 if (ar || !(i in from)) {
669 if (!ar)
670 ar = Array.prototype.slice.call(from, 0, i);
671 ar[i] = from[i];
672 }
673 }
674 return to.concat(ar || Array.prototype.slice.call(from));
675 }
676 function __await(v) {
677 return this instanceof __await ? (this.v = v, this) : new __await(v);
678 }
679 function __asyncGenerator(thisArg, _arguments, generator) {
680 if (!Symbol.asyncIterator)
681 throw new TypeError("Symbol.asyncIterator is not defined.");
682 var g = generator.apply(thisArg, _arguments || []), i, q = [];
683 return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
684 function verb(n) { if (g[n])
685 i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
686 function resume(n, v) { try {
687 step(g[n](v));
688 }
689 catch (e) {
690 settle(q[0][3], e);
691 } }
692 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
693 function fulfill(value) { resume("next", value); }
694 function reject(value) { resume("throw", value); }
695 function settle(f, v) { if (f(v), q.shift(), q.length)
696 resume(q[0][0], q[0][1]); }
697 }
698 function __asyncDelegator(o) {
699 var i, p;
700 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
701 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
702 }
703 function __asyncValues(o) {
704 if (!Symbol.asyncIterator)
705 throw new TypeError("Symbol.asyncIterator is not defined.");
706 var m = o[Symbol.asyncIterator], i;
707 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
708 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
709 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
710 }
711 function __makeTemplateObject(cooked, raw) {
712 if (Object.defineProperty) {
713 Object.defineProperty(cooked, "raw", { value: raw });
714 }
715 else {
716 cooked.raw = raw;
717 }
718 return cooked;
719 }
720 ;
721 var __setModuleDefault = Object.create ? (function (o, v) {
722 Object.defineProperty(o, "default", { enumerable: true, value: v });
723 }) : function (o, v) {
724 o["default"] = v;
725 };
726 function __importStar(mod) {
727 if (mod && mod.__esModule)
728 return mod;
729 var result = {};
730 if (mod != null)
731 for (var k in mod)
732 if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
733 __createBinding(result, mod, k);
734 __setModuleDefault(result, mod);
735 return result;
736 }
737 function __importDefault(mod) {
738 return (mod && mod.__esModule) ? mod : { default: mod };
739 }
740 function __classPrivateFieldGet(receiver, state, kind, f) {
741 if (kind === "a" && !f)
742 throw new TypeError("Private accessor was defined without a getter");
743 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
744 throw new TypeError("Cannot read private member from an object whose class did not declare it");
745 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
746 }
747 function __classPrivateFieldSet(receiver, state, value, kind, f) {
748 if (kind === "m")
749 throw new TypeError("Private method is not writable");
750 if (kind === "a" && !f)
751 throw new TypeError("Private accessor was defined without a setter");
752 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
753 throw new TypeError("Cannot write private member to an object whose class did not declare it");
754 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
755 }
756
757 var CalendarTooltipWindowComponent = /** @class */ (function () {
758 function CalendarTooltipWindowComponent() {
759 }
760 return CalendarTooltipWindowComponent;
761 }());
762 CalendarTooltipWindowComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTooltipWindowComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
763 CalendarTooltipWindowComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarTooltipWindowComponent, selector: "mwl-calendar-tooltip-window", inputs: { contents: "contents", placement: "placement", event: "event", customTemplate: "customTemplate" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-contents=\"contents\"\n let-placement=\"placement\"\n let-event=\"event\"\n >\n <div class=\"cal-tooltip\" [ngClass]=\"'cal-tooltip-' + placement\">\n <div class=\"cal-tooltip-arrow\"></div>\n <div class=\"cal-tooltip-inner\" [innerHtml]=\"contents\"></div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n contents: contents,\n placement: placement,\n event: event\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
764 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTooltipWindowComponent, decorators: [{
765 type: i0.Component,
766 args: [{
767 selector: 'mwl-calendar-tooltip-window',
768 template: "\n <ng-template\n #defaultTemplate\n let-contents=\"contents\"\n let-placement=\"placement\"\n let-event=\"event\"\n >\n <div class=\"cal-tooltip\" [ngClass]=\"'cal-tooltip-' + placement\">\n <div class=\"cal-tooltip-arrow\"></div>\n <div class=\"cal-tooltip-inner\" [innerHtml]=\"contents\"></div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n contents: contents,\n placement: placement,\n event: event\n }\"\n >\n </ng-template>\n ",
769 }]
770 }], propDecorators: { contents: [{
771 type: i0.Input
772 }], placement: [{
773 type: i0.Input
774 }], event: [{
775 type: i0.Input
776 }], customTemplate: [{
777 type: i0.Input
778 }] } });
779 var CalendarTooltipDirective = /** @class */ (function () {
780 function CalendarTooltipDirective(elementRef, injector, renderer, componentFactoryResolver, viewContainerRef, document // eslint-disable-line
781 ) {
782 this.elementRef = elementRef;
783 this.injector = injector;
784 this.renderer = renderer;
785 this.viewContainerRef = viewContainerRef;
786 this.document = document;
787 this.placement = 'auto'; // eslint-disable-line @angular-eslint/no-input-rename
788 this.delay = null; // eslint-disable-line @angular-eslint/no-input-rename
789 this.cancelTooltipDelay$ = new rxjs.Subject();
790 this.tooltipFactory = componentFactoryResolver.resolveComponentFactory(CalendarTooltipWindowComponent);
791 }
792 CalendarTooltipDirective.prototype.ngOnChanges = function (changes) {
793 if (this.tooltipRef &&
794 (changes.contents || changes.customTemplate || changes.event)) {
795 this.tooltipRef.instance.contents = this.contents;
796 this.tooltipRef.instance.customTemplate = this.customTemplate;
797 this.tooltipRef.instance.event = this.event;
798 this.tooltipRef.changeDetectorRef.markForCheck();
799 if (!this.contents) {
800 this.hide();
801 }
802 }
803 };
804 CalendarTooltipDirective.prototype.ngOnDestroy = function () {
805 this.hide();
806 };
807 CalendarTooltipDirective.prototype.onMouseOver = function () {
808 var _this = this;
809 var delay$ = this.delay === null ? rxjs.of('now') : rxjs.timer(this.delay);
810 delay$.pipe(operators.takeUntil(this.cancelTooltipDelay$)).subscribe(function () {
811 _this.show();
812 });
813 };
814 CalendarTooltipDirective.prototype.onMouseOut = function () {
815 this.hide();
816 };
817 CalendarTooltipDirective.prototype.show = function () {
818 var _this = this;
819 if (!this.tooltipRef && this.contents) {
820 this.tooltipRef = this.viewContainerRef.createComponent(this.tooltipFactory, 0, this.injector, []);
821 this.tooltipRef.instance.contents = this.contents;
822 this.tooltipRef.instance.customTemplate = this.customTemplate;
823 this.tooltipRef.instance.event = this.event;
824 if (this.appendToBody) {
825 this.document.body.appendChild(this.tooltipRef.location.nativeElement);
826 }
827 requestAnimationFrame(function () {
828 _this.positionTooltip();
829 });
830 }
831 };
832 CalendarTooltipDirective.prototype.hide = function () {
833 if (this.tooltipRef) {
834 this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.tooltipRef.hostView));
835 this.tooltipRef = null;
836 }
837 this.cancelTooltipDelay$.next();
838 };
839 CalendarTooltipDirective.prototype.positionTooltip = function (previousPositions) {
840 if (previousPositions === void 0) { previousPositions = []; }
841 if (this.tooltipRef) {
842 this.tooltipRef.changeDetectorRef.detectChanges();
843 this.tooltipRef.instance.placement = positioning.positionElements(this.elementRef.nativeElement, this.tooltipRef.location.nativeElement.children[0], this.placement, this.appendToBody);
844 // keep re-positioning the tooltip until the arrow position doesn't make a difference
845 if (previousPositions.indexOf(this.tooltipRef.instance.placement) === -1) {
846 this.positionTooltip(__spreadArray(__spreadArray([], __read(previousPositions)), [
847 this.tooltipRef.instance.placement,
848 ]));
849 }
850 }
851 };
852 return CalendarTooltipDirective;
853 }());
854 CalendarTooltipDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTooltipDirective, deps: [{ token: i0__namespace.ElementRef }, { token: i0__namespace.Injector }, { token: i0__namespace.Renderer2 }, { token: i0__namespace.ComponentFactoryResolver }, { token: i0__namespace.ViewContainerRef }, { token: i1.DOCUMENT }], target: i0__namespace.ɵɵFactoryTarget.Directive });
855 CalendarTooltipDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: CalendarTooltipDirective, selector: "[mwlCalendarTooltip]", inputs: { contents: ["mwlCalendarTooltip", "contents"], placement: ["tooltipPlacement", "placement"], customTemplate: ["tooltipTemplate", "customTemplate"], event: ["tooltipEvent", "event"], appendToBody: ["tooltipAppendToBody", "appendToBody"], delay: ["tooltipDelay", "delay"] }, host: { listeners: { "mouseenter": "onMouseOver()", "mouseleave": "onMouseOut()" } }, usesOnChanges: true, ngImport: i0__namespace });
856 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTooltipDirective, decorators: [{
857 type: i0.Directive,
858 args: [{
859 selector: '[mwlCalendarTooltip]',
860 }]
861 }], ctorParameters: function () {
862 return [{ type: i0__namespace.ElementRef }, { type: i0__namespace.Injector }, { type: i0__namespace.Renderer2 }, { type: i0__namespace.ComponentFactoryResolver }, { type: i0__namespace.ViewContainerRef }, { type: undefined, decorators: [{
863 type: i0.Inject,
864 args: [i1.DOCUMENT]
865 }] }];
866 }, propDecorators: { contents: [{
867 type: i0.Input,
868 args: ['mwlCalendarTooltip']
869 }], placement: [{
870 type: i0.Input,
871 args: ['tooltipPlacement']
872 }], customTemplate: [{
873 type: i0.Input,
874 args: ['tooltipTemplate']
875 }], event: [{
876 type: i0.Input,
877 args: ['tooltipEvent']
878 }], appendToBody: [{
879 type: i0.Input,
880 args: ['tooltipAppendToBody']
881 }], delay: [{
882 type: i0.Input,
883 args: ['tooltipDelay']
884 }], onMouseOver: [{
885 type: i0.HostListener,
886 args: ['mouseenter']
887 }], onMouseOut: [{
888 type: i0.HostListener,
889 args: ['mouseleave']
890 }] } });
891
892 exports.CalendarView = void 0;
893 (function (CalendarView) {
894 CalendarView["Month"] = "month";
895 CalendarView["Week"] = "week";
896 CalendarView["Day"] = "day";
897 })(exports.CalendarView || (exports.CalendarView = {}));
898
899 var validateEvents = function (events) {
900 var warn = function () {
901 var args = [];
902 for (var _i = 0; _i < arguments.length; _i++) {
903 args[_i] = arguments[_i];
904 }
905 return console.warn.apply(console, __spreadArray(['angular-calendar'], __read(args)));
906 };
907 return calendarUtils.validateEvents(events, warn);
908 };
909 function isInsideLeftAndRight(outer, inner) {
910 return (Math.floor(outer.left) <= Math.ceil(inner.left) &&
911 Math.floor(inner.left) <= Math.ceil(outer.right) &&
912 Math.floor(outer.left) <= Math.ceil(inner.right) &&
913 Math.floor(inner.right) <= Math.ceil(outer.right));
914 }
915 function isInsideTopAndBottom(outer, inner) {
916 return (Math.floor(outer.top) <= Math.ceil(inner.top) &&
917 Math.floor(inner.top) <= Math.ceil(outer.bottom) &&
918 Math.floor(outer.top) <= Math.ceil(inner.bottom) &&
919 Math.floor(inner.bottom) <= Math.ceil(outer.bottom));
920 }
921 function isInside(outer, inner) {
922 return (isInsideLeftAndRight(outer, inner) && isInsideTopAndBottom(outer, inner));
923 }
924 function roundToNearest(amount, precision) {
925 return Math.round(amount / precision) * precision;
926 }
927 var trackByEventId = function (index, event) { return event.id ? event.id : event; };
928 var trackByWeekDayHeaderDate = function (index, day) { return day.date.toISOString(); };
929 var trackByHourSegment = function (index, segment) { return segment.date.toISOString(); };
930 var trackByHour = function (index, hour) { return hour.segments[0].date.toISOString(); };
931 var trackByWeekAllDayEvent = function (index, weekEvent) { return (weekEvent.event.id ? weekEvent.event.id : weekEvent.event); };
932 var trackByWeekTimeEvent = function (index, weekEvent) { return (weekEvent.event.id ? weekEvent.event.id : weekEvent.event); };
933 var MINUTES_IN_HOUR = 60;
934 function getPixelAmountInMinutes(hourSegments, hourSegmentHeight, hourDuration) {
935 return (hourDuration || MINUTES_IN_HOUR) / (hourSegments * hourSegmentHeight);
936 }
937 function getMinutesMoved(movedY, hourSegments, hourSegmentHeight, eventSnapSize, hourDuration) {
938 var draggedInPixelsSnapSize = roundToNearest(movedY, eventSnapSize || hourSegmentHeight);
939 var pixelAmountInMinutes = getPixelAmountInMinutes(hourSegments, hourSegmentHeight, hourDuration);
940 return draggedInPixelsSnapSize * pixelAmountInMinutes;
941 }
942 function getDefaultEventEnd(dateAdapter, event, minimumMinutes) {
943 if (event.end) {
944 return event.end;
945 }
946 else {
947 return dateAdapter.addMinutes(event.start, minimumMinutes);
948 }
949 }
950 function addDaysWithExclusions(dateAdapter, date, days, excluded) {
951 var daysCounter = 0;
952 var daysToAdd = 0;
953 var changeDays = days < 0 ? dateAdapter.subDays : dateAdapter.addDays;
954 var result = date;
955 while (daysToAdd <= Math.abs(days)) {
956 result = changeDays(date, daysCounter);
957 var day = dateAdapter.getDay(result);
958 if (excluded.indexOf(day) === -1) {
959 daysToAdd++;
960 }
961 daysCounter++;
962 }
963 return result;
964 }
965 function isDraggedWithinPeriod(newStart, newEnd, period) {
966 var end = newEnd || newStart;
967 return ((period.start <= newStart && newStart <= period.end) ||
968 (period.start <= end && end <= period.end));
969 }
970 function shouldFireDroppedEvent(dropEvent, date, allDay, calendarId) {
971 return (dropEvent.dropData &&
972 dropEvent.dropData.event &&
973 (dropEvent.dropData.calendarId !== calendarId ||
974 (dropEvent.dropData.event.allDay && !allDay) ||
975 (!dropEvent.dropData.event.allDay && allDay)));
976 }
977 function getWeekViewPeriod(dateAdapter, viewDate, weekStartsOn, excluded, daysInWeek) {
978 if (excluded === void 0) { excluded = []; }
979 var viewStart = daysInWeek
980 ? dateAdapter.startOfDay(viewDate)
981 : dateAdapter.startOfWeek(viewDate, { weekStartsOn: weekStartsOn });
982 var endOfWeek = dateAdapter.endOfWeek(viewDate, { weekStartsOn: weekStartsOn });
983 while (excluded.indexOf(dateAdapter.getDay(viewStart)) > -1 &&
984 viewStart < endOfWeek) {
985 viewStart = dateAdapter.addDays(viewStart, 1);
986 }
987 if (daysInWeek) {
988 var viewEnd = dateAdapter.endOfDay(addDaysWithExclusions(dateAdapter, viewStart, daysInWeek - 1, excluded));
989 return { viewStart: viewStart, viewEnd: viewEnd };
990 }
991 else {
992 var viewEnd = endOfWeek;
993 while (excluded.indexOf(dateAdapter.getDay(viewEnd)) > -1 &&
994 viewEnd > viewStart) {
995 viewEnd = dateAdapter.subDays(viewEnd, 1);
996 }
997 return { viewStart: viewStart, viewEnd: viewEnd };
998 }
999 }
1000 function isWithinThreshold(_a) {
1001 var x = _a.x, y = _a.y;
1002 var DRAG_THRESHOLD = 1;
1003 return Math.abs(x) > DRAG_THRESHOLD || Math.abs(y) > DRAG_THRESHOLD;
1004 }
1005
1006 var DateAdapter = /** @class */ (function () {
1007 function DateAdapter() {
1008 }
1009 return DateAdapter;
1010 }());
1011
1012 /**
1013 * Change the view date to the previous view. For example:
1014 *
1015 * ```typescript
1016 * <button
1017 * mwlCalendarPreviousView
1018 * [(viewDate)]="viewDate"
1019 * [view]="view">
1020 * Previous
1021 * </button>
1022 * ```
1023 */
1024 var CalendarPreviousViewDirective = /** @class */ (function () {
1025 function CalendarPreviousViewDirective(dateAdapter) {
1026 this.dateAdapter = dateAdapter;
1027 /**
1028 * Days to skip when going back by 1 day
1029 */
1030 this.excludeDays = [];
1031 /**
1032 * Called when the view date is changed
1033 */
1034 this.viewDateChange = new i0.EventEmitter();
1035 }
1036 /**
1037 * @hidden
1038 */
1039 CalendarPreviousViewDirective.prototype.onClick = function () {
1040 var subFn = {
1041 day: this.dateAdapter.subDays,
1042 week: this.dateAdapter.subWeeks,
1043 month: this.dateAdapter.subMonths,
1044 }[this.view];
1045 if (this.view === exports.CalendarView.Day) {
1046 this.viewDateChange.emit(addDaysWithExclusions(this.dateAdapter, this.viewDate, -1, this.excludeDays));
1047 }
1048 else if (this.view === exports.CalendarView.Week && this.daysInWeek) {
1049 this.viewDateChange.emit(addDaysWithExclusions(this.dateAdapter, this.viewDate, -this.daysInWeek, this.excludeDays));
1050 }
1051 else {
1052 this.viewDateChange.emit(subFn(this.viewDate, 1));
1053 }
1054 };
1055 return CalendarPreviousViewDirective;
1056 }());
1057 CalendarPreviousViewDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarPreviousViewDirective, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1058 CalendarPreviousViewDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: CalendarPreviousViewDirective, selector: "[mwlCalendarPreviousView]", inputs: { view: "view", viewDate: "viewDate", excludeDays: "excludeDays", daysInWeek: "daysInWeek" }, outputs: { viewDateChange: "viewDateChange" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0__namespace });
1059 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarPreviousViewDirective, decorators: [{
1060 type: i0.Directive,
1061 args: [{
1062 selector: '[mwlCalendarPreviousView]',
1063 }]
1064 }], ctorParameters: function () { return [{ type: DateAdapter }]; }, propDecorators: { view: [{
1065 type: i0.Input
1066 }], viewDate: [{
1067 type: i0.Input
1068 }], excludeDays: [{
1069 type: i0.Input
1070 }], daysInWeek: [{
1071 type: i0.Input
1072 }], viewDateChange: [{
1073 type: i0.Output
1074 }], onClick: [{
1075 type: i0.HostListener,
1076 args: ['click']
1077 }] } });
1078
1079 /**
1080 * Change the view date to the next view. For example:
1081 *
1082 * ```typescript
1083 * <button
1084 * mwlCalendarNextView
1085 * [(viewDate)]="viewDate"
1086 * [view]="view">
1087 * Next
1088 * </button>
1089 * ```
1090 */
1091 var CalendarNextViewDirective = /** @class */ (function () {
1092 function CalendarNextViewDirective(dateAdapter) {
1093 this.dateAdapter = dateAdapter;
1094 /**
1095 * Days to skip when going forward by 1 day
1096 */
1097 this.excludeDays = [];
1098 /**
1099 * Called when the view date is changed
1100 */
1101 this.viewDateChange = new i0.EventEmitter();
1102 }
1103 /**
1104 * @hidden
1105 */
1106 CalendarNextViewDirective.prototype.onClick = function () {
1107 var addFn = {
1108 day: this.dateAdapter.addDays,
1109 week: this.dateAdapter.addWeeks,
1110 month: this.dateAdapter.addMonths,
1111 }[this.view];
1112 if (this.view === exports.CalendarView.Day) {
1113 this.viewDateChange.emit(addDaysWithExclusions(this.dateAdapter, this.viewDate, 1, this.excludeDays));
1114 }
1115 else if (this.view === exports.CalendarView.Week && this.daysInWeek) {
1116 this.viewDateChange.emit(addDaysWithExclusions(this.dateAdapter, this.viewDate, this.daysInWeek, this.excludeDays));
1117 }
1118 else {
1119 this.viewDateChange.emit(addFn(this.viewDate, 1));
1120 }
1121 };
1122 return CalendarNextViewDirective;
1123 }());
1124 CalendarNextViewDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarNextViewDirective, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1125 CalendarNextViewDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: CalendarNextViewDirective, selector: "[mwlCalendarNextView]", inputs: { view: "view", viewDate: "viewDate", excludeDays: "excludeDays", daysInWeek: "daysInWeek" }, outputs: { viewDateChange: "viewDateChange" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0__namespace });
1126 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarNextViewDirective, decorators: [{
1127 type: i0.Directive,
1128 args: [{
1129 selector: '[mwlCalendarNextView]',
1130 }]
1131 }], ctorParameters: function () { return [{ type: DateAdapter }]; }, propDecorators: { view: [{
1132 type: i0.Input
1133 }], viewDate: [{
1134 type: i0.Input
1135 }], excludeDays: [{
1136 type: i0.Input
1137 }], daysInWeek: [{
1138 type: i0.Input
1139 }], viewDateChange: [{
1140 type: i0.Output
1141 }], onClick: [{
1142 type: i0.HostListener,
1143 args: ['click']
1144 }] } });
1145
1146 /**
1147 * Change the view date to the current day. For example:
1148 *
1149 * ```typescript
1150 * <button
1151 * mwlCalendarToday
1152 * [(viewDate)]="viewDate">
1153 * Today
1154 * </button>
1155 * ```
1156 */
1157 var CalendarTodayDirective = /** @class */ (function () {
1158 function CalendarTodayDirective(dateAdapter) {
1159 this.dateAdapter = dateAdapter;
1160 /**
1161 * Called when the view date is changed
1162 */
1163 this.viewDateChange = new i0.EventEmitter();
1164 }
1165 /**
1166 * @hidden
1167 */
1168 CalendarTodayDirective.prototype.onClick = function () {
1169 this.viewDateChange.emit(this.dateAdapter.startOfDay(new Date()));
1170 };
1171 return CalendarTodayDirective;
1172 }());
1173 CalendarTodayDirective.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTodayDirective, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Directive });
1174 CalendarTodayDirective.ɵdir = i0__namespace.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.3", type: CalendarTodayDirective, selector: "[mwlCalendarToday]", inputs: { viewDate: "viewDate" }, outputs: { viewDateChange: "viewDateChange" }, host: { listeners: { "click": "onClick()" } }, ngImport: i0__namespace });
1175 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarTodayDirective, decorators: [{
1176 type: i0.Directive,
1177 args: [{
1178 selector: '[mwlCalendarToday]',
1179 }]
1180 }], ctorParameters: function () { return [{ type: DateAdapter }]; }, propDecorators: { viewDate: [{
1181 type: i0.Input
1182 }], viewDateChange: [{
1183 type: i0.Output
1184 }], onClick: [{
1185 type: i0.HostListener,
1186 args: ['click']
1187 }] } });
1188
1189 /**
1190 * This will use the angular date pipe to do all date formatting. It is the default date formatter used by the calendar.
1191 */
1192 var CalendarAngularDateFormatter = /** @class */ (function () {
1193 function CalendarAngularDateFormatter(dateAdapter) {
1194 this.dateAdapter = dateAdapter;
1195 }
1196 /**
1197 * The month view header week day labels
1198 */
1199 CalendarAngularDateFormatter.prototype.monthViewColumnHeader = function (_a) {
1200 var date = _a.date, locale = _a.locale;
1201 return i1.formatDate(date, 'EEEE', locale);
1202 };
1203 /**
1204 * The month view cell day number
1205 */
1206 CalendarAngularDateFormatter.prototype.monthViewDayNumber = function (_a) {
1207 var date = _a.date, locale = _a.locale;
1208 return i1.formatDate(date, 'd', locale);
1209 };
1210 /**
1211 * The month view title
1212 */
1213 CalendarAngularDateFormatter.prototype.monthViewTitle = function (_a) {
1214 var date = _a.date, locale = _a.locale;
1215 return i1.formatDate(date, 'LLLL y', locale);
1216 };
1217 /**
1218 * The week view header week day labels
1219 */
1220 CalendarAngularDateFormatter.prototype.weekViewColumnHeader = function (_a) {
1221 var date = _a.date, locale = _a.locale;
1222 return i1.formatDate(date, 'EEEE', locale);
1223 };
1224 /**
1225 * The week view sub header day and month labels
1226 */
1227 CalendarAngularDateFormatter.prototype.weekViewColumnSubHeader = function (_a) {
1228 var date = _a.date, locale = _a.locale;
1229 return i1.formatDate(date, 'MMM d', locale);
1230 };
1231 /**
1232 * The week view title
1233 */
1234 CalendarAngularDateFormatter.prototype.weekViewTitle = function (_a) {
1235 var date = _a.date, locale = _a.locale, weekStartsOn = _a.weekStartsOn, excludeDays = _a.excludeDays, daysInWeek = _a.daysInWeek;
1236 var _b = getWeekViewPeriod(this.dateAdapter, date, weekStartsOn, excludeDays, daysInWeek), viewStart = _b.viewStart, viewEnd = _b.viewEnd;
1237 var format = function (dateToFormat, showYear) { return i1.formatDate(dateToFormat, 'MMM d' + (showYear ? ', yyyy' : ''), locale); };
1238 return format(viewStart, viewStart.getUTCFullYear() !== viewEnd.getUTCFullYear()) + " - " + format(viewEnd, true);
1239 };
1240 /**
1241 * The time formatting down the left hand side of the week view
1242 */
1243 CalendarAngularDateFormatter.prototype.weekViewHour = function (_a) {
1244 var date = _a.date, locale = _a.locale;
1245 return i1.formatDate(date, 'h a', locale);
1246 };
1247 /**
1248 * The time formatting down the left hand side of the day view
1249 */
1250 CalendarAngularDateFormatter.prototype.dayViewHour = function (_a) {
1251 var date = _a.date, locale = _a.locale;
1252 return i1.formatDate(date, 'h a', locale);
1253 };
1254 /**
1255 * The day view title
1256 */
1257 CalendarAngularDateFormatter.prototype.dayViewTitle = function (_a) {
1258 var date = _a.date, locale = _a.locale;
1259 return i1.formatDate(date, 'EEEE, MMMM d, y', locale);
1260 };
1261 return CalendarAngularDateFormatter;
1262 }());
1263 CalendarAngularDateFormatter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarAngularDateFormatter, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1264 CalendarAngularDateFormatter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarAngularDateFormatter });
1265 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarAngularDateFormatter, decorators: [{
1266 type: i0.Injectable
1267 }], ctorParameters: function () { return [{ type: DateAdapter }]; } });
1268
1269 /**
1270 * This class is responsible for all formatting of dates. There are 3 implementations available, the `CalendarAngularDateFormatter` (default) which uses the angular date pipe to format dates, the `CalendarNativeDateFormatter` which will use the <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank">Intl</a> API to format dates, or there is the `CalendarMomentDateFormatter` which uses <a href="http://momentjs.com/" target="_blank">moment</a>.
1271 *
1272 * If you wish, you may override any of the defaults via angulars DI. For example:
1273 *
1274 * ```typescript
1275 * import { CalendarDateFormatter, DateFormatterParams } from 'angular-calendar';
1276 * import { formatDate } from '@angular/common';
1277 * import { Injectable } from '@angular/core';
1278 *
1279 * @Injectable()
1280 * class CustomDateFormatter extends CalendarDateFormatter {
1281 *
1282 * public monthViewColumnHeader({date, locale}: DateFormatterParams): string {
1283 * return formatDate(date, 'EEE', locale); // use short week days
1284 * }
1285 *
1286 * }
1287 *
1288 * // in your component that uses the calendar
1289 * providers: [{
1290 * provide: CalendarDateFormatter,
1291 * useClass: CustomDateFormatter
1292 * }]
1293 * ```
1294 */
1295 var CalendarDateFormatter = /** @class */ (function (_super) {
1296 __extends(CalendarDateFormatter, _super);
1297 function CalendarDateFormatter() {
1298 return _super !== null && _super.apply(this, arguments) || this;
1299 }
1300 return CalendarDateFormatter;
1301 }(CalendarAngularDateFormatter));
1302 CalendarDateFormatter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDateFormatter, deps: null, target: i0__namespace.ɵɵFactoryTarget.Injectable });
1303 CalendarDateFormatter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDateFormatter });
1304 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDateFormatter, decorators: [{
1305 type: i0.Injectable
1306 }] });
1307
1308 /**
1309 * This pipe is primarily for rendering the current view title. Example usage:
1310 * ```typescript
1311 * // where `viewDate` is a `Date` and view is `'month' | 'week' | 'day'`
1312 * {{ viewDate | calendarDate:(view + 'ViewTitle'):'en' }}
1313 * ```
1314 */
1315 var CalendarDatePipe = /** @class */ (function () {
1316 function CalendarDatePipe(dateFormatter, locale) {
1317 this.dateFormatter = dateFormatter;
1318 this.locale = locale;
1319 }
1320 CalendarDatePipe.prototype.transform = function (date, method, locale, weekStartsOn, excludeDays, daysInWeek) {
1321 if (locale === void 0) { locale = this.locale; }
1322 if (weekStartsOn === void 0) { weekStartsOn = 0; }
1323 if (excludeDays === void 0) { excludeDays = []; }
1324 if (typeof this.dateFormatter[method] === 'undefined') {
1325 var allowedMethods = Object.getOwnPropertyNames(Object.getPrototypeOf(CalendarDateFormatter.prototype)).filter(function (iMethod) { return iMethod !== 'constructor'; });
1326 throw new Error(method + " is not a valid date formatter. Can only be one of " + allowedMethods.join(', '));
1327 }
1328 return this.dateFormatter[method]({
1329 date: date,
1330 locale: locale,
1331 weekStartsOn: weekStartsOn,
1332 excludeDays: excludeDays,
1333 daysInWeek: daysInWeek,
1334 });
1335 };
1336 return CalendarDatePipe;
1337 }());
1338 CalendarDatePipe.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDatePipe, deps: [{ token: CalendarDateFormatter }, { token: i0.LOCALE_ID }], target: i0__namespace.ɵɵFactoryTarget.Pipe });
1339 CalendarDatePipe.ɵpipe = i0__namespace.ɵɵngDeclarePipe({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDatePipe, name: "calendarDate" });
1340 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDatePipe, decorators: [{
1341 type: i0.Pipe,
1342 args: [{
1343 name: 'calendarDate',
1344 }]
1345 }], ctorParameters: function () {
1346 return [{ type: CalendarDateFormatter }, { type: undefined, decorators: [{
1347 type: i0.Inject,
1348 args: [i0.LOCALE_ID]
1349 }] }];
1350 } });
1351
1352 var CalendarUtils = /** @class */ (function () {
1353 function CalendarUtils(dateAdapter) {
1354 this.dateAdapter = dateAdapter;
1355 }
1356 CalendarUtils.prototype.getMonthView = function (args) {
1357 return calendarUtils.getMonthView(this.dateAdapter, args);
1358 };
1359 CalendarUtils.prototype.getWeekViewHeader = function (args) {
1360 return calendarUtils.getWeekViewHeader(this.dateAdapter, args);
1361 };
1362 CalendarUtils.prototype.getWeekView = function (args) {
1363 return calendarUtils.getWeekView(this.dateAdapter, args);
1364 };
1365 return CalendarUtils;
1366 }());
1367 CalendarUtils.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarUtils, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1368 CalendarUtils.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarUtils });
1369 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarUtils, decorators: [{
1370 type: i0.Injectable
1371 }], ctorParameters: function () { return [{ type: DateAdapter }]; } });
1372
1373 var MOMENT = new i0.InjectionToken('Moment');
1374 /**
1375 * This will use <a href="http://momentjs.com/" target="_blank">moment</a> to do all date formatting. To use this class:
1376 *
1377 * ```typescript
1378 * import { CalendarDateFormatter, CalendarMomentDateFormatter, MOMENT } from 'angular-calendar';
1379 * import moment from 'moment';
1380 *
1381 * // in your component
1382 * provide: [{
1383 * provide: MOMENT, useValue: moment
1384 * }, {
1385 * provide: CalendarDateFormatter, useClass: CalendarMomentDateFormatter
1386 * }]
1387 *
1388 * ```
1389 */
1390 var CalendarMomentDateFormatter = /** @class */ (function () {
1391 /**
1392 * @hidden
1393 */
1394 function CalendarMomentDateFormatter(moment, dateAdapter) {
1395 this.moment = moment;
1396 this.dateAdapter = dateAdapter;
1397 }
1398 /**
1399 * The month view header week day labels
1400 */
1401 CalendarMomentDateFormatter.prototype.monthViewColumnHeader = function (_a) {
1402 var date = _a.date, locale = _a.locale;
1403 return this.moment(date).locale(locale).format('dddd');
1404 };
1405 /**
1406 * The month view cell day number
1407 */
1408 CalendarMomentDateFormatter.prototype.monthViewDayNumber = function (_a) {
1409 var date = _a.date, locale = _a.locale;
1410 return this.moment(date).locale(locale).format('D');
1411 };
1412 /**
1413 * The month view title
1414 */
1415 CalendarMomentDateFormatter.prototype.monthViewTitle = function (_a) {
1416 var date = _a.date, locale = _a.locale;
1417 return this.moment(date).locale(locale).format('MMMM YYYY');
1418 };
1419 /**
1420 * The week view header week day labels
1421 */
1422 CalendarMomentDateFormatter.prototype.weekViewColumnHeader = function (_a) {
1423 var date = _a.date, locale = _a.locale;
1424 return this.moment(date).locale(locale).format('dddd');
1425 };
1426 /**
1427 * The week view sub header day and month labels
1428 */
1429 CalendarMomentDateFormatter.prototype.weekViewColumnSubHeader = function (_a) {
1430 var date = _a.date, locale = _a.locale;
1431 return this.moment(date).locale(locale).format('MMM D');
1432 };
1433 /**
1434 * The week view title
1435 */
1436 CalendarMomentDateFormatter.prototype.weekViewTitle = function (_a) {
1437 var _this = this;
1438 var date = _a.date, locale = _a.locale, weekStartsOn = _a.weekStartsOn, excludeDays = _a.excludeDays, daysInWeek = _a.daysInWeek;
1439 var _b = getWeekViewPeriod(this.dateAdapter, date, weekStartsOn, excludeDays, daysInWeek), viewStart = _b.viewStart, viewEnd = _b.viewEnd;
1440 var format = function (dateToFormat, showYear) { return _this.moment(dateToFormat)
1441 .locale(locale)
1442 .format('MMM D' + (showYear ? ', YYYY' : '')); };
1443 return format(viewStart, viewStart.getUTCFullYear() !== viewEnd.getUTCFullYear()) + " - " + format(viewEnd, true);
1444 };
1445 /**
1446 * The time formatting down the left hand side of the week view
1447 */
1448 CalendarMomentDateFormatter.prototype.weekViewHour = function (_a) {
1449 var date = _a.date, locale = _a.locale;
1450 return this.moment(date).locale(locale).format('ha');
1451 };
1452 /**
1453 * The time formatting down the left hand side of the day view
1454 */
1455 CalendarMomentDateFormatter.prototype.dayViewHour = function (_a) {
1456 var date = _a.date, locale = _a.locale;
1457 return this.moment(date).locale(locale).format('ha');
1458 };
1459 /**
1460 * The day view title
1461 */
1462 CalendarMomentDateFormatter.prototype.dayViewTitle = function (_a) {
1463 var date = _a.date, locale = _a.locale;
1464 return this.moment(date).locale(locale).format('dddd, LL'); // dddd = Thursday
1465 }; // LL = locale-dependent Month Day, Year
1466 return CalendarMomentDateFormatter;
1467 }());
1468 CalendarMomentDateFormatter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMomentDateFormatter, deps: [{ token: MOMENT }, { token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1469 CalendarMomentDateFormatter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMomentDateFormatter });
1470 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMomentDateFormatter, decorators: [{
1471 type: i0.Injectable
1472 }], ctorParameters: function () {
1473 return [{ type: undefined, decorators: [{
1474 type: i0.Inject,
1475 args: [MOMENT]
1476 }] }, { type: DateAdapter }];
1477 } });
1478
1479 /**
1480 * This will use <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Intl" target="_blank">Intl</a> API to do all date formatting.
1481 *
1482 * You will need to include a <a href="https://github.com/andyearnshaw/Intl.js/">polyfill</a> for older browsers.
1483 */
1484 var CalendarNativeDateFormatter = /** @class */ (function () {
1485 function CalendarNativeDateFormatter(dateAdapter) {
1486 this.dateAdapter = dateAdapter;
1487 }
1488 /**
1489 * The month view header week day labels
1490 */
1491 CalendarNativeDateFormatter.prototype.monthViewColumnHeader = function (_a) {
1492 var date = _a.date, locale = _a.locale;
1493 return new Intl.DateTimeFormat(locale, { weekday: 'long' }).format(date);
1494 };
1495 /**
1496 * The month view cell day number
1497 */
1498 CalendarNativeDateFormatter.prototype.monthViewDayNumber = function (_a) {
1499 var date = _a.date, locale = _a.locale;
1500 return new Intl.DateTimeFormat(locale, { day: 'numeric' }).format(date);
1501 };
1502 /**
1503 * The month view title
1504 */
1505 CalendarNativeDateFormatter.prototype.monthViewTitle = function (_a) {
1506 var date = _a.date, locale = _a.locale;
1507 return new Intl.DateTimeFormat(locale, {
1508 year: 'numeric',
1509 month: 'long',
1510 }).format(date);
1511 };
1512 /**
1513 * The week view header week day labels
1514 */
1515 CalendarNativeDateFormatter.prototype.weekViewColumnHeader = function (_a) {
1516 var date = _a.date, locale = _a.locale;
1517 return new Intl.DateTimeFormat(locale, { weekday: 'long' }).format(date);
1518 };
1519 /**
1520 * The week view sub header day and month labels
1521 */
1522 CalendarNativeDateFormatter.prototype.weekViewColumnSubHeader = function (_a) {
1523 var date = _a.date, locale = _a.locale;
1524 return new Intl.DateTimeFormat(locale, {
1525 day: 'numeric',
1526 month: 'short',
1527 }).format(date);
1528 };
1529 /**
1530 * The week view title
1531 */
1532 CalendarNativeDateFormatter.prototype.weekViewTitle = function (_a) {
1533 var date = _a.date, locale = _a.locale, weekStartsOn = _a.weekStartsOn, excludeDays = _a.excludeDays, daysInWeek = _a.daysInWeek;
1534 var _b = getWeekViewPeriod(this.dateAdapter, date, weekStartsOn, excludeDays, daysInWeek), viewStart = _b.viewStart, viewEnd = _b.viewEnd;
1535 var format = function (dateToFormat, showYear) { return new Intl.DateTimeFormat(locale, {
1536 day: 'numeric',
1537 month: 'short',
1538 year: showYear ? 'numeric' : undefined,
1539 }).format(dateToFormat); };
1540 return format(viewStart, viewStart.getUTCFullYear() !== viewEnd.getUTCFullYear()) + " - " + format(viewEnd, true);
1541 };
1542 /**
1543 * The time formatting down the left hand side of the week view
1544 */
1545 CalendarNativeDateFormatter.prototype.weekViewHour = function (_a) {
1546 var date = _a.date, locale = _a.locale;
1547 return new Intl.DateTimeFormat(locale, { hour: 'numeric' }).format(date);
1548 };
1549 /**
1550 * The time formatting down the left hand side of the day view
1551 */
1552 CalendarNativeDateFormatter.prototype.dayViewHour = function (_a) {
1553 var date = _a.date, locale = _a.locale;
1554 return new Intl.DateTimeFormat(locale, { hour: 'numeric' }).format(date);
1555 };
1556 /**
1557 * The day view title
1558 */
1559 CalendarNativeDateFormatter.prototype.dayViewTitle = function (_a) {
1560 var date = _a.date, locale = _a.locale;
1561 return new Intl.DateTimeFormat(locale, {
1562 day: 'numeric',
1563 month: 'long',
1564 year: 'numeric',
1565 weekday: 'long',
1566 }).format(date);
1567 };
1568 return CalendarNativeDateFormatter;
1569 }());
1570 CalendarNativeDateFormatter.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarNativeDateFormatter, deps: [{ token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1571 CalendarNativeDateFormatter.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarNativeDateFormatter });
1572 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarNativeDateFormatter, decorators: [{
1573 type: i0.Injectable
1574 }], ctorParameters: function () { return [{ type: DateAdapter }]; } });
1575
1576 exports.CalendarEventTimesChangedEventType = void 0;
1577 (function (CalendarEventTimesChangedEventType) {
1578 CalendarEventTimesChangedEventType["Drag"] = "drag";
1579 CalendarEventTimesChangedEventType["Drop"] = "drop";
1580 CalendarEventTimesChangedEventType["Resize"] = "resize";
1581 })(exports.CalendarEventTimesChangedEventType || (exports.CalendarEventTimesChangedEventType = {}));
1582
1583 /**
1584 * Import this module to if you're just using a singular view and want to save on bundle size. Example usage:
1585 *
1586 * ```typescript
1587 * import { CalendarCommonModule, CalendarMonthModule } from 'angular-calendar';
1588 *
1589 * @NgModule({
1590 * imports: [
1591 * CalendarCommonModule.forRoot(),
1592 * CalendarMonthModule
1593 * ]
1594 * })
1595 * class MyModule {}
1596 * ```
1597 *
1598 */
1599 var CalendarCommonModule = /** @class */ (function () {
1600 function CalendarCommonModule() {
1601 }
1602 CalendarCommonModule.forRoot = function (dateAdapter, config) {
1603 if (config === void 0) { config = {}; }
1604 return {
1605 ngModule: CalendarCommonModule,
1606 providers: [
1607 dateAdapter,
1608 config.eventTitleFormatter || CalendarEventTitleFormatter,
1609 config.dateFormatter || CalendarDateFormatter,
1610 config.utils || CalendarUtils,
1611 config.a11y || CalendarA11y,
1612 ],
1613 };
1614 };
1615 return CalendarCommonModule;
1616 }());
1617 CalendarCommonModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarCommonModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
1618 CalendarCommonModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarCommonModule, declarations: [CalendarEventActionsComponent,
1619 CalendarEventTitleComponent,
1620 CalendarTooltipWindowComponent,
1621 CalendarTooltipDirective,
1622 CalendarPreviousViewDirective,
1623 CalendarNextViewDirective,
1624 CalendarTodayDirective,
1625 CalendarDatePipe,
1626 CalendarEventTitlePipe,
1627 CalendarA11yPipe,
1628 ClickDirective,
1629 KeydownEnterDirective], imports: [i1.CommonModule], exports: [CalendarEventActionsComponent,
1630 CalendarEventTitleComponent,
1631 CalendarTooltipWindowComponent,
1632 CalendarTooltipDirective,
1633 CalendarPreviousViewDirective,
1634 CalendarNextViewDirective,
1635 CalendarTodayDirective,
1636 CalendarDatePipe,
1637 CalendarEventTitlePipe,
1638 CalendarA11yPipe,
1639 ClickDirective,
1640 KeydownEnterDirective] });
1641 CalendarCommonModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarCommonModule, providers: [i1.I18nPluralPipe], imports: [[i1.CommonModule]] });
1642 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarCommonModule, decorators: [{
1643 type: i0.NgModule,
1644 args: [{
1645 declarations: [
1646 CalendarEventActionsComponent,
1647 CalendarEventTitleComponent,
1648 CalendarTooltipWindowComponent,
1649 CalendarTooltipDirective,
1650 CalendarPreviousViewDirective,
1651 CalendarNextViewDirective,
1652 CalendarTodayDirective,
1653 CalendarDatePipe,
1654 CalendarEventTitlePipe,
1655 CalendarA11yPipe,
1656 ClickDirective,
1657 KeydownEnterDirective,
1658 ],
1659 imports: [i1.CommonModule],
1660 exports: [
1661 CalendarEventActionsComponent,
1662 CalendarEventTitleComponent,
1663 CalendarTooltipWindowComponent,
1664 CalendarTooltipDirective,
1665 CalendarPreviousViewDirective,
1666 CalendarNextViewDirective,
1667 CalendarTodayDirective,
1668 CalendarDatePipe,
1669 CalendarEventTitlePipe,
1670 CalendarA11yPipe,
1671 ClickDirective,
1672 KeydownEnterDirective,
1673 ],
1674 providers: [i1.I18nPluralPipe],
1675 entryComponents: [CalendarTooltipWindowComponent],
1676 }]
1677 }] });
1678
1679 var CalendarMonthViewHeaderComponent = /** @class */ (function () {
1680 function CalendarMonthViewHeaderComponent() {
1681 this.columnHeaderClicked = new i0.EventEmitter();
1682 this.trackByWeekDayHeaderDate = trackByWeekDayHeaderDate;
1683 }
1684 return CalendarMonthViewHeaderComponent;
1685 }());
1686 CalendarMonthViewHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthViewHeaderComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1687 CalendarMonthViewHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarMonthViewHeaderComponent, selector: "mwl-calendar-month-view-header", inputs: { days: "days", locale: "locale", customTemplate: "customTemplate" }, outputs: { columnHeaderClicked: "columnHeaderClicked" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-days=\"days\"\n let-locale=\"locale\"\n let-trackByWeekDayHeaderDate=\"trackByWeekDayHeaderDate\"\n >\n <div class=\"cal-cell-row cal-header\" role=\"row\">\n <div\n class=\"cal-cell\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n [class.cal-past]=\"day.isPast\"\n [class.cal-today]=\"day.isToday\"\n [class.cal-future]=\"day.isFuture\"\n [class.cal-weekend]=\"day.isWeekend\"\n (click)=\"\n columnHeaderClicked.emit({\n isoDayNumber: day.day,\n sourceEvent: $event\n })\n \"\n [ngClass]=\"day.cssClass\"\n tabindex=\"0\"\n role=\"columnheader\"\n >\n {{ day.date | calendarDate: 'monthViewColumnHeader':locale }}\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n days: days,\n locale: locale,\n trackByWeekDayHeaderDate: trackByWeekDayHeaderDate\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarDate": CalendarDatePipe } });
1688 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthViewHeaderComponent, decorators: [{
1689 type: i0.Component,
1690 args: [{
1691 selector: 'mwl-calendar-month-view-header',
1692 template: "\n <ng-template\n #defaultTemplate\n let-days=\"days\"\n let-locale=\"locale\"\n let-trackByWeekDayHeaderDate=\"trackByWeekDayHeaderDate\"\n >\n <div class=\"cal-cell-row cal-header\" role=\"row\">\n <div\n class=\"cal-cell\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n [class.cal-past]=\"day.isPast\"\n [class.cal-today]=\"day.isToday\"\n [class.cal-future]=\"day.isFuture\"\n [class.cal-weekend]=\"day.isWeekend\"\n (click)=\"\n columnHeaderClicked.emit({\n isoDayNumber: day.day,\n sourceEvent: $event\n })\n \"\n [ngClass]=\"day.cssClass\"\n tabindex=\"0\"\n role=\"columnheader\"\n >\n {{ day.date | calendarDate: 'monthViewColumnHeader':locale }}\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n days: days,\n locale: locale,\n trackByWeekDayHeaderDate: trackByWeekDayHeaderDate\n }\"\n >\n </ng-template>\n ",
1693 }]
1694 }], propDecorators: { days: [{
1695 type: i0.Input
1696 }], locale: [{
1697 type: i0.Input
1698 }], customTemplate: [{
1699 type: i0.Input
1700 }], columnHeaderClicked: [{
1701 type: i0.Output
1702 }] } });
1703
1704 var CalendarMonthCellComponent = /** @class */ (function () {
1705 function CalendarMonthCellComponent() {
1706 this.highlightDay = new i0.EventEmitter();
1707 this.unhighlightDay = new i0.EventEmitter();
1708 this.eventClicked = new i0.EventEmitter();
1709 this.trackByEventId = trackByEventId;
1710 this.validateDrag = isWithinThreshold;
1711 }
1712 return CalendarMonthCellComponent;
1713 }());
1714 CalendarMonthCellComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthCellComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1715 CalendarMonthCellComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarMonthCellComponent, selector: "mwl-calendar-month-cell", inputs: { day: "day", openDay: "openDay", locale: "locale", tooltipPlacement: "tooltipPlacement", tooltipAppendToBody: "tooltipAppendToBody", customTemplate: "customTemplate", tooltipTemplate: "tooltipTemplate", tooltipDelay: "tooltipDelay" }, outputs: { highlightDay: "highlightDay", unhighlightDay: "unhighlightDay", eventClicked: "eventClicked" }, host: { properties: { "class.cal-past": "day.isPast", "class.cal-today": "day.isToday", "class.cal-future": "day.isFuture", "class.cal-weekend": "day.isWeekend", "class.cal-in-month": "day.inMonth", "class.cal-out-month": "!day.inMonth", "class.cal-has-events": "day.events.length > 0", "class.cal-open": "day === openDay", "class.cal-event-highlight": "!!day.backgroundColor" }, classAttribute: "cal-cell cal-day-cell" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-day=\"day\"\n let-openDay=\"openDay\"\n let-locale=\"locale\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-highlightDay=\"highlightDay\"\n let-unhighlightDay=\"unhighlightDay\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDelay=\"tooltipDelay\"\n let-trackByEventId=\"trackByEventId\"\n let-validateDrag=\"validateDrag\"\n >\n <div\n class=\"cal-cell-top\"\n [attr.aria-label]=\"\n { day: day, locale: locale } | calendarA11y: 'monthCell'\n \"\n >\n <span aria-hidden=\"true\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{\n day.badgeTotal\n }}</span>\n <span class=\"cal-day-number\">{{\n day.date | calendarDate: 'monthViewDayNumber':locale\n }}</span>\n </span>\n </div>\n <div class=\"cal-events\" *ngIf=\"day.events.length > 0\">\n <div\n class=\"cal-event\"\n *ngFor=\"let event of day.events; trackBy: trackByEventId\"\n [ngStyle]=\"{ backgroundColor: event.color?.primary }\"\n [ngClass]=\"event?.cssClass\"\n (mouseenter)=\"highlightDay.emit({ event: event })\"\n (mouseleave)=\"unhighlightDay.emit({ event: event })\"\n [mwlCalendarTooltip]=\"\n event.title | calendarEventTitle: 'monthTooltip':event\n \"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n mwlDraggable\n [class.cal-draggable]=\"event.draggable\"\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: event, draggedFrom: day }\"\n [dragAxis]=\"{ x: event.draggable, y: event.draggable }\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n (mwlClick)=\"eventClicked.emit({ event: event, sourceEvent: $event })\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideMonthCellEvents'\"\n ></div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n day: day,\n openDay: openDay,\n locale: locale,\n tooltipPlacement: tooltipPlacement,\n highlightDay: highlightDay,\n unhighlightDay: unhighlightDay,\n eventClicked: eventClicked,\n tooltipTemplate: tooltipTemplate,\n tooltipAppendToBody: tooltipAppendToBody,\n tooltipDelay: tooltipDelay,\n trackByEventId: trackByEventId,\n validateDrag: validateDrag\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.DraggableDirective, selector: "[mwlDraggable]", inputs: ["dropData", "dragAxis", "dragSnapGrid", "ghostDragEnabled", "showOriginalElementWhileDragging", "validateDrag", "dragCursor", "dragActiveClass", "ghostElementAppendTo", "ghostElementTemplate", "touchStartLongPress", "autoScroll"], outputs: ["dragPointerDown", "dragStart", "ghostElementCreated", "dragging", "dragEnd"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: CalendarTooltipDirective, selector: "[mwlCalendarTooltip]", inputs: ["mwlCalendarTooltip", "tooltipPlacement", "tooltipTemplate", "tooltipEvent", "tooltipAppendToBody", "tooltipDelay"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarA11y": CalendarA11yPipe, "calendarDate": CalendarDatePipe, "calendarEventTitle": CalendarEventTitlePipe } });
1716 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthCellComponent, decorators: [{
1717 type: i0.Component,
1718 args: [{
1719 selector: 'mwl-calendar-month-cell',
1720 template: "\n <ng-template\n #defaultTemplate\n let-day=\"day\"\n let-openDay=\"openDay\"\n let-locale=\"locale\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-highlightDay=\"highlightDay\"\n let-unhighlightDay=\"unhighlightDay\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDelay=\"tooltipDelay\"\n let-trackByEventId=\"trackByEventId\"\n let-validateDrag=\"validateDrag\"\n >\n <div\n class=\"cal-cell-top\"\n [attr.aria-label]=\"\n { day: day, locale: locale } | calendarA11y: 'monthCell'\n \"\n >\n <span aria-hidden=\"true\">\n <span class=\"cal-day-badge\" *ngIf=\"day.badgeTotal > 0\">{{\n day.badgeTotal\n }}</span>\n <span class=\"cal-day-number\">{{\n day.date | calendarDate: 'monthViewDayNumber':locale\n }}</span>\n </span>\n </div>\n <div class=\"cal-events\" *ngIf=\"day.events.length > 0\">\n <div\n class=\"cal-event\"\n *ngFor=\"let event of day.events; trackBy: trackByEventId\"\n [ngStyle]=\"{ backgroundColor: event.color?.primary }\"\n [ngClass]=\"event?.cssClass\"\n (mouseenter)=\"highlightDay.emit({ event: event })\"\n (mouseleave)=\"unhighlightDay.emit({ event: event })\"\n [mwlCalendarTooltip]=\"\n event.title | calendarEventTitle: 'monthTooltip':event\n \"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n mwlDraggable\n [class.cal-draggable]=\"event.draggable\"\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: event, draggedFrom: day }\"\n [dragAxis]=\"{ x: event.draggable, y: event.draggable }\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n (mwlClick)=\"eventClicked.emit({ event: event, sourceEvent: $event })\"\n [attr.aria-hidden]=\"{} | calendarA11y: 'hideMonthCellEvents'\"\n ></div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n day: day,\n openDay: openDay,\n locale: locale,\n tooltipPlacement: tooltipPlacement,\n highlightDay: highlightDay,\n unhighlightDay: unhighlightDay,\n eventClicked: eventClicked,\n tooltipTemplate: tooltipTemplate,\n tooltipAppendToBody: tooltipAppendToBody,\n tooltipDelay: tooltipDelay,\n trackByEventId: trackByEventId,\n validateDrag: validateDrag\n }\"\n >\n </ng-template>\n ",
1721 // eslint-disable-next-line @angular-eslint/no-host-metadata-property
1722 host: {
1723 class: 'cal-cell cal-day-cell',
1724 '[class.cal-past]': 'day.isPast',
1725 '[class.cal-today]': 'day.isToday',
1726 '[class.cal-future]': 'day.isFuture',
1727 '[class.cal-weekend]': 'day.isWeekend',
1728 '[class.cal-in-month]': 'day.inMonth',
1729 '[class.cal-out-month]': '!day.inMonth',
1730 '[class.cal-has-events]': 'day.events.length > 0',
1731 '[class.cal-open]': 'day === openDay',
1732 '[class.cal-event-highlight]': '!!day.backgroundColor',
1733 },
1734 }]
1735 }], propDecorators: { day: [{
1736 type: i0.Input
1737 }], openDay: [{
1738 type: i0.Input
1739 }], locale: [{
1740 type: i0.Input
1741 }], tooltipPlacement: [{
1742 type: i0.Input
1743 }], tooltipAppendToBody: [{
1744 type: i0.Input
1745 }], customTemplate: [{
1746 type: i0.Input
1747 }], tooltipTemplate: [{
1748 type: i0.Input
1749 }], tooltipDelay: [{
1750 type: i0.Input
1751 }], highlightDay: [{
1752 type: i0.Output
1753 }], unhighlightDay: [{
1754 type: i0.Output
1755 }], eventClicked: [{
1756 type: i0.Output
1757 }] } });
1758
1759 var collapseAnimation = animations.trigger('collapse', [
1760 animations.state('void', animations.style({
1761 height: 0,
1762 overflow: 'hidden',
1763 'padding-top': 0,
1764 'padding-bottom': 0,
1765 })),
1766 animations.state('*', animations.style({
1767 height: '*',
1768 overflow: 'hidden',
1769 'padding-top': '*',
1770 'padding-bottom': '*',
1771 })),
1772 animations.transition('* => void', animations.animate('150ms ease-out')),
1773 animations.transition('void => *', animations.animate('150ms ease-in')),
1774 ]);
1775 var CalendarOpenDayEventsComponent = /** @class */ (function () {
1776 function CalendarOpenDayEventsComponent() {
1777 this.isOpen = false;
1778 this.eventClicked = new i0.EventEmitter();
1779 this.trackByEventId = trackByEventId;
1780 this.validateDrag = isWithinThreshold;
1781 }
1782 return CalendarOpenDayEventsComponent;
1783 }());
1784 CalendarOpenDayEventsComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarOpenDayEventsComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
1785 CalendarOpenDayEventsComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarOpenDayEventsComponent, selector: "mwl-calendar-open-day-events", inputs: { locale: "locale", isOpen: "isOpen", events: "events", customTemplate: "customTemplate", eventTitleTemplate: "eventTitleTemplate", eventActionsTemplate: "eventActionsTemplate", date: "date" }, outputs: { eventClicked: "eventClicked" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-events=\"events\"\n let-eventClicked=\"eventClicked\"\n let-isOpen=\"isOpen\"\n let-trackByEventId=\"trackByEventId\"\n let-validateDrag=\"validateDrag\"\n >\n <div\n class=\"cal-open-day-events\"\n [@collapse]\n *ngIf=\"isOpen\"\n role=\"application\"\n >\n <span\n tabindex=\"-1\"\n role=\"alert\"\n [attr.aria-label]=\"\n { date: date, locale: locale } | calendarA11y: 'openDayEventsAlert'\n \"\n ></span>\n <span\n tabindex=\"0\"\n role=\"landmark\"\n [attr.aria-label]=\"\n { date: date, locale: locale }\n | calendarA11y: 'openDayEventsLandmark'\n \"\n ></span>\n <div\n *ngFor=\"let event of events; trackBy: trackByEventId\"\n [ngClass]=\"event?.cssClass\"\n mwlDraggable\n [class.cal-draggable]=\"event.draggable\"\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: event }\"\n [dragAxis]=\"{ x: event.draggable, y: event.draggable }\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n >\n <span\n class=\"cal-event\"\n [ngStyle]=\"{ backgroundColor: event.color?.primary }\"\n >\n </span>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"event\"\n [customTemplate]=\"eventTitleTemplate\"\n view=\"month\"\n (mwlClick)=\"\n eventClicked.emit({ event: event, sourceEvent: $event })\n \"\n (mwlKeydownEnter)=\"\n eventClicked.emit({ event: event, sourceEvent: $event })\n \"\n tabindex=\"0\"\n [attr.aria-label]=\"\n { event: event, locale: locale }\n | calendarA11y: 'eventDescription'\n \"\n >\n </mwl-calendar-event-title>\n &ngsp;\n <mwl-calendar-event-actions\n [event]=\"event\"\n [customTemplate]=\"eventActionsTemplate\"\n >\n </mwl-calendar-event-actions>\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n events: events,\n eventClicked: eventClicked,\n isOpen: isOpen,\n trackByEventId: trackByEventId,\n validateDrag: validateDrag\n }\"\n >\n </ng-template>\n ", isInline: true, components: [{ type: CalendarEventTitleComponent, selector: "mwl-calendar-event-title", inputs: ["event", "customTemplate", "view"] }, { type: CalendarEventActionsComponent, selector: "mwl-calendar-event-actions", inputs: ["event", "customTemplate"] }], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.DraggableDirective, selector: "[mwlDraggable]", inputs: ["dropData", "dragAxis", "dragSnapGrid", "ghostDragEnabled", "showOriginalElementWhileDragging", "validateDrag", "dragCursor", "dragActiveClass", "ghostElementAppendTo", "ghostElementTemplate", "touchStartLongPress", "autoScroll"], outputs: ["dragPointerDown", "dragStart", "ghostElementCreated", "dragging", "dragEnd"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: KeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: ["mwlKeydownEnter"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarA11y": CalendarA11yPipe }, animations: [collapseAnimation] });
1786 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarOpenDayEventsComponent, decorators: [{
1787 type: i0.Component,
1788 args: [{
1789 selector: 'mwl-calendar-open-day-events',
1790 template: "\n <ng-template\n #defaultTemplate\n let-events=\"events\"\n let-eventClicked=\"eventClicked\"\n let-isOpen=\"isOpen\"\n let-trackByEventId=\"trackByEventId\"\n let-validateDrag=\"validateDrag\"\n >\n <div\n class=\"cal-open-day-events\"\n [@collapse]\n *ngIf=\"isOpen\"\n role=\"application\"\n >\n <span\n tabindex=\"-1\"\n role=\"alert\"\n [attr.aria-label]=\"\n { date: date, locale: locale } | calendarA11y: 'openDayEventsAlert'\n \"\n ></span>\n <span\n tabindex=\"0\"\n role=\"landmark\"\n [attr.aria-label]=\"\n { date: date, locale: locale }\n | calendarA11y: 'openDayEventsLandmark'\n \"\n ></span>\n <div\n *ngFor=\"let event of events; trackBy: trackByEventId\"\n [ngClass]=\"event?.cssClass\"\n mwlDraggable\n [class.cal-draggable]=\"event.draggable\"\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: event }\"\n [dragAxis]=\"{ x: event.draggable, y: event.draggable }\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n >\n <span\n class=\"cal-event\"\n [ngStyle]=\"{ backgroundColor: event.color?.primary }\"\n >\n </span>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"event\"\n [customTemplate]=\"eventTitleTemplate\"\n view=\"month\"\n (mwlClick)=\"\n eventClicked.emit({ event: event, sourceEvent: $event })\n \"\n (mwlKeydownEnter)=\"\n eventClicked.emit({ event: event, sourceEvent: $event })\n \"\n tabindex=\"0\"\n [attr.aria-label]=\"\n { event: event, locale: locale }\n | calendarA11y: 'eventDescription'\n \"\n >\n </mwl-calendar-event-title>\n &ngsp;\n <mwl-calendar-event-actions\n [event]=\"event\"\n [customTemplate]=\"eventActionsTemplate\"\n >\n </mwl-calendar-event-actions>\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n events: events,\n eventClicked: eventClicked,\n isOpen: isOpen,\n trackByEventId: trackByEventId,\n validateDrag: validateDrag\n }\"\n >\n </ng-template>\n ",
1791 animations: [collapseAnimation],
1792 }]
1793 }], propDecorators: { locale: [{
1794 type: i0.Input
1795 }], isOpen: [{
1796 type: i0.Input
1797 }], events: [{
1798 type: i0.Input
1799 }], customTemplate: [{
1800 type: i0.Input
1801 }], eventTitleTemplate: [{
1802 type: i0.Input
1803 }], eventActionsTemplate: [{
1804 type: i0.Input
1805 }], date: [{
1806 type: i0.Input
1807 }], eventClicked: [{
1808 type: i0.Output
1809 }] } });
1810
1811 /**
1812 * Shows all events on a given month. Example usage:
1813 *
1814 * ```typescript
1815 * <mwl-calendar-month-view
1816 * [viewDate]="viewDate"
1817 * [events]="events">
1818 * </mwl-calendar-month-view>
1819 * ```
1820 */
1821 var CalendarMonthViewComponent = /** @class */ (function () {
1822 /**
1823 * @hidden
1824 */
1825 function CalendarMonthViewComponent(cdr, utils, locale, dateAdapter) {
1826 var _this = this;
1827 this.cdr = cdr;
1828 this.utils = utils;
1829 this.dateAdapter = dateAdapter;
1830 /**
1831 * An array of events to display on view.
1832 * The schema is available here: https://github.com/mattlewis92/calendar-utils/blob/c51689985f59a271940e30bc4e2c4e1fee3fcb5c/src/calendarUtils.ts#L49-L63
1833 */
1834 this.events = [];
1835 /**
1836 * An array of day indexes (0 = sunday, 1 = monday etc) that will be hidden on the view
1837 */
1838 this.excludeDays = [];
1839 /**
1840 * Whether the events list for the day of the `viewDate` option is visible or not
1841 */
1842 this.activeDayIsOpen = false;
1843 /**
1844 * The placement of the event tooltip
1845 */
1846 this.tooltipPlacement = 'auto';
1847 /**
1848 * Whether to append tooltips to the body or next to the trigger element
1849 */
1850 this.tooltipAppendToBody = true;
1851 /**
1852 * The delay in milliseconds before the tooltip should be displayed. If not provided the tooltip
1853 * will be displayed immediately.
1854 */
1855 this.tooltipDelay = null;
1856 /**
1857 * An output that will be called before the view is rendered for the current month.
1858 * If you add the `cssClass` property to a day in the body it will add that class to the cell element in the template
1859 */
1860 this.beforeViewRender = new i0.EventEmitter();
1861 /**
1862 * Called when the day cell is clicked
1863 */
1864 this.dayClicked = new i0.EventEmitter();
1865 /**
1866 * Called when the event title is clicked
1867 */
1868 this.eventClicked = new i0.EventEmitter();
1869 /**
1870 * Called when a header week day is clicked. Returns ISO day number.
1871 */
1872 this.columnHeaderClicked = new i0.EventEmitter();
1873 /**
1874 * Called when an event is dragged and dropped
1875 */
1876 this.eventTimesChanged = new i0.EventEmitter();
1877 /**
1878 * @hidden
1879 */
1880 this.trackByRowOffset = function (index, offset) { return _this.view.days
1881 .slice(offset, _this.view.totalDaysVisibleInWeek)
1882 .map(function (day) { return day.date.toISOString(); })
1883 .join('-'); };
1884 /**
1885 * @hidden
1886 */
1887 this.trackByDate = function (index, day) { return day.date.toISOString(); };
1888 this.locale = locale;
1889 }
1890 /**
1891 * @hidden
1892 */
1893 CalendarMonthViewComponent.prototype.ngOnInit = function () {
1894 var _this = this;
1895 if (this.refresh) {
1896 this.refreshSubscription = this.refresh.subscribe(function () {
1897 _this.refreshAll();
1898 _this.cdr.markForCheck();
1899 });
1900 }
1901 };
1902 /**
1903 * @hidden
1904 */
1905 CalendarMonthViewComponent.prototype.ngOnChanges = function (changes) {
1906 var refreshHeader = changes.viewDate || changes.excludeDays || changes.weekendDays;
1907 var refreshBody = changes.viewDate ||
1908 changes.events ||
1909 changes.excludeDays ||
1910 changes.weekendDays;
1911 if (refreshHeader) {
1912 this.refreshHeader();
1913 }
1914 if (changes.events) {
1915 validateEvents(this.events);
1916 }
1917 if (refreshBody) {
1918 this.refreshBody();
1919 }
1920 if (refreshHeader || refreshBody) {
1921 this.emitBeforeViewRender();
1922 }
1923 if (changes.activeDayIsOpen ||
1924 changes.viewDate ||
1925 changes.events ||
1926 changes.excludeDays ||
1927 changes.activeDay) {
1928 this.checkActiveDayIsOpen();
1929 }
1930 };
1931 /**
1932 * @hidden
1933 */
1934 CalendarMonthViewComponent.prototype.ngOnDestroy = function () {
1935 if (this.refreshSubscription) {
1936 this.refreshSubscription.unsubscribe();
1937 }
1938 };
1939 /**
1940 * @hidden
1941 */
1942 CalendarMonthViewComponent.prototype.toggleDayHighlight = function (event, isHighlighted) {
1943 this.view.days.forEach(function (day) {
1944 if (isHighlighted && day.events.indexOf(event) > -1) {
1945 day.backgroundColor =
1946 (event.color && event.color.secondary) || '#D1E8FF';
1947 }
1948 else {
1949 delete day.backgroundColor;
1950 }
1951 });
1952 };
1953 /**
1954 * @hidden
1955 */
1956 CalendarMonthViewComponent.prototype.eventDropped = function (droppedOn, event, draggedFrom) {
1957 if (droppedOn !== draggedFrom) {
1958 var year = this.dateAdapter.getYear(droppedOn.date);
1959 var month = this.dateAdapter.getMonth(droppedOn.date);
1960 var date = this.dateAdapter.getDate(droppedOn.date);
1961 var newStart = this.dateAdapter.setDate(this.dateAdapter.setMonth(this.dateAdapter.setYear(event.start, year), month), date);
1962 var newEnd = void 0;
1963 if (event.end) {
1964 var secondsDiff = this.dateAdapter.differenceInSeconds(newStart, event.start);
1965 newEnd = this.dateAdapter.addSeconds(event.end, secondsDiff);
1966 }
1967 this.eventTimesChanged.emit({
1968 event: event,
1969 newStart: newStart,
1970 newEnd: newEnd,
1971 day: droppedOn,
1972 type: exports.CalendarEventTimesChangedEventType.Drop,
1973 });
1974 }
1975 };
1976 CalendarMonthViewComponent.prototype.refreshHeader = function () {
1977 this.columnHeaders = this.utils.getWeekViewHeader({
1978 viewDate: this.viewDate,
1979 weekStartsOn: this.weekStartsOn,
1980 excluded: this.excludeDays,
1981 weekendDays: this.weekendDays,
1982 });
1983 };
1984 CalendarMonthViewComponent.prototype.refreshBody = function () {
1985 this.view = this.utils.getMonthView({
1986 events: this.events,
1987 viewDate: this.viewDate,
1988 weekStartsOn: this.weekStartsOn,
1989 excluded: this.excludeDays,
1990 weekendDays: this.weekendDays,
1991 });
1992 };
1993 CalendarMonthViewComponent.prototype.checkActiveDayIsOpen = function () {
1994 var _this = this;
1995 if (this.activeDayIsOpen === true) {
1996 var activeDay_1 = this.activeDay || this.viewDate;
1997 this.openDay = this.view.days.find(function (day) { return _this.dateAdapter.isSameDay(day.date, activeDay_1); });
1998 var index = this.view.days.indexOf(this.openDay);
1999 this.openRowIndex =
2000 Math.floor(index / this.view.totalDaysVisibleInWeek) *
2001 this.view.totalDaysVisibleInWeek;
2002 }
2003 else {
2004 this.openRowIndex = null;
2005 this.openDay = null;
2006 }
2007 };
2008 CalendarMonthViewComponent.prototype.refreshAll = function () {
2009 this.refreshHeader();
2010 this.refreshBody();
2011 this.emitBeforeViewRender();
2012 this.checkActiveDayIsOpen();
2013 };
2014 CalendarMonthViewComponent.prototype.emitBeforeViewRender = function () {
2015 if (this.columnHeaders && this.view) {
2016 this.beforeViewRender.emit({
2017 header: this.columnHeaders,
2018 body: this.view.days,
2019 period: this.view.period,
2020 });
2021 }
2022 };
2023 return CalendarMonthViewComponent;
2024 }());
2025 CalendarMonthViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthViewComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: CalendarUtils }, { token: i0.LOCALE_ID }, { token: DateAdapter }], target: i0__namespace.ɵɵFactoryTarget.Component });
2026 CalendarMonthViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarMonthViewComponent, selector: "mwl-calendar-month-view", inputs: { viewDate: "viewDate", events: "events", excludeDays: "excludeDays", activeDayIsOpen: "activeDayIsOpen", activeDay: "activeDay", refresh: "refresh", locale: "locale", tooltipPlacement: "tooltipPlacement", tooltipTemplate: "tooltipTemplate", tooltipAppendToBody: "tooltipAppendToBody", tooltipDelay: "tooltipDelay", weekStartsOn: "weekStartsOn", headerTemplate: "headerTemplate", cellTemplate: "cellTemplate", openDayEventsTemplate: "openDayEventsTemplate", eventTitleTemplate: "eventTitleTemplate", eventActionsTemplate: "eventActionsTemplate", weekendDays: "weekendDays" }, outputs: { beforeViewRender: "beforeViewRender", dayClicked: "dayClicked", eventClicked: "eventClicked", columnHeaderClicked: "columnHeaderClicked", eventTimesChanged: "eventTimesChanged" }, usesOnChanges: true, ngImport: i0__namespace, template: "\n <div class=\"cal-month-view\" role=\"grid\">\n <mwl-calendar-month-view-header\n [days]=\"columnHeaders\"\n [locale]=\"locale\"\n (columnHeaderClicked)=\"columnHeaderClicked.emit($event)\"\n [customTemplate]=\"headerTemplate\"\n >\n </mwl-calendar-month-view-header>\n <div class=\"cal-days\">\n <div\n *ngFor=\"let rowIndex of view.rowOffsets; trackBy: trackByRowOffset\"\n >\n <div role=\"row\" class=\"cal-cell-row\">\n <mwl-calendar-month-cell\n role=\"gridcell\"\n *ngFor=\"\n let day of view.days\n | slice: rowIndex:rowIndex + view.totalDaysVisibleInWeek;\n trackBy: trackByDate\n \"\n [ngClass]=\"day?.cssClass\"\n [day]=\"day\"\n [openDay]=\"openDay\"\n [locale]=\"locale\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"cellTemplate\"\n [ngStyle]=\"{ backgroundColor: day.backgroundColor }\"\n (mwlClick)=\"dayClicked.emit({ day: day, sourceEvent: $event })\"\n [clickListenerDisabled]=\"dayClicked.observers.length === 0\"\n (mwlKeydownEnter)=\"\n dayClicked.emit({ day: day, sourceEvent: $event })\n \"\n (highlightDay)=\"toggleDayHighlight($event.event, true)\"\n (unhighlightDay)=\"toggleDayHighlight($event.event, false)\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped(\n day,\n $event.dropData.event,\n $event.dropData.draggedFrom\n )\n \"\n (eventClicked)=\"\n eventClicked.emit({\n event: $event.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n [attr.tabindex]=\"{} | calendarA11y: 'monthCellTabIndex'\"\n >\n </mwl-calendar-month-cell>\n </div>\n <mwl-calendar-open-day-events\n [locale]=\"locale\"\n [isOpen]=\"openRowIndex === rowIndex\"\n [events]=\"openDay?.events\"\n [date]=\"openDay?.date\"\n [customTemplate]=\"openDayEventsTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n (eventClicked)=\"\n eventClicked.emit({\n event: $event.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped(\n openDay,\n $event.dropData.event,\n $event.dropData.draggedFrom\n )\n \"\n >\n </mwl-calendar-open-day-events>\n </div>\n </div>\n </div>\n ", isInline: true, components: [{ type: CalendarMonthViewHeaderComponent, selector: "mwl-calendar-month-view-header", inputs: ["days", "locale", "customTemplate"], outputs: ["columnHeaderClicked"] }, { type: CalendarMonthCellComponent, selector: "mwl-calendar-month-cell", inputs: ["day", "openDay", "locale", "tooltipPlacement", "tooltipAppendToBody", "customTemplate", "tooltipTemplate", "tooltipDelay"], outputs: ["highlightDay", "unhighlightDay", "eventClicked"] }, { type: CalendarOpenDayEventsComponent, selector: "mwl-calendar-open-day-events", inputs: ["locale", "isOpen", "events", "customTemplate", "eventTitleTemplate", "eventActionsTemplate", "date"], outputs: ["eventClicked"] }], directives: [{ type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.DroppableDirective, selector: "[mwlDroppable]", inputs: ["dragOverClass", "dragActiveClass", "validateDrop"], outputs: ["dragEnter", "dragLeave", "dragOver", "drop"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: KeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: ["mwlKeydownEnter"] }], pipes: { "calendarA11y": CalendarA11yPipe, "slice": i1__namespace.SlicePipe } });
2027 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthViewComponent, decorators: [{
2028 type: i0.Component,
2029 args: [{
2030 selector: 'mwl-calendar-month-view',
2031 template: "\n <div class=\"cal-month-view\" role=\"grid\">\n <mwl-calendar-month-view-header\n [days]=\"columnHeaders\"\n [locale]=\"locale\"\n (columnHeaderClicked)=\"columnHeaderClicked.emit($event)\"\n [customTemplate]=\"headerTemplate\"\n >\n </mwl-calendar-month-view-header>\n <div class=\"cal-days\">\n <div\n *ngFor=\"let rowIndex of view.rowOffsets; trackBy: trackByRowOffset\"\n >\n <div role=\"row\" class=\"cal-cell-row\">\n <mwl-calendar-month-cell\n role=\"gridcell\"\n *ngFor=\"\n let day of view.days\n | slice: rowIndex:rowIndex + view.totalDaysVisibleInWeek;\n trackBy: trackByDate\n \"\n [ngClass]=\"day?.cssClass\"\n [day]=\"day\"\n [openDay]=\"openDay\"\n [locale]=\"locale\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"cellTemplate\"\n [ngStyle]=\"{ backgroundColor: day.backgroundColor }\"\n (mwlClick)=\"dayClicked.emit({ day: day, sourceEvent: $event })\"\n [clickListenerDisabled]=\"dayClicked.observers.length === 0\"\n (mwlKeydownEnter)=\"\n dayClicked.emit({ day: day, sourceEvent: $event })\n \"\n (highlightDay)=\"toggleDayHighlight($event.event, true)\"\n (unhighlightDay)=\"toggleDayHighlight($event.event, false)\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped(\n day,\n $event.dropData.event,\n $event.dropData.draggedFrom\n )\n \"\n (eventClicked)=\"\n eventClicked.emit({\n event: $event.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n [attr.tabindex]=\"{} | calendarA11y: 'monthCellTabIndex'\"\n >\n </mwl-calendar-month-cell>\n </div>\n <mwl-calendar-open-day-events\n [locale]=\"locale\"\n [isOpen]=\"openRowIndex === rowIndex\"\n [events]=\"openDay?.events\"\n [date]=\"openDay?.date\"\n [customTemplate]=\"openDayEventsTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n (eventClicked)=\"\n eventClicked.emit({\n event: $event.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped(\n openDay,\n $event.dropData.event,\n $event.dropData.draggedFrom\n )\n \"\n >\n </mwl-calendar-open-day-events>\n </div>\n </div>\n </div>\n ",
2032 }]
2033 }], ctorParameters: function () {
2034 return [{ type: i0__namespace.ChangeDetectorRef }, { type: CalendarUtils }, { type: undefined, decorators: [{
2035 type: i0.Inject,
2036 args: [i0.LOCALE_ID]
2037 }] }, { type: DateAdapter }];
2038 }, propDecorators: { viewDate: [{
2039 type: i0.Input
2040 }], events: [{
2041 type: i0.Input
2042 }], excludeDays: [{
2043 type: i0.Input
2044 }], activeDayIsOpen: [{
2045 type: i0.Input
2046 }], activeDay: [{
2047 type: i0.Input
2048 }], refresh: [{
2049 type: i0.Input
2050 }], locale: [{
2051 type: i0.Input
2052 }], tooltipPlacement: [{
2053 type: i0.Input
2054 }], tooltipTemplate: [{
2055 type: i0.Input
2056 }], tooltipAppendToBody: [{
2057 type: i0.Input
2058 }], tooltipDelay: [{
2059 type: i0.Input
2060 }], weekStartsOn: [{
2061 type: i0.Input
2062 }], headerTemplate: [{
2063 type: i0.Input
2064 }], cellTemplate: [{
2065 type: i0.Input
2066 }], openDayEventsTemplate: [{
2067 type: i0.Input
2068 }], eventTitleTemplate: [{
2069 type: i0.Input
2070 }], eventActionsTemplate: [{
2071 type: i0.Input
2072 }], weekendDays: [{
2073 type: i0.Input
2074 }], beforeViewRender: [{
2075 type: i0.Output
2076 }], dayClicked: [{
2077 type: i0.Output
2078 }], eventClicked: [{
2079 type: i0.Output
2080 }], columnHeaderClicked: [{
2081 type: i0.Output
2082 }], eventTimesChanged: [{
2083 type: i0.Output
2084 }] } });
2085
2086 var CalendarMonthModule = /** @class */ (function () {
2087 function CalendarMonthModule() {
2088 }
2089 return CalendarMonthModule;
2090 }());
2091 CalendarMonthModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
2092 CalendarMonthModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthModule, declarations: [CalendarMonthViewComponent,
2093 CalendarMonthCellComponent,
2094 CalendarOpenDayEventsComponent,
2095 CalendarMonthViewHeaderComponent], imports: [i1.CommonModule, i2.DragAndDropModule, CalendarCommonModule], exports: [i2.DragAndDropModule,
2096 CalendarMonthViewComponent,
2097 CalendarMonthCellComponent,
2098 CalendarOpenDayEventsComponent,
2099 CalendarMonthViewHeaderComponent] });
2100 CalendarMonthModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthModule, imports: [[i1.CommonModule, i2.DragAndDropModule, CalendarCommonModule], i2.DragAndDropModule] });
2101 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarMonthModule, decorators: [{
2102 type: i0.NgModule,
2103 args: [{
2104 imports: [i1.CommonModule, i2.DragAndDropModule, CalendarCommonModule],
2105 declarations: [
2106 CalendarMonthViewComponent,
2107 CalendarMonthCellComponent,
2108 CalendarOpenDayEventsComponent,
2109 CalendarMonthViewHeaderComponent,
2110 ],
2111 exports: [
2112 i2.DragAndDropModule,
2113 CalendarMonthViewComponent,
2114 CalendarMonthCellComponent,
2115 CalendarOpenDayEventsComponent,
2116 CalendarMonthViewHeaderComponent,
2117 ],
2118 }]
2119 }] });
2120
2121 var CalendarDragHelper = /** @class */ (function () {
2122 function CalendarDragHelper(dragContainerElement, draggableElement) {
2123 this.dragContainerElement = dragContainerElement;
2124 this.startPosition = draggableElement.getBoundingClientRect();
2125 }
2126 CalendarDragHelper.prototype.validateDrag = function (_a) {
2127 var x = _a.x, y = _a.y, snapDraggedEvents = _a.snapDraggedEvents, dragAlreadyMoved = _a.dragAlreadyMoved, transform = _a.transform;
2128 var isDraggedWithinThreshold = isWithinThreshold({ x: x, y: y }) || dragAlreadyMoved;
2129 if (snapDraggedEvents) {
2130 var inner = Object.assign({}, this.startPosition, {
2131 left: this.startPosition.left + transform.x,
2132 right: this.startPosition.right + transform.x,
2133 top: this.startPosition.top + transform.y,
2134 bottom: this.startPosition.bottom + transform.y,
2135 });
2136 if (isDraggedWithinThreshold) {
2137 var outer = this.dragContainerElement.getBoundingClientRect();
2138 var isTopInside = outer.top < inner.top && inner.top < outer.bottom;
2139 var isBottomInside = outer.top < inner.bottom && inner.bottom < outer.bottom;
2140 return (isInsideLeftAndRight(outer, inner) && (isTopInside || isBottomInside));
2141 }
2142 /* istanbul ignore next */
2143 return false;
2144 }
2145 else {
2146 return isDraggedWithinThreshold;
2147 }
2148 };
2149 return CalendarDragHelper;
2150 }());
2151
2152 var CalendarResizeHelper = /** @class */ (function () {
2153 function CalendarResizeHelper(resizeContainerElement, minWidth, rtl) {
2154 this.resizeContainerElement = resizeContainerElement;
2155 this.minWidth = minWidth;
2156 this.rtl = rtl;
2157 }
2158 CalendarResizeHelper.prototype.validateResize = function (_a) {
2159 var rectangle = _a.rectangle, edges = _a.edges;
2160 if (this.rtl) {
2161 // TODO - find a way of testing this, for some reason the tests always fail but it does actually work
2162 /* istanbul ignore next */
2163 if (typeof edges.left !== 'undefined') {
2164 rectangle.left -= edges.left;
2165 rectangle.right += edges.left;
2166 }
2167 else if (typeof edges.right !== 'undefined') {
2168 rectangle.left += edges.right;
2169 rectangle.right -= edges.right;
2170 }
2171 rectangle.width = rectangle.right - rectangle.left;
2172 }
2173 if (this.minWidth &&
2174 Math.ceil(rectangle.width) < Math.ceil(this.minWidth)) {
2175 return false;
2176 }
2177 return isInside(this.resizeContainerElement.getBoundingClientRect(), rectangle);
2178 };
2179 return CalendarResizeHelper;
2180 }());
2181
2182 var CalendarWeekViewHeaderComponent = /** @class */ (function () {
2183 function CalendarWeekViewHeaderComponent() {
2184 this.dayHeaderClicked = new i0.EventEmitter();
2185 this.eventDropped = new i0.EventEmitter();
2186 this.dragEnter = new i0.EventEmitter();
2187 this.trackByWeekDayHeaderDate = trackByWeekDayHeaderDate;
2188 }
2189 return CalendarWeekViewHeaderComponent;
2190 }());
2191 CalendarWeekViewHeaderComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewHeaderComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2192 CalendarWeekViewHeaderComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarWeekViewHeaderComponent, selector: "mwl-calendar-week-view-header", inputs: { days: "days", locale: "locale", customTemplate: "customTemplate" }, outputs: { dayHeaderClicked: "dayHeaderClicked", eventDropped: "eventDropped", dragEnter: "dragEnter" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-days=\"days\"\n let-locale=\"locale\"\n let-dayHeaderClicked=\"dayHeaderClicked\"\n let-eventDropped=\"eventDropped\"\n let-trackByWeekDayHeaderDate=\"trackByWeekDayHeaderDate\"\n let-dragEnter=\"dragEnter\"\n >\n <div class=\"cal-day-headers\" role=\"row\">\n <div\n class=\"cal-header\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n [class.cal-past]=\"day.isPast\"\n [class.cal-today]=\"day.isToday\"\n [class.cal-future]=\"day.isFuture\"\n [class.cal-weekend]=\"day.isWeekend\"\n [ngClass]=\"day.cssClass\"\n (mwlClick)=\"dayHeaderClicked.emit({ day: day, sourceEvent: $event })\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped.emit({\n event: $event.dropData.event,\n newStart: day.date\n })\n \"\n (dragEnter)=\"dragEnter.emit({ date: day.date })\"\n tabindex=\"0\"\n role=\"columnheader\"\n >\n <b>{{ day.date | calendarDate: 'weekViewColumnHeader':locale }}</b\n ><br />\n <span>{{\n day.date | calendarDate: 'weekViewColumnSubHeader':locale\n }}</span>\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n days: days,\n locale: locale,\n dayHeaderClicked: dayHeaderClicked,\n eventDropped: eventDropped,\n dragEnter: dragEnter,\n trackByWeekDayHeaderDate: trackByWeekDayHeaderDate\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i2__namespace.DroppableDirective, selector: "[mwlDroppable]", inputs: ["dragOverClass", "dragActiveClass", "validateDrop"], outputs: ["dragEnter", "dragLeave", "dragOver", "drop"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarDate": CalendarDatePipe } });
2193 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewHeaderComponent, decorators: [{
2194 type: i0.Component,
2195 args: [{
2196 selector: 'mwl-calendar-week-view-header',
2197 template: "\n <ng-template\n #defaultTemplate\n let-days=\"days\"\n let-locale=\"locale\"\n let-dayHeaderClicked=\"dayHeaderClicked\"\n let-eventDropped=\"eventDropped\"\n let-trackByWeekDayHeaderDate=\"trackByWeekDayHeaderDate\"\n let-dragEnter=\"dragEnter\"\n >\n <div class=\"cal-day-headers\" role=\"row\">\n <div\n class=\"cal-header\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n [class.cal-past]=\"day.isPast\"\n [class.cal-today]=\"day.isToday\"\n [class.cal-future]=\"day.isFuture\"\n [class.cal-weekend]=\"day.isWeekend\"\n [ngClass]=\"day.cssClass\"\n (mwlClick)=\"dayHeaderClicked.emit({ day: day, sourceEvent: $event })\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"\n eventDropped.emit({\n event: $event.dropData.event,\n newStart: day.date\n })\n \"\n (dragEnter)=\"dragEnter.emit({ date: day.date })\"\n tabindex=\"0\"\n role=\"columnheader\"\n >\n <b>{{ day.date | calendarDate: 'weekViewColumnHeader':locale }}</b\n ><br />\n <span>{{\n day.date | calendarDate: 'weekViewColumnSubHeader':locale\n }}</span>\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n days: days,\n locale: locale,\n dayHeaderClicked: dayHeaderClicked,\n eventDropped: eventDropped,\n dragEnter: dragEnter,\n trackByWeekDayHeaderDate: trackByWeekDayHeaderDate\n }\"\n >\n </ng-template>\n ",
2198 }]
2199 }], propDecorators: { days: [{
2200 type: i0.Input
2201 }], locale: [{
2202 type: i0.Input
2203 }], customTemplate: [{
2204 type: i0.Input
2205 }], dayHeaderClicked: [{
2206 type: i0.Output
2207 }], eventDropped: [{
2208 type: i0.Output
2209 }], dragEnter: [{
2210 type: i0.Output
2211 }] } });
2212
2213 var CalendarWeekViewEventComponent = /** @class */ (function () {
2214 function CalendarWeekViewEventComponent() {
2215 this.eventClicked = new i0.EventEmitter();
2216 }
2217 return CalendarWeekViewEventComponent;
2218 }());
2219 CalendarWeekViewEventComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewEventComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2220 CalendarWeekViewEventComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarWeekViewEventComponent, selector: "mwl-calendar-week-view-event", inputs: { locale: "locale", weekEvent: "weekEvent", tooltipPlacement: "tooltipPlacement", tooltipAppendToBody: "tooltipAppendToBody", tooltipDisabled: "tooltipDisabled", tooltipDelay: "tooltipDelay", customTemplate: "customTemplate", eventTitleTemplate: "eventTitleTemplate", eventActionsTemplate: "eventActionsTemplate", tooltipTemplate: "tooltipTemplate", column: "column", daysInWeek: "daysInWeek" }, outputs: { eventClicked: "eventClicked" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-weekEvent=\"weekEvent\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDisabled=\"tooltipDisabled\"\n let-tooltipDelay=\"tooltipDelay\"\n let-column=\"column\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n class=\"cal-event\"\n [ngStyle]=\"{\n backgroundColor: weekEvent.event.color?.secondary,\n borderColor: weekEvent.event.color?.primary\n }\"\n [mwlCalendarTooltip]=\"\n !tooltipDisabled\n ? (weekEvent.event.title\n | calendarEventTitle\n : (daysInWeek === 1 ? 'dayTooltip' : 'weekTooltip')\n : weekEvent.tempEvent || weekEvent.event)\n : ''\n \"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"weekEvent.tempEvent || weekEvent.event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n (mwlClick)=\"eventClicked.emit({ sourceEvent: $event })\"\n (mwlKeydownEnter)=\"eventClicked.emit({ sourceEvent: $event })\"\n tabindex=\"0\"\n role=\"application\"\n [attr.aria-label]=\"\n { event: weekEvent.tempEvent || weekEvent.event, locale: locale }\n | calendarA11y: 'eventDescription'\n \"\n >\n <mwl-calendar-event-actions\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventActionsTemplate\"\n >\n </mwl-calendar-event-actions>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventTitleTemplate\"\n [view]=\"daysInWeek === 1 ? 'day' : 'week'\"\n >\n </mwl-calendar-event-title>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n weekEvent: weekEvent,\n tooltipPlacement: tooltipPlacement,\n eventClicked: eventClicked,\n tooltipTemplate: tooltipTemplate,\n tooltipAppendToBody: tooltipAppendToBody,\n tooltipDisabled: tooltipDisabled,\n tooltipDelay: tooltipDelay,\n column: column,\n daysInWeek: daysInWeek\n }\"\n >\n </ng-template>\n ", isInline: true, components: [{ type: CalendarEventActionsComponent, selector: "mwl-calendar-event-actions", inputs: ["event", "customTemplate"] }, { type: CalendarEventTitleComponent, selector: "mwl-calendar-event-title", inputs: ["event", "customTemplate", "view"] }], directives: [{ type: i1__namespace.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: CalendarTooltipDirective, selector: "[mwlCalendarTooltip]", inputs: ["mwlCalendarTooltip", "tooltipPlacement", "tooltipTemplate", "tooltipEvent", "tooltipAppendToBody", "tooltipDelay"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }, { type: KeydownEnterDirective, selector: "[mwlKeydownEnter]", outputs: ["mwlKeydownEnter"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarEventTitle": CalendarEventTitlePipe, "calendarA11y": CalendarA11yPipe } });
2221 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewEventComponent, decorators: [{
2222 type: i0.Component,
2223 args: [{
2224 selector: 'mwl-calendar-week-view-event',
2225 template: "\n <ng-template\n #defaultTemplate\n let-weekEvent=\"weekEvent\"\n let-tooltipPlacement=\"tooltipPlacement\"\n let-eventClicked=\"eventClicked\"\n let-tooltipTemplate=\"tooltipTemplate\"\n let-tooltipAppendToBody=\"tooltipAppendToBody\"\n let-tooltipDisabled=\"tooltipDisabled\"\n let-tooltipDelay=\"tooltipDelay\"\n let-column=\"column\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n class=\"cal-event\"\n [ngStyle]=\"{\n backgroundColor: weekEvent.event.color?.secondary,\n borderColor: weekEvent.event.color?.primary\n }\"\n [mwlCalendarTooltip]=\"\n !tooltipDisabled\n ? (weekEvent.event.title\n | calendarEventTitle\n : (daysInWeek === 1 ? 'dayTooltip' : 'weekTooltip')\n : weekEvent.tempEvent || weekEvent.event)\n : ''\n \"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipEvent]=\"weekEvent.tempEvent || weekEvent.event\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n (mwlClick)=\"eventClicked.emit({ sourceEvent: $event })\"\n (mwlKeydownEnter)=\"eventClicked.emit({ sourceEvent: $event })\"\n tabindex=\"0\"\n role=\"application\"\n [attr.aria-label]=\"\n { event: weekEvent.tempEvent || weekEvent.event, locale: locale }\n | calendarA11y: 'eventDescription'\n \"\n >\n <mwl-calendar-event-actions\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventActionsTemplate\"\n >\n </mwl-calendar-event-actions>\n &ngsp;\n <mwl-calendar-event-title\n [event]=\"weekEvent.tempEvent || weekEvent.event\"\n [customTemplate]=\"eventTitleTemplate\"\n [view]=\"daysInWeek === 1 ? 'day' : 'week'\"\n >\n </mwl-calendar-event-title>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n weekEvent: weekEvent,\n tooltipPlacement: tooltipPlacement,\n eventClicked: eventClicked,\n tooltipTemplate: tooltipTemplate,\n tooltipAppendToBody: tooltipAppendToBody,\n tooltipDisabled: tooltipDisabled,\n tooltipDelay: tooltipDelay,\n column: column,\n daysInWeek: daysInWeek\n }\"\n >\n </ng-template>\n ",
2226 }]
2227 }], propDecorators: { locale: [{
2228 type: i0.Input
2229 }], weekEvent: [{
2230 type: i0.Input
2231 }], tooltipPlacement: [{
2232 type: i0.Input
2233 }], tooltipAppendToBody: [{
2234 type: i0.Input
2235 }], tooltipDisabled: [{
2236 type: i0.Input
2237 }], tooltipDelay: [{
2238 type: i0.Input
2239 }], customTemplate: [{
2240 type: i0.Input
2241 }], eventTitleTemplate: [{
2242 type: i0.Input
2243 }], eventActionsTemplate: [{
2244 type: i0.Input
2245 }], tooltipTemplate: [{
2246 type: i0.Input
2247 }], column: [{
2248 type: i0.Input
2249 }], daysInWeek: [{
2250 type: i0.Input
2251 }], eventClicked: [{
2252 type: i0.Output
2253 }] } });
2254
2255 var CalendarWeekViewHourSegmentComponent = /** @class */ (function () {
2256 function CalendarWeekViewHourSegmentComponent() {
2257 }
2258 return CalendarWeekViewHourSegmentComponent;
2259 }());
2260 CalendarWeekViewHourSegmentComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewHourSegmentComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
2261 CalendarWeekViewHourSegmentComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarWeekViewHourSegmentComponent, selector: "mwl-calendar-week-view-hour-segment", inputs: { segment: "segment", segmentHeight: "segmentHeight", locale: "locale", isTimeLabel: "isTimeLabel", daysInWeek: "daysInWeek", customTemplate: "customTemplate" }, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-segment=\"segment\"\n let-locale=\"locale\"\n let-segmentHeight=\"segmentHeight\"\n let-isTimeLabel=\"isTimeLabel\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n [attr.aria-hidden]=\"\n {}\n | calendarA11y\n : (daysInWeek === 1\n ? 'hideDayHourSegment'\n : 'hideWeekHourSegment')\n \"\n class=\"cal-hour-segment\"\n [style.height.px]=\"segmentHeight\"\n [class.cal-hour-start]=\"segment.isStart\"\n [class.cal-after-hour-start]=\"!segment.isStart\"\n [ngClass]=\"segment.cssClass\"\n >\n <div class=\"cal-time\" *ngIf=\"isTimeLabel\">\n {{\n segment.displayDate\n | calendarDate\n : (daysInWeek === 1 ? 'dayViewHour' : 'weekViewHour')\n : locale\n }}\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n segment: segment,\n locale: locale,\n segmentHeight: segmentHeight,\n isTimeLabel: isTimeLabel,\n daysInWeek: daysInWeek\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "calendarA11y": CalendarA11yPipe, "calendarDate": CalendarDatePipe } });
2262 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewHourSegmentComponent, decorators: [{
2263 type: i0.Component,
2264 args: [{
2265 selector: 'mwl-calendar-week-view-hour-segment',
2266 template: "\n <ng-template\n #defaultTemplate\n let-segment=\"segment\"\n let-locale=\"locale\"\n let-segmentHeight=\"segmentHeight\"\n let-isTimeLabel=\"isTimeLabel\"\n let-daysInWeek=\"daysInWeek\"\n >\n <div\n [attr.aria-hidden]=\"\n {}\n | calendarA11y\n : (daysInWeek === 1\n ? 'hideDayHourSegment'\n : 'hideWeekHourSegment')\n \"\n class=\"cal-hour-segment\"\n [style.height.px]=\"segmentHeight\"\n [class.cal-hour-start]=\"segment.isStart\"\n [class.cal-after-hour-start]=\"!segment.isStart\"\n [ngClass]=\"segment.cssClass\"\n >\n <div class=\"cal-time\" *ngIf=\"isTimeLabel\">\n {{\n segment.displayDate\n | calendarDate\n : (daysInWeek === 1 ? 'dayViewHour' : 'weekViewHour')\n : locale\n }}\n </div>\n </div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n segment: segment,\n locale: locale,\n segmentHeight: segmentHeight,\n isTimeLabel: isTimeLabel,\n daysInWeek: daysInWeek\n }\"\n >\n </ng-template>\n ",
2267 }]
2268 }], propDecorators: { segment: [{
2269 type: i0.Input
2270 }], segmentHeight: [{
2271 type: i0.Input
2272 }], locale: [{
2273 type: i0.Input
2274 }], isTimeLabel: [{
2275 type: i0.Input
2276 }], daysInWeek: [{
2277 type: i0.Input
2278 }], customTemplate: [{
2279 type: i0.Input
2280 }] } });
2281
2282 var CalendarWeekViewCurrentTimeMarkerComponent = /** @class */ (function () {
2283 function CalendarWeekViewCurrentTimeMarkerComponent(dateAdapter, zone) {
2284 var _this = this;
2285 this.dateAdapter = dateAdapter;
2286 this.zone = zone;
2287 this.columnDate$ = new rxjs.BehaviorSubject(undefined);
2288 this.marker$ = this.zone.onStable.pipe(operators.switchMap(function () { return rxjs.interval(60 * 1000); }), operators.startWith(0), operators.switchMapTo(this.columnDate$), operators.map(function (columnDate) {
2289 var startOfDay = _this.dateAdapter.setMinutes(_this.dateAdapter.setHours(columnDate, _this.dayStartHour), _this.dayStartMinute);
2290 var endOfDay = _this.dateAdapter.setMinutes(_this.dateAdapter.setHours(columnDate, _this.dayEndHour), _this.dayEndMinute);
2291 var hourHeightModifier = (_this.hourSegments * _this.hourSegmentHeight) /
2292 (_this.hourDuration || 60);
2293 var now = new Date();
2294 return {
2295 isVisible: _this.dateAdapter.isSameDay(columnDate, now) &&
2296 now >= startOfDay &&
2297 now <= endOfDay,
2298 top: _this.dateAdapter.differenceInMinutes(now, startOfDay) *
2299 hourHeightModifier,
2300 };
2301 }));
2302 }
2303 CalendarWeekViewCurrentTimeMarkerComponent.prototype.ngOnChanges = function (changes) {
2304 if (changes.columnDate) {
2305 this.columnDate$.next(changes.columnDate.currentValue);
2306 }
2307 };
2308 return CalendarWeekViewCurrentTimeMarkerComponent;
2309 }());
2310 CalendarWeekViewCurrentTimeMarkerComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewCurrentTimeMarkerComponent, deps: [{ token: DateAdapter }, { token: i0__namespace.NgZone }], target: i0__namespace.ɵɵFactoryTarget.Component });
2311 CalendarWeekViewCurrentTimeMarkerComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarWeekViewCurrentTimeMarkerComponent, selector: "mwl-calendar-week-view-current-time-marker", inputs: { columnDate: "columnDate", dayStartHour: "dayStartHour", dayStartMinute: "dayStartMinute", dayEndHour: "dayEndHour", dayEndMinute: "dayEndMinute", hourSegments: "hourSegments", hourDuration: "hourDuration", hourSegmentHeight: "hourSegmentHeight", customTemplate: "customTemplate" }, usesOnChanges: true, ngImport: i0__namespace, template: "\n <ng-template\n #defaultTemplate\n let-columnDate=\"columnDate\"\n let-dayStartHour=\"dayStartHour\"\n let-dayStartMinute=\"dayStartMinute\"\n let-dayEndHour=\"dayEndHour\"\n let-dayEndMinute=\"dayEndMinute\"\n let-isVisible=\"isVisible\"\n let-topPx=\"topPx\"\n >\n <div\n class=\"cal-current-time-marker\"\n *ngIf=\"isVisible\"\n [style.top.px]=\"topPx\"\n ></div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n columnDate: columnDate,\n dayStartHour: dayStartHour,\n dayStartMinute: dayStartMinute,\n dayEndHour: dayEndHour,\n dayEndMinute: dayEndMinute,\n isVisible: (marker$ | async)?.isVisible,\n topPx: (marker$ | async)?.top\n }\"\n >\n </ng-template>\n ", isInline: true, directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "async": i1__namespace.AsyncPipe } });
2312 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewCurrentTimeMarkerComponent, decorators: [{
2313 type: i0.Component,
2314 args: [{
2315 selector: 'mwl-calendar-week-view-current-time-marker',
2316 template: "\n <ng-template\n #defaultTemplate\n let-columnDate=\"columnDate\"\n let-dayStartHour=\"dayStartHour\"\n let-dayStartMinute=\"dayStartMinute\"\n let-dayEndHour=\"dayEndHour\"\n let-dayEndMinute=\"dayEndMinute\"\n let-isVisible=\"isVisible\"\n let-topPx=\"topPx\"\n >\n <div\n class=\"cal-current-time-marker\"\n *ngIf=\"isVisible\"\n [style.top.px]=\"topPx\"\n ></div>\n </ng-template>\n <ng-template\n [ngTemplateOutlet]=\"customTemplate || defaultTemplate\"\n [ngTemplateOutletContext]=\"{\n columnDate: columnDate,\n dayStartHour: dayStartHour,\n dayStartMinute: dayStartMinute,\n dayEndHour: dayEndHour,\n dayEndMinute: dayEndMinute,\n isVisible: (marker$ | async)?.isVisible,\n topPx: (marker$ | async)?.top\n }\"\n >\n </ng-template>\n ",
2317 }]
2318 }], ctorParameters: function () { return [{ type: DateAdapter }, { type: i0__namespace.NgZone }]; }, propDecorators: { columnDate: [{
2319 type: i0.Input
2320 }], dayStartHour: [{
2321 type: i0.Input
2322 }], dayStartMinute: [{
2323 type: i0.Input
2324 }], dayEndHour: [{
2325 type: i0.Input
2326 }], dayEndMinute: [{
2327 type: i0.Input
2328 }], hourSegments: [{
2329 type: i0.Input
2330 }], hourDuration: [{
2331 type: i0.Input
2332 }], hourSegmentHeight: [{
2333 type: i0.Input
2334 }], customTemplate: [{
2335 type: i0.Input
2336 }] } });
2337
2338 /**
2339 * Shows all events on a given week. Example usage:
2340 *
2341 * ```typescript
2342 * <mwl-calendar-week-view
2343 * [viewDate]="viewDate"
2344 * [events]="events">
2345 * </mwl-calendar-week-view>
2346 * ```
2347 */
2348 var CalendarWeekViewComponent = /** @class */ (function () {
2349 /**
2350 * @hidden
2351 */
2352 function CalendarWeekViewComponent(cdr, utils, locale, dateAdapter, element) {
2353 this.cdr = cdr;
2354 this.utils = utils;
2355 this.dateAdapter = dateAdapter;
2356 this.element = element;
2357 /**
2358 * An array of events to display on view
2359 * The schema is available here: https://github.com/mattlewis92/calendar-utils/blob/c51689985f59a271940e30bc4e2c4e1fee3fcb5c/src/calendarUtils.ts#L49-L63
2360 */
2361 this.events = [];
2362 /**
2363 * An array of day indexes (0 = sunday, 1 = monday etc) that will be hidden on the view
2364 */
2365 this.excludeDays = [];
2366 /**
2367 * The placement of the event tooltip
2368 */
2369 this.tooltipPlacement = 'auto';
2370 /**
2371 * Whether to append tooltips to the body or next to the trigger element
2372 */
2373 this.tooltipAppendToBody = true;
2374 /**
2375 * The delay in milliseconds before the tooltip should be displayed. If not provided the tooltip
2376 * will be displayed immediately.
2377 */
2378 this.tooltipDelay = null;
2379 /**
2380 * The precision to display events.
2381 * `days` will round event start and end dates to the nearest day and `minutes` will not do this rounding
2382 */
2383 this.precision = 'days';
2384 /**
2385 * Whether to snap events to a grid when dragging
2386 */
2387 this.snapDraggedEvents = true;
2388 /**
2389 * The number of segments in an hour. Must divide equally into 60.
2390 */
2391 this.hourSegments = 2;
2392 /**
2393 * The height in pixels of each hour segment
2394 */
2395 this.hourSegmentHeight = 30;
2396 /**
2397 * The minimum height in pixels of each event
2398 */
2399 this.minimumEventHeight = 30;
2400 /**
2401 * The day start hours in 24 hour time. Must be 0-23
2402 */
2403 this.dayStartHour = 0;
2404 /**
2405 * The day start minutes. Must be 0-59
2406 */
2407 this.dayStartMinute = 0;
2408 /**
2409 * The day end hours in 24 hour time. Must be 0-23
2410 */
2411 this.dayEndHour = 23;
2412 /**
2413 * The day end minutes. Must be 0-59
2414 */
2415 this.dayEndMinute = 59;
2416 /**
2417 * Called when a header week day is clicked. Adding a `cssClass` property on `$event.day` will add that class to the header element
2418 */
2419 this.dayHeaderClicked = new i0.EventEmitter();
2420 /**
2421 * Called when an event title is clicked
2422 */
2423 this.eventClicked = new i0.EventEmitter();
2424 /**
2425 * Called when an event is resized or dragged and dropped
2426 */
2427 this.eventTimesChanged = new i0.EventEmitter();
2428 /**
2429 * An output that will be called before the view is rendered for the current week.
2430 * If you add the `cssClass` property to a day in the header it will add that class to the cell element in the template
2431 */
2432 this.beforeViewRender = new i0.EventEmitter();
2433 /**
2434 * Called when an hour segment is clicked
2435 */
2436 this.hourSegmentClicked = new i0.EventEmitter();
2437 /**
2438 * @hidden
2439 */
2440 this.allDayEventResizes = new Map();
2441 /**
2442 * @hidden
2443 */
2444 this.timeEventResizes = new Map();
2445 /**
2446 * @hidden
2447 */
2448 this.eventDragEnterByType = {
2449 allDay: 0,
2450 time: 0,
2451 };
2452 /**
2453 * @hidden
2454 */
2455 this.dragActive = false;
2456 /**
2457 * @hidden
2458 */
2459 this.dragAlreadyMoved = false;
2460 /**
2461 * @hidden
2462 */
2463 this.calendarId = Symbol('angular calendar week view id');
2464 /**
2465 * @hidden
2466 */
2467 this.rtl = false;
2468 /**
2469 * @hidden
2470 */
2471 this.trackByWeekDayHeaderDate = trackByWeekDayHeaderDate;
2472 /**
2473 * @hidden
2474 */
2475 this.trackByHourSegment = trackByHourSegment;
2476 /**
2477 * @hidden
2478 */
2479 this.trackByHour = trackByHour;
2480 /**
2481 * @hidden
2482 */
2483 this.trackByWeekAllDayEvent = trackByWeekAllDayEvent;
2484 /**
2485 * @hidden
2486 */
2487 this.trackByWeekTimeEvent = trackByWeekTimeEvent;
2488 /**
2489 * @hidden
2490 */
2491 this.trackByHourColumn = function (index, column) { return column.hours[0] ? column.hours[0].segments[0].date.toISOString() : column; };
2492 /**
2493 * @hidden
2494 */
2495 this.trackById = function (index, row) { return row.id; };
2496 this.locale = locale;
2497 }
2498 /**
2499 * @hidden
2500 */
2501 CalendarWeekViewComponent.prototype.ngOnInit = function () {
2502 var _this = this;
2503 if (this.refresh) {
2504 this.refreshSubscription = this.refresh.subscribe(function () {
2505 _this.refreshAll();
2506 _this.cdr.markForCheck();
2507 });
2508 }
2509 };
2510 /**
2511 * @hidden
2512 */
2513 CalendarWeekViewComponent.prototype.ngOnChanges = function (changes) {
2514 var refreshHeader = changes.viewDate ||
2515 changes.excludeDays ||
2516 changes.weekendDays ||
2517 changes.daysInWeek ||
2518 changes.weekStartsOn;
2519 var refreshBody = changes.viewDate ||
2520 changes.dayStartHour ||
2521 changes.dayStartMinute ||
2522 changes.dayEndHour ||
2523 changes.dayEndMinute ||
2524 changes.hourSegments ||
2525 changes.hourDuration ||
2526 changes.weekStartsOn ||
2527 changes.weekendDays ||
2528 changes.excludeDays ||
2529 changes.hourSegmentHeight ||
2530 changes.events ||
2531 changes.daysInWeek ||
2532 changes.minimumEventHeight;
2533 if (refreshHeader) {
2534 this.refreshHeader();
2535 }
2536 if (changes.events) {
2537 validateEvents(this.events);
2538 }
2539 if (refreshBody) {
2540 this.refreshBody();
2541 }
2542 if (refreshHeader || refreshBody) {
2543 this.emitBeforeViewRender();
2544 }
2545 };
2546 /**
2547 * @hidden
2548 */
2549 CalendarWeekViewComponent.prototype.ngOnDestroy = function () {
2550 if (this.refreshSubscription) {
2551 this.refreshSubscription.unsubscribe();
2552 }
2553 };
2554 /**
2555 * @hidden
2556 */
2557 CalendarWeekViewComponent.prototype.ngAfterViewInit = function () {
2558 this.rtl =
2559 typeof window !== 'undefined' &&
2560 getComputedStyle(this.element.nativeElement).direction === 'rtl';
2561 this.cdr.detectChanges();
2562 };
2563 /**
2564 * @hidden
2565 */
2566 CalendarWeekViewComponent.prototype.timeEventResizeStarted = function (eventsContainer, timeEvent, resizeEvent) {
2567 this.timeEventResizes.set(timeEvent.event, resizeEvent);
2568 this.resizeStarted(eventsContainer, timeEvent);
2569 };
2570 /**
2571 * @hidden
2572 */
2573 CalendarWeekViewComponent.prototype.timeEventResizing = function (timeEvent, resizeEvent) {
2574 var _this = this;
2575 this.timeEventResizes.set(timeEvent.event, resizeEvent);
2576 var adjustedEvents = new Map();
2577 var tempEvents = __spreadArray([], __read(this.events));
2578 this.timeEventResizes.forEach(function (lastResizeEvent, event) {
2579 var newEventDates = _this.getTimeEventResizedDates(event, lastResizeEvent);
2580 var adjustedEvent = Object.assign(Object.assign({}, event), newEventDates);
2581 adjustedEvents.set(adjustedEvent, event);
2582 var eventIndex = tempEvents.indexOf(event);
2583 tempEvents[eventIndex] = adjustedEvent;
2584 });
2585 this.restoreOriginalEvents(tempEvents, adjustedEvents, true);
2586 };
2587 /**
2588 * @hidden
2589 */
2590 CalendarWeekViewComponent.prototype.timeEventResizeEnded = function (timeEvent) {
2591 this.view = this.getWeekView(this.events);
2592 var lastResizeEvent = this.timeEventResizes.get(timeEvent.event);
2593 if (lastResizeEvent) {
2594 this.timeEventResizes.delete(timeEvent.event);
2595 var newEventDates = this.getTimeEventResizedDates(timeEvent.event, lastResizeEvent);
2596 this.eventTimesChanged.emit({
2597 newStart: newEventDates.start,
2598 newEnd: newEventDates.end,
2599 event: timeEvent.event,
2600 type: exports.CalendarEventTimesChangedEventType.Resize,
2601 });
2602 }
2603 };
2604 /**
2605 * @hidden
2606 */
2607 CalendarWeekViewComponent.prototype.allDayEventResizeStarted = function (allDayEventsContainer, allDayEvent, resizeEvent) {
2608 this.allDayEventResizes.set(allDayEvent, {
2609 originalOffset: allDayEvent.offset,
2610 originalSpan: allDayEvent.span,
2611 edge: typeof resizeEvent.edges.left !== 'undefined' ? 'left' : 'right',
2612 });
2613 this.resizeStarted(allDayEventsContainer, allDayEvent, this.getDayColumnWidth(allDayEventsContainer));
2614 };
2615 /**
2616 * @hidden
2617 */
2618 CalendarWeekViewComponent.prototype.allDayEventResizing = function (allDayEvent, resizeEvent, dayWidth) {
2619 var currentResize = this.allDayEventResizes.get(allDayEvent);
2620 var modifier = this.rtl ? -1 : 1;
2621 if (typeof resizeEvent.edges.left !== 'undefined') {
2622 var diff = Math.round(+resizeEvent.edges.left / dayWidth) * modifier;
2623 allDayEvent.offset = currentResize.originalOffset + diff;
2624 allDayEvent.span = currentResize.originalSpan - diff;
2625 }
2626 else if (typeof resizeEvent.edges.right !== 'undefined') {
2627 var diff = Math.round(+resizeEvent.edges.right / dayWidth) * modifier;
2628 allDayEvent.span = currentResize.originalSpan + diff;
2629 }
2630 };
2631 /**
2632 * @hidden
2633 */
2634 CalendarWeekViewComponent.prototype.allDayEventResizeEnded = function (allDayEvent) {
2635 var currentResize = this.allDayEventResizes.get(allDayEvent);
2636 if (currentResize) {
2637 var allDayEventResizingBeforeStart = currentResize.edge === 'left';
2638 var daysDiff = void 0;
2639 if (allDayEventResizingBeforeStart) {
2640 daysDiff = allDayEvent.offset - currentResize.originalOffset;
2641 }
2642 else {
2643 daysDiff = allDayEvent.span - currentResize.originalSpan;
2644 }
2645 allDayEvent.offset = currentResize.originalOffset;
2646 allDayEvent.span = currentResize.originalSpan;
2647 var newDates = this.getAllDayEventResizedDates(allDayEvent.event, daysDiff, allDayEventResizingBeforeStart);
2648 this.eventTimesChanged.emit({
2649 newStart: newDates.start,
2650 newEnd: newDates.end,
2651 event: allDayEvent.event,
2652 type: exports.CalendarEventTimesChangedEventType.Resize,
2653 });
2654 this.allDayEventResizes.delete(allDayEvent);
2655 }
2656 };
2657 /**
2658 * @hidden
2659 */
2660 CalendarWeekViewComponent.prototype.getDayColumnWidth = function (eventRowContainer) {
2661 return Math.floor(eventRowContainer.offsetWidth / this.days.length);
2662 };
2663 /**
2664 * @hidden
2665 */
2666 CalendarWeekViewComponent.prototype.dateDragEnter = function (date) {
2667 this.lastDragEnterDate = date;
2668 };
2669 /**
2670 * @hidden
2671 */
2672 CalendarWeekViewComponent.prototype.eventDropped = function (dropEvent, date, allDay) {
2673 if (shouldFireDroppedEvent(dropEvent, date, allDay, this.calendarId) &&
2674 this.lastDragEnterDate.getTime() === date.getTime() &&
2675 (!this.snapDraggedEvents ||
2676 dropEvent.dropData.event !== this.lastDraggedEvent)) {
2677 this.eventTimesChanged.emit({
2678 type: exports.CalendarEventTimesChangedEventType.Drop,
2679 event: dropEvent.dropData.event,
2680 newStart: date,
2681 allDay: allDay,
2682 });
2683 }
2684 this.lastDraggedEvent = null;
2685 };
2686 /**
2687 * @hidden
2688 */
2689 CalendarWeekViewComponent.prototype.dragEnter = function (type) {
2690 this.eventDragEnterByType[type]++;
2691 };
2692 /**
2693 * @hidden
2694 */
2695 CalendarWeekViewComponent.prototype.dragLeave = function (type) {
2696 this.eventDragEnterByType[type]--;
2697 };
2698 /**
2699 * @hidden
2700 */
2701 CalendarWeekViewComponent.prototype.dragStarted = function (eventsContainerElement, eventElement, event, useY) {
2702 var _this = this;
2703 this.dayColumnWidth = this.getDayColumnWidth(eventsContainerElement);
2704 var dragHelper = new CalendarDragHelper(eventsContainerElement, eventElement);
2705 this.validateDrag = function (_a) {
2706 var x = _a.x, y = _a.y, transform = _a.transform;
2707 var isAllowed = _this.allDayEventResizes.size === 0 &&
2708 _this.timeEventResizes.size === 0 &&
2709 dragHelper.validateDrag({
2710 x: x,
2711 y: y,
2712 snapDraggedEvents: _this.snapDraggedEvents,
2713 dragAlreadyMoved: _this.dragAlreadyMoved,
2714 transform: transform,
2715 });
2716 if (isAllowed && _this.validateEventTimesChanged) {
2717 var newEventTimes = _this.getDragMovedEventTimes(event, { x: x, y: y }, _this.dayColumnWidth, useY);
2718 return _this.validateEventTimesChanged({
2719 type: exports.CalendarEventTimesChangedEventType.Drag,
2720 event: event.event,
2721 newStart: newEventTimes.start,
2722 newEnd: newEventTimes.end,
2723 });
2724 }
2725 return isAllowed;
2726 };
2727 this.dragActive = true;
2728 this.dragAlreadyMoved = false;
2729 this.lastDraggedEvent = null;
2730 this.eventDragEnterByType = {
2731 allDay: 0,
2732 time: 0,
2733 };
2734 if (!this.snapDraggedEvents && useY) {
2735 this.view.hourColumns.forEach(function (column) {
2736 var linkedEvent = column.events.find(function (columnEvent) { return columnEvent.event === event.event && columnEvent !== event; });
2737 // hide any linked events while dragging
2738 if (linkedEvent) {
2739 linkedEvent.width = 0;
2740 linkedEvent.height = 0;
2741 }
2742 });
2743 }
2744 this.cdr.markForCheck();
2745 };
2746 /**
2747 * @hidden
2748 */
2749 CalendarWeekViewComponent.prototype.dragMove = function (dayEvent, dragEvent) {
2750 var newEventTimes = this.getDragMovedEventTimes(dayEvent, dragEvent, this.dayColumnWidth, true);
2751 var originalEvent = dayEvent.event;
2752 var adjustedEvent = Object.assign(Object.assign({}, originalEvent), newEventTimes);
2753 var tempEvents = this.events.map(function (event) {
2754 if (event === originalEvent) {
2755 return adjustedEvent;
2756 }
2757 return event;
2758 });
2759 this.restoreOriginalEvents(tempEvents, new Map([[adjustedEvent, originalEvent]]), this.snapDraggedEvents);
2760 this.dragAlreadyMoved = true;
2761 };
2762 /**
2763 * @hidden
2764 */
2765 CalendarWeekViewComponent.prototype.allDayEventDragMove = function () {
2766 this.dragAlreadyMoved = true;
2767 };
2768 /**
2769 * @hidden
2770 */
2771 CalendarWeekViewComponent.prototype.dragEnded = function (weekEvent, dragEndEvent, dayWidth, useY) {
2772 if (useY === void 0) { useY = false; }
2773 this.view = this.getWeekView(this.events);
2774 this.dragActive = false;
2775 this.validateDrag = null;
2776 var _a = this.getDragMovedEventTimes(weekEvent, dragEndEvent, dayWidth, useY), start = _a.start, end = _a.end;
2777 if ((this.snapDraggedEvents ||
2778 this.eventDragEnterByType[useY ? 'time' : 'allDay'] > 0) &&
2779 isDraggedWithinPeriod(start, end, this.view.period)) {
2780 this.lastDraggedEvent = weekEvent.event;
2781 this.eventTimesChanged.emit({
2782 newStart: start,
2783 newEnd: end,
2784 event: weekEvent.event,
2785 type: exports.CalendarEventTimesChangedEventType.Drag,
2786 allDay: !useY,
2787 });
2788 }
2789 };
2790 CalendarWeekViewComponent.prototype.refreshHeader = function () {
2791 this.days = this.utils.getWeekViewHeader(Object.assign({ viewDate: this.viewDate, weekStartsOn: this.weekStartsOn, excluded: this.excludeDays, weekendDays: this.weekendDays }, getWeekViewPeriod(this.dateAdapter, this.viewDate, this.weekStartsOn, this.excludeDays, this.daysInWeek)));
2792 };
2793 CalendarWeekViewComponent.prototype.refreshBody = function () {
2794 this.view = this.getWeekView(this.events);
2795 };
2796 CalendarWeekViewComponent.prototype.refreshAll = function () {
2797 this.refreshHeader();
2798 this.refreshBody();
2799 this.emitBeforeViewRender();
2800 };
2801 CalendarWeekViewComponent.prototype.emitBeforeViewRender = function () {
2802 if (this.days && this.view) {
2803 this.beforeViewRender.emit(Object.assign({ header: this.days }, this.view));
2804 }
2805 };
2806 CalendarWeekViewComponent.prototype.getWeekView = function (events) {
2807 return this.utils.getWeekView(Object.assign({ events: events, viewDate: this.viewDate, weekStartsOn: this.weekStartsOn, excluded: this.excludeDays, precision: this.precision, absolutePositionedEvents: true, hourSegments: this.hourSegments, hourDuration: this.hourDuration, dayStart: {
2808 hour: this.dayStartHour,
2809 minute: this.dayStartMinute,
2810 }, dayEnd: {
2811 hour: this.dayEndHour,
2812 minute: this.dayEndMinute,
2813 }, segmentHeight: this.hourSegmentHeight, weekendDays: this.weekendDays, minimumEventHeight: this.minimumEventHeight }, getWeekViewPeriod(this.dateAdapter, this.viewDate, this.weekStartsOn, this.excludeDays, this.daysInWeek)));
2814 };
2815 CalendarWeekViewComponent.prototype.getDragMovedEventTimes = function (weekEvent, dragEndEvent, dayWidth, useY) {
2816 var daysDragged = (roundToNearest(dragEndEvent.x, dayWidth) / dayWidth) *
2817 (this.rtl ? -1 : 1);
2818 var minutesMoved = useY
2819 ? getMinutesMoved(dragEndEvent.y, this.hourSegments, this.hourSegmentHeight, this.eventSnapSize, this.hourDuration)
2820 : 0;
2821 var start = this.dateAdapter.addMinutes(addDaysWithExclusions(this.dateAdapter, weekEvent.event.start, daysDragged, this.excludeDays), minutesMoved);
2822 var end;
2823 if (weekEvent.event.end) {
2824 end = this.dateAdapter.addMinutes(addDaysWithExclusions(this.dateAdapter, weekEvent.event.end, daysDragged, this.excludeDays), minutesMoved);
2825 }
2826 return { start: start, end: end };
2827 };
2828 CalendarWeekViewComponent.prototype.restoreOriginalEvents = function (tempEvents, adjustedEvents, snapDraggedEvents) {
2829 if (snapDraggedEvents === void 0) { snapDraggedEvents = true; }
2830 var previousView = this.view;
2831 if (snapDraggedEvents) {
2832 this.view = this.getWeekView(tempEvents);
2833 }
2834 var adjustedEventsArray = tempEvents.filter(function (event) { return adjustedEvents.has(event); });
2835 this.view.hourColumns.forEach(function (column, columnIndex) {
2836 previousView.hourColumns[columnIndex].hours.forEach(function (hour, hourIndex) {
2837 hour.segments.forEach(function (segment, segmentIndex) {
2838 column.hours[hourIndex].segments[segmentIndex].cssClass =
2839 segment.cssClass;
2840 });
2841 });
2842 adjustedEventsArray.forEach(function (adjustedEvent) {
2843 var originalEvent = adjustedEvents.get(adjustedEvent);
2844 var existingColumnEvent = column.events.find(function (columnEvent) { return columnEvent.event ===
2845 (snapDraggedEvents ? adjustedEvent : originalEvent); });
2846 if (existingColumnEvent) {
2847 // restore the original event so trackBy kicks in and the dom isn't changed
2848 existingColumnEvent.event = originalEvent;
2849 existingColumnEvent['tempEvent'] = adjustedEvent;
2850 if (!snapDraggedEvents) {
2851 existingColumnEvent.height = 0;
2852 existingColumnEvent.width = 0;
2853 }
2854 }
2855 else {
2856 // add a dummy event to the drop so if the event was removed from the original column the drag doesn't end early
2857 var event = {
2858 event: originalEvent,
2859 left: 0,
2860 top: 0,
2861 height: 0,
2862 width: 0,
2863 startsBeforeDay: false,
2864 endsAfterDay: false,
2865 tempEvent: adjustedEvent,
2866 };
2867 column.events.push(event);
2868 }
2869 });
2870 });
2871 adjustedEvents.clear();
2872 };
2873 CalendarWeekViewComponent.prototype.getTimeEventResizedDates = function (calendarEvent, resizeEvent) {
2874 var newEventDates = {
2875 start: calendarEvent.start,
2876 end: getDefaultEventEnd(this.dateAdapter, calendarEvent, this.minimumEventHeight),
2877 };
2878 var end = calendarEvent.end, eventWithoutEnd = __rest(calendarEvent, ["end"]);
2879 var smallestResizes = {
2880 start: this.dateAdapter.addMinutes(newEventDates.end, this.minimumEventHeight * -1),
2881 end: getDefaultEventEnd(this.dateAdapter, eventWithoutEnd, this.minimumEventHeight),
2882 };
2883 var modifier = this.rtl ? -1 : 1;
2884 if (typeof resizeEvent.edges.left !== 'undefined') {
2885 var daysDiff = Math.round(+resizeEvent.edges.left / this.dayColumnWidth) * modifier;
2886 var newStart = addDaysWithExclusions(this.dateAdapter, newEventDates.start, daysDiff, this.excludeDays);
2887 if (newStart < smallestResizes.start) {
2888 newEventDates.start = newStart;
2889 }
2890 else {
2891 newEventDates.start = smallestResizes.start;
2892 }
2893 }
2894 else if (typeof resizeEvent.edges.right !== 'undefined') {
2895 var daysDiff = Math.round(+resizeEvent.edges.right / this.dayColumnWidth) * modifier;
2896 var newEnd = addDaysWithExclusions(this.dateAdapter, newEventDates.end, daysDiff, this.excludeDays);
2897 if (newEnd > smallestResizes.end) {
2898 newEventDates.end = newEnd;
2899 }
2900 else {
2901 newEventDates.end = smallestResizes.end;
2902 }
2903 }
2904 if (typeof resizeEvent.edges.top !== 'undefined') {
2905 var minutesMoved = getMinutesMoved(resizeEvent.edges.top, this.hourSegments, this.hourSegmentHeight, this.eventSnapSize, this.hourDuration);
2906 var newStart = this.dateAdapter.addMinutes(newEventDates.start, minutesMoved);
2907 if (newStart < smallestResizes.start) {
2908 newEventDates.start = newStart;
2909 }
2910 else {
2911 newEventDates.start = smallestResizes.start;
2912 }
2913 }
2914 else if (typeof resizeEvent.edges.bottom !== 'undefined') {
2915 var minutesMoved = getMinutesMoved(resizeEvent.edges.bottom, this.hourSegments, this.hourSegmentHeight, this.eventSnapSize, this.hourDuration);
2916 var newEnd = this.dateAdapter.addMinutes(newEventDates.end, minutesMoved);
2917 if (newEnd > smallestResizes.end) {
2918 newEventDates.end = newEnd;
2919 }
2920 else {
2921 newEventDates.end = smallestResizes.end;
2922 }
2923 }
2924 return newEventDates;
2925 };
2926 CalendarWeekViewComponent.prototype.resizeStarted = function (eventsContainer, event, dayWidth) {
2927 var _this = this;
2928 this.dayColumnWidth = this.getDayColumnWidth(eventsContainer);
2929 var resizeHelper = new CalendarResizeHelper(eventsContainer, dayWidth, this.rtl);
2930 this.validateResize = function (_a) {
2931 var rectangle = _a.rectangle, edges = _a.edges;
2932 var isWithinBoundary = resizeHelper.validateResize({
2933 rectangle: Object.assign({}, rectangle),
2934 edges: edges,
2935 });
2936 if (isWithinBoundary && _this.validateEventTimesChanged) {
2937 var newEventDates = void 0;
2938 if (!dayWidth) {
2939 newEventDates = _this.getTimeEventResizedDates(event.event, {
2940 rectangle: rectangle,
2941 edges: edges,
2942 });
2943 }
2944 else {
2945 var modifier = _this.rtl ? -1 : 1;
2946 if (typeof edges.left !== 'undefined') {
2947 var diff = Math.round(+edges.left / dayWidth) * modifier;
2948 newEventDates = _this.getAllDayEventResizedDates(event.event, diff, !_this.rtl);
2949 }
2950 else {
2951 var diff = Math.round(+edges.right / dayWidth) * modifier;
2952 newEventDates = _this.getAllDayEventResizedDates(event.event, diff, _this.rtl);
2953 }
2954 }
2955 return _this.validateEventTimesChanged({
2956 type: exports.CalendarEventTimesChangedEventType.Resize,
2957 event: event.event,
2958 newStart: newEventDates.start,
2959 newEnd: newEventDates.end,
2960 });
2961 }
2962 return isWithinBoundary;
2963 };
2964 this.cdr.markForCheck();
2965 };
2966 /**
2967 * @hidden
2968 */
2969 CalendarWeekViewComponent.prototype.getAllDayEventResizedDates = function (event, daysDiff, beforeStart) {
2970 var start = event.start;
2971 var end = event.end || event.start;
2972 if (beforeStart) {
2973 start = addDaysWithExclusions(this.dateAdapter, start, daysDiff, this.excludeDays);
2974 }
2975 else {
2976 end = addDaysWithExclusions(this.dateAdapter, end, daysDiff, this.excludeDays);
2977 }
2978 return { start: start, end: end };
2979 };
2980 return CalendarWeekViewComponent;
2981 }());
2982 CalendarWeekViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewComponent, deps: [{ token: i0__namespace.ChangeDetectorRef }, { token: CalendarUtils }, { token: i0.LOCALE_ID }, { token: DateAdapter }, { token: i0__namespace.ElementRef }], target: i0__namespace.ɵɵFactoryTarget.Component });
2983 CalendarWeekViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarWeekViewComponent, selector: "mwl-calendar-week-view", inputs: { viewDate: "viewDate", events: "events", excludeDays: "excludeDays", refresh: "refresh", locale: "locale", tooltipPlacement: "tooltipPlacement", tooltipTemplate: "tooltipTemplate", tooltipAppendToBody: "tooltipAppendToBody", tooltipDelay: "tooltipDelay", weekStartsOn: "weekStartsOn", headerTemplate: "headerTemplate", eventTemplate: "eventTemplate", eventTitleTemplate: "eventTitleTemplate", eventActionsTemplate: "eventActionsTemplate", precision: "precision", weekendDays: "weekendDays", snapDraggedEvents: "snapDraggedEvents", hourSegments: "hourSegments", hourDuration: "hourDuration", hourSegmentHeight: "hourSegmentHeight", minimumEventHeight: "minimumEventHeight", dayStartHour: "dayStartHour", dayStartMinute: "dayStartMinute", dayEndHour: "dayEndHour", dayEndMinute: "dayEndMinute", hourSegmentTemplate: "hourSegmentTemplate", eventSnapSize: "eventSnapSize", allDayEventsLabelTemplate: "allDayEventsLabelTemplate", daysInWeek: "daysInWeek", currentTimeMarkerTemplate: "currentTimeMarkerTemplate", validateEventTimesChanged: "validateEventTimesChanged" }, outputs: { dayHeaderClicked: "dayHeaderClicked", eventClicked: "eventClicked", eventTimesChanged: "eventTimesChanged", beforeViewRender: "beforeViewRender", hourSegmentClicked: "hourSegmentClicked" }, usesOnChanges: true, ngImport: i0__namespace, template: "\n <div class=\"cal-week-view\" role=\"grid\">\n <mwl-calendar-week-view-header\n [days]=\"days\"\n [locale]=\"locale\"\n [customTemplate]=\"headerTemplate\"\n (dayHeaderClicked)=\"dayHeaderClicked.emit($event)\"\n (eventDropped)=\"\n eventDropped({ dropData: $event }, $event.newStart, true)\n \"\n (dragEnter)=\"dateDragEnter($event.date)\"\n >\n </mwl-calendar-week-view-header>\n <div\n class=\"cal-all-day-events\"\n #allDayEventsContainer\n *ngIf=\"view.allDayEventRows.length > 0\"\n mwlDroppable\n (dragEnter)=\"dragEnter('allDay')\"\n (dragLeave)=\"dragLeave('allDay')\"\n >\n <div class=\"cal-day-columns\">\n <div\n class=\"cal-time-label-column\"\n [ngTemplateOutlet]=\"allDayEventsLabelTemplate\"\n ></div>\n <div\n class=\"cal-day-column\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"eventDropped($event, day.date, true)\"\n (dragEnter)=\"dateDragEnter(day.date)\"\n ></div>\n </div>\n <div\n *ngFor=\"let eventRow of view.allDayEventRows; trackBy: trackById\"\n #eventRowContainer\n class=\"cal-events-row\"\n >\n <div\n *ngFor=\"\n let allDayEvent of eventRow.row;\n trackBy: trackByWeekAllDayEvent\n \"\n #event\n class=\"cal-event-container\"\n [class.cal-draggable]=\"\n allDayEvent.event.draggable && allDayEventResizes.size === 0\n \"\n [class.cal-starts-within-week]=\"!allDayEvent.startsBeforeWeek\"\n [class.cal-ends-within-week]=\"!allDayEvent.endsAfterWeek\"\n [ngClass]=\"allDayEvent.event?.cssClass\"\n [style.width.%]=\"(100 / days.length) * allDayEvent.span\"\n [style.marginLeft.%]=\"\n rtl ? null : (100 / days.length) * allDayEvent.offset\n \"\n [style.marginRight.%]=\"\n rtl\n ? (100 / days.length) * (days.length - allDayEvent.offset) * -1\n : null\n \"\n mwlResizable\n [resizeSnapGrid]=\"{ left: dayColumnWidth, right: dayColumnWidth }\"\n [validateResize]=\"validateResize\"\n (resizeStart)=\"\n allDayEventResizeStarted(eventRowContainer, allDayEvent, $event)\n \"\n (resizing)=\"\n allDayEventResizing(allDayEvent, $event, dayColumnWidth)\n \"\n (resizeEnd)=\"allDayEventResizeEnded(allDayEvent)\"\n mwlDraggable\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: allDayEvent.event, calendarId: calendarId }\"\n [dragAxis]=\"{\n x: allDayEvent.event.draggable && allDayEventResizes.size === 0,\n y:\n !snapDraggedEvents &&\n allDayEvent.event.draggable &&\n allDayEventResizes.size === 0\n }\"\n [dragSnapGrid]=\"snapDraggedEvents ? { x: dayColumnWidth } : {}\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n (dragStart)=\"\n dragStarted(eventRowContainer, event, allDayEvent, false)\n \"\n (dragging)=\"allDayEventDragMove()\"\n (dragEnd)=\"dragEnded(allDayEvent, $event, dayColumnWidth)\"\n >\n <div\n class=\"cal-resize-handle cal-resize-handle-before-start\"\n *ngIf=\"\n allDayEvent.event?.resizable?.beforeStart &&\n !allDayEvent.startsBeforeWeek\n \"\n mwlResizeHandle\n [resizeEdges]=\"{ left: true }\"\n ></div>\n <mwl-calendar-week-view-event\n [locale]=\"locale\"\n [weekEvent]=\"allDayEvent\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [daysInWeek]=\"daysInWeek\"\n (eventClicked)=\"\n eventClicked.emit({\n event: allDayEvent.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n >\n </mwl-calendar-week-view-event>\n <div\n class=\"cal-resize-handle cal-resize-handle-after-end\"\n *ngIf=\"\n allDayEvent.event?.resizable?.afterEnd &&\n !allDayEvent.endsAfterWeek\n \"\n mwlResizeHandle\n [resizeEdges]=\"{ right: true }\"\n ></div>\n </div>\n </div>\n </div>\n <div\n class=\"cal-time-events\"\n mwlDroppable\n (dragEnter)=\"dragEnter('time')\"\n (dragLeave)=\"dragLeave('time')\"\n >\n <div\n class=\"cal-time-label-column\"\n *ngIf=\"view.hourColumns.length > 0 && daysInWeek !== 1\"\n >\n <div\n *ngFor=\"\n let hour of view.hourColumns[0].hours;\n trackBy: trackByHour;\n let odd = odd\n \"\n class=\"cal-hour\"\n [class.cal-hour-odd]=\"odd\"\n >\n <mwl-calendar-week-view-hour-segment\n *ngFor=\"let segment of hour.segments; trackBy: trackByHourSegment\"\n [style.height.px]=\"hourSegmentHeight\"\n [segment]=\"segment\"\n [segmentHeight]=\"hourSegmentHeight\"\n [locale]=\"locale\"\n [customTemplate]=\"hourSegmentTemplate\"\n [isTimeLabel]=\"true\"\n [daysInWeek]=\"daysInWeek\"\n >\n </mwl-calendar-week-view-hour-segment>\n </div>\n </div>\n <div\n class=\"cal-day-columns\"\n [class.cal-resize-active]=\"timeEventResizes.size > 0\"\n #dayColumns\n >\n <div\n class=\"cal-day-column\"\n *ngFor=\"let column of view.hourColumns; trackBy: trackByHourColumn\"\n >\n <mwl-calendar-week-view-current-time-marker\n [columnDate]=\"column.date\"\n [dayStartHour]=\"dayStartHour\"\n [dayStartMinute]=\"dayStartMinute\"\n [dayEndHour]=\"dayEndHour\"\n [dayEndMinute]=\"dayEndMinute\"\n [hourSegments]=\"hourSegments\"\n [hourDuration]=\"hourDuration\"\n [hourSegmentHeight]=\"hourSegmentHeight\"\n [customTemplate]=\"currentTimeMarkerTemplate\"\n ></mwl-calendar-week-view-current-time-marker>\n <div class=\"cal-events-container\">\n <div\n *ngFor=\"\n let timeEvent of column.events;\n trackBy: trackByWeekTimeEvent\n \"\n #event\n class=\"cal-event-container\"\n [class.cal-draggable]=\"\n timeEvent.event.draggable && timeEventResizes.size === 0\n \"\n [class.cal-starts-within-day]=\"!timeEvent.startsBeforeDay\"\n [class.cal-ends-within-day]=\"!timeEvent.endsAfterDay\"\n [ngClass]=\"timeEvent.event.cssClass\"\n [hidden]=\"timeEvent.height === 0 && timeEvent.width === 0\"\n [style.top.px]=\"timeEvent.top\"\n [style.height.px]=\"timeEvent.height\"\n [style.left.%]=\"timeEvent.left\"\n [style.width.%]=\"timeEvent.width\"\n mwlResizable\n [resizeSnapGrid]=\"{\n left: dayColumnWidth,\n right: dayColumnWidth,\n top: eventSnapSize || hourSegmentHeight,\n bottom: eventSnapSize || hourSegmentHeight\n }\"\n [validateResize]=\"validateResize\"\n [allowNegativeResizes]=\"true\"\n (resizeStart)=\"\n timeEventResizeStarted(dayColumns, timeEvent, $event)\n \"\n (resizing)=\"timeEventResizing(timeEvent, $event)\"\n (resizeEnd)=\"timeEventResizeEnded(timeEvent)\"\n mwlDraggable\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: timeEvent.event, calendarId: calendarId }\"\n [dragAxis]=\"{\n x: timeEvent.event.draggable && timeEventResizes.size === 0,\n y: timeEvent.event.draggable && timeEventResizes.size === 0\n }\"\n [dragSnapGrid]=\"\n snapDraggedEvents\n ? {\n x: dayColumnWidth,\n y: eventSnapSize || hourSegmentHeight\n }\n : {}\n \"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n [ghostDragEnabled]=\"!snapDraggedEvents\"\n [ghostElementTemplate]=\"weekEventTemplate\"\n [validateDrag]=\"validateDrag\"\n (dragStart)=\"dragStarted(dayColumns, event, timeEvent, true)\"\n (dragging)=\"dragMove(timeEvent, $event)\"\n (dragEnd)=\"dragEnded(timeEvent, $event, dayColumnWidth, true)\"\n >\n <div\n class=\"cal-resize-handle cal-resize-handle-before-start\"\n *ngIf=\"\n timeEvent.event?.resizable?.beforeStart &&\n !timeEvent.startsBeforeDay\n \"\n mwlResizeHandle\n [resizeEdges]=\"{\n left: true,\n top: true\n }\"\n ></div>\n <ng-template\n [ngTemplateOutlet]=\"weekEventTemplate\"\n ></ng-template>\n <ng-template #weekEventTemplate>\n <mwl-calendar-week-view-event\n [locale]=\"locale\"\n [weekEvent]=\"timeEvent\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDisabled]=\"dragActive || timeEventResizes.size > 0\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [column]=\"column\"\n [daysInWeek]=\"daysInWeek\"\n (eventClicked)=\"\n eventClicked.emit({\n event: timeEvent.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n >\n </mwl-calendar-week-view-event>\n </ng-template>\n <div\n class=\"cal-resize-handle cal-resize-handle-after-end\"\n *ngIf=\"\n timeEvent.event?.resizable?.afterEnd &&\n !timeEvent.endsAfterDay\n \"\n mwlResizeHandle\n [resizeEdges]=\"{\n right: true,\n bottom: true\n }\"\n ></div>\n </div>\n </div>\n\n <div\n *ngFor=\"\n let hour of column.hours;\n trackBy: trackByHour;\n let odd = odd\n \"\n class=\"cal-hour\"\n [class.cal-hour-odd]=\"odd\"\n >\n <mwl-calendar-week-view-hour-segment\n *ngFor=\"\n let segment of hour.segments;\n trackBy: trackByHourSegment\n \"\n [style.height.px]=\"hourSegmentHeight\"\n [segment]=\"segment\"\n [segmentHeight]=\"hourSegmentHeight\"\n [locale]=\"locale\"\n [customTemplate]=\"hourSegmentTemplate\"\n [daysInWeek]=\"daysInWeek\"\n (mwlClick)=\"\n hourSegmentClicked.emit({\n date: segment.date,\n sourceEvent: $event\n })\n \"\n [clickListenerDisabled]=\"\n hourSegmentClicked.observers.length === 0\n \"\n mwlDroppable\n [dragOverClass]=\"\n !dragActive || !snapDraggedEvents ? 'cal-drag-over' : null\n \"\n dragActiveClass=\"cal-drag-active\"\n (drop)=\"eventDropped($event, segment.date, false)\"\n (dragEnter)=\"dateDragEnter(segment.date)\"\n [isTimeLabel]=\"daysInWeek === 1\"\n >\n </mwl-calendar-week-view-hour-segment>\n </div>\n </div>\n </div>\n </div>\n </div>\n ", isInline: true, components: [{ type: CalendarWeekViewHeaderComponent, selector: "mwl-calendar-week-view-header", inputs: ["days", "locale", "customTemplate"], outputs: ["dayHeaderClicked", "eventDropped", "dragEnter"] }, { type: CalendarWeekViewEventComponent, selector: "mwl-calendar-week-view-event", inputs: ["locale", "weekEvent", "tooltipPlacement", "tooltipAppendToBody", "tooltipDisabled", "tooltipDelay", "customTemplate", "eventTitleTemplate", "eventActionsTemplate", "tooltipTemplate", "column", "daysInWeek"], outputs: ["eventClicked"] }, { type: CalendarWeekViewHourSegmentComponent, selector: "mwl-calendar-week-view-hour-segment", inputs: ["segment", "segmentHeight", "locale", "isTimeLabel", "daysInWeek", "customTemplate"] }, { type: CalendarWeekViewCurrentTimeMarkerComponent, selector: "mwl-calendar-week-view-current-time-marker", inputs: ["columnDate", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "hourSegments", "hourDuration", "hourSegmentHeight", "customTemplate"] }], directives: [{ type: i1__namespace.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2__namespace.DroppableDirective, selector: "[mwlDroppable]", inputs: ["dragOverClass", "dragActiveClass", "validateDrop"], outputs: ["dragEnter", "dragLeave", "dragOver", "drop"] }, { type: i1__namespace.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i1__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i9__namespace.ResizableDirective, selector: "[mwlResizable]", inputs: ["validateResize", "enableGhostResize", "resizeSnapGrid", "resizeCursors", "ghostElementPositioning", "allowNegativeResizes", "mouseMoveThrottleMS"], outputs: ["resizeStart", "resizing", "resizeEnd"], exportAs: ["mwlResizable"] }, { type: i2__namespace.DraggableDirective, selector: "[mwlDraggable]", inputs: ["dropData", "dragAxis", "dragSnapGrid", "ghostDragEnabled", "showOriginalElementWhileDragging", "validateDrag", "dragCursor", "dragActiveClass", "ghostElementAppendTo", "ghostElementTemplate", "touchStartLongPress", "autoScroll"], outputs: ["dragPointerDown", "dragStart", "ghostElementCreated", "dragging", "dragEnd"] }, { type: i1__namespace.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i9__namespace.ResizeHandleDirective, selector: "[mwlResizeHandle]", inputs: ["resizeEdges", "resizableContainer"] }, { type: ClickDirective, selector: "[mwlClick]", inputs: ["clickListenerDisabled"], outputs: ["mwlClick"] }] });
2984 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekViewComponent, decorators: [{
2985 type: i0.Component,
2986 args: [{
2987 selector: 'mwl-calendar-week-view',
2988 template: "\n <div class=\"cal-week-view\" role=\"grid\">\n <mwl-calendar-week-view-header\n [days]=\"days\"\n [locale]=\"locale\"\n [customTemplate]=\"headerTemplate\"\n (dayHeaderClicked)=\"dayHeaderClicked.emit($event)\"\n (eventDropped)=\"\n eventDropped({ dropData: $event }, $event.newStart, true)\n \"\n (dragEnter)=\"dateDragEnter($event.date)\"\n >\n </mwl-calendar-week-view-header>\n <div\n class=\"cal-all-day-events\"\n #allDayEventsContainer\n *ngIf=\"view.allDayEventRows.length > 0\"\n mwlDroppable\n (dragEnter)=\"dragEnter('allDay')\"\n (dragLeave)=\"dragLeave('allDay')\"\n >\n <div class=\"cal-day-columns\">\n <div\n class=\"cal-time-label-column\"\n [ngTemplateOutlet]=\"allDayEventsLabelTemplate\"\n ></div>\n <div\n class=\"cal-day-column\"\n *ngFor=\"let day of days; trackBy: trackByWeekDayHeaderDate\"\n mwlDroppable\n dragOverClass=\"cal-drag-over\"\n (drop)=\"eventDropped($event, day.date, true)\"\n (dragEnter)=\"dateDragEnter(day.date)\"\n ></div>\n </div>\n <div\n *ngFor=\"let eventRow of view.allDayEventRows; trackBy: trackById\"\n #eventRowContainer\n class=\"cal-events-row\"\n >\n <div\n *ngFor=\"\n let allDayEvent of eventRow.row;\n trackBy: trackByWeekAllDayEvent\n \"\n #event\n class=\"cal-event-container\"\n [class.cal-draggable]=\"\n allDayEvent.event.draggable && allDayEventResizes.size === 0\n \"\n [class.cal-starts-within-week]=\"!allDayEvent.startsBeforeWeek\"\n [class.cal-ends-within-week]=\"!allDayEvent.endsAfterWeek\"\n [ngClass]=\"allDayEvent.event?.cssClass\"\n [style.width.%]=\"(100 / days.length) * allDayEvent.span\"\n [style.marginLeft.%]=\"\n rtl ? null : (100 / days.length) * allDayEvent.offset\n \"\n [style.marginRight.%]=\"\n rtl\n ? (100 / days.length) * (days.length - allDayEvent.offset) * -1\n : null\n \"\n mwlResizable\n [resizeSnapGrid]=\"{ left: dayColumnWidth, right: dayColumnWidth }\"\n [validateResize]=\"validateResize\"\n (resizeStart)=\"\n allDayEventResizeStarted(eventRowContainer, allDayEvent, $event)\n \"\n (resizing)=\"\n allDayEventResizing(allDayEvent, $event, dayColumnWidth)\n \"\n (resizeEnd)=\"allDayEventResizeEnded(allDayEvent)\"\n mwlDraggable\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: allDayEvent.event, calendarId: calendarId }\"\n [dragAxis]=\"{\n x: allDayEvent.event.draggable && allDayEventResizes.size === 0,\n y:\n !snapDraggedEvents &&\n allDayEvent.event.draggable &&\n allDayEventResizes.size === 0\n }\"\n [dragSnapGrid]=\"snapDraggedEvents ? { x: dayColumnWidth } : {}\"\n [validateDrag]=\"validateDrag\"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n (dragStart)=\"\n dragStarted(eventRowContainer, event, allDayEvent, false)\n \"\n (dragging)=\"allDayEventDragMove()\"\n (dragEnd)=\"dragEnded(allDayEvent, $event, dayColumnWidth)\"\n >\n <div\n class=\"cal-resize-handle cal-resize-handle-before-start\"\n *ngIf=\"\n allDayEvent.event?.resizable?.beforeStart &&\n !allDayEvent.startsBeforeWeek\n \"\n mwlResizeHandle\n [resizeEdges]=\"{ left: true }\"\n ></div>\n <mwl-calendar-week-view-event\n [locale]=\"locale\"\n [weekEvent]=\"allDayEvent\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [daysInWeek]=\"daysInWeek\"\n (eventClicked)=\"\n eventClicked.emit({\n event: allDayEvent.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n >\n </mwl-calendar-week-view-event>\n <div\n class=\"cal-resize-handle cal-resize-handle-after-end\"\n *ngIf=\"\n allDayEvent.event?.resizable?.afterEnd &&\n !allDayEvent.endsAfterWeek\n \"\n mwlResizeHandle\n [resizeEdges]=\"{ right: true }\"\n ></div>\n </div>\n </div>\n </div>\n <div\n class=\"cal-time-events\"\n mwlDroppable\n (dragEnter)=\"dragEnter('time')\"\n (dragLeave)=\"dragLeave('time')\"\n >\n <div\n class=\"cal-time-label-column\"\n *ngIf=\"view.hourColumns.length > 0 && daysInWeek !== 1\"\n >\n <div\n *ngFor=\"\n let hour of view.hourColumns[0].hours;\n trackBy: trackByHour;\n let odd = odd\n \"\n class=\"cal-hour\"\n [class.cal-hour-odd]=\"odd\"\n >\n <mwl-calendar-week-view-hour-segment\n *ngFor=\"let segment of hour.segments; trackBy: trackByHourSegment\"\n [style.height.px]=\"hourSegmentHeight\"\n [segment]=\"segment\"\n [segmentHeight]=\"hourSegmentHeight\"\n [locale]=\"locale\"\n [customTemplate]=\"hourSegmentTemplate\"\n [isTimeLabel]=\"true\"\n [daysInWeek]=\"daysInWeek\"\n >\n </mwl-calendar-week-view-hour-segment>\n </div>\n </div>\n <div\n class=\"cal-day-columns\"\n [class.cal-resize-active]=\"timeEventResizes.size > 0\"\n #dayColumns\n >\n <div\n class=\"cal-day-column\"\n *ngFor=\"let column of view.hourColumns; trackBy: trackByHourColumn\"\n >\n <mwl-calendar-week-view-current-time-marker\n [columnDate]=\"column.date\"\n [dayStartHour]=\"dayStartHour\"\n [dayStartMinute]=\"dayStartMinute\"\n [dayEndHour]=\"dayEndHour\"\n [dayEndMinute]=\"dayEndMinute\"\n [hourSegments]=\"hourSegments\"\n [hourDuration]=\"hourDuration\"\n [hourSegmentHeight]=\"hourSegmentHeight\"\n [customTemplate]=\"currentTimeMarkerTemplate\"\n ></mwl-calendar-week-view-current-time-marker>\n <div class=\"cal-events-container\">\n <div\n *ngFor=\"\n let timeEvent of column.events;\n trackBy: trackByWeekTimeEvent\n \"\n #event\n class=\"cal-event-container\"\n [class.cal-draggable]=\"\n timeEvent.event.draggable && timeEventResizes.size === 0\n \"\n [class.cal-starts-within-day]=\"!timeEvent.startsBeforeDay\"\n [class.cal-ends-within-day]=\"!timeEvent.endsAfterDay\"\n [ngClass]=\"timeEvent.event.cssClass\"\n [hidden]=\"timeEvent.height === 0 && timeEvent.width === 0\"\n [style.top.px]=\"timeEvent.top\"\n [style.height.px]=\"timeEvent.height\"\n [style.left.%]=\"timeEvent.left\"\n [style.width.%]=\"timeEvent.width\"\n mwlResizable\n [resizeSnapGrid]=\"{\n left: dayColumnWidth,\n right: dayColumnWidth,\n top: eventSnapSize || hourSegmentHeight,\n bottom: eventSnapSize || hourSegmentHeight\n }\"\n [validateResize]=\"validateResize\"\n [allowNegativeResizes]=\"true\"\n (resizeStart)=\"\n timeEventResizeStarted(dayColumns, timeEvent, $event)\n \"\n (resizing)=\"timeEventResizing(timeEvent, $event)\"\n (resizeEnd)=\"timeEventResizeEnded(timeEvent)\"\n mwlDraggable\n dragActiveClass=\"cal-drag-active\"\n [dropData]=\"{ event: timeEvent.event, calendarId: calendarId }\"\n [dragAxis]=\"{\n x: timeEvent.event.draggable && timeEventResizes.size === 0,\n y: timeEvent.event.draggable && timeEventResizes.size === 0\n }\"\n [dragSnapGrid]=\"\n snapDraggedEvents\n ? {\n x: dayColumnWidth,\n y: eventSnapSize || hourSegmentHeight\n }\n : {}\n \"\n [touchStartLongPress]=\"{ delay: 300, delta: 30 }\"\n [ghostDragEnabled]=\"!snapDraggedEvents\"\n [ghostElementTemplate]=\"weekEventTemplate\"\n [validateDrag]=\"validateDrag\"\n (dragStart)=\"dragStarted(dayColumns, event, timeEvent, true)\"\n (dragging)=\"dragMove(timeEvent, $event)\"\n (dragEnd)=\"dragEnded(timeEvent, $event, dayColumnWidth, true)\"\n >\n <div\n class=\"cal-resize-handle cal-resize-handle-before-start\"\n *ngIf=\"\n timeEvent.event?.resizable?.beforeStart &&\n !timeEvent.startsBeforeDay\n \"\n mwlResizeHandle\n [resizeEdges]=\"{\n left: true,\n top: true\n }\"\n ></div>\n <ng-template\n [ngTemplateOutlet]=\"weekEventTemplate\"\n ></ng-template>\n <ng-template #weekEventTemplate>\n <mwl-calendar-week-view-event\n [locale]=\"locale\"\n [weekEvent]=\"timeEvent\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDisabled]=\"dragActive || timeEventResizes.size > 0\"\n [tooltipDelay]=\"tooltipDelay\"\n [customTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [column]=\"column\"\n [daysInWeek]=\"daysInWeek\"\n (eventClicked)=\"\n eventClicked.emit({\n event: timeEvent.event,\n sourceEvent: $event.sourceEvent\n })\n \"\n >\n </mwl-calendar-week-view-event>\n </ng-template>\n <div\n class=\"cal-resize-handle cal-resize-handle-after-end\"\n *ngIf=\"\n timeEvent.event?.resizable?.afterEnd &&\n !timeEvent.endsAfterDay\n \"\n mwlResizeHandle\n [resizeEdges]=\"{\n right: true,\n bottom: true\n }\"\n ></div>\n </div>\n </div>\n\n <div\n *ngFor=\"\n let hour of column.hours;\n trackBy: trackByHour;\n let odd = odd\n \"\n class=\"cal-hour\"\n [class.cal-hour-odd]=\"odd\"\n >\n <mwl-calendar-week-view-hour-segment\n *ngFor=\"\n let segment of hour.segments;\n trackBy: trackByHourSegment\n \"\n [style.height.px]=\"hourSegmentHeight\"\n [segment]=\"segment\"\n [segmentHeight]=\"hourSegmentHeight\"\n [locale]=\"locale\"\n [customTemplate]=\"hourSegmentTemplate\"\n [daysInWeek]=\"daysInWeek\"\n (mwlClick)=\"\n hourSegmentClicked.emit({\n date: segment.date,\n sourceEvent: $event\n })\n \"\n [clickListenerDisabled]=\"\n hourSegmentClicked.observers.length === 0\n \"\n mwlDroppable\n [dragOverClass]=\"\n !dragActive || !snapDraggedEvents ? 'cal-drag-over' : null\n \"\n dragActiveClass=\"cal-drag-active\"\n (drop)=\"eventDropped($event, segment.date, false)\"\n (dragEnter)=\"dateDragEnter(segment.date)\"\n [isTimeLabel]=\"daysInWeek === 1\"\n >\n </mwl-calendar-week-view-hour-segment>\n </div>\n </div>\n </div>\n </div>\n </div>\n ",
2989 }]
2990 }], ctorParameters: function () {
2991 return [{ type: i0__namespace.ChangeDetectorRef }, { type: CalendarUtils }, { type: undefined, decorators: [{
2992 type: i0.Inject,
2993 args: [i0.LOCALE_ID]
2994 }] }, { type: DateAdapter }, { type: i0__namespace.ElementRef }];
2995 }, propDecorators: { viewDate: [{
2996 type: i0.Input
2997 }], events: [{
2998 type: i0.Input
2999 }], excludeDays: [{
3000 type: i0.Input
3001 }], refresh: [{
3002 type: i0.Input
3003 }], locale: [{
3004 type: i0.Input
3005 }], tooltipPlacement: [{
3006 type: i0.Input
3007 }], tooltipTemplate: [{
3008 type: i0.Input
3009 }], tooltipAppendToBody: [{
3010 type: i0.Input
3011 }], tooltipDelay: [{
3012 type: i0.Input
3013 }], weekStartsOn: [{
3014 type: i0.Input
3015 }], headerTemplate: [{
3016 type: i0.Input
3017 }], eventTemplate: [{
3018 type: i0.Input
3019 }], eventTitleTemplate: [{
3020 type: i0.Input
3021 }], eventActionsTemplate: [{
3022 type: i0.Input
3023 }], precision: [{
3024 type: i0.Input
3025 }], weekendDays: [{
3026 type: i0.Input
3027 }], snapDraggedEvents: [{
3028 type: i0.Input
3029 }], hourSegments: [{
3030 type: i0.Input
3031 }], hourDuration: [{
3032 type: i0.Input
3033 }], hourSegmentHeight: [{
3034 type: i0.Input
3035 }], minimumEventHeight: [{
3036 type: i0.Input
3037 }], dayStartHour: [{
3038 type: i0.Input
3039 }], dayStartMinute: [{
3040 type: i0.Input
3041 }], dayEndHour: [{
3042 type: i0.Input
3043 }], dayEndMinute: [{
3044 type: i0.Input
3045 }], hourSegmentTemplate: [{
3046 type: i0.Input
3047 }], eventSnapSize: [{
3048 type: i0.Input
3049 }], allDayEventsLabelTemplate: [{
3050 type: i0.Input
3051 }], daysInWeek: [{
3052 type: i0.Input
3053 }], currentTimeMarkerTemplate: [{
3054 type: i0.Input
3055 }], validateEventTimesChanged: [{
3056 type: i0.Input
3057 }], dayHeaderClicked: [{
3058 type: i0.Output
3059 }], eventClicked: [{
3060 type: i0.Output
3061 }], eventTimesChanged: [{
3062 type: i0.Output
3063 }], beforeViewRender: [{
3064 type: i0.Output
3065 }], hourSegmentClicked: [{
3066 type: i0.Output
3067 }] } });
3068
3069 var CalendarWeekModule = /** @class */ (function () {
3070 function CalendarWeekModule() {
3071 }
3072 return CalendarWeekModule;
3073 }());
3074 CalendarWeekModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3075 CalendarWeekModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekModule, declarations: [CalendarWeekViewComponent,
3076 CalendarWeekViewHeaderComponent,
3077 CalendarWeekViewEventComponent,
3078 CalendarWeekViewHourSegmentComponent,
3079 CalendarWeekViewCurrentTimeMarkerComponent], imports: [i1.CommonModule,
3080 i9.ResizableModule,
3081 i2.DragAndDropModule,
3082 CalendarCommonModule], exports: [i9.ResizableModule,
3083 i2.DragAndDropModule,
3084 CalendarWeekViewComponent,
3085 CalendarWeekViewHeaderComponent,
3086 CalendarWeekViewEventComponent,
3087 CalendarWeekViewHourSegmentComponent,
3088 CalendarWeekViewCurrentTimeMarkerComponent] });
3089 CalendarWeekModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekModule, imports: [[
3090 i1.CommonModule,
3091 i9.ResizableModule,
3092 i2.DragAndDropModule,
3093 CalendarCommonModule,
3094 ], i9.ResizableModule,
3095 i2.DragAndDropModule] });
3096 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarWeekModule, decorators: [{
3097 type: i0.NgModule,
3098 args: [{
3099 imports: [
3100 i1.CommonModule,
3101 i9.ResizableModule,
3102 i2.DragAndDropModule,
3103 CalendarCommonModule,
3104 ],
3105 declarations: [
3106 CalendarWeekViewComponent,
3107 CalendarWeekViewHeaderComponent,
3108 CalendarWeekViewEventComponent,
3109 CalendarWeekViewHourSegmentComponent,
3110 CalendarWeekViewCurrentTimeMarkerComponent,
3111 ],
3112 exports: [
3113 i9.ResizableModule,
3114 i2.DragAndDropModule,
3115 CalendarWeekViewComponent,
3116 CalendarWeekViewHeaderComponent,
3117 CalendarWeekViewEventComponent,
3118 CalendarWeekViewHourSegmentComponent,
3119 CalendarWeekViewCurrentTimeMarkerComponent,
3120 ],
3121 }]
3122 }] });
3123
3124 /**
3125 * Shows all events on a given day. Example usage:
3126 *
3127 * ```typescript
3128 * <mwl-calendar-day-view
3129 * [viewDate]="viewDate"
3130 * [events]="events">
3131 * </mwl-calendar-day-view>
3132 * ```
3133 */
3134 var CalendarDayViewComponent = /** @class */ (function () {
3135 function CalendarDayViewComponent() {
3136 /**
3137 * An array of events to display on view
3138 * The schema is available here: https://github.com/mattlewis92/calendar-utils/blob/c51689985f59a271940e30bc4e2c4e1fee3fcb5c/src/calendarUtils.ts#L49-L63
3139 */
3140 this.events = [];
3141 /**
3142 * The number of segments in an hour. Must divide equally into 60.
3143 */
3144 this.hourSegments = 2;
3145 /**
3146 * The height in pixels of each hour segment
3147 */
3148 this.hourSegmentHeight = 30;
3149 /**
3150 * The minimum height in pixels of each event
3151 */
3152 this.minimumEventHeight = 30;
3153 /**
3154 * The day start hours in 24 hour time. Must be 0-23
3155 */
3156 this.dayStartHour = 0;
3157 /**
3158 * The day start minutes. Must be 0-59
3159 */
3160 this.dayStartMinute = 0;
3161 /**
3162 * The day end hours in 24 hour time. Must be 0-23
3163 */
3164 this.dayEndHour = 23;
3165 /**
3166 * The day end minutes. Must be 0-59
3167 */
3168 this.dayEndMinute = 59;
3169 /**
3170 * The placement of the event tooltip
3171 */
3172 this.tooltipPlacement = 'auto';
3173 /**
3174 * Whether to append tooltips to the body or next to the trigger element
3175 */
3176 this.tooltipAppendToBody = true;
3177 /**
3178 * The delay in milliseconds before the tooltip should be displayed. If not provided the tooltip
3179 * will be displayed immediately.
3180 */
3181 this.tooltipDelay = null;
3182 /**
3183 * Whether to snap events to a grid when dragging
3184 */
3185 this.snapDraggedEvents = true;
3186 /**
3187 * Called when an event title is clicked
3188 */
3189 this.eventClicked = new i0.EventEmitter();
3190 /**
3191 * Called when an hour segment is clicked
3192 */
3193 this.hourSegmentClicked = new i0.EventEmitter();
3194 /**
3195 * Called when an event is resized or dragged and dropped
3196 */
3197 this.eventTimesChanged = new i0.EventEmitter();
3198 /**
3199 * An output that will be called before the view is rendered for the current day.
3200 * If you add the `cssClass` property to an hour grid segment it will add that class to the hour segment in the template
3201 */
3202 this.beforeViewRender = new i0.EventEmitter();
3203 }
3204 return CalendarDayViewComponent;
3205 }());
3206 CalendarDayViewComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayViewComponent, deps: [], target: i0__namespace.ɵɵFactoryTarget.Component });
3207 CalendarDayViewComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.3", type: CalendarDayViewComponent, selector: "mwl-calendar-day-view", inputs: { viewDate: "viewDate", events: "events", hourSegments: "hourSegments", hourSegmentHeight: "hourSegmentHeight", hourDuration: "hourDuration", minimumEventHeight: "minimumEventHeight", dayStartHour: "dayStartHour", dayStartMinute: "dayStartMinute", dayEndHour: "dayEndHour", dayEndMinute: "dayEndMinute", refresh: "refresh", locale: "locale", eventSnapSize: "eventSnapSize", tooltipPlacement: "tooltipPlacement", tooltipTemplate: "tooltipTemplate", tooltipAppendToBody: "tooltipAppendToBody", tooltipDelay: "tooltipDelay", hourSegmentTemplate: "hourSegmentTemplate", eventTemplate: "eventTemplate", eventTitleTemplate: "eventTitleTemplate", eventActionsTemplate: "eventActionsTemplate", snapDraggedEvents: "snapDraggedEvents", allDayEventsLabelTemplate: "allDayEventsLabelTemplate", currentTimeMarkerTemplate: "currentTimeMarkerTemplate", validateEventTimesChanged: "validateEventTimesChanged" }, outputs: { eventClicked: "eventClicked", hourSegmentClicked: "hourSegmentClicked", eventTimesChanged: "eventTimesChanged", beforeViewRender: "beforeViewRender" }, ngImport: i0__namespace, template: "\n <mwl-calendar-week-view\n class=\"cal-day-view\"\n [daysInWeek]=\"1\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [hourSegments]=\"hourSegments\"\n [hourDuration]=\"hourDuration\"\n [hourSegmentHeight]=\"hourSegmentHeight\"\n [minimumEventHeight]=\"minimumEventHeight\"\n [dayStartHour]=\"dayStartHour\"\n [dayStartMinute]=\"dayStartMinute\"\n [dayEndHour]=\"dayEndHour\"\n [dayEndMinute]=\"dayEndMinute\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [eventSnapSize]=\"eventSnapSize\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n [hourSegmentTemplate]=\"hourSegmentTemplate\"\n [eventTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [snapDraggedEvents]=\"snapDraggedEvents\"\n [allDayEventsLabelTemplate]=\"allDayEventsLabelTemplate\"\n [currentTimeMarkerTemplate]=\"currentTimeMarkerTemplate\"\n [validateEventTimesChanged]=\"validateEventTimesChanged\"\n (eventClicked)=\"eventClicked.emit($event)\"\n (hourSegmentClicked)=\"hourSegmentClicked.emit($event)\"\n (eventTimesChanged)=\"eventTimesChanged.emit($event)\"\n (beforeViewRender)=\"beforeViewRender.emit($event)\"\n ></mwl-calendar-week-view>\n ", isInline: true, components: [{ type: CalendarWeekViewComponent, selector: "mwl-calendar-week-view", inputs: ["viewDate", "events", "excludeDays", "refresh", "locale", "tooltipPlacement", "tooltipTemplate", "tooltipAppendToBody", "tooltipDelay", "weekStartsOn", "headerTemplate", "eventTemplate", "eventTitleTemplate", "eventActionsTemplate", "precision", "weekendDays", "snapDraggedEvents", "hourSegments", "hourDuration", "hourSegmentHeight", "minimumEventHeight", "dayStartHour", "dayStartMinute", "dayEndHour", "dayEndMinute", "hourSegmentTemplate", "eventSnapSize", "allDayEventsLabelTemplate", "daysInWeek", "currentTimeMarkerTemplate", "validateEventTimesChanged"], outputs: ["dayHeaderClicked", "eventClicked", "eventTimesChanged", "beforeViewRender", "hourSegmentClicked"] }] });
3208 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayViewComponent, decorators: [{
3209 type: i0.Component,
3210 args: [{
3211 selector: 'mwl-calendar-day-view',
3212 template: "\n <mwl-calendar-week-view\n class=\"cal-day-view\"\n [daysInWeek]=\"1\"\n [viewDate]=\"viewDate\"\n [events]=\"events\"\n [hourSegments]=\"hourSegments\"\n [hourDuration]=\"hourDuration\"\n [hourSegmentHeight]=\"hourSegmentHeight\"\n [minimumEventHeight]=\"minimumEventHeight\"\n [dayStartHour]=\"dayStartHour\"\n [dayStartMinute]=\"dayStartMinute\"\n [dayEndHour]=\"dayEndHour\"\n [dayEndMinute]=\"dayEndMinute\"\n [refresh]=\"refresh\"\n [locale]=\"locale\"\n [eventSnapSize]=\"eventSnapSize\"\n [tooltipPlacement]=\"tooltipPlacement\"\n [tooltipTemplate]=\"tooltipTemplate\"\n [tooltipAppendToBody]=\"tooltipAppendToBody\"\n [tooltipDelay]=\"tooltipDelay\"\n [hourSegmentTemplate]=\"hourSegmentTemplate\"\n [eventTemplate]=\"eventTemplate\"\n [eventTitleTemplate]=\"eventTitleTemplate\"\n [eventActionsTemplate]=\"eventActionsTemplate\"\n [snapDraggedEvents]=\"snapDraggedEvents\"\n [allDayEventsLabelTemplate]=\"allDayEventsLabelTemplate\"\n [currentTimeMarkerTemplate]=\"currentTimeMarkerTemplate\"\n [validateEventTimesChanged]=\"validateEventTimesChanged\"\n (eventClicked)=\"eventClicked.emit($event)\"\n (hourSegmentClicked)=\"hourSegmentClicked.emit($event)\"\n (eventTimesChanged)=\"eventTimesChanged.emit($event)\"\n (beforeViewRender)=\"beforeViewRender.emit($event)\"\n ></mwl-calendar-week-view>\n ",
3213 }]
3214 }], propDecorators: { viewDate: [{
3215 type: i0.Input
3216 }], events: [{
3217 type: i0.Input
3218 }], hourSegments: [{
3219 type: i0.Input
3220 }], hourSegmentHeight: [{
3221 type: i0.Input
3222 }], hourDuration: [{
3223 type: i0.Input
3224 }], minimumEventHeight: [{
3225 type: i0.Input
3226 }], dayStartHour: [{
3227 type: i0.Input
3228 }], dayStartMinute: [{
3229 type: i0.Input
3230 }], dayEndHour: [{
3231 type: i0.Input
3232 }], dayEndMinute: [{
3233 type: i0.Input
3234 }], refresh: [{
3235 type: i0.Input
3236 }], locale: [{
3237 type: i0.Input
3238 }], eventSnapSize: [{
3239 type: i0.Input
3240 }], tooltipPlacement: [{
3241 type: i0.Input
3242 }], tooltipTemplate: [{
3243 type: i0.Input
3244 }], tooltipAppendToBody: [{
3245 type: i0.Input
3246 }], tooltipDelay: [{
3247 type: i0.Input
3248 }], hourSegmentTemplate: [{
3249 type: i0.Input
3250 }], eventTemplate: [{
3251 type: i0.Input
3252 }], eventTitleTemplate: [{
3253 type: i0.Input
3254 }], eventActionsTemplate: [{
3255 type: i0.Input
3256 }], snapDraggedEvents: [{
3257 type: i0.Input
3258 }], allDayEventsLabelTemplate: [{
3259 type: i0.Input
3260 }], currentTimeMarkerTemplate: [{
3261 type: i0.Input
3262 }], validateEventTimesChanged: [{
3263 type: i0.Input
3264 }], eventClicked: [{
3265 type: i0.Output
3266 }], hourSegmentClicked: [{
3267 type: i0.Output
3268 }], eventTimesChanged: [{
3269 type: i0.Output
3270 }], beforeViewRender: [{
3271 type: i0.Output
3272 }] } });
3273
3274 var CalendarDayModule = /** @class */ (function () {
3275 function CalendarDayModule() {
3276 }
3277 return CalendarDayModule;
3278 }());
3279 CalendarDayModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3280 CalendarDayModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayModule, declarations: [CalendarDayViewComponent], imports: [i1.CommonModule, CalendarCommonModule, CalendarWeekModule], exports: [CalendarDayViewComponent] });
3281 CalendarDayModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayModule, imports: [[i1.CommonModule, CalendarCommonModule, CalendarWeekModule]] });
3282 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarDayModule, decorators: [{
3283 type: i0.NgModule,
3284 args: [{
3285 imports: [i1.CommonModule, CalendarCommonModule, CalendarWeekModule],
3286 declarations: [CalendarDayViewComponent],
3287 exports: [CalendarDayViewComponent],
3288 }]
3289 }] });
3290
3291 /**
3292 * The main module of this library. Example usage:
3293 *
3294 * ```typescript
3295 * import { CalenderModule } from 'angular-calendar';
3296 *
3297 * @NgModule({
3298 * imports: [
3299 * CalenderModule.forRoot()
3300 * ]
3301 * })
3302 * class MyModule {}
3303 * ```
3304 *
3305 */
3306 var CalendarModule = /** @class */ (function () {
3307 function CalendarModule() {
3308 }
3309 CalendarModule.forRoot = function (dateAdapter, config) {
3310 if (config === void 0) { config = {}; }
3311 return {
3312 ngModule: CalendarModule,
3313 providers: [
3314 dateAdapter,
3315 config.eventTitleFormatter || CalendarEventTitleFormatter,
3316 config.dateFormatter || CalendarDateFormatter,
3317 config.utils || CalendarUtils,
3318 config.a11y || CalendarA11y,
3319 ],
3320 };
3321 };
3322 return CalendarModule;
3323 }());
3324 CalendarModule.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarModule, deps: [], target: i0__namespace.ɵɵFactoryTarget.NgModule });
3325 CalendarModule.ɵmod = i0__namespace.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarModule, imports: [CalendarCommonModule,
3326 CalendarMonthModule,
3327 CalendarWeekModule,
3328 CalendarDayModule], exports: [CalendarCommonModule,
3329 CalendarMonthModule,
3330 CalendarWeekModule,
3331 CalendarDayModule] });
3332 CalendarModule.ɵinj = i0__namespace.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarModule, imports: [[
3333 CalendarCommonModule,
3334 CalendarMonthModule,
3335 CalendarWeekModule,
3336 CalendarDayModule,
3337 ], CalendarCommonModule,
3338 CalendarMonthModule,
3339 CalendarWeekModule,
3340 CalendarDayModule] });
3341 i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.3", ngImport: i0__namespace, type: CalendarModule, decorators: [{
3342 type: i0.NgModule,
3343 args: [{
3344 imports: [
3345 CalendarCommonModule,
3346 CalendarMonthModule,
3347 CalendarWeekModule,
3348 CalendarDayModule,
3349 ],
3350 exports: [
3351 CalendarCommonModule,
3352 CalendarMonthModule,
3353 CalendarWeekModule,
3354 CalendarDayModule,
3355 ],
3356 }]
3357 }] });
3358
3359 /*
3360 * Public API Surface of angular-calendar
3361 */
3362
3363 /**
3364 * Generated bundle index. Do not edit.
3365 */
3366
3367 Object.defineProperty(exports, 'DAYS_OF_WEEK', {
3368 enumerable: true,
3369 get: function () {
3370 return calendarUtils.DAYS_OF_WEEK;
3371 }
3372 });
3373 exports.CalendarA11y = CalendarA11y;
3374 exports.CalendarAngularDateFormatter = CalendarAngularDateFormatter;
3375 exports.CalendarCommonModule = CalendarCommonModule;
3376 exports.CalendarDateFormatter = CalendarDateFormatter;
3377 exports.CalendarDayModule = CalendarDayModule;
3378 exports.CalendarDayViewComponent = CalendarDayViewComponent;
3379 exports.CalendarEventTitleFormatter = CalendarEventTitleFormatter;
3380 exports.CalendarModule = CalendarModule;
3381 exports.CalendarMomentDateFormatter = CalendarMomentDateFormatter;
3382 exports.CalendarMonthModule = CalendarMonthModule;
3383 exports.CalendarMonthViewComponent = CalendarMonthViewComponent;
3384 exports.CalendarNativeDateFormatter = CalendarNativeDateFormatter;
3385 exports.CalendarUtils = CalendarUtils;
3386 exports.CalendarWeekModule = CalendarWeekModule;
3387 exports.CalendarWeekViewComponent = CalendarWeekViewComponent;
3388 exports.DateAdapter = DateAdapter;
3389 exports.MOMENT = MOMENT;
3390 exports.collapseAnimation = collapseAnimation;
3391 exports.getWeekViewPeriod = getWeekViewPeriod;
3392 exports.ɵCalendarA11yPipe = CalendarA11yPipe;
3393 exports.ɵCalendarDatePipe = CalendarDatePipe;
3394 exports.ɵCalendarEventActionsComponent = CalendarEventActionsComponent;
3395 exports.ɵCalendarEventTitleComponent = CalendarEventTitleComponent;
3396 exports.ɵCalendarEventTitlePipe = CalendarEventTitlePipe;
3397 exports.ɵCalendarMonthCellComponent = CalendarMonthCellComponent;
3398 exports.ɵCalendarMonthViewHeaderComponent = CalendarMonthViewHeaderComponent;
3399 exports.ɵCalendarNextViewDirective = CalendarNextViewDirective;
3400 exports.ɵCalendarOpenDayEventsComponent = CalendarOpenDayEventsComponent;
3401 exports.ɵCalendarPreviousViewDirective = CalendarPreviousViewDirective;
3402 exports.ɵCalendarTodayDirective = CalendarTodayDirective;
3403 exports.ɵCalendarTooltipDirective = CalendarTooltipDirective;
3404 exports.ɵCalendarTooltipWindowComponent = CalendarTooltipWindowComponent;
3405 exports.ɵCalendarWeekViewCurrentTimeMarkerComponent = CalendarWeekViewCurrentTimeMarkerComponent;
3406 exports.ɵCalendarWeekViewEventComponent = CalendarWeekViewEventComponent;
3407 exports.ɵCalendarWeekViewHeaderComponent = CalendarWeekViewHeaderComponent;
3408 exports.ɵCalendarWeekViewHourSegmentComponent = CalendarWeekViewHourSegmentComponent;
3409 exports.ɵClickDirective = ClickDirective;
3410 exports.ɵKeydownEnterDirective = KeydownEnterDirective;
3411
3412 Object.defineProperty(exports, '__esModule', { value: true });
3413
3414})));
3415//# sourceMappingURL=angular-calendar.umd.js.map