@progress/kendo-angular-scheduler 14.4.0-develop.8 → 15.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE.txt +146 -593
- package/editing/date-time-picker.component.d.ts +4 -0
- package/editing/recurrence/recurrence-end-rule-editor.component.d.ts +3 -3
- package/editing/recurrence/recurrence-interval-editor.component.d.ts +3 -3
- package/editing/recurrence/recurrence-monthly-yearly-editor.component.d.ts +3 -3
- package/esm2020/editing/date-time-picker.component.mjs +62 -8
- package/esm2020/editing/recurrence/recurrence-end-rule-editor.component.mjs +35 -9
- package/esm2020/editing/recurrence/recurrence-interval-editor.component.mjs +19 -7
- package/esm2020/editing/recurrence/recurrence-monthly-yearly-editor.component.mjs +19 -7
- package/esm2020/editing/resource-multiple-editor.component.mjs +1 -1
- package/esm2020/editing/timezone-editor.component.mjs +1 -1
- package/esm2020/index.mjs +1 -0
- package/esm2020/localization/messages.mjs +35 -1
- package/esm2020/navigation/shortcuts.directive.mjs +9 -0
- package/esm2020/package-metadata.mjs +2 -2
- package/esm2020/scheduler.component.mjs +200 -98
- package/esm2020/scheduler.module.mjs +8 -1
- package/esm2020/toolbar/navigation.component.mjs +9 -1
- package/esm2020/toolbar/toolbar.component.mjs +25 -3
- package/esm2020/views/timeline/timeline-month-view.component.mjs +13 -5
- package/esm2020/views/timeline/timeline-view.component.mjs +13 -5
- package/esm2020/views/timeline/timeline-week-view.component.mjs +12 -5
- package/esm2020/views/year/utils.mjs +60 -0
- package/esm2020/views/year/year-view-internal.component.mjs +418 -0
- package/esm2020/views/year/year-view.component.mjs +115 -0
- package/esm2020/views/year/year-view.module.mjs +47 -0
- package/fesm2015/progress-kendo-angular-scheduler.mjs +1043 -157
- package/fesm2020/progress-kendo-angular-scheduler.mjs +1037 -157
- package/index.d.ts +1 -0
- package/localization/messages.d.ts +118 -50
- package/package.json +13 -12
- package/scheduler.module.d.ts +15 -13
- package/schematics/ngAdd/index.js +2 -2
- package/toolbar/navigation.component.d.ts +10 -2
- package/toolbar/toolbar.component.d.ts +9 -0
- package/types/scheduler-slot.interface.d.ts +4 -0
- package/types/slot-class-args.interface.d.ts +4 -0
- package/views/timeline/timeline-month-view.component.d.ts +4 -1
- package/views/timeline/timeline-view.component.d.ts +4 -1
- package/views/timeline/timeline-week-view.component.d.ts +3 -1
- package/views/year/utils.d.ts +21 -0
- package/views/year/year-view-internal.component.d.ts +82 -0
- package/views/year/year-view.component.d.ts +56 -0
- package/views/year/year-view.module.d.ts +19 -0
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { ChangeDetectorRef, Component, ElementRef, Inject, Input, LOCALE_ID, NgZone, Renderer2, ViewChild, } from '@angular/core';
|
|
6
|
+
import { ScrollbarWidthService } from '@progress/kendo-angular-common';
|
|
7
|
+
import { ViewContextService } from '../view-context.service';
|
|
8
|
+
import { ViewStateService } from '../view-state.service';
|
|
9
|
+
import { IntlService } from '@progress/kendo-angular-intl';
|
|
10
|
+
import { PDFService } from '../../pdf/pdf.service';
|
|
11
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
12
|
+
import { addDays, addYears, toLocalDate } from '@progress/kendo-date-math';
|
|
13
|
+
import { TooltipDirective } from '@progress/kendo-angular-tooltip';
|
|
14
|
+
import { formatEventTime, toUTCDate } from '../utils';
|
|
15
|
+
import { caretAltLeftIcon, caretAltRightIcon } from '@progress/kendo-svg-icons';
|
|
16
|
+
import { FocusService } from '../../navigation';
|
|
17
|
+
import { MultiViewCalendarComponent } from '@progress/kendo-angular-dateinputs';
|
|
18
|
+
import { BaseView } from '../common/base-view';
|
|
19
|
+
import { createTasks, noop, yearEnd, yearStart } from './utils';
|
|
20
|
+
import { MonthSlotService } from '../month/month-slot.service';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
23
|
+
import * as i2 from "../../navigation";
|
|
24
|
+
import * as i3 from "@progress/kendo-angular-intl";
|
|
25
|
+
import * as i4 from "../view-context.service";
|
|
26
|
+
import * as i5 from "../view-state.service";
|
|
27
|
+
import * as i6 from "../../pdf/pdf.service";
|
|
28
|
+
import * as i7 from "../month/month-slot.service";
|
|
29
|
+
import * as i8 from "@progress/kendo-angular-common";
|
|
30
|
+
import * as i9 from "@progress/kendo-angular-dateinputs";
|
|
31
|
+
import * as i10 from "@progress/kendo-angular-icons";
|
|
32
|
+
import * as i11 from "@progress/kendo-angular-tooltip";
|
|
33
|
+
import * as i12 from "@angular/common";
|
|
34
|
+
const today = new Date(Date.now());
|
|
35
|
+
const getDateAttribute = (element) => element?.querySelector('span>span[date]')?.getAttribute('date');
|
|
36
|
+
/**
|
|
37
|
+
* @hidden
|
|
38
|
+
*/
|
|
39
|
+
export class YearViewInternalComponent extends BaseView {
|
|
40
|
+
constructor(localization, focusService, intl, viewContext, viewState, zone, renderer, pdfService, element, slotService, scrollBarWidthService, changeDetector, localeId) {
|
|
41
|
+
super(viewContext, viewState, intl, slotService, zone, renderer, element, pdfService, localization, changeDetector, scrollBarWidthService);
|
|
42
|
+
this.localization = localization;
|
|
43
|
+
this.focusService = focusService;
|
|
44
|
+
this.intl = intl;
|
|
45
|
+
this.localeId = localeId;
|
|
46
|
+
this.caretAltLeftIcon = caretAltLeftIcon;
|
|
47
|
+
this.caretAltRightIcon = caretAltRightIcon;
|
|
48
|
+
this.eventsPerSelectedDay = [];
|
|
49
|
+
this.days = [];
|
|
50
|
+
this.tds = [];
|
|
51
|
+
this.isTooltipClicked = false;
|
|
52
|
+
this.slotByIndex = (slotIndex, args) => noop(slotIndex);
|
|
53
|
+
this.dragHintSize = (startSlot, endSlot) => noop(startSlot);
|
|
54
|
+
this.dragRanges = (slot) => noop(slot);
|
|
55
|
+
this.slotByPosition = (x, y, container) => noop(x);
|
|
56
|
+
this.cachedTds = [];
|
|
57
|
+
}
|
|
58
|
+
get arrowIcons() {
|
|
59
|
+
return !this.localization.rtl
|
|
60
|
+
? ['caret-alt-left', 'caret-alt-right']
|
|
61
|
+
: ['caret-alt-right', 'caret-alt-left'];
|
|
62
|
+
}
|
|
63
|
+
get arrowSVGIcons() {
|
|
64
|
+
return !this.localization.rtl
|
|
65
|
+
? [this.caretAltLeftIcon, this.caretAltRightIcon]
|
|
66
|
+
: [this.caretAltRightIcon, this.caretAltLeftIcon];
|
|
67
|
+
}
|
|
68
|
+
ngAfterViewInit() {
|
|
69
|
+
this.updateTds();
|
|
70
|
+
super.ngAfterViewInit();
|
|
71
|
+
}
|
|
72
|
+
getSlotClass(date) {
|
|
73
|
+
if (this.slotClass) {
|
|
74
|
+
return this.slotClass({
|
|
75
|
+
start: date,
|
|
76
|
+
end: addDays(date, 1),
|
|
77
|
+
events: this.eventsPerDay(date),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
getEventClasses(item, resources, isAllDay) {
|
|
82
|
+
if (this.eventClass) {
|
|
83
|
+
return this.eventClass({
|
|
84
|
+
event: item.event,
|
|
85
|
+
resources,
|
|
86
|
+
isAllDay,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
onBlur() {
|
|
91
|
+
if (!this.isTooltipClicked) {
|
|
92
|
+
this.tooltip.hide();
|
|
93
|
+
}
|
|
94
|
+
this.isTooltipClicked = false;
|
|
95
|
+
}
|
|
96
|
+
getDate(element) {
|
|
97
|
+
return new Date(getDateAttribute(element.nativeElement));
|
|
98
|
+
}
|
|
99
|
+
eventTitle(event) {
|
|
100
|
+
const startTime = toLocalDate(event.startTime);
|
|
101
|
+
const endTime = toLocalDate(event.endTime);
|
|
102
|
+
const time = formatEventTime(startTime, endTime, event.isAllDay, this.localeId);
|
|
103
|
+
return `${time}, ${event.event.title}`;
|
|
104
|
+
}
|
|
105
|
+
onClick(event) {
|
|
106
|
+
if (event.target.tagName === 'SPAN') {
|
|
107
|
+
const clickedDate = getDateAttribute(event.target.closest('td.k-calendar-td'));
|
|
108
|
+
if (clickedDate === getDateAttribute(this.currentTd)) {
|
|
109
|
+
this.tooltip.show(this.currentTd);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
this.tooltip.hide();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
onMouseDown() {
|
|
117
|
+
this.isTooltipClicked = true;
|
|
118
|
+
}
|
|
119
|
+
onKeydown(event) {
|
|
120
|
+
if (event.key === 'Backspace' || event.key === 'Delete') {
|
|
121
|
+
this.tooltip.hide();
|
|
122
|
+
}
|
|
123
|
+
if (event.key === 'Enter' && !this.tooltip.popupRef) {
|
|
124
|
+
this.tooltip.show(this.currentTd);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (event.key === 'Enter' && this.tooltip.popupRef && (getDateAttribute(this.currentTd) === this.calendar.focusedDate.toString())) {
|
|
128
|
+
this.navigateToDay(new Date(getDateAttribute(this.currentTd)));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
navigateToDay(date) {
|
|
132
|
+
this.tooltip.hide();
|
|
133
|
+
this.zone.run(() => {
|
|
134
|
+
this.viewState.navigateTo({ viewName: 'day', date: new Date(date) });
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
eventsPerDay(date) {
|
|
138
|
+
return this.tasksPerDay(date)?.map((task) => task.event) || [];
|
|
139
|
+
}
|
|
140
|
+
tasksPerDay(date) {
|
|
141
|
+
if (this.resources?.length > 0) {
|
|
142
|
+
return this.tasks?.filter((event) => event.resources.length > 0 &&
|
|
143
|
+
event.startTime.getUTCDate() === date.getDate() &&
|
|
144
|
+
event.startTime.getUTCMonth() === date.getMonth());
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
return this.tasks?.filter((event) => event.startTime.getUTCDate() === date.getDate() && event.startTime.getUTCMonth() === date.getMonth());
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
onValueChange(date) {
|
|
151
|
+
this.eventsPerSelectedDay = this.tasksPerDay(date);
|
|
152
|
+
this.currentTd = this.tds.find((td) => getDateAttribute(td) === date.toString());
|
|
153
|
+
if (this.tooltip.popupRef) {
|
|
154
|
+
this.tooltip.hide();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
hasEvent(date) {
|
|
158
|
+
return this.tasksPerDay(date).length > 0;
|
|
159
|
+
}
|
|
160
|
+
createPDFElement() {
|
|
161
|
+
const element = this.element.nativeElement.cloneNode(true);
|
|
162
|
+
element.style.width = `${this.element.nativeElement.offsetWidth}px`;
|
|
163
|
+
element.querySelector('.k-scheduler-layout').style.height = 'auto';
|
|
164
|
+
this.pdfService.elementReady.emit({
|
|
165
|
+
element: element,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
onSelectDate(date) {
|
|
169
|
+
const year = date.getFullYear();
|
|
170
|
+
this.focusedDate = new Date(year, today.getMonth(), today.getDate());
|
|
171
|
+
const start = yearStart(year);
|
|
172
|
+
this.selectedDate = start;
|
|
173
|
+
const dateRange = this.dateRange(date);
|
|
174
|
+
this.viewState.notifyDateRange(dateRange);
|
|
175
|
+
this.days = this.createDaySlots(dateRange);
|
|
176
|
+
if (this.calendar) {
|
|
177
|
+
this.calendar.min = start;
|
|
178
|
+
this.calendar.max = yearEnd(start.getFullYear());
|
|
179
|
+
this.updateTds();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
onAction(e) {
|
|
183
|
+
const now = this.selectedDate;
|
|
184
|
+
if (e.type === 'next' || e.type === 'prev') {
|
|
185
|
+
const offset = e.type === 'next' ? 1 : -1;
|
|
186
|
+
const next = addYears(now, offset);
|
|
187
|
+
this.viewState.notifyNextDate(next);
|
|
188
|
+
this.calendar.min = next;
|
|
189
|
+
this.calendar.max = yearEnd(next.getFullYear());
|
|
190
|
+
this.focusedDate = new Date(next.getFullYear(), today.getMonth(), today.getDate());
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
createTasks(items, dateRange) {
|
|
194
|
+
this.days = this.createDaySlots(dateRange);
|
|
195
|
+
return createTasks(dateRange.start, dateRange.end, items, this.days);
|
|
196
|
+
}
|
|
197
|
+
reflow() {
|
|
198
|
+
this.updateContentHeight();
|
|
199
|
+
const content = this.content.nativeElement;
|
|
200
|
+
if (this.contentHeight === 'auto') {
|
|
201
|
+
// bigger size changes cause the table to overflow the container and in horizontal scrollbars
|
|
202
|
+
// this changes the table and slots size during rendering before the browser re-adjusts the 100% table width
|
|
203
|
+
content.style.overflow = 'visible';
|
|
204
|
+
}
|
|
205
|
+
if (this.contentHeight === 'auto') {
|
|
206
|
+
content.style.overflow = '';
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
dateRange(date = this.selectedDate) {
|
|
210
|
+
return this.dateRangeFn(date);
|
|
211
|
+
}
|
|
212
|
+
onTasksChange() {
|
|
213
|
+
this.items.next(this.tasks);
|
|
214
|
+
}
|
|
215
|
+
createDaySlots({ start }) {
|
|
216
|
+
const days = [];
|
|
217
|
+
const monthsPerYear = 12;
|
|
218
|
+
let date = start;
|
|
219
|
+
for (let idx = 0; idx < monthsPerYear; idx++) {
|
|
220
|
+
const monthTotalDays = this.getLastDayOfMonth(date.getFullYear(), date.getMonth());
|
|
221
|
+
for (let dayIdx = 0; dayIdx < monthTotalDays; dayIdx++) {
|
|
222
|
+
days.push(date);
|
|
223
|
+
const nextDay = addDays(date, 1);
|
|
224
|
+
date = nextDay;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
return days;
|
|
228
|
+
}
|
|
229
|
+
getLastDayOfMonth(year, month) {
|
|
230
|
+
return new Date(year, month + 1, 0).getDate();
|
|
231
|
+
}
|
|
232
|
+
updateTds() {
|
|
233
|
+
this.cachedTds.forEach((td) => {
|
|
234
|
+
this.renderer.setAttribute(td, 'class', 'k-calendar-td');
|
|
235
|
+
});
|
|
236
|
+
this.cachedTds = [];
|
|
237
|
+
this.tds = Array.from(this.calendar.element.nativeElement.querySelectorAll('.k-calendar-td:not(.k-other-month)'));
|
|
238
|
+
if (this.slotClass) {
|
|
239
|
+
this.tds.forEach((td) => {
|
|
240
|
+
const date = toUTCDate(new Date(getDateAttribute(td)));
|
|
241
|
+
const userClass = this.getSlotClass(date);
|
|
242
|
+
if (userClass) {
|
|
243
|
+
this.renderer.addClass(td, userClass);
|
|
244
|
+
this.cachedTds.push(td);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
YearViewInternalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewInternalComponent, deps: [{ token: i1.LocalizationService }, { token: i2.FocusService }, { token: i3.IntlService }, { token: i4.ViewContextService }, { token: i5.ViewStateService }, { token: i0.NgZone }, { token: i0.Renderer2 }, { token: i6.PDFService }, { token: i0.ElementRef }, { token: i7.MonthSlotService }, { token: i8.ScrollbarWidthService }, { token: i0.ChangeDetectorRef }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Component });
|
|
251
|
+
YearViewInternalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: YearViewInternalComponent, selector: "year-view-internal", inputs: { newRange: "newRange", dateRangeFn: "dateRangeFn", selectedDateFormat: "selectedDateFormat", selectedShortDateFormat: "selectedShortDateFormat" }, providers: [MonthSlotService], viewQueries: [{ propertyName: "calendar", first: true, predicate: MultiViewCalendarComponent, descendants: true }, { propertyName: "tooltip", first: true, predicate: TooltipDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
252
|
+
<div #content class="k-scheduler-layout k-scheduler-layout-flex k-scheduler-yearview">
|
|
253
|
+
<div class="k-scheduler-body">
|
|
254
|
+
<kendo-multiviewcalendar
|
|
255
|
+
[showOtherMonthDates]="false"
|
|
256
|
+
[showCalendarHeader]="false"
|
|
257
|
+
[showViewHeader]="true"
|
|
258
|
+
[views]="12"
|
|
259
|
+
[focusedDate]="focusedDate"
|
|
260
|
+
kendoTooltip
|
|
261
|
+
filter=".k-calendar-td"
|
|
262
|
+
showOn="none"
|
|
263
|
+
[tooltipTemplate]="template"
|
|
264
|
+
position="right"
|
|
265
|
+
tooltipContentClass="k-scheduler-tooltip"
|
|
266
|
+
[tooltipWidth]="220"
|
|
267
|
+
[collision]="{ horizontal: 'flip', vertical: 'flip' }"
|
|
268
|
+
(valueChange)="onValueChange($event)"
|
|
269
|
+
(blur)="onBlur()"
|
|
270
|
+
>
|
|
271
|
+
<ng-template kendoCalendarMonthCellTemplate let-date let-context="cellContext">
|
|
272
|
+
<span *ngIf="!context.isOtherMonth" [attr.date]="date">{{ date.getDate() }}</span>
|
|
273
|
+
<span *ngIf="!context.isOtherMonth && hasEvent(date)" class="k-day-indicator"></span>
|
|
274
|
+
</ng-template>
|
|
275
|
+
</kendo-multiviewcalendar>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
<ng-template #template let-anchor>
|
|
279
|
+
<div
|
|
280
|
+
class="k-tooltip-title k-text-center"
|
|
281
|
+
(click)="navigateToDay(getDate(anchor))"
|
|
282
|
+
(mousedown)="onMouseDown()"
|
|
283
|
+
>
|
|
284
|
+
<div class="k-month">{{ intl.formatDate(getDate(anchor), 'MMM') }}</div>
|
|
285
|
+
<div class="k-link k-day k-text-primary">{{ intl.formatDate(getDate(anchor), 'dd') }}</div>
|
|
286
|
+
</div>
|
|
287
|
+
<div class="k-tooltip-events-container" (mousedown)="onMouseDown()">
|
|
288
|
+
<div class="k-tooltip-events">
|
|
289
|
+
<div
|
|
290
|
+
*ngFor="let event of eventsPerSelectedDay"
|
|
291
|
+
class="k-tooltip-event k-event"
|
|
292
|
+
[title]="eventTitle(event)"
|
|
293
|
+
[ngClass]="getEventClasses(event, event.resources)"
|
|
294
|
+
[ngStyle]="getEventStyles(event, event.resources[0], event.isAllDay)"
|
|
295
|
+
>
|
|
296
|
+
<kendo-icon-wrapper
|
|
297
|
+
*ngIf="event.tail || event.mid"
|
|
298
|
+
[name]="arrowIcons[0]"
|
|
299
|
+
[svgIcon]="arrowSVGIcons[0]"
|
|
300
|
+
>
|
|
301
|
+
</kendo-icon-wrapper>
|
|
302
|
+
<div class="k-event-title k-text-ellipsis">{{ event.event.title }}</div>
|
|
303
|
+
<span class="k-spacer"></span>
|
|
304
|
+
<span
|
|
305
|
+
class="k-event-time"
|
|
306
|
+
*ngIf="(event.isMultiDay && event.head && !event.isAllDay) || !event.isMultiDay"
|
|
307
|
+
>{{ intl.formatDate(event.start, 't') }}</span
|
|
308
|
+
>
|
|
309
|
+
<kendo-icon-wrapper
|
|
310
|
+
*ngIf="event.head || event.mid"
|
|
311
|
+
[name]="arrowIcons[1]"
|
|
312
|
+
[svgIcon]="arrowSVGIcons[1]"
|
|
313
|
+
>
|
|
314
|
+
</kendo-icon-wrapper>
|
|
315
|
+
</div>
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
<div *ngIf="eventsPerSelectedDay.length === 0" class="k-no-data k-text-center">
|
|
319
|
+
{{ localization.get('yearViewNoEvents') }}
|
|
320
|
+
</div>
|
|
321
|
+
</ng-template>
|
|
322
|
+
`, isInline: true, components: [{ type: i9.MultiViewCalendarComponent, selector: "kendo-multiviewcalendar", inputs: ["showOtherMonthDates", "showCalendarHeader", "id", "focusedDate", "min", "max", "rangeValidation", "disabledDatesRangeValidation", "selection", "value", "disabled", "tabindex", "tabIndex", "isActive", "disabledDates", "activeView", "bottomView", "topView", "showViewHeader", "animateNavigation", "weekNumber", "activeRangeEnd", "selectionRange", "views", "orientation", "cellTemplate", "monthCellTemplate", "yearCellTemplate", "decadeCellTemplate", "centuryCellTemplate", "weekNumberTemplate", "headerTitleTemplate"], outputs: ["activeViewChange", "navigate", "cellEnter", "cellLeave", "valueChange", "blur", "focus", "focusCalendar", "onClosePopup", "onTabPress", "onShiftTabPress"], exportAs: ["kendo-multiviewcalendar"] }, { type: i10.IconWrapperComponent, selector: "kendo-icon-wrapper", inputs: ["name", "svgIcon", "innerCssClass", "customFontClass", "size"], exportAs: ["kendoIconWrapper"] }], directives: [{ type: i11.TooltipDirective, selector: "[kendoTooltip]", inputs: ["filter", "position", "titleTemplate", "showOn", "showAfter", "callout", "closable", "offset", "tooltipWidth", "tooltipHeight", "tooltipClass", "tooltipContentClass", "collision", "closeTitle", "tooltipTemplate"], exportAs: ["kendoTooltip"] }, { type: i9.MonthCellTemplateDirective, selector: "[kendoCalendarMonthCellTemplate]" }, { type: i12.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i12.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i12.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i12.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
323
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewInternalComponent, decorators: [{
|
|
324
|
+
type: Component,
|
|
325
|
+
args: [{
|
|
326
|
+
selector: 'year-view-internal',
|
|
327
|
+
providers: [MonthSlotService],
|
|
328
|
+
template: `
|
|
329
|
+
<div #content class="k-scheduler-layout k-scheduler-layout-flex k-scheduler-yearview">
|
|
330
|
+
<div class="k-scheduler-body">
|
|
331
|
+
<kendo-multiviewcalendar
|
|
332
|
+
[showOtherMonthDates]="false"
|
|
333
|
+
[showCalendarHeader]="false"
|
|
334
|
+
[showViewHeader]="true"
|
|
335
|
+
[views]="12"
|
|
336
|
+
[focusedDate]="focusedDate"
|
|
337
|
+
kendoTooltip
|
|
338
|
+
filter=".k-calendar-td"
|
|
339
|
+
showOn="none"
|
|
340
|
+
[tooltipTemplate]="template"
|
|
341
|
+
position="right"
|
|
342
|
+
tooltipContentClass="k-scheduler-tooltip"
|
|
343
|
+
[tooltipWidth]="220"
|
|
344
|
+
[collision]="{ horizontal: 'flip', vertical: 'flip' }"
|
|
345
|
+
(valueChange)="onValueChange($event)"
|
|
346
|
+
(blur)="onBlur()"
|
|
347
|
+
>
|
|
348
|
+
<ng-template kendoCalendarMonthCellTemplate let-date let-context="cellContext">
|
|
349
|
+
<span *ngIf="!context.isOtherMonth" [attr.date]="date">{{ date.getDate() }}</span>
|
|
350
|
+
<span *ngIf="!context.isOtherMonth && hasEvent(date)" class="k-day-indicator"></span>
|
|
351
|
+
</ng-template>
|
|
352
|
+
</kendo-multiviewcalendar>
|
|
353
|
+
</div>
|
|
354
|
+
</div>
|
|
355
|
+
<ng-template #template let-anchor>
|
|
356
|
+
<div
|
|
357
|
+
class="k-tooltip-title k-text-center"
|
|
358
|
+
(click)="navigateToDay(getDate(anchor))"
|
|
359
|
+
(mousedown)="onMouseDown()"
|
|
360
|
+
>
|
|
361
|
+
<div class="k-month">{{ intl.formatDate(getDate(anchor), 'MMM') }}</div>
|
|
362
|
+
<div class="k-link k-day k-text-primary">{{ intl.formatDate(getDate(anchor), 'dd') }}</div>
|
|
363
|
+
</div>
|
|
364
|
+
<div class="k-tooltip-events-container" (mousedown)="onMouseDown()">
|
|
365
|
+
<div class="k-tooltip-events">
|
|
366
|
+
<div
|
|
367
|
+
*ngFor="let event of eventsPerSelectedDay"
|
|
368
|
+
class="k-tooltip-event k-event"
|
|
369
|
+
[title]="eventTitle(event)"
|
|
370
|
+
[ngClass]="getEventClasses(event, event.resources)"
|
|
371
|
+
[ngStyle]="getEventStyles(event, event.resources[0], event.isAllDay)"
|
|
372
|
+
>
|
|
373
|
+
<kendo-icon-wrapper
|
|
374
|
+
*ngIf="event.tail || event.mid"
|
|
375
|
+
[name]="arrowIcons[0]"
|
|
376
|
+
[svgIcon]="arrowSVGIcons[0]"
|
|
377
|
+
>
|
|
378
|
+
</kendo-icon-wrapper>
|
|
379
|
+
<div class="k-event-title k-text-ellipsis">{{ event.event.title }}</div>
|
|
380
|
+
<span class="k-spacer"></span>
|
|
381
|
+
<span
|
|
382
|
+
class="k-event-time"
|
|
383
|
+
*ngIf="(event.isMultiDay && event.head && !event.isAllDay) || !event.isMultiDay"
|
|
384
|
+
>{{ intl.formatDate(event.start, 't') }}</span
|
|
385
|
+
>
|
|
386
|
+
<kendo-icon-wrapper
|
|
387
|
+
*ngIf="event.head || event.mid"
|
|
388
|
+
[name]="arrowIcons[1]"
|
|
389
|
+
[svgIcon]="arrowSVGIcons[1]"
|
|
390
|
+
>
|
|
391
|
+
</kendo-icon-wrapper>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
</div>
|
|
395
|
+
<div *ngIf="eventsPerSelectedDay.length === 0" class="k-no-data k-text-center">
|
|
396
|
+
{{ localization.get('yearViewNoEvents') }}
|
|
397
|
+
</div>
|
|
398
|
+
</ng-template>
|
|
399
|
+
`,
|
|
400
|
+
}]
|
|
401
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i2.FocusService }, { type: i3.IntlService }, { type: i4.ViewContextService }, { type: i5.ViewStateService }, { type: i0.NgZone }, { type: i0.Renderer2 }, { type: i6.PDFService }, { type: i0.ElementRef }, { type: i7.MonthSlotService }, { type: i8.ScrollbarWidthService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
402
|
+
type: Inject,
|
|
403
|
+
args: [LOCALE_ID]
|
|
404
|
+
}] }]; }, propDecorators: { newRange: [{
|
|
405
|
+
type: Input
|
|
406
|
+
}], dateRangeFn: [{
|
|
407
|
+
type: Input
|
|
408
|
+
}], calendar: [{
|
|
409
|
+
type: ViewChild,
|
|
410
|
+
args: [MultiViewCalendarComponent]
|
|
411
|
+
}], tooltip: [{
|
|
412
|
+
type: ViewChild,
|
|
413
|
+
args: [TooltipDirective]
|
|
414
|
+
}], selectedDateFormat: [{
|
|
415
|
+
type: Input
|
|
416
|
+
}], selectedShortDateFormat: [{
|
|
417
|
+
type: Input
|
|
418
|
+
}] } });
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { Component, forwardRef, ChangeDetectionStrategy, ChangeDetectorRef, Input } from '@angular/core';
|
|
6
|
+
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
7
|
+
import { SchedulerView } from '../../types';
|
|
8
|
+
import { ViewContextService } from '../view-context.service';
|
|
9
|
+
import { ViewStateService } from '../view-state.service';
|
|
10
|
+
import { ConfigurationViewBase } from '../common/configuration-view-base';
|
|
11
|
+
import { addYears } from '@progress/kendo-date-math';
|
|
12
|
+
import { IntlService } from '@progress/kendo-angular-intl';
|
|
13
|
+
import { yearEnd, yearStart } from './utils';
|
|
14
|
+
import * as i0 from "@angular/core";
|
|
15
|
+
import * as i1 from "@progress/kendo-angular-l10n";
|
|
16
|
+
import * as i2 from "../view-context.service";
|
|
17
|
+
import * as i3 from "../view-state.service";
|
|
18
|
+
import * as i4 from "@progress/kendo-angular-intl";
|
|
19
|
+
import * as i5 from "./year-view-internal.component";
|
|
20
|
+
/**
|
|
21
|
+
* The component for rendering the **Year** view.
|
|
22
|
+
*/
|
|
23
|
+
export class YearViewComponent extends ConfigurationViewBase {
|
|
24
|
+
constructor(localization, changeDetector, viewContext, viewState, intl) {
|
|
25
|
+
super(localization, changeDetector, viewContext, viewState);
|
|
26
|
+
this.intl = intl;
|
|
27
|
+
/**
|
|
28
|
+
* The long-date format for displaying the
|
|
29
|
+
* selected year in the Scheduler toolbar.
|
|
30
|
+
* For more information, see [Parsing and Formatting Dates and Numbers]({% slug parsingandformatting_intl %}#toc-date-formatting).
|
|
31
|
+
* @default '{0:yyy}'
|
|
32
|
+
*/
|
|
33
|
+
this.selectedDateFormat = '{0:yyy}';
|
|
34
|
+
/**
|
|
35
|
+
* The short-date format for displaying the
|
|
36
|
+
* selected year in the Scheduler toolbar.
|
|
37
|
+
* For more information, see [Parsing and Formatting Dates and Numbers]({% slug parsingandformatting_intl %}#toc-date-formatting).
|
|
38
|
+
* @default '{0:yyy}'
|
|
39
|
+
*/
|
|
40
|
+
this.selectedShortDateFormat = '{0:yyy}';
|
|
41
|
+
/**
|
|
42
|
+
* The invariant name for this view.
|
|
43
|
+
* @default 'year'
|
|
44
|
+
*/
|
|
45
|
+
this.name = 'year';
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* @hidden
|
|
49
|
+
*/
|
|
50
|
+
get title() {
|
|
51
|
+
return this.localization.get('yearViewTitle');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* @hidden
|
|
55
|
+
*/
|
|
56
|
+
dateRange(date) {
|
|
57
|
+
const year = date.getFullYear();
|
|
58
|
+
const start = yearStart(year);
|
|
59
|
+
const end = yearEnd(year);
|
|
60
|
+
const text = this.intl.format(this.selectedDateFormat, start);
|
|
61
|
+
const shortText = this.intl.format(this.selectedShortDateFormat, start);
|
|
62
|
+
return { start, end, text, shortText };
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* @hidden
|
|
66
|
+
*/
|
|
67
|
+
newRange(date, direction = 1) {
|
|
68
|
+
return new Date(addYears(date, direction));
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
YearViewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewComponent, deps: [{ token: i1.LocalizationService }, { token: i0.ChangeDetectorRef }, { token: i2.ViewContextService }, { token: i3.ViewStateService }, { token: i4.IntlService }], target: i0.ɵɵFactoryTarget.Component });
|
|
72
|
+
YearViewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.12", type: YearViewComponent, selector: "kendo-scheduler-year-view", inputs: { selectedDateFormat: "selectedDateFormat", selectedShortDateFormat: "selectedShortDateFormat" }, providers: [{
|
|
73
|
+
provide: SchedulerView,
|
|
74
|
+
useExisting: forwardRef(() => YearViewComponent)
|
|
75
|
+
}], usesInheritance: true, ngImport: i0, template: `
|
|
76
|
+
<ng-template #content>
|
|
77
|
+
<year-view-internal
|
|
78
|
+
[selectedDateFormat]="selectedDateFormat"
|
|
79
|
+
[selectedShortDateFormat]="selectedShortDateFormat"
|
|
80
|
+
[slotClass]="viewSlotClass"
|
|
81
|
+
[eventClass]="viewEventClass"
|
|
82
|
+
[eventStyles]="viewEventStyles"
|
|
83
|
+
[dateRangeFn]="dateRange"
|
|
84
|
+
[newRange]="newRange">
|
|
85
|
+
</year-view-internal>
|
|
86
|
+
</ng-template>
|
|
87
|
+
`, isInline: true, components: [{ type: i5.YearViewInternalComponent, selector: "year-view-internal", inputs: ["newRange", "dateRangeFn", "selectedDateFormat", "selectedShortDateFormat"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewComponent, decorators: [{
|
|
89
|
+
type: Component,
|
|
90
|
+
args: [{
|
|
91
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
92
|
+
selector: 'kendo-scheduler-year-view',
|
|
93
|
+
providers: [{
|
|
94
|
+
provide: SchedulerView,
|
|
95
|
+
useExisting: forwardRef(() => YearViewComponent)
|
|
96
|
+
}],
|
|
97
|
+
template: `
|
|
98
|
+
<ng-template #content>
|
|
99
|
+
<year-view-internal
|
|
100
|
+
[selectedDateFormat]="selectedDateFormat"
|
|
101
|
+
[selectedShortDateFormat]="selectedShortDateFormat"
|
|
102
|
+
[slotClass]="viewSlotClass"
|
|
103
|
+
[eventClass]="viewEventClass"
|
|
104
|
+
[eventStyles]="viewEventStyles"
|
|
105
|
+
[dateRangeFn]="dateRange"
|
|
106
|
+
[newRange]="newRange">
|
|
107
|
+
</year-view-internal>
|
|
108
|
+
</ng-template>
|
|
109
|
+
`
|
|
110
|
+
}]
|
|
111
|
+
}], ctorParameters: function () { return [{ type: i1.LocalizationService }, { type: i0.ChangeDetectorRef }, { type: i2.ViewContextService }, { type: i3.ViewStateService }, { type: i4.IntlService }]; }, propDecorators: { selectedDateFormat: [{
|
|
112
|
+
type: Input
|
|
113
|
+
}], selectedShortDateFormat: [{
|
|
114
|
+
type: Input
|
|
115
|
+
}] } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import { NgModule } from '@angular/core';
|
|
6
|
+
import { ViewsSharedModule } from '../common/views-shared.module';
|
|
7
|
+
import { YearViewComponent } from './year-view.component';
|
|
8
|
+
import { CalendarsModule } from '@progress/kendo-angular-dateinputs';
|
|
9
|
+
import { TooltipsModule } from '@progress/kendo-angular-tooltip';
|
|
10
|
+
import { IntlModule } from '@progress/kendo-angular-intl';
|
|
11
|
+
import { YearViewInternalComponent } from './year-view-internal.component';
|
|
12
|
+
import * as i0 from "@angular/core";
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export class YearViewModule {
|
|
17
|
+
}
|
|
18
|
+
YearViewModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
19
|
+
YearViewModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewModule, declarations: [YearViewComponent,
|
|
20
|
+
YearViewInternalComponent], imports: [ViewsSharedModule,
|
|
21
|
+
CalendarsModule,
|
|
22
|
+
TooltipsModule,
|
|
23
|
+
IntlModule], exports: [YearViewComponent] });
|
|
24
|
+
YearViewModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewModule, imports: [[
|
|
25
|
+
ViewsSharedModule,
|
|
26
|
+
CalendarsModule,
|
|
27
|
+
TooltipsModule,
|
|
28
|
+
IntlModule
|
|
29
|
+
]] });
|
|
30
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.12", ngImport: i0, type: YearViewModule, decorators: [{
|
|
31
|
+
type: NgModule,
|
|
32
|
+
args: [{
|
|
33
|
+
imports: [
|
|
34
|
+
ViewsSharedModule,
|
|
35
|
+
CalendarsModule,
|
|
36
|
+
TooltipsModule,
|
|
37
|
+
IntlModule
|
|
38
|
+
],
|
|
39
|
+
exports: [
|
|
40
|
+
YearViewComponent
|
|
41
|
+
],
|
|
42
|
+
declarations: [
|
|
43
|
+
YearViewComponent,
|
|
44
|
+
YearViewInternalComponent
|
|
45
|
+
]
|
|
46
|
+
}]
|
|
47
|
+
}] });
|