barsa-calendar 0.0.2
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/README.md +25 -0
- package/esm2020/barsa-calendar.mjs +5 -0
- package/esm2020/lib/barsa-calendar.module.mjs +106 -0
- package/esm2020/lib/calendar-container/calendar-container.component.mjs +190 -0
- package/esm2020/lib/calendar-header/calendar-header.component.mjs +61 -0
- package/esm2020/lib/calendar-list/calendar-list.component.mjs +19 -0
- package/esm2020/lib/calendar-list-container/calendar-list-container.component.mjs +30 -0
- package/esm2020/lib/calendar-list-item/calendar-list-item.component.mjs +14 -0
- package/esm2020/lib/calendar-month/calendar-month.component.mjs +244 -0
- package/esm2020/lib/calendar-selection-days/calendar-selection-days.component.mjs +193 -0
- package/esm2020/lib/calendar-week/calendar-week.component.mjs +182 -0
- package/esm2020/lib/constants.mjs +4 -0
- package/esm2020/lib/date-time-picker/date-time-picker.component.mjs +324 -0
- package/esm2020/lib/day-event-list/day-event-list.component.mjs +53 -0
- package/esm2020/lib/day-number-box/day-number-box.component.mjs +105 -0
- package/esm2020/lib/days-in-week.pipe.mjs +17 -0
- package/esm2020/lib/equal-date.pipe.mjs +23 -0
- package/esm2020/lib/event-button/event-button.component.mjs +70 -0
- package/esm2020/lib/event-date.pipe.mjs +24 -0
- package/esm2020/lib/event-preview/event-preview.component.mjs +60 -0
- package/esm2020/lib/event-time.pipe.mjs +22 -0
- package/esm2020/lib/from-to-time.pipe.mjs +23 -0
- package/esm2020/lib/models.mjs +14 -0
- package/esm2020/lib/month-days/month-days.component.mjs +220 -0
- package/esm2020/lib/services/calendar.service.mjs +610 -0
- package/esm2020/public-api.mjs +21 -0
- package/fesm2015/barsa-calendar.mjs +2447 -0
- package/fesm2015/barsa-calendar.mjs.map +1 -0
- package/fesm2020/barsa-calendar.mjs +2455 -0
- package/fesm2020/barsa-calendar.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/barsa-calendar.module.d.ts +33 -0
- package/lib/calendar-container/calendar-container.component.d.ts +73 -0
- package/lib/calendar-header/calendar-header.component.d.ts +29 -0
- package/lib/calendar-list/calendar-list.component.d.ts +8 -0
- package/lib/calendar-list-container/calendar-list-container.component.d.ts +14 -0
- package/lib/calendar-list-item/calendar-list-item.component.d.ts +7 -0
- package/lib/calendar-month/calendar-month.component.d.ts +70 -0
- package/lib/calendar-selection-days/calendar-selection-days.component.d.ts +47 -0
- package/lib/calendar-week/calendar-week.component.d.ts +57 -0
- package/lib/constants.d.ts +1 -0
- package/lib/date-time-picker/date-time-picker.component.d.ts +98 -0
- package/lib/day-event-list/day-event-list.component.d.ts +20 -0
- package/lib/day-number-box/day-number-box.component.d.ts +30 -0
- package/lib/days-in-week.pipe.d.ts +9 -0
- package/lib/equal-date.pipe.d.ts +8 -0
- package/lib/event-button/event-button.component.d.ts +26 -0
- package/lib/event-date.pipe.d.ts +9 -0
- package/lib/event-preview/event-preview.component.d.ts +19 -0
- package/lib/event-time.pipe.d.ts +9 -0
- package/lib/from-to-time.pipe.d.ts +9 -0
- package/lib/models.d.ts +107 -0
- package/lib/month-days/month-days.component.d.ts +69 -0
- package/lib/services/calendar.service.d.ts +70 -0
- package/package.json +31 -0
- package/public-api.d.ts +17 -0
|
@@ -0,0 +1,2447 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Injectable, Optional, Inject, Pipe, EventEmitter, Component, ChangeDetectionStrategy, HostBinding, Input, Output, HostListener, ViewChild, Self, NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
|
|
3
|
+
import { takeUntil, distinctUntilChanged, map, switchMap } from 'rxjs/operators';
|
|
4
|
+
import * as i2 from 'barsa-novin-ray-core';
|
|
5
|
+
import { BaseComponent, getDateService, getUniqueId, PreventDefaulEvent, DateService, BarsaApi, ReportViewBaseComponent, LogService, BarsaNovinRayCoreModule } from 'barsa-novin-ray-core';
|
|
6
|
+
import { BehaviorSubject, combineLatest, of } from 'rxjs';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
import { CommonModule, TitleCasePipe } from '@angular/common';
|
|
9
|
+
import * as i4 from '@fundamental-ngx/core/button';
|
|
10
|
+
import * as i5$1 from '@fundamental-ngx/core/popover';
|
|
11
|
+
import { PopoverModule } from '@fundamental-ngx/core/popover';
|
|
12
|
+
import * as i6 from '@fundamental-ngx/core/toolbar';
|
|
13
|
+
import * as i7 from '@fundamental-ngx/platform/button';
|
|
14
|
+
import moment from 'moment';
|
|
15
|
+
import * as i6$1 from '@fundamental-ngx/core/table';
|
|
16
|
+
import * as i2$3 from '@fundamental-ngx/core';
|
|
17
|
+
import { PopoverComponent, FdDate, DatetimeAdapter, FdDatetimeAdapter, TimeI18n, TimeComponent, FundamentalNgxCoreModule } from '@fundamental-ngx/core';
|
|
18
|
+
import * as i2$1 from '@fundamental-ngx/core/avatar';
|
|
19
|
+
import * as i3$1 from '@fundamental-ngx/core/icon';
|
|
20
|
+
import * as i4$1 from '@fundamental-ngx/core/layout-panel';
|
|
21
|
+
import * as i5 from '@fundamental-ngx/core/quick-view';
|
|
22
|
+
import { QuickViewModule } from '@fundamental-ngx/core/quick-view';
|
|
23
|
+
import * as i2$2 from '@fundamental-ngx/core/bar';
|
|
24
|
+
import * as i3$2 from '@fundamental-ngx/core/list';
|
|
25
|
+
import * as i4$2 from '@angular/forms';
|
|
26
|
+
import { FormsModule } from '@angular/forms';
|
|
27
|
+
import * as i7$1 from '@fundamental-ngx/core/input-group';
|
|
28
|
+
import * as i9 from '@fundamental-ngx/core/time';
|
|
29
|
+
import * as i2$4 from '@fundamental-ngx/core/menu';
|
|
30
|
+
import * as i3$3 from '@fundamental-ngx/core/title';
|
|
31
|
+
import * as i4$3 from '@fundamental-ngx/core/split-button';
|
|
32
|
+
import { FundamentalNgxPlatformModule } from '@fundamental-ngx/platform';
|
|
33
|
+
import { CardModule } from '@fundamental-ngx/core/card';
|
|
34
|
+
|
|
35
|
+
var DayStatus;
|
|
36
|
+
(function (DayStatus) {
|
|
37
|
+
DayStatus[DayStatus["Open"] = 0] = "Open";
|
|
38
|
+
DayStatus[DayStatus["Completed"] = 1] = "Completed";
|
|
39
|
+
DayStatus[DayStatus["Failed"] = 2] = "Failed";
|
|
40
|
+
})(DayStatus || (DayStatus = {}));
|
|
41
|
+
class CalendarMonthInfo {
|
|
42
|
+
get daysInWeek() {
|
|
43
|
+
const start = this.selectedWeek * 7;
|
|
44
|
+
const days = this.days.slice(start, start + 7);
|
|
45
|
+
return days;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
class CalendarService extends BaseComponent {
|
|
50
|
+
constructor(_logService, culture) {
|
|
51
|
+
super();
|
|
52
|
+
this._logService = _logService;
|
|
53
|
+
this._calendarsSource = new BehaviorSubject([]);
|
|
54
|
+
this._modeSource = new BehaviorSubject('month');
|
|
55
|
+
this._currentMonthIndexSource = new BehaviorSubject(-1);
|
|
56
|
+
this._weekModeDaysSource = new BehaviorSubject([]);
|
|
57
|
+
this._daysSource = new BehaviorSubject([]);
|
|
58
|
+
this._dateService = getDateService(_logService, culture);
|
|
59
|
+
this.days$ = this._daysSource.asObservable();
|
|
60
|
+
this.mode$ = this._modeSource.asObservable();
|
|
61
|
+
this.weekModeDays$ = this._weekModeDaysSource.asObservable();
|
|
62
|
+
this.calendars$ = this._calendarsSource.asObservable();
|
|
63
|
+
this.currentMonthIndex$ = this._currentMonthIndexSource.asObservable();
|
|
64
|
+
this._initilize();
|
|
65
|
+
}
|
|
66
|
+
get todayMonthInfo() {
|
|
67
|
+
return this._todayMonthInfo;
|
|
68
|
+
}
|
|
69
|
+
get selectedMonth() {
|
|
70
|
+
return this._selectedSource.getValue();
|
|
71
|
+
}
|
|
72
|
+
get calendars() {
|
|
73
|
+
return this._calendarsSource.getValue();
|
|
74
|
+
}
|
|
75
|
+
get weeksCount() {
|
|
76
|
+
return this._daysSource.getValue().length / 7;
|
|
77
|
+
}
|
|
78
|
+
get days() {
|
|
79
|
+
return this._daysSource.getValue();
|
|
80
|
+
}
|
|
81
|
+
get Months() {
|
|
82
|
+
return this._dateService.monthNames();
|
|
83
|
+
}
|
|
84
|
+
loadMonthByDate(value) {
|
|
85
|
+
const monthInfo = this._dateService.getDateInfo(value);
|
|
86
|
+
this.loadMonth(monthInfo);
|
|
87
|
+
}
|
|
88
|
+
setDateService(primaryCalendarType) {
|
|
89
|
+
let dateService = this._dateService;
|
|
90
|
+
switch (primaryCalendarType) {
|
|
91
|
+
case 'Persian':
|
|
92
|
+
dateService = getDateService(this._logService, 'fa-IR');
|
|
93
|
+
break;
|
|
94
|
+
case 'Gregorian':
|
|
95
|
+
dateService = getDateService(this._logService, 'en-US');
|
|
96
|
+
break;
|
|
97
|
+
case 'Arabic':
|
|
98
|
+
dateService = getDateService(this._logService, 'ar-AE');
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
this._dateService = dateService;
|
|
102
|
+
this._initilize();
|
|
103
|
+
}
|
|
104
|
+
setDays(days) {
|
|
105
|
+
this._daysSource.next(days);
|
|
106
|
+
}
|
|
107
|
+
prepareWeek(monthInfo, startIndex, daysCount) {
|
|
108
|
+
const startDays = monthInfo.days.slice(startIndex, startIndex + daysCount);
|
|
109
|
+
this._weekModeDaysSource.next(startDays);
|
|
110
|
+
}
|
|
111
|
+
setSelected(selected) {
|
|
112
|
+
this._selectedSource.next(selected);
|
|
113
|
+
}
|
|
114
|
+
weekDaysMin() {
|
|
115
|
+
return this._dateService.weekdaysMin();
|
|
116
|
+
}
|
|
117
|
+
weekDays() {
|
|
118
|
+
return this._dateService.weekDays();
|
|
119
|
+
}
|
|
120
|
+
gotoToday() {
|
|
121
|
+
this.loadMonth(this._todayMonthInfo.dateInfo, 0);
|
|
122
|
+
this.setMode(this._modeSource.getValue(), this._todayMonthInfo.days.find((c) => c.isToday), this._weekModeDaysSource.getValue().length);
|
|
123
|
+
}
|
|
124
|
+
rangeSelect(startDay, endDay, monthInfo) {
|
|
125
|
+
const diff = endDay.index - startDay.index;
|
|
126
|
+
if (diff < 7) {
|
|
127
|
+
this.setMode('week', startDay, diff + 1);
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
const diff2 = diff + 1;
|
|
131
|
+
this.setMode('customMonth');
|
|
132
|
+
this.setMonth(monthInfo, startDay, diff2);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
setMonth(monthInfo, startDay, diff = 0) {
|
|
136
|
+
if (startDay && diff > 0) {
|
|
137
|
+
const startIndex = startDay.index;
|
|
138
|
+
this.loadCalendarMonthInfo(monthInfo);
|
|
139
|
+
this.setDays(monthInfo.days.slice(startIndex, startIndex + diff));
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
this.loadCalendarMonthInfo(monthInfo);
|
|
143
|
+
this.setDays(monthInfo.days);
|
|
144
|
+
// else if (mode === 'month') {
|
|
145
|
+
// startDay = daysLoaded[0];
|
|
146
|
+
// if (startDay) this.loadMonth(startDay.monthDateInfo);
|
|
147
|
+
// }
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
setMode(mode, startDay, daysCount) {
|
|
151
|
+
const oldMode = this._modeSource.getValue();
|
|
152
|
+
this._modeSource.next(mode);
|
|
153
|
+
if (mode === 'month') {
|
|
154
|
+
this.setMonth(this.selectedMonth, startDay);
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
else if (mode === 'customMonth') {
|
|
158
|
+
this.setMonth(this.selectedMonth, startDay, this.days.length);
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
const daysLoaded = this._weekModeDaysSource.getValue();
|
|
162
|
+
daysCount = daysCount !== null && daysCount !== void 0 ? daysCount : (mode === 'week' ? 7 : 1);
|
|
163
|
+
let startIndex = 0;
|
|
164
|
+
if (!startDay) {
|
|
165
|
+
if (mode === 'week' || mode === 'day') {
|
|
166
|
+
if (oldMode === 'month') {
|
|
167
|
+
startDay = this.selectedMonth.days.find((c) => c.isStartOfMonth);
|
|
168
|
+
}
|
|
169
|
+
else if (oldMode === 'customMonth') {
|
|
170
|
+
startDay = this.days[0];
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
startDay = daysLoaded[0];
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (startDay) {
|
|
178
|
+
if (startDay.monthDateInfo.month !== this.selectedMonth.dateInfo.month ||
|
|
179
|
+
startDay.monthDateInfo.year !== this.selectedMonth.dateInfo.year) {
|
|
180
|
+
this.loadMonth(startDay.monthDateInfo);
|
|
181
|
+
}
|
|
182
|
+
startIndex = this.selectedMonth.days.findIndex((c) => c.month === (startDay === null || startDay === void 0 ? void 0 : startDay.month) && c.dayInMonth === startDay.dayInMonth);
|
|
183
|
+
}
|
|
184
|
+
this.prepareWeek(this._selectedSource.getValue(), startIndex, daysCount);
|
|
185
|
+
}
|
|
186
|
+
fillWeek(week, daysCount = 7) {
|
|
187
|
+
const arr = Object.values(week);
|
|
188
|
+
arr.forEach((element) => {
|
|
189
|
+
for (const el of element) {
|
|
190
|
+
const valueDate = el.end;
|
|
191
|
+
if (valueDate && this._dateService.getMoment(valueDate).isBefore(this.today, 'day')) {
|
|
192
|
+
el.opacity = 0.5;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
for (let i = element.length; i < daysCount; i++) {
|
|
196
|
+
element.push({ colSpan: 1 });
|
|
197
|
+
}
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
sortTasks(calendarTasks, calendarFields) {
|
|
201
|
+
const startDateField = calendarFields.StartDate;
|
|
202
|
+
const endDateField = calendarFields.EndDate;
|
|
203
|
+
calendarTasks.sort((taskA, taskB) => (taskA[startDateField] < taskB[startDateField] ? -1 : 1));
|
|
204
|
+
calendarTasks.sort((taskA, taskB) => {
|
|
205
|
+
const taskAStartDate = taskA[startDateField];
|
|
206
|
+
const taskBStartDate = taskB[startDateField];
|
|
207
|
+
const momentTaskAStartDate = this._dateService.getMoment(taskAStartDate);
|
|
208
|
+
const momentTaskBStartDate = this._dateService.getMoment(taskBStartDate);
|
|
209
|
+
if (momentTaskAStartDate.isSame(momentTaskBStartDate, 'day')) {
|
|
210
|
+
const taskAEndDate = taskA[endDateField];
|
|
211
|
+
const taskBEndDate = taskB[endDateField];
|
|
212
|
+
const dayADiff = momentTaskAStartDate.diff(taskAEndDate, 'day');
|
|
213
|
+
const dayBDiff = momentTaskBStartDate.diff(taskBEndDate, 'day');
|
|
214
|
+
if (dayADiff > dayBDiff) {
|
|
215
|
+
return 1;
|
|
216
|
+
}
|
|
217
|
+
if (dayADiff < dayBDiff) {
|
|
218
|
+
return -1;
|
|
219
|
+
}
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
{
|
|
223
|
+
return 0;
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return calendarTasks;
|
|
227
|
+
}
|
|
228
|
+
createWeekTask(days, moDataList, calendarFields, taskHeight) {
|
|
229
|
+
const week = {};
|
|
230
|
+
days.forEach((day, dayIndex) => {
|
|
231
|
+
let counter = 0;
|
|
232
|
+
moDataList.forEach((event) => {
|
|
233
|
+
const counterIndex = counter.toString();
|
|
234
|
+
if (!week[counterIndex]) {
|
|
235
|
+
week[counterIndex] = [];
|
|
236
|
+
}
|
|
237
|
+
else if (week[counterIndex].length > dayIndex) {
|
|
238
|
+
counter++;
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
for (let m = week[counterIndex].length; m < dayIndex; m++) {
|
|
242
|
+
week[counterIndex].push({ colSpan: 1 });
|
|
243
|
+
}
|
|
244
|
+
// agar week[counter] colspan ja dasht anjam gardad.
|
|
245
|
+
const newTask = { colSpan: 1 };
|
|
246
|
+
const momentDay = this._dateService.getMoment(day.date);
|
|
247
|
+
const momentOfStartEvent = this._dateService.getMoment(event[calendarFields.StartDate]);
|
|
248
|
+
const endDate = event[calendarFields.EndDate];
|
|
249
|
+
const momentOfEndEvent = this._dateService.getMoment(endDate);
|
|
250
|
+
const diff = Math.abs(momentOfStartEvent.diff(momentOfEndEvent, 'day'));
|
|
251
|
+
if (diff === 0 && momentDay.isSame(momentOfStartEvent, 'day')) {
|
|
252
|
+
newTask.colSpan = 1;
|
|
253
|
+
const startMinuteTop = (event.$StartDateInfo.minutes * taskHeight) / 60;
|
|
254
|
+
newTask.top = event.$StartDateInfo.hour * taskHeight + startMinuteTop;
|
|
255
|
+
const endMinuteTop = (event.$EndDateInfo.minutes * taskHeight) / 60;
|
|
256
|
+
newTask.height =
|
|
257
|
+
(event.$EndDateInfo.hour - event.$StartDateInfo.hour) * taskHeight +
|
|
258
|
+
endMinuteTop -
|
|
259
|
+
startMinuteTop;
|
|
260
|
+
newTask.event = event;
|
|
261
|
+
newTask.enddayIsInRow = true;
|
|
262
|
+
newTask.startdayIsInRow = true;
|
|
263
|
+
newTask.isStartDay = true;
|
|
264
|
+
newTask.isEndDay = true;
|
|
265
|
+
newTask.start = newTask.end = day.date;
|
|
266
|
+
newTask.inDay =
|
|
267
|
+
event.$StartDateInfo.hour > 0 ||
|
|
268
|
+
event.$StartDateInfo.minutes > 0 ||
|
|
269
|
+
event.$EndDateInfo.hour > 0 ||
|
|
270
|
+
event.$EndDateInfo.minutes > 0;
|
|
271
|
+
week[counterIndex].splice(dayIndex, 0, newTask);
|
|
272
|
+
day.tasks.push(newTask);
|
|
273
|
+
counter++;
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
let diffFromEndOfEvent = 0;
|
|
277
|
+
let diffFromStartOfEvent = 0;
|
|
278
|
+
const isBetween = momentDay.isSameOrAfter(momentOfStartEvent, 'day') &&
|
|
279
|
+
momentDay.isSameOrBefore(momentOfEndEvent, 'day');
|
|
280
|
+
if (isBetween) {
|
|
281
|
+
diffFromEndOfEvent = 0;
|
|
282
|
+
if (diff === 0) {
|
|
283
|
+
newTask.colSpan = 1;
|
|
284
|
+
newTask.event = event;
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
diffFromEndOfEvent = Math.abs(momentDay.diff(momentOfEndEvent, 'day'));
|
|
288
|
+
diffFromStartOfEvent = Math.abs(momentDay.diff(momentOfStartEvent, 'day'));
|
|
289
|
+
const isStartDay = momentDay.isSame(momentOfStartEvent, 'day');
|
|
290
|
+
const isEndDay = momentDay.isSame(momentOfEndEvent, 'day');
|
|
291
|
+
let colSpan = diff;
|
|
292
|
+
if (!isStartDay) {
|
|
293
|
+
colSpan = diffFromEndOfEvent;
|
|
294
|
+
}
|
|
295
|
+
else {
|
|
296
|
+
colSpan = diff + 1; // include the start
|
|
297
|
+
}
|
|
298
|
+
newTask.colSpan = this._calcColSpan(colSpan, dayIndex, days.length);
|
|
299
|
+
newTask.isStartDay = isStartDay;
|
|
300
|
+
newTask.isEndDay = isEndDay;
|
|
301
|
+
newTask.isMiddle = !isStartDay && !isEndDay;
|
|
302
|
+
newTask.event = event;
|
|
303
|
+
}
|
|
304
|
+
if (newTask.isStartDay || dayIndex === 0) {
|
|
305
|
+
for (let span = 0; span < newTask.colSpan; span++) {
|
|
306
|
+
const taskIndex = dayIndex + span;
|
|
307
|
+
if (taskIndex > days.length - 1) {
|
|
308
|
+
break;
|
|
309
|
+
}
|
|
310
|
+
const taskDayInfo = days[taskIndex];
|
|
311
|
+
const taskInfo = Object.assign(Object.assign({}, newTask), { start: taskDayInfo.date, end: endDate, isStartDay: span === 0 ? newTask.isStartDay : null, startTask: event.$StartDayInfo, endTask: event.$EndDayInfo, startdayIsInRow: dayIndex - diffFromStartOfEvent > -1, enddayIsInRow: !!days[diffFromEndOfEvent], isMiddle: span === 0
|
|
312
|
+
? newTask.isMiddle
|
|
313
|
+
: this._dateService
|
|
314
|
+
.getMoment(taskDayInfo.date)
|
|
315
|
+
.isBetween(momentOfStartEvent, momentOfEndEvent, 'day'), isEndDay: span === 0
|
|
316
|
+
? newTask.isEndDay
|
|
317
|
+
: Math.abs(this._dateService
|
|
318
|
+
.getMoment(taskDayInfo.date)
|
|
319
|
+
.diff(momentOfEndEvent, 'day')) <= 1, colSpan: span === 0 ? newTask.colSpan : null });
|
|
320
|
+
week[counter.toString()].splice(taskIndex, 0, taskInfo);
|
|
321
|
+
taskDayInfo.tasks.push(taskInfo);
|
|
322
|
+
}
|
|
323
|
+
counter++;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
});
|
|
328
|
+
});
|
|
329
|
+
return week;
|
|
330
|
+
}
|
|
331
|
+
loadNext() {
|
|
332
|
+
const mode = this._modeSource.getValue();
|
|
333
|
+
const selectedMonth = this._selectedSource.getValue();
|
|
334
|
+
switch (mode) {
|
|
335
|
+
case 'customMonth':
|
|
336
|
+
case 'month':
|
|
337
|
+
{
|
|
338
|
+
const days = this.days;
|
|
339
|
+
const newDays = this._loadNextMonth(days, selectedMonth);
|
|
340
|
+
this.setDays(newDays);
|
|
341
|
+
}
|
|
342
|
+
break;
|
|
343
|
+
case 'week':
|
|
344
|
+
case 'day':
|
|
345
|
+
{
|
|
346
|
+
const days = this._weekModeDaysSource.getValue();
|
|
347
|
+
const newDays = this._loadNextWeek(days, selectedMonth);
|
|
348
|
+
this._weekModeDaysSource.next(newDays);
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
break;
|
|
352
|
+
case 'list':
|
|
353
|
+
break;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
gotoMonth(monthName, monthIndex) {
|
|
357
|
+
const selectedMonth = this.selectedMonth.dateInfo.month;
|
|
358
|
+
const val = monthIndex - selectedMonth;
|
|
359
|
+
this.loadMonth(this.selectedMonth.dateInfo, val);
|
|
360
|
+
}
|
|
361
|
+
gotoYear(year) {
|
|
362
|
+
const selectedYear = this.selectedMonth.dateInfo.year;
|
|
363
|
+
const val = year - selectedYear;
|
|
364
|
+
this.increaseYear(val);
|
|
365
|
+
}
|
|
366
|
+
loadNextYear() {
|
|
367
|
+
this.increaseYear(1);
|
|
368
|
+
}
|
|
369
|
+
loadPrevYear() {
|
|
370
|
+
this.increaseYear(-1);
|
|
371
|
+
}
|
|
372
|
+
increaseYear(value) {
|
|
373
|
+
const selectedYear = this.selectedMonth.dateInfo.moment.toDate();
|
|
374
|
+
selectedYear.setFullYear(selectedYear.getFullYear() + value); // next year
|
|
375
|
+
this.loadMonthByDate(selectedYear);
|
|
376
|
+
}
|
|
377
|
+
loadPrevious() {
|
|
378
|
+
const mode = this._modeSource.getValue();
|
|
379
|
+
const selectedMonth = this._selectedSource.getValue();
|
|
380
|
+
switch (mode) {
|
|
381
|
+
case 'customMonth':
|
|
382
|
+
case 'month':
|
|
383
|
+
{
|
|
384
|
+
const days = this.days;
|
|
385
|
+
const newDays = this._loadPrevMonth(days, selectedMonth);
|
|
386
|
+
this.setDays(newDays);
|
|
387
|
+
}
|
|
388
|
+
break;
|
|
389
|
+
case 'week':
|
|
390
|
+
case 'day':
|
|
391
|
+
{
|
|
392
|
+
const days = this._weekModeDaysSource.getValue();
|
|
393
|
+
const newDays = this._loadPrevWeek(days, selectedMonth);
|
|
394
|
+
this._weekModeDaysSource.next(newDays);
|
|
395
|
+
}
|
|
396
|
+
break;
|
|
397
|
+
break;
|
|
398
|
+
case 'list':
|
|
399
|
+
break;
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
loadMonth(dateInfo, addMonth = 0) {
|
|
403
|
+
let loadedMonthDate = this._dateService.getMoment(dateInfo.date);
|
|
404
|
+
if (addMonth > 0) {
|
|
405
|
+
loadedMonthDate = this._dateService.addMonth(loadedMonthDate, addMonth);
|
|
406
|
+
}
|
|
407
|
+
if (addMonth < 0) {
|
|
408
|
+
loadedMonthDate = this._dateService.subtractMonth(loadedMonthDate, Math.abs(addMonth));
|
|
409
|
+
}
|
|
410
|
+
let loadedCalendarMonthInfo = this.calendars.find((c) => c.dateInfo.moment.isSame(loadedMonthDate, 'day'));
|
|
411
|
+
if (!loadedCalendarMonthInfo) {
|
|
412
|
+
loadedCalendarMonthInfo = this.getMonthInfo(loadedMonthDate, this.today);
|
|
413
|
+
}
|
|
414
|
+
this.loadCalendarMonthInfo(loadedCalendarMonthInfo);
|
|
415
|
+
return loadedCalendarMonthInfo;
|
|
416
|
+
}
|
|
417
|
+
loadCalendarMonthInfo(loadedCalendarMonthInfo) {
|
|
418
|
+
const calendarsInfo = [...this.calendars];
|
|
419
|
+
const exists = calendarsInfo.find((c) => c.dateInfo.year === loadedCalendarMonthInfo.dateInfo.year &&
|
|
420
|
+
c.dateInfo.month === loadedCalendarMonthInfo.dateInfo.month);
|
|
421
|
+
if (!exists) {
|
|
422
|
+
calendarsInfo.push(loadedCalendarMonthInfo);
|
|
423
|
+
this._calendarsSource.next(calendarsInfo);
|
|
424
|
+
}
|
|
425
|
+
this.setSelected(loadedCalendarMonthInfo);
|
|
426
|
+
}
|
|
427
|
+
addCalendarMonthInfo(calendarMonthInfo) {
|
|
428
|
+
const newList = this.calendars;
|
|
429
|
+
newList.push(calendarMonthInfo);
|
|
430
|
+
this._calendarsSource.next(newList);
|
|
431
|
+
}
|
|
432
|
+
getNumber(value) {
|
|
433
|
+
const find = ['۰', '۱', '۲', '۳', '۴', '۵', '۶', '۷', '۸', '۹'];
|
|
434
|
+
const replace = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
435
|
+
let replaceString = value;
|
|
436
|
+
let regex;
|
|
437
|
+
for (let i = 0; i < find.length; i++) {
|
|
438
|
+
regex = new RegExp(find[i], 'g');
|
|
439
|
+
replaceString = replaceString.replace(regex, replace[i]);
|
|
440
|
+
}
|
|
441
|
+
return Number(replaceString);
|
|
442
|
+
}
|
|
443
|
+
_initilize() {
|
|
444
|
+
this.today = this._dateService.getMoment(new Date());
|
|
445
|
+
const todayMonthInfo = this.getCalendarMonthInfo(new Date());
|
|
446
|
+
this.todayDay = todayMonthInfo.days.find((c) => c.isToday);
|
|
447
|
+
this._selectedSource = new BehaviorSubject(todayMonthInfo);
|
|
448
|
+
this.selected$ = this._selectedSource.asObservable();
|
|
449
|
+
this._calendarsSource.next([todayMonthInfo]);
|
|
450
|
+
this.setDays(todayMonthInfo.days);
|
|
451
|
+
this.setSelected(todayMonthInfo);
|
|
452
|
+
this._currentMonthIndexSource.next(todayMonthInfo.dateInfo.month);
|
|
453
|
+
this._todayMonthInfo = todayMonthInfo;
|
|
454
|
+
this.calendars$.pipe(takeUntil(this._onDestroy$)).subscribe();
|
|
455
|
+
}
|
|
456
|
+
_calcColSpan(diff, dayIndex, maxColSpan) {
|
|
457
|
+
if (diff === 0) {
|
|
458
|
+
return 2;
|
|
459
|
+
}
|
|
460
|
+
if (Math.floor(diff / maxColSpan) > 0) {
|
|
461
|
+
return maxColSpan;
|
|
462
|
+
}
|
|
463
|
+
if (dayIndex + diff > maxColSpan) {
|
|
464
|
+
return maxColSpan - dayIndex;
|
|
465
|
+
}
|
|
466
|
+
return diff;
|
|
467
|
+
}
|
|
468
|
+
_loadNextMonth(days, monthInfo) {
|
|
469
|
+
const daysCount = days.length;
|
|
470
|
+
let lastDay = days[daysCount - 1];
|
|
471
|
+
const lastDayIndex = monthInfo.days.findIndex((c) => c.dayInMonth === lastDay.dayInMonth && c.month === lastDay.month);
|
|
472
|
+
let newDays = lastDayIndex > -1 ? monthInfo.days.slice(lastDayIndex + 1, lastDayIndex + 1 + daysCount) : [];
|
|
473
|
+
if (newDays.length < daysCount) {
|
|
474
|
+
// we move to next month
|
|
475
|
+
if (newDays.length > 0) {
|
|
476
|
+
lastDay = newDays[newDays.length - 1];
|
|
477
|
+
}
|
|
478
|
+
const needCountDay = daysCount - newDays.length;
|
|
479
|
+
const nextMonth = this.loadMonth(monthInfo.dateInfo, 1);
|
|
480
|
+
let startPosition = 0;
|
|
481
|
+
if (needCountDay < 42) {
|
|
482
|
+
startPosition = nextMonth.days.findIndex((c) => c.dayInMonth === lastDay.dayInMonth && c.month === lastDay.month);
|
|
483
|
+
if (startPosition === -1) {
|
|
484
|
+
startPosition = 0;
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
startPosition++;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
const nextDays = nextMonth.days.slice(startPosition, startPosition + needCountDay);
|
|
491
|
+
newDays = [...newDays, ...nextDays];
|
|
492
|
+
}
|
|
493
|
+
return newDays;
|
|
494
|
+
}
|
|
495
|
+
_loadNextWeek(days, monthInfo) {
|
|
496
|
+
const daysCount = days.length;
|
|
497
|
+
const lastDay = days[daysCount - 1];
|
|
498
|
+
const lastDayIndex = monthInfo.days.findIndex((c) => c.dayInMonth === lastDay.dayInMonth && c.month === lastDay.month);
|
|
499
|
+
let newDays = monthInfo.days.slice(lastDayIndex + 1, lastDayIndex + 1 + daysCount);
|
|
500
|
+
if (newDays.length < daysCount) {
|
|
501
|
+
// we move to next month
|
|
502
|
+
let lastNewDay = newDays[newDays.length - 1];
|
|
503
|
+
if (!lastNewDay) {
|
|
504
|
+
lastNewDay = lastDay;
|
|
505
|
+
}
|
|
506
|
+
const nextMonth = this.loadMonth(monthInfo.dateInfo, 1);
|
|
507
|
+
const lastDayIndex2 = nextMonth.days.findIndex((c) => c.dayInMonth === lastNewDay.dayInMonth && c.month === lastNewDay.month);
|
|
508
|
+
newDays = newDays.concat(nextMonth.days.slice(lastDayIndex2 + 1, lastDayIndex2 + 1 + (daysCount - newDays.length)));
|
|
509
|
+
}
|
|
510
|
+
return newDays;
|
|
511
|
+
}
|
|
512
|
+
_loadPrevMonth(days, monthInfo) {
|
|
513
|
+
const daysCount = days.length;
|
|
514
|
+
let firstDay = days[0];
|
|
515
|
+
const firstDayIndex = monthInfo.days.findIndex((c) => c.dayInMonth === firstDay.dayInMonth && c.month === firstDay.month);
|
|
516
|
+
let newDays = monthInfo.days.slice(firstDayIndex - daysCount > 0 ? firstDayIndex - daysCount : 0, firstDayIndex);
|
|
517
|
+
if (newDays.length < daysCount) {
|
|
518
|
+
// we move to prev month
|
|
519
|
+
if (newDays.length > 0) {
|
|
520
|
+
firstDay = newDays[0];
|
|
521
|
+
}
|
|
522
|
+
const needCountDay = daysCount - newDays.length;
|
|
523
|
+
const prevMonth = this.loadMonth(monthInfo.dateInfo, -1);
|
|
524
|
+
let endPosition = prevMonth.days.length;
|
|
525
|
+
if (needCountDay < 42) {
|
|
526
|
+
endPosition = prevMonth.days.findIndex((c) => c.dayInMonth === firstDay.dayInMonth && c.month === firstDay.month);
|
|
527
|
+
if (endPosition === -1) {
|
|
528
|
+
endPosition = prevMonth.days.length;
|
|
529
|
+
}
|
|
530
|
+
}
|
|
531
|
+
const prevDays = prevMonth.days.slice(endPosition - needCountDay, endPosition);
|
|
532
|
+
newDays = [...prevDays, ...newDays];
|
|
533
|
+
}
|
|
534
|
+
return newDays;
|
|
535
|
+
}
|
|
536
|
+
_loadPrevWeek(days, monthInfo) {
|
|
537
|
+
const daysCount = days.length;
|
|
538
|
+
const firstDay = days[0];
|
|
539
|
+
const firstDayIndex = monthInfo.days.findIndex((c) => c.dayInMonth === firstDay.dayInMonth && c.month === firstDay.month);
|
|
540
|
+
const partIndexPrev = firstDayIndex - daysCount;
|
|
541
|
+
let newDays = [];
|
|
542
|
+
if (partIndexPrev < 0) {
|
|
543
|
+
newDays = firstDayIndex - 1 >= 0 ? monthInfo.days.slice(0, firstDayIndex - 1) : [];
|
|
544
|
+
}
|
|
545
|
+
else {
|
|
546
|
+
newDays = monthInfo.days.slice(firstDayIndex - daysCount, firstDayIndex);
|
|
547
|
+
}
|
|
548
|
+
if (newDays.length < daysCount) {
|
|
549
|
+
// we move to prev month
|
|
550
|
+
let firstNewDay = newDays[0];
|
|
551
|
+
if (!firstNewDay) {
|
|
552
|
+
firstNewDay = firstDay;
|
|
553
|
+
}
|
|
554
|
+
const prevMonth = this.loadMonth(monthInfo.dateInfo, -1);
|
|
555
|
+
const firstDayIndex2 = prevMonth.days.findIndex((c) => c.dayInMonth === firstNewDay.dayInMonth && c.month === firstNewDay.month);
|
|
556
|
+
newDays = newDays.concat(prevMonth.days.slice(firstDayIndex2 - (daysCount - newDays.length), firstDayIndex2));
|
|
557
|
+
}
|
|
558
|
+
return newDays;
|
|
559
|
+
}
|
|
560
|
+
getCalendarMonthInfo(date) {
|
|
561
|
+
const startOfMonth = this._dateService.startOfMonth(date);
|
|
562
|
+
const momentDate = this._dateService.getMoment(date);
|
|
563
|
+
return this.getMonthInfo(startOfMonth, momentDate);
|
|
564
|
+
}
|
|
565
|
+
getMonthInfo(date, today) {
|
|
566
|
+
const days = [];
|
|
567
|
+
const activeDate = this._dateService.getMoment(date);
|
|
568
|
+
const startOfMonth = this._dateService.startOfMonth(activeDate);
|
|
569
|
+
const endOfMonth = this._dateService.endOfMonth(activeDate);
|
|
570
|
+
const dateInfo = this._dateService.getDateInfo(activeDate);
|
|
571
|
+
const dayInWeek = this._dateService.day(startOfMonth) + 1; // we add 1 to the dayInWeek because it's starts with zero
|
|
572
|
+
let weekCounter = 0;
|
|
573
|
+
let dayCounter = 0;
|
|
574
|
+
for (let i = 0; i < 42; i++) {
|
|
575
|
+
const dateOfStartOfMonth = new Date(startOfMonth);
|
|
576
|
+
dateOfStartOfMonth.setDate(dateOfStartOfMonth.getDate() + i - dayInWeek);
|
|
577
|
+
const { day, isInMonth } = this._getDay(dateOfStartOfMonth, activeDate, today, endOfMonth, startOfMonth, dateInfo, i);
|
|
578
|
+
days.push(day);
|
|
579
|
+
dayCounter++;
|
|
580
|
+
if (isInMonth && dayCounter > weekCounter * 7) {
|
|
581
|
+
weekCounter++;
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
// const endOfMonthIndex = days.findIndex((c) => c.isEndOfMonth);
|
|
585
|
+
// if (endOfMonthIndex > -1 && days.length - endOfMonthIndex > 7) {
|
|
586
|
+
// // days.splice(days.length - 7, 7);
|
|
587
|
+
// }
|
|
588
|
+
const calendarInfo = new CalendarMonthInfo();
|
|
589
|
+
calendarInfo.id = getUniqueId(3);
|
|
590
|
+
calendarInfo.dateInfo = dateInfo;
|
|
591
|
+
calendarInfo.days = days;
|
|
592
|
+
calendarInfo.weeksCount = weekCounter;
|
|
593
|
+
// this.cdr.detectChanges();
|
|
594
|
+
return calendarInfo;
|
|
595
|
+
}
|
|
596
|
+
_getDay(date, activeDate, today, endOfMonth, startOfMonth, dateInfo, i) {
|
|
597
|
+
const isInMonth = this._dateService.isSame(date, activeDate, 'month');
|
|
598
|
+
const momentOfDate = this._dateService.getMoment(date);
|
|
599
|
+
const isToday = momentOfDate.isSame(today, 'day');
|
|
600
|
+
const dayInMonth = this._dateService.strDate(date);
|
|
601
|
+
const dayInWeek = this._dateService.day(date);
|
|
602
|
+
const isEndOfMonth = momentOfDate.isSame(endOfMonth, 'day');
|
|
603
|
+
const isStartOfMonth = momentOfDate.isSame(startOfMonth, 'day');
|
|
604
|
+
const monthDateInfo = isInMonth ? dateInfo : this._dateService.getDateInfo(date);
|
|
605
|
+
const day = {
|
|
606
|
+
index: i,
|
|
607
|
+
date,
|
|
608
|
+
dayInWeek,
|
|
609
|
+
status: DayStatus.Open,
|
|
610
|
+
dayInMonth,
|
|
611
|
+
dayInMonthN: this.getNumber(dayInMonth),
|
|
612
|
+
isToday,
|
|
613
|
+
isInMonth,
|
|
614
|
+
isEndOfMonth,
|
|
615
|
+
isStartOfMonth,
|
|
616
|
+
momentOfDate,
|
|
617
|
+
month: monthDateInfo.month,
|
|
618
|
+
year: monthDateInfo.year,
|
|
619
|
+
monthName: monthDateInfo.monthName,
|
|
620
|
+
dayName: momentOfDate.format('dddd'),
|
|
621
|
+
tasks: [],
|
|
622
|
+
monthDateInfo,
|
|
623
|
+
row: Math.floor(i / 7 + 1),
|
|
624
|
+
col: 6 - (i % 7)
|
|
625
|
+
};
|
|
626
|
+
return { day, isInMonth };
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
CalendarService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarService, deps: [{ token: i2.LogService }, { token: 'Date_Culture', optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
630
|
+
CalendarService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarService });
|
|
631
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarService, decorators: [{
|
|
632
|
+
type: Injectable
|
|
633
|
+
}], ctorParameters: function () {
|
|
634
|
+
return [{ type: i2.LogService }, { type: undefined, decorators: [{
|
|
635
|
+
type: Optional
|
|
636
|
+
}, {
|
|
637
|
+
type: Inject,
|
|
638
|
+
args: ['Date_Culture']
|
|
639
|
+
}] }];
|
|
640
|
+
} });
|
|
641
|
+
|
|
642
|
+
class DaysInWeekPipe {
|
|
643
|
+
constructor() { }
|
|
644
|
+
transform(days, weekNumber) {
|
|
645
|
+
return days.slice(7 * weekNumber, 7 * weekNumber + 7);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
DaysInWeekPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DaysInWeekPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
649
|
+
DaysInWeekPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: DaysInWeekPipe, name: "daysInWeek" });
|
|
650
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DaysInWeekPipe, decorators: [{
|
|
651
|
+
type: Pipe,
|
|
652
|
+
args: [{
|
|
653
|
+
name: 'daysInWeek'
|
|
654
|
+
}]
|
|
655
|
+
}], ctorParameters: function () { return []; } });
|
|
656
|
+
|
|
657
|
+
class DayNumberBoxComponent extends BaseComponent {
|
|
658
|
+
constructor() {
|
|
659
|
+
super(...arguments);
|
|
660
|
+
this.dayClick = new EventEmitter();
|
|
661
|
+
this.dayMouseDown = new EventEmitter();
|
|
662
|
+
this.dayMouseUp = new EventEmitter();
|
|
663
|
+
this.dayMouseMove = new EventEmitter();
|
|
664
|
+
this._cursor = 'default';
|
|
665
|
+
this._hover = '';
|
|
666
|
+
this._itemInRange = false;
|
|
667
|
+
this._isActive = false;
|
|
668
|
+
}
|
|
669
|
+
mouseup() {
|
|
670
|
+
this.dayMouseUp.emit(this.day);
|
|
671
|
+
}
|
|
672
|
+
mousedown() {
|
|
673
|
+
this.dayMouseDown.emit(this.day);
|
|
674
|
+
}
|
|
675
|
+
mousemove() {
|
|
676
|
+
this.dayMouseMove.emit(this.day);
|
|
677
|
+
}
|
|
678
|
+
onClick() {
|
|
679
|
+
this.dayClick.emit(this.day);
|
|
680
|
+
}
|
|
681
|
+
ngOnInit() {
|
|
682
|
+
super.ngOnInit();
|
|
683
|
+
this._cursor = this.isPickerMode ? 'pointer' : 'default';
|
|
684
|
+
this.display = this.isSingleDay ? 'inline-block' : 'flex';
|
|
685
|
+
this._hover = this.isPickerMode ? 'hover' : '';
|
|
686
|
+
}
|
|
687
|
+
ngOnChanges(changes) {
|
|
688
|
+
super.ngOnChanges(changes);
|
|
689
|
+
const { itemInRange, isActive } = changes;
|
|
690
|
+
if (itemInRange) {
|
|
691
|
+
this._itemInRange = itemInRange.currentValue;
|
|
692
|
+
}
|
|
693
|
+
if (isActive) {
|
|
694
|
+
this._isActive = isActive.currentValue;
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
onDayBoxNumberClick(e, day) {
|
|
698
|
+
// change calendar mode to Day
|
|
699
|
+
PreventDefaulEvent(e);
|
|
700
|
+
this.dayClick.emit(day);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
DayNumberBoxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DayNumberBoxComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
704
|
+
DayNumberBoxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: DayNumberBoxComponent, selector: "bc-day-number-box", inputs: { isWeekMode: "isWeekMode", isSingleDay: "isSingleDay", day: "day", isPickerMode: "isPickerMode", itemInRange: "itemInRange", isActive: "isActive" }, outputs: { dayClick: "dayClick", dayMouseDown: "dayMouseDown", dayMouseUp: "dayMouseUp", dayMouseMove: "dayMouseMove" }, host: { listeners: { "mouseup": "mouseup()", "mousedown": "mousedown()", "mousemove": "mousemove()", "click": "onClick()" }, properties: { "style.display": "this.display", "style.cursor": "this._cursor", "class": "this._hover", "class.fd-calendar__item--range": "this._itemInRange", "class.is-active": "this._isActive" } }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<button\r\n fd-button\r\n (click)=\"onDayBoxNumberClick($event, day)\"\r\n [style.width]=\"isSingleDay ? 'auto' : '100%'\"\r\n [style.maxWidth]=\"isSingleDay ? 'auto' : '100%'\"\r\n>\r\n <div\r\n [ngClass]=\"{\r\n 'fd-avatar--s': isWeekMode,\r\n 'fd-avatar--xs': !isWeekMode || (day.isToday && isPickerMode),\r\n 'fd-avatar': !isPickerMode || day.isToday,\r\n 'fd-avatar--circle': !isPickerMode || day.isToday\r\n }\"\r\n [class.not-today]=\"!day.isToday\"\r\n [style.fontSize]=\"isWeekMode ? '1.7rem' : null\"\r\n >\r\n <span>{{ day.dayInMonth }}</span>\r\n </div>\r\n</button>\r\n", styles: [":host{position:relative;height:100%;justify-content:center}button{justify-content:center;flex-direction:column;align-items:center;background-color:transparent;border:none;height:100%;max-height:100%}button.hover:hover .not-today{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}button div{cursor:pointer}button .not-today{background-color:transparent;color:var(--sapList_HeaderTextColor, #32363a)}button .not-today:hover{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
705
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DayNumberBoxComponent, decorators: [{
|
|
706
|
+
type: Component,
|
|
707
|
+
args: [{ selector: 'bc-day-number-box', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\r\n fd-button\r\n (click)=\"onDayBoxNumberClick($event, day)\"\r\n [style.width]=\"isSingleDay ? 'auto' : '100%'\"\r\n [style.maxWidth]=\"isSingleDay ? 'auto' : '100%'\"\r\n>\r\n <div\r\n [ngClass]=\"{\r\n 'fd-avatar--s': isWeekMode,\r\n 'fd-avatar--xs': !isWeekMode || (day.isToday && isPickerMode),\r\n 'fd-avatar': !isPickerMode || day.isToday,\r\n 'fd-avatar--circle': !isPickerMode || day.isToday\r\n }\"\r\n [class.not-today]=\"!day.isToday\"\r\n [style.fontSize]=\"isWeekMode ? '1.7rem' : null\"\r\n >\r\n <span>{{ day.dayInMonth }}</span>\r\n </div>\r\n</button>\r\n", styles: [":host{position:relative;height:100%;justify-content:center}button{justify-content:center;flex-direction:column;align-items:center;background-color:transparent;border:none;height:100%;max-height:100%}button.hover:hover .not-today{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}button div{cursor:pointer}button .not-today{background-color:transparent;color:var(--sapList_HeaderTextColor, #32363a)}button .not-today:hover{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}\n"] }]
|
|
708
|
+
}], propDecorators: { display: [{
|
|
709
|
+
type: HostBinding,
|
|
710
|
+
args: ['style.display']
|
|
711
|
+
}], isWeekMode: [{
|
|
712
|
+
type: Input
|
|
713
|
+
}], isSingleDay: [{
|
|
714
|
+
type: Input
|
|
715
|
+
}], day: [{
|
|
716
|
+
type: Input
|
|
717
|
+
}], isPickerMode: [{
|
|
718
|
+
type: Input
|
|
719
|
+
}], itemInRange: [{
|
|
720
|
+
type: Input
|
|
721
|
+
}], isActive: [{
|
|
722
|
+
type: Input
|
|
723
|
+
}], dayClick: [{
|
|
724
|
+
type: Output
|
|
725
|
+
}], dayMouseDown: [{
|
|
726
|
+
type: Output
|
|
727
|
+
}], dayMouseUp: [{
|
|
728
|
+
type: Output
|
|
729
|
+
}], dayMouseMove: [{
|
|
730
|
+
type: Output
|
|
731
|
+
}], _cursor: [{
|
|
732
|
+
type: HostBinding,
|
|
733
|
+
args: ['style.cursor']
|
|
734
|
+
}], _hover: [{
|
|
735
|
+
type: HostBinding,
|
|
736
|
+
args: ['class']
|
|
737
|
+
}], _itemInRange: [{
|
|
738
|
+
type: HostBinding,
|
|
739
|
+
args: ['class.fd-calendar__item--range']
|
|
740
|
+
}], _isActive: [{
|
|
741
|
+
type: HostBinding,
|
|
742
|
+
args: ['class.is-active']
|
|
743
|
+
}], mouseup: [{
|
|
744
|
+
type: HostListener,
|
|
745
|
+
args: ['mouseup']
|
|
746
|
+
}], mousedown: [{
|
|
747
|
+
type: HostListener,
|
|
748
|
+
args: ['mousedown']
|
|
749
|
+
}], mousemove: [{
|
|
750
|
+
type: HostListener,
|
|
751
|
+
args: ['mousemove']
|
|
752
|
+
}], onClick: [{
|
|
753
|
+
type: HostListener,
|
|
754
|
+
args: ['click']
|
|
755
|
+
}] } });
|
|
756
|
+
|
|
757
|
+
function getPadedTime(value) {
|
|
758
|
+
return String(value.toString().padStart(2, '0'));
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
class EventDatePipe {
|
|
762
|
+
constructor() { }
|
|
763
|
+
transform(from, to, onlyTime = false) {
|
|
764
|
+
const showTime = from.hour || from.minutes || to.hour || to.minutes > 0;
|
|
765
|
+
const fromTime = `${getPadedTime(from.hour)}:${getPadedTime(from.minutes)}`;
|
|
766
|
+
const toTime = `${getPadedTime(to.hour)}:${getPadedTime(to.hour)}`;
|
|
767
|
+
if (onlyTime) {
|
|
768
|
+
return `${fromTime}`;
|
|
769
|
+
}
|
|
770
|
+
return `${from.strDay} ${from.monthName} ${from.strYear}${showTime ? `, ${fromTime}` : ''} – ${to.strDay} ${to.monthName} ${to.strYear}${showTime ? `, ${toTime}` : ''}`;
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
EventDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
774
|
+
EventDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: EventDatePipe, name: "eventDate" });
|
|
775
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventDatePipe, decorators: [{
|
|
776
|
+
type: Pipe,
|
|
777
|
+
args: [{
|
|
778
|
+
name: 'eventDate'
|
|
779
|
+
}]
|
|
780
|
+
}], ctorParameters: function () { return []; } });
|
|
781
|
+
|
|
782
|
+
class EventPreviewComponent extends BaseComponent {
|
|
783
|
+
constructor() {
|
|
784
|
+
super(...arguments);
|
|
785
|
+
this.deleteEvent = new EventEmitter();
|
|
786
|
+
this.editEvent = new EventEmitter();
|
|
787
|
+
}
|
|
788
|
+
onDelete(event, popover, popover2) {
|
|
789
|
+
this.deleteEvent.emit(event);
|
|
790
|
+
this._closePopover(popover);
|
|
791
|
+
this._closePopover(popover2);
|
|
792
|
+
}
|
|
793
|
+
onEdit(event, popover, popover2) {
|
|
794
|
+
this.editEvent.emit(event);
|
|
795
|
+
this._closePopover(popover);
|
|
796
|
+
this._closePopover(popover2);
|
|
797
|
+
}
|
|
798
|
+
onClosePopover(popover) {
|
|
799
|
+
this._closePopover(popover);
|
|
800
|
+
}
|
|
801
|
+
_closePopover(popover) {
|
|
802
|
+
if (popover) {
|
|
803
|
+
popover.close();
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
EventPreviewComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventPreviewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
808
|
+
EventPreviewComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: EventPreviewComponent, selector: "bc-event-preview", inputs: { event: "event", calendarFields: "calendarFields", popover: "popover", popover2: "popover2", canEdit: "canEdit", canDelete: "canDelete" }, outputs: { deleteEvent: "deleteEvent", editEvent: "editEvent" }, usesInheritance: true, ngImport: i0, template: "<fd-layout-panel style=\"min-width: 400px\">\n <fd-layout-panel-header>\n <fd-layout-panel-actions>\n <fd-toolbar [clearBorder]=\"true\" [fdType]=\"'transparent'\">\n <fdp-button\n *ngIf=\"canEdit\"\n fd-toolbar-item\n glyph=\"edit\"\n buttonType=\"transparent\"\n (click)=\"onEdit(event, popover, popover2)\"\n ></fdp-button>\n <fdp-button\n *ngIf=\"canDelete\"\n fd-toolbar-item\n glyph=\"delete\"\n buttonType=\"transparent\"\n (click)=\"onDelete(event, popover, popover2)\"\n ></fdp-button>\n <fdp-button\n fd-toolbar-item\n glyph=\"decline\"\n buttonType=\"transparent\"\n (click)=\"onClosePopover(popover)\"\n ></fdp-button>\n </fd-toolbar>\n </fd-layout-panel-actions>\n </fd-layout-panel-header>\n <fd-layout-panel-body>\n <fd-quick-view>\n <fd-quick-view-subheader>\n <fd-avatar\n size=\"xs\"\n glyph=\"color-fill\"\n [transparent]=\"true\"\n [style.color]=\"event[calendarFields.Color] ? event[calendarFields.Color] : ''\"\n ></fd-avatar>\n <fd-quick-view-subheader-title>\n {{ event[calendarFields.Title] }}\n </fd-quick-view-subheader-title>\n <fd-quick-view-subheader-subtitle>\n <span>{{ event.$StartDateInfo | eventDate: event.$EndDateInfo }} </span>\n </fd-quick-view-subheader-subtitle>\n </fd-quick-view-subheader>\n\n <fd-quick-view-group>\n <fd-quick-view-group-item *ngIf=\"event | barsaVisibleValue: calendarFields.Notes as notes\">\n <fd-quick-view-group-item-label>\n <fd-icon glyph=\"text-align-justified\"></fd-icon>\n </fd-quick-view-group-item-label>\n <fd-quick-view-group-item-content>\n <div fd-quick-view-group-item-content-element style=\"white-space: normal\">\n {{ notes }}\n </div>\n </fd-quick-view-group-item-content>\n </fd-quick-view-group-item>\n <fd-quick-view-group-item>\n <fd-quick-view-group-item-label>\n <fd-icon glyph=\"appointment\"></fd-icon>\n </fd-quick-view-group-item-label>\n <fd-quick-view-group-item-content>\n <span>\u06A9\u0627\u0631\u0628\u0631</span>\n </fd-quick-view-group-item-content>\n </fd-quick-view-group-item>\n </fd-quick-view-group>\n </fd-quick-view>\n </fd-layout-panel-body>\n</fd-layout-panel>\n", styles: [":host{display:block;width:460px}:host ::ng-deep .fd-form-item{flex-direction:row}:host fd-avatar{min-width:1rem;width:1rem}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.AvatarComponent, selector: "fd-avatar", inputs: ["class", "id", "ariaLabel", "ariaLabelledby", "label", "size", "glyph", "zoomGlyph", "circle", "transparent", "contain", "placeholder", "tile", "border", "colorAccent", "random", "clickable", "backgroundImage", "image", "alterIcon", "backupImage"], outputs: ["avatarClicked", "zoomGlyphClicked"] }, { kind: "component", type: i3$1.IconComponent, selector: "fd-icon", inputs: ["glyph", "font", "class", "ariaLabel"] }, { kind: "component", type: i4$1.LayoutPanelComponent, selector: "fd-layout-panel", inputs: ["backgroundImage"] }, { kind: "component", type: i4$1.LayoutPanelHeaderComponent, selector: "fd-layout-panel-header" }, { kind: "component", type: i4$1.LayoutPanelActionsComponent, selector: "fd-layout-panel-actions" }, { kind: "component", type: i4$1.LayoutPanelBodyComponent, selector: "fd-layout-panel-body", inputs: ["bleed"] }, { kind: "component", type: i5.QuickViewComponent, selector: "fd-quick-view", inputs: ["id"] }, { kind: "component", type: i5.QuickViewSubheaderComponent, selector: "fd-quick-view-subheader" }, { kind: "component", type: i5.QuickViewSubheaderTitleComponent, selector: "fd-quick-view-subheader-title" }, { kind: "component", type: i5.QuickViewSubheaderSubtitleComponent, selector: "fd-quick-view-subheader-subtitle" }, { kind: "component", type: i5.QuickViewGroupComponent, selector: "fd-quick-view-group" }, { kind: "component", type: i5.QuickViewGroupItemComponent, selector: "fd-quick-view-group-item", inputs: ["id"] }, { kind: "component", type: i5.QuickViewGroupItemLabelComponent, selector: "fd-quick-view-group-item-label" }, { kind: "component", type: i5.QuickViewGroupItemContentComponent, selector: "fd-quick-view-group-item-content" }, { kind: "directive", type: i5.QuickViewGroupItemContentElementDirective, selector: "[fd-quick-view-group-item-content-element]" }, { kind: "component", type: i6.ToolbarComponent, selector: "fd-toolbar", inputs: ["class", "shouldOverflow", "fdType", "hasTitle", "title", "active", "clearBorder", "forceOverflow", "tabindex"] }, { kind: "directive", type: i6.ToolbarItemDirective, selector: "[fd-toolbar-item]" }, { kind: "component", type: i7.ButtonComponent, selector: "fdp-button", inputs: ["glyphPosition", "label", "glyph", "buttonType", "title", "ariaSelected", "ariaDisabled", "ariaExpanded", "ariaControlsId", "ariaPressed", "name", "type", "value"], outputs: ["buttonClicked"] }, { kind: "pipe", type: i2.VisibleValuePipe, name: "barsaVisibleValue" }, { kind: "pipe", type: EventDatePipe, name: "eventDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventPreviewComponent, decorators: [{
|
|
810
|
+
type: Component,
|
|
811
|
+
args: [{ selector: 'bc-event-preview', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fd-layout-panel style=\"min-width: 400px\">\n <fd-layout-panel-header>\n <fd-layout-panel-actions>\n <fd-toolbar [clearBorder]=\"true\" [fdType]=\"'transparent'\">\n <fdp-button\n *ngIf=\"canEdit\"\n fd-toolbar-item\n glyph=\"edit\"\n buttonType=\"transparent\"\n (click)=\"onEdit(event, popover, popover2)\"\n ></fdp-button>\n <fdp-button\n *ngIf=\"canDelete\"\n fd-toolbar-item\n glyph=\"delete\"\n buttonType=\"transparent\"\n (click)=\"onDelete(event, popover, popover2)\"\n ></fdp-button>\n <fdp-button\n fd-toolbar-item\n glyph=\"decline\"\n buttonType=\"transparent\"\n (click)=\"onClosePopover(popover)\"\n ></fdp-button>\n </fd-toolbar>\n </fd-layout-panel-actions>\n </fd-layout-panel-header>\n <fd-layout-panel-body>\n <fd-quick-view>\n <fd-quick-view-subheader>\n <fd-avatar\n size=\"xs\"\n glyph=\"color-fill\"\n [transparent]=\"true\"\n [style.color]=\"event[calendarFields.Color] ? event[calendarFields.Color] : ''\"\n ></fd-avatar>\n <fd-quick-view-subheader-title>\n {{ event[calendarFields.Title] }}\n </fd-quick-view-subheader-title>\n <fd-quick-view-subheader-subtitle>\n <span>{{ event.$StartDateInfo | eventDate: event.$EndDateInfo }} </span>\n </fd-quick-view-subheader-subtitle>\n </fd-quick-view-subheader>\n\n <fd-quick-view-group>\n <fd-quick-view-group-item *ngIf=\"event | barsaVisibleValue: calendarFields.Notes as notes\">\n <fd-quick-view-group-item-label>\n <fd-icon glyph=\"text-align-justified\"></fd-icon>\n </fd-quick-view-group-item-label>\n <fd-quick-view-group-item-content>\n <div fd-quick-view-group-item-content-element style=\"white-space: normal\">\n {{ notes }}\n </div>\n </fd-quick-view-group-item-content>\n </fd-quick-view-group-item>\n <fd-quick-view-group-item>\n <fd-quick-view-group-item-label>\n <fd-icon glyph=\"appointment\"></fd-icon>\n </fd-quick-view-group-item-label>\n <fd-quick-view-group-item-content>\n <span>\u06A9\u0627\u0631\u0628\u0631</span>\n </fd-quick-view-group-item-content>\n </fd-quick-view-group-item>\n </fd-quick-view-group>\n </fd-quick-view>\n </fd-layout-panel-body>\n</fd-layout-panel>\n", styles: [":host{display:block;width:460px}:host ::ng-deep .fd-form-item{flex-direction:row}:host fd-avatar{min-width:1rem;width:1rem}\n"] }]
|
|
812
|
+
}], propDecorators: { event: [{
|
|
813
|
+
type: Input
|
|
814
|
+
}], calendarFields: [{
|
|
815
|
+
type: Input
|
|
816
|
+
}], popover: [{
|
|
817
|
+
type: Input
|
|
818
|
+
}], popover2: [{
|
|
819
|
+
type: Input
|
|
820
|
+
}], canEdit: [{
|
|
821
|
+
type: Input
|
|
822
|
+
}], canDelete: [{
|
|
823
|
+
type: Input
|
|
824
|
+
}], deleteEvent: [{
|
|
825
|
+
type: Output
|
|
826
|
+
}], editEvent: [{
|
|
827
|
+
type: Output
|
|
828
|
+
}] } });
|
|
829
|
+
|
|
830
|
+
class EventTimePipe {
|
|
831
|
+
constructor() { }
|
|
832
|
+
transform(task, calendarFields) {
|
|
833
|
+
const event = task.event;
|
|
834
|
+
const dateInfo = event.$StartDateInfo;
|
|
835
|
+
const showTime = dateInfo.hour || dateInfo.minutes > 0;
|
|
836
|
+
const fromTime = `${getPadedTime(dateInfo.hour)}:${getPadedTime(dateInfo.minutes)}`;
|
|
837
|
+
return `${showTime ? fromTime : ''} ${event[calendarFields.Title]}`;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
EventTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
841
|
+
EventTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: EventTimePipe, name: "eventTime" });
|
|
842
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventTimePipe, decorators: [{
|
|
843
|
+
type: Pipe,
|
|
844
|
+
args: [{
|
|
845
|
+
name: 'eventTime'
|
|
846
|
+
}]
|
|
847
|
+
}], ctorParameters: function () { return []; } });
|
|
848
|
+
|
|
849
|
+
class EventButtonComponent extends BaseComponent {
|
|
850
|
+
constructor(_el) {
|
|
851
|
+
super();
|
|
852
|
+
this._el = _el;
|
|
853
|
+
this.deleteEvent = new EventEmitter();
|
|
854
|
+
this.editEvent = new EventEmitter();
|
|
855
|
+
this.openPopoverChange = new EventEmitter();
|
|
856
|
+
this.opacity = 1;
|
|
857
|
+
this._rtl = true;
|
|
858
|
+
}
|
|
859
|
+
ngOnInit() {
|
|
860
|
+
var _a;
|
|
861
|
+
super.ngOnInit();
|
|
862
|
+
this._rtl = this.rtl;
|
|
863
|
+
this.opacity = (_a = this.task.opacity) !== null && _a !== void 0 ? _a : 1;
|
|
864
|
+
if (!this.buttonTemplate) {
|
|
865
|
+
this.buttonTemplate = this.defaultButtonTemplate;
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
onPopOverOpenChange(isOpen) {
|
|
869
|
+
this.openPopoverChange.emit(isOpen);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
EventButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventButtonComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
873
|
+
EventButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: EventButtonComponent, selector: "bc-event-button", inputs: { buttonTemplate: "buttonTemplate", calendarFields: "calendarFields", task: "task", rtl: "rtl", canDelete: "canDelete", canEdit: "canEdit", deviceSize: "deviceSize" }, outputs: { deleteEvent: "deleteEvent", editEvent: "editEvent", openPopoverChange: "openPopoverChange" }, host: { properties: { "style.opacity": "this.opacity", "attr.rtl": "this._rtl" } }, viewQueries: [{ propertyName: "defaultButtonTemplate", first: true, predicate: ["defaultButton"], descendants: true, static: true }, { propertyName: "popoverComponent", first: true, predicate: PopoverComponent, descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<span [ngClass]=\"{ 'end-day': rtl, 'start-day': !rtl }\" *ngIf=\"!task.startdayIsInRow\"></span>\n<ng-container\n *ngTemplateOutlet=\"\n buttonTemplate;\n context: {\n $implicit: task,\n calendarFields: calendarFields,\n popover: popover\n }\n \"\n></ng-container>\n<span [ngClass]=\"{ 'start-day': rtl, 'end-day': !rtl }\" *ngIf=\"!task.enddayIsInRow\"></span>\n\n<fd-popover\n #popover\n placement=\"bottom\"\n [mobile]=\"deviceSize === 's'\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [title]=\"task.event[calendarFields.Title]\"\n (isOpenChange)=\"onPopOverOpenChange($event)\"\n>\n <bc-event-preview\n [event]=\"task.event\"\n [calendarFields]=\"calendarFields\"\n [popover]=\"popover\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-preview>\n</fd-popover>\n\n<ng-template #defaultButton let-task let-popover=\"popover\" let-calendarFields=\"calendarFields\">\n <button\n fd-button\n [compact]=\"true\"\n [fdPopoverTrigger]=\"popover\"\n [fdType]=\"task.inDay ? 'standard' : 'emphasized'\"\n [label]=\"task | eventTime: calendarFields\"\n [style.background-color]=\"task.event[calendarFields.Color]\"\n class=\"task-title\"\n ></button>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:row;align-items:stretch;justify-content:stretch;width:100%;height:100%;padding-top:1px}:host[rtl=true]{padding-right:3px}:host[rtl=false]{padding-left:3px}.task-title{justify-content:start!important;font-weight:400}button{flex-grow:1;border-radius:0!important;height:100%;max-height:100%;min-height:100%;border:none}.start-day{width:0;height:0;border-top:10px solid transparent;border-right:10px solid var(--sapButton_Emphasized_Background, #0a6ed1);border-bottom:10px solid transparent;height:100%}.end-day{width:0;height:0;border-top:10px solid transparent;border-left:10px solid var(--sapButton_Emphasized_Background, #0a6ed1);border-bottom:10px solid transparent;height:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "directive", type: i4.DeprecatedButtonContentDensityDirective, selector: "[fd-button][compact]" }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "directive", type: i5$1.PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: EventPreviewComponent, selector: "bc-event-preview", inputs: ["event", "calendarFields", "popover", "popover2", "canEdit", "canDelete"], outputs: ["deleteEvent", "editEvent"] }, { kind: "pipe", type: EventTimePipe, name: "eventTime" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
874
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EventButtonComponent, decorators: [{
|
|
875
|
+
type: Component,
|
|
876
|
+
args: [{ selector: 'bc-event-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<span [ngClass]=\"{ 'end-day': rtl, 'start-day': !rtl }\" *ngIf=\"!task.startdayIsInRow\"></span>\n<ng-container\n *ngTemplateOutlet=\"\n buttonTemplate;\n context: {\n $implicit: task,\n calendarFields: calendarFields,\n popover: popover\n }\n \"\n></ng-container>\n<span [ngClass]=\"{ 'start-day': rtl, 'end-day': !rtl }\" *ngIf=\"!task.enddayIsInRow\"></span>\n\n<fd-popover\n #popover\n placement=\"bottom\"\n [mobile]=\"deviceSize === 's'\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [title]=\"task.event[calendarFields.Title]\"\n (isOpenChange)=\"onPopOverOpenChange($event)\"\n>\n <bc-event-preview\n [event]=\"task.event\"\n [calendarFields]=\"calendarFields\"\n [popover]=\"popover\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-preview>\n</fd-popover>\n\n<ng-template #defaultButton let-task let-popover=\"popover\" let-calendarFields=\"calendarFields\">\n <button\n fd-button\n [compact]=\"true\"\n [fdPopoverTrigger]=\"popover\"\n [fdType]=\"task.inDay ? 'standard' : 'emphasized'\"\n [label]=\"task | eventTime: calendarFields\"\n [style.background-color]=\"task.event[calendarFields.Color]\"\n class=\"task-title\"\n ></button>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:row;align-items:stretch;justify-content:stretch;width:100%;height:100%;padding-top:1px}:host[rtl=true]{padding-right:3px}:host[rtl=false]{padding-left:3px}.task-title{justify-content:start!important;font-weight:400}button{flex-grow:1;border-radius:0!important;height:100%;max-height:100%;min-height:100%;border:none}.start-day{width:0;height:0;border-top:10px solid transparent;border-right:10px solid var(--sapButton_Emphasized_Background, #0a6ed1);border-bottom:10px solid transparent;height:100%}.end-day{width:0;height:0;border-top:10px solid transparent;border-left:10px solid var(--sapButton_Emphasized_Background, #0a6ed1);border-bottom:10px solid transparent;height:100%}\n"] }]
|
|
877
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { defaultButtonTemplate: [{
|
|
878
|
+
type: ViewChild,
|
|
879
|
+
args: ['defaultButton', { static: true }]
|
|
880
|
+
}], popoverComponent: [{
|
|
881
|
+
type: ViewChild,
|
|
882
|
+
args: [PopoverComponent, { static: true }]
|
|
883
|
+
}], buttonTemplate: [{
|
|
884
|
+
type: Input
|
|
885
|
+
}], calendarFields: [{
|
|
886
|
+
type: Input
|
|
887
|
+
}], task: [{
|
|
888
|
+
type: Input
|
|
889
|
+
}], rtl: [{
|
|
890
|
+
type: Input
|
|
891
|
+
}], canDelete: [{
|
|
892
|
+
type: Input
|
|
893
|
+
}], canEdit: [{
|
|
894
|
+
type: Input
|
|
895
|
+
}], deviceSize: [{
|
|
896
|
+
type: Input
|
|
897
|
+
}], deleteEvent: [{
|
|
898
|
+
type: Output
|
|
899
|
+
}], editEvent: [{
|
|
900
|
+
type: Output
|
|
901
|
+
}], openPopoverChange: [{
|
|
902
|
+
type: Output
|
|
903
|
+
}], opacity: [{
|
|
904
|
+
type: HostBinding,
|
|
905
|
+
args: ['style.opacity']
|
|
906
|
+
}], _rtl: [{
|
|
907
|
+
type: HostBinding,
|
|
908
|
+
args: ['attr.rtl']
|
|
909
|
+
}] } });
|
|
910
|
+
|
|
911
|
+
class DayEventListComponent extends BaseComponent {
|
|
912
|
+
constructor() {
|
|
913
|
+
super(...arguments);
|
|
914
|
+
this.deleteEvent = new EventEmitter();
|
|
915
|
+
this.editEvent = new EventEmitter();
|
|
916
|
+
this.openPopOver = new EventEmitter();
|
|
917
|
+
}
|
|
918
|
+
onClosePopover(popover, popover2) {
|
|
919
|
+
popover.close();
|
|
920
|
+
if (popover2) {
|
|
921
|
+
popover2.close();
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
DayEventListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DayEventListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
926
|
+
DayEventListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: DayEventListComponent, selector: "bc-day-event-list", inputs: { day: "day", deviceSize: "deviceSize", weekDays: "weekDays", calendarFields: "calendarFields", rtl: "rtl", canDelete: "canDelete", canEdit: "canEdit", popover: "popover" }, outputs: { deleteEvent: "deleteEvent", editEvent: "editEvent", openPopOver: "openPopOver" }, usesInheritance: true, ngImport: i0, template: "<div fd-bar [barDesign]=\"'header-with-subheader'\">\n <div fd-bar-left>\n <fd-bar-element>\n <fdp-button glyph=\"decline\" [buttonType]=\"'transparent'\" (click)=\"onClosePopover(popover)\"></fdp-button>\n </fd-bar-element>\n </div>\n <div fd-bar-middle>\n <fd-bar-element>\n {{ weekDays[day.dayInWeek] }}\n </fd-bar-element>\n </div>\n <div fd-bar-right>\n <fd-bar-element> </fd-bar-element>\n </div>\n</div>\n<div fd-bar [barDesign]=\"'subheader'\">\n <div fd-bar-middle>\n <fd-bar-element [fullWidth]=\"true\">\n <bc-day-number-box [day]=\"day\" [isWeekMode]=\"true\"></bc-day-number-box>\n </fd-bar-element>\n </div>\n</div>\n<ul fd-list>\n <li fd-list-item *ngFor=\"let task of day.tasks\" class=\"task-start-end\" (click)=\"popoverPreview.open()\">\n <span [ngClass]=\"{ 'end-day': rtl, 'start-day': !rtl }\" *ngIf=\"task.isMiddle && !task.isStartDay\"></span>\n <span class=\"middle-day\">{{ task.event[calendarFields.Title] }}</span>\n <span\n [ngClass]=\"{ 'start-day': rtl, 'end-day': !rtl }\"\n *ngIf=\"(task.isMiddle || task.isStartDay) && !task.isEndDay\"\n ></span>\n <fd-popover\n #popoverPreview\n placement=\"bottom\"\n [mobile]=\"deviceSize === 's'\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [title]=\"task.event[calendarFields.Title]\"\n >\n <bc-event-preview\n [event]=\"task.event\"\n [calendarFields]=\"calendarFields\"\n [popover]=\"popoverPreview\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [popover2]=\"popover\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-preview>\n </fd-popover>\n </li>\n</ul>\n", styles: [".task-start-end{cursor:pointer}.start-day{width:0;height:0;border-top:10px solid transparent;border-right:10px solid var(--sapButton_Emphasized_BorderColor, #0a6ed1);border-bottom:10px solid transparent}.middle-day{width:100%;min-width:200px;height:20px;background-color:var(--sapButton_Emphasized_Background, #0a6ed1);color:var(--sapButton_Emphasized_TextColor, #fff);text-align:center}.end-day{width:0;height:0;border-top:10px solid transparent;border-left:10px solid var(--sapButton_Emphasized_BorderColor, #0a6ed1);border-bottom:10px solid transparent}.event-list-number-day{width:40px;height:40px;flex-grow:0;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-grow:0!important}.event-list-number-day:hover{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}::ng-deep .fd-form-item{flex-direction:row!important}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$2.BarComponent, selector: "[fd-bar]", inputs: ["class", "barDesign", "inPage", "inHomePage", "size"] }, { kind: "directive", type: i2$2.BarLeftDirective, selector: "[fd-bar-left]" }, { kind: "directive", type: i2$2.BarMiddleDirective, selector: "[fd-bar-middle]" }, { kind: "directive", type: i2$2.BarRightDirective, selector: "[fd-bar-right]" }, { kind: "directive", type: i2$2.BarElementDirective, selector: "fd-bar-element", inputs: ["fullWidth", "isTitle"] }, { kind: "component", type: i3$2.ListComponent, selector: "[fd-list], [fdList]", inputs: ["dropdownMode", "multiInputMode", "mobileMode", "hasMessage", "noBorder", "navigationIndicator", "selection", "keyboardSupport", "byline"], outputs: ["focusEscapeList"] }, { kind: "component", type: i3$2.ListItemComponent, selector: "[fdListItem] ,[fd-list-item]", inputs: ["selected", "ariaDescribedBy", "noData", "action", "interactive", "growing", "counter", "unread", "selectedListItemScreenReaderText", "navigatedListItemScreenReaderText", "navigatableListItemScreenReaderText"], outputs: ["keyDown"] }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i7.ButtonComponent, selector: "fdp-button", inputs: ["glyphPosition", "label", "glyph", "buttonType", "title", "ariaSelected", "ariaDisabled", "ariaExpanded", "ariaControlsId", "ariaPressed", "name", "type", "value"], outputs: ["buttonClicked"] }, { kind: "component", type: EventPreviewComponent, selector: "bc-event-preview", inputs: ["event", "calendarFields", "popover", "popover2", "canEdit", "canDelete"], outputs: ["deleteEvent", "editEvent"] }, { kind: "component", type: DayNumberBoxComponent, selector: "bc-day-number-box", inputs: ["isWeekMode", "isSingleDay", "day", "isPickerMode", "itemInRange", "isActive"], outputs: ["dayClick", "dayMouseDown", "dayMouseUp", "dayMouseMove"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
927
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DayEventListComponent, decorators: [{
|
|
928
|
+
type: Component,
|
|
929
|
+
args: [{ selector: 'bc-day-event-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div fd-bar [barDesign]=\"'header-with-subheader'\">\n <div fd-bar-left>\n <fd-bar-element>\n <fdp-button glyph=\"decline\" [buttonType]=\"'transparent'\" (click)=\"onClosePopover(popover)\"></fdp-button>\n </fd-bar-element>\n </div>\n <div fd-bar-middle>\n <fd-bar-element>\n {{ weekDays[day.dayInWeek] }}\n </fd-bar-element>\n </div>\n <div fd-bar-right>\n <fd-bar-element> </fd-bar-element>\n </div>\n</div>\n<div fd-bar [barDesign]=\"'subheader'\">\n <div fd-bar-middle>\n <fd-bar-element [fullWidth]=\"true\">\n <bc-day-number-box [day]=\"day\" [isWeekMode]=\"true\"></bc-day-number-box>\n </fd-bar-element>\n </div>\n</div>\n<ul fd-list>\n <li fd-list-item *ngFor=\"let task of day.tasks\" class=\"task-start-end\" (click)=\"popoverPreview.open()\">\n <span [ngClass]=\"{ 'end-day': rtl, 'start-day': !rtl }\" *ngIf=\"task.isMiddle && !task.isStartDay\"></span>\n <span class=\"middle-day\">{{ task.event[calendarFields.Title] }}</span>\n <span\n [ngClass]=\"{ 'start-day': rtl, 'end-day': !rtl }\"\n *ngIf=\"(task.isMiddle || task.isStartDay) && !task.isEndDay\"\n ></span>\n <fd-popover\n #popoverPreview\n placement=\"bottom\"\n [mobile]=\"deviceSize === 's'\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [title]=\"task.event[calendarFields.Title]\"\n >\n <bc-event-preview\n [event]=\"task.event\"\n [calendarFields]=\"calendarFields\"\n [popover]=\"popoverPreview\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [popover2]=\"popover\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-preview>\n </fd-popover>\n </li>\n</ul>\n", styles: [".task-start-end{cursor:pointer}.start-day{width:0;height:0;border-top:10px solid transparent;border-right:10px solid var(--sapButton_Emphasized_BorderColor, #0a6ed1);border-bottom:10px solid transparent}.middle-day{width:100%;min-width:200px;height:20px;background-color:var(--sapButton_Emphasized_Background, #0a6ed1);color:var(--sapButton_Emphasized_TextColor, #fff);text-align:center}.end-day{width:0;height:0;border-top:10px solid transparent;border-left:10px solid var(--sapButton_Emphasized_BorderColor, #0a6ed1);border-bottom:10px solid transparent}.event-list-number-day{width:40px;height:40px;flex-grow:0;border-radius:50%;display:flex;align-items:center;justify-content:center;flex-grow:0!important}.event-list-number-day:hover{color:var(--sapButton_Hover_TextColor, #0854a0);background-color:var(--sapButton_Hover_Background, #ebf5fe);cursor:pointer}::ng-deep .fd-form-item{flex-direction:row!important}\n"] }]
|
|
930
|
+
}], propDecorators: { day: [{
|
|
931
|
+
type: Input
|
|
932
|
+
}], deviceSize: [{
|
|
933
|
+
type: Input
|
|
934
|
+
}], weekDays: [{
|
|
935
|
+
type: Input
|
|
936
|
+
}], calendarFields: [{
|
|
937
|
+
type: Input
|
|
938
|
+
}], rtl: [{
|
|
939
|
+
type: Input
|
|
940
|
+
}], canDelete: [{
|
|
941
|
+
type: Input
|
|
942
|
+
}], canEdit: [{
|
|
943
|
+
type: Input
|
|
944
|
+
}], popover: [{
|
|
945
|
+
type: Input
|
|
946
|
+
}], deleteEvent: [{
|
|
947
|
+
type: Output
|
|
948
|
+
}], editEvent: [{
|
|
949
|
+
type: Output
|
|
950
|
+
}], openPopOver: [{
|
|
951
|
+
type: Output
|
|
952
|
+
}] } });
|
|
953
|
+
|
|
954
|
+
class EqualDatePipe {
|
|
955
|
+
constructor() { }
|
|
956
|
+
transform(value, secondValue) {
|
|
957
|
+
if ((value && !secondValue) || (!value && secondValue)) {
|
|
958
|
+
return false;
|
|
959
|
+
}
|
|
960
|
+
const yearEqual = value.getFullYear() === (secondValue === null || secondValue === void 0 ? void 0 : secondValue.getFullYear());
|
|
961
|
+
const monthEqual = value.getMonth() === (secondValue === null || secondValue === void 0 ? void 0 : secondValue.getMonth());
|
|
962
|
+
const dayEqual = value.getDate() === (secondValue === null || secondValue === void 0 ? void 0 : secondValue.getDate());
|
|
963
|
+
return yearEqual && monthEqual && dayEqual;
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
EqualDatePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EqualDatePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
967
|
+
EqualDatePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: EqualDatePipe, name: "equalDate" });
|
|
968
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: EqualDatePipe, decorators: [{
|
|
969
|
+
type: Pipe,
|
|
970
|
+
args: [{
|
|
971
|
+
name: 'equalDate'
|
|
972
|
+
}]
|
|
973
|
+
}], ctorParameters: function () { return []; } });
|
|
974
|
+
|
|
975
|
+
class CalendarMonthComponent extends BaseComponent {
|
|
976
|
+
constructor(daysInWeek, _cdr, _calendarService) {
|
|
977
|
+
super();
|
|
978
|
+
this.daysInWeek = daysInWeek;
|
|
979
|
+
this._cdr = _cdr;
|
|
980
|
+
this._calendarService = _calendarService;
|
|
981
|
+
this.datePicker = false;
|
|
982
|
+
this.rangePicker = false;
|
|
983
|
+
this.canDelete = false;
|
|
984
|
+
this.canAdd = false;
|
|
985
|
+
this.canEdit = false;
|
|
986
|
+
this.editEvent = new EventEmitter();
|
|
987
|
+
this.deleteEvent = new EventEmitter();
|
|
988
|
+
this.daySelect = new EventEmitter();
|
|
989
|
+
this.dayClick = new EventEmitter();
|
|
990
|
+
this.dayMouseMove = new EventEmitter();
|
|
991
|
+
this.dayMouseUp = new EventEmitter();
|
|
992
|
+
this.dayMouseDown = new EventEmitter();
|
|
993
|
+
this.showEvent = new EventEmitter();
|
|
994
|
+
this.taskHeight = 30;
|
|
995
|
+
this._hasPopoverOpened = [];
|
|
996
|
+
}
|
|
997
|
+
ngOnChanges(changes) {
|
|
998
|
+
super.ngOnChanges(changes);
|
|
999
|
+
let needToDetectChange = false;
|
|
1000
|
+
const { containerHeight, deviceSize, moDataList, days, monthWeeksCount, startSelectedDayIndex, endSelectedDayIndex } = changes;
|
|
1001
|
+
if (containerHeight && !containerHeight.firstChange) {
|
|
1002
|
+
this.fitToContainer(changes.containerHeight.currentValue);
|
|
1003
|
+
}
|
|
1004
|
+
if (deviceSize && !deviceSize.firstChange) {
|
|
1005
|
+
this.prepareWeekDays(changes.deviceSize.currentValue);
|
|
1006
|
+
}
|
|
1007
|
+
if (moDataList && !moDataList.firstChange) {
|
|
1008
|
+
this._prepareDaysTasks(changes.moDataList.currentValue);
|
|
1009
|
+
needToDetectChange = true;
|
|
1010
|
+
}
|
|
1011
|
+
if (days && !days.firstChange) {
|
|
1012
|
+
this.fitToContainer(this.containerHeight);
|
|
1013
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1014
|
+
needToDetectChange = true;
|
|
1015
|
+
}
|
|
1016
|
+
if (monthWeeksCount && !monthWeeksCount.firstChange) {
|
|
1017
|
+
this.fitToContainer(this.containerHeight);
|
|
1018
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1019
|
+
needToDetectChange = true;
|
|
1020
|
+
}
|
|
1021
|
+
if ((startSelectedDayIndex && !startSelectedDayIndex.firstChange) ||
|
|
1022
|
+
(endSelectedDayIndex && !endSelectedDayIndex.firstChange)) {
|
|
1023
|
+
needToDetectChange = true;
|
|
1024
|
+
}
|
|
1025
|
+
if (needToDetectChange) {
|
|
1026
|
+
this._cdr.detectChanges();
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
ngOnInit() {
|
|
1030
|
+
super.ngOnInit();
|
|
1031
|
+
this.isPickerMode = this.datePicker || this.rangePicker;
|
|
1032
|
+
this.prepareWeekDays(this.deviceSize);
|
|
1033
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1034
|
+
this.fitToContainer(this.containerHeight);
|
|
1035
|
+
}
|
|
1036
|
+
onDayBoxSelect(day) {
|
|
1037
|
+
this._fireDaySelect(day);
|
|
1038
|
+
}
|
|
1039
|
+
onDaySelect(weekIndex, dayIndex) {
|
|
1040
|
+
if (!this.canAdd) {
|
|
1041
|
+
return;
|
|
1042
|
+
}
|
|
1043
|
+
const day = this.days[weekIndex * 7 + dayIndex];
|
|
1044
|
+
this._fireDaySelect(day);
|
|
1045
|
+
}
|
|
1046
|
+
onOpenPopoverChange(isOpen) {
|
|
1047
|
+
this._openPopover(isOpen);
|
|
1048
|
+
}
|
|
1049
|
+
onMoreButton(e, popover) {
|
|
1050
|
+
this._preventEvent(e);
|
|
1051
|
+
popover.open();
|
|
1052
|
+
}
|
|
1053
|
+
onTask(e, task) {
|
|
1054
|
+
this.showEvent.emit(task);
|
|
1055
|
+
}
|
|
1056
|
+
onDayClick(day) {
|
|
1057
|
+
this.selected = day;
|
|
1058
|
+
this.dayClick.emit(day);
|
|
1059
|
+
}
|
|
1060
|
+
onDayMouseMove(day) {
|
|
1061
|
+
this.dayMouseMove.emit(day);
|
|
1062
|
+
}
|
|
1063
|
+
onDayMouseDown(day) {
|
|
1064
|
+
this.dayMouseDown.emit(day);
|
|
1065
|
+
}
|
|
1066
|
+
onDayMouseUp(day) {
|
|
1067
|
+
this.dayMouseUp.emit(day);
|
|
1068
|
+
}
|
|
1069
|
+
_preventEvent(e) {
|
|
1070
|
+
e.stopPropagation();
|
|
1071
|
+
e.preventDefault();
|
|
1072
|
+
}
|
|
1073
|
+
_fireDaySelect(day) {
|
|
1074
|
+
if (this._hasPopoverOpened.length === 0) {
|
|
1075
|
+
this.daySelect.emit(moment(day.date));
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1078
|
+
_openPopover(isOpen) {
|
|
1079
|
+
if (isOpen) {
|
|
1080
|
+
this._hasPopoverOpened.push(true);
|
|
1081
|
+
}
|
|
1082
|
+
else {
|
|
1083
|
+
setTimeout(() => {
|
|
1084
|
+
this._hasPopoverOpened = [];
|
|
1085
|
+
}, 0);
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
prepareWeekDays(deviceSize) {
|
|
1089
|
+
if (deviceSize !== 's' && deviceSize !== 'm') {
|
|
1090
|
+
this.selectedWeekDays = this.weekDays;
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
this.selectedWeekDays = this.weekDaysMin;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
fitToContainer(containerHeight) {
|
|
1097
|
+
let _weeksCount;
|
|
1098
|
+
if (this.monthWeeksCount > 0) {
|
|
1099
|
+
const weeksCount = this.monthWeeksCount;
|
|
1100
|
+
_weeksCount = weeksCount;
|
|
1101
|
+
}
|
|
1102
|
+
else {
|
|
1103
|
+
_weeksCount = this.days.length / 7;
|
|
1104
|
+
}
|
|
1105
|
+
this.numberOfWeek = Array.from(Array(_weeksCount).keys());
|
|
1106
|
+
this.numberOfWeek = this.numberOfWeek.map((value) => value);
|
|
1107
|
+
if (this.isPickerMode) {
|
|
1108
|
+
this.dayHeight = 40;
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
this.dayHeight = Math.floor(containerHeight / (_weeksCount + 1));
|
|
1112
|
+
this.maxTaskCount = Math.floor((this.dayHeight - this.taskHeight) / this.taskHeight);
|
|
1113
|
+
if (this.maxTaskCount > 0) {
|
|
1114
|
+
this.maxRowTasks = new Array(this.maxTaskCount).fill(0).map((x, i) => i);
|
|
1115
|
+
}
|
|
1116
|
+
}
|
|
1117
|
+
_prepareDaysTasks(calendarTasks) {
|
|
1118
|
+
if (this.isPickerMode) {
|
|
1119
|
+
this.weekTasksArray = {};
|
|
1120
|
+
return;
|
|
1121
|
+
}
|
|
1122
|
+
const calendarFields = this.calendarFields;
|
|
1123
|
+
// Sort all Tasks
|
|
1124
|
+
const moDataList = this._calendarService.sortTasks(calendarTasks, calendarFields);
|
|
1125
|
+
this.days.forEach((day) => (day.tasks = []));
|
|
1126
|
+
const weekTasksArray = [];
|
|
1127
|
+
for (let j = 0; j < this.days.length / 7; j++) {
|
|
1128
|
+
const days = this.daysInWeek.transform(this.days, j);
|
|
1129
|
+
const week = this._calendarService.createWeekTask(days, moDataList, calendarFields, 0);
|
|
1130
|
+
weekTasksArray.push(week);
|
|
1131
|
+
}
|
|
1132
|
+
weekTasksArray.forEach((week) => {
|
|
1133
|
+
const arr = Object.values(week);
|
|
1134
|
+
for (let i = arr.length; i < this.maxTaskCount; i++) {
|
|
1135
|
+
week[i.toString()] = [];
|
|
1136
|
+
}
|
|
1137
|
+
});
|
|
1138
|
+
// به ازای هر ردیف تسک باید تعداد 7 ستون اضافه گردد و برای ستونی که تسکی ندارد یک جای خالی colspan 1 میگذاریم
|
|
1139
|
+
weekTasksArray.forEach((week) => {
|
|
1140
|
+
this._calendarService.fillWeek(week);
|
|
1141
|
+
});
|
|
1142
|
+
this.weekTasksArray = weekTasksArray;
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
CalendarMonthComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarMonthComponent, deps: [{ token: DaysInWeekPipe }, { token: i0.ChangeDetectorRef }, { token: CalendarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1146
|
+
CalendarMonthComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarMonthComponent, selector: "bc-calendar-month", inputs: { monthWeeksCount: "monthWeeksCount", weekDays: "weekDays", weekDaysMin: "weekDaysMin", today: "today", containerHeight: "containerHeight", days: "days", calendarFields: "calendarFields", rtl: "rtl", deviceSize: "deviceSize", moDataList: "moDataList", datePicker: "datePicker", rangePicker: "rangePicker", canDelete: "canDelete", canAdd: "canAdd", canEdit: "canEdit", selectedDate: "selectedDate", startSelectedDayIndex: "startSelectedDayIndex", endSelectedDayIndex: "endSelectedDayIndex" }, outputs: { editEvent: "editEvent", deleteEvent: "deleteEvent", daySelect: "daySelect", dayClick: "dayClick", dayMouseMove: "dayMouseMove", dayMouseUp: "dayMouseUp", dayMouseDown: "dayMouseDown", showEvent: "showEvent" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<table fd-table class=\"table-header\" [compact]=\"true\" [attr.picker]=\"datePicker\">\n <thead fd-table-header>\n <tr fd-table-row>\n <th\n class=\"weekday-header\"\n *ngFor=\"let weekDay of selectedWeekDays\"\n fd-table-cell\n [class.noborder]=\"isPickerMode\"\n >\n {{ weekDay }}\n </th>\n </tr>\n </thead>\n <tbody fd-table-body>\n <ng-container *ngFor=\"let weekDay of numberOfWeek\">\n <tr fd-table-row>\n <td\n [style.height.px]=\"dayHeight\"\n fd-table-cell\n colspan=\"7\"\n [style.border]=\"isPickerMode ? 'none' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n renderTasks;\n context: {\n $implicit: isPickerMode ? null : moDataList[weekDay],\n weekIndex: weekDay,\n days: days | daysInWeek: weekDay,\n maxRowTasks: maxRowTasks,\n weekDays: weekDays,\n calendarFields: calendarFields,\n rtl: rtl,\n isPickerMode: isPickerMode\n }\n \"\n ></ng-container>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>\n<ng-template\n #renderTasks\n let-task\n let-weekIndex=\"weekIndex\"\n let-weekDays=\"weekDays\"\n let-days=\"days\"\n let-maxRowTasks=\"maxRowTasks\"\n let-calendarFields=\"calendarFields\"\n let-deviceSize=\"deviceSize\"\n let-rtl=\"rtl\"\n let-isPickerMode=\"isPickerMode\"\n>\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\n <tbody>\n <tr fd-table-row class=\"row-day-number\" [attr.rtl]=\"rtl\">\n <td fd-table-cell *ngFor=\"let day of days\" [class.noborder]=\"isPickerMode\">\n <bc-day-number-box\n [class.fd-calendar__item]=\"isPickerMode\"\n [class.fd-calendar__item--other-month]=\"isPickerMode && !day.isInMonth\"\n [class.fd-calendar__item--weekend]=\"isPickerMode && day.isWeekend\"\n [isPickerMode]=\"isPickerMode\"\n [day]=\"day\"\n [isActive]=\"\n day.index === startSelectedDayIndex || day.index === endSelectedDayIndex || day.date\n | equalDate: selectedDate\n \"\n [itemInRange]=\"\n startSelectedDayIndex !== undefined &&\n endSelectedDayIndex !== undefined &&\n day.index >= startSelectedDayIndex &&\n day.index <= endSelectedDayIndex\n \"\n (dayClick)=\"onDayClick(day)\"\n (dayMouseMove)=\"onDayMouseMove(day)\"\n (dayMouseDown)=\"onDayMouseDown(day)\"\n (dayMouseUp)=\"onDayMouseUp(day)\"\n ></bc-day-number-box>\n </td>\n </tr>\n <ng-container *ngIf=\"!isPickerMode\">\n <ng-container\n *ngTemplateOutlet=\"\n renderDayTasks;\n context: {\n $implicit: weekTasksArray[weekIndex],\n maxRowTasks: maxRowTasks,\n weekIndex: weekIndex,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n weekDays: weekDays\n }\n \"\n ></ng-container>\n <tr fd-table-row>\n <td fd-table-cell *ngFor=\"let day of days\" class=\"more-fd\" (click)=\"onDayBoxSelect(day)\">\n <ng-container *ngIf=\"maxRowTasks?.length < day.tasks.length\">\n <button\n fd-button\n (click)=\"onMoreButton($event, popover)\"\n [fdType]=\"'transparent'\"\n [compact]=\"true\"\n >\n {{ day.tasks?.length - maxRowTasks?.length }}\n {{ 'More' | bbbTranslate }}\n </button>\n <fd-popover\n #popover\n [mobile]=\"deviceSize === 's'\"\n placement=\"bottom\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n (isOpenChange)=\"onOpenPopoverChange($event)\"\n >\n <bc-day-event-list\n [day]=\"day\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [weekDays]=\"weekDays\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [popover]=\"popover\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-day-event-list>\n </fd-popover>\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n</ng-template>\n\n<ng-template\n #renderDayTasks\n let-weekTasks\n let-maxRowTasks=\"maxRowTasks\"\n let-weekIndex=\"weekIndex\"\n let-deviceSize=\"deviceSize\"\n let-calendarFields=\"calendarFields\"\n let-weekDays=\"weekDays\"\n>\n <tr fd-table-row *ngFor=\"let rowTask of maxRowTasks; let i = index\">\n <ng-container *ngIf=\"!weekTasks[i] || weekTasks[i].length === 0\">\n <td fd-table-cell *ngFor=\"let day of weekDays\"></td>\n </ng-container>\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\n <td fd-table-cell [attr.colspan]=\"task.colSpan\" *ngIf=\"task.colSpan\">\n <ng-container *ngIf=\"task.event; else newDaySelect\">\n <bc-event-button\n [task]=\"task\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\n ></bc-event-button>\n </ng-container>\n <ng-template #newDaySelect>\n <div style=\"width: 100%; height: 100%\" (click)=\"onDaySelect(weekIndex, dayIndex)\"></div>\n </ng-template>\n </td>\n </ng-container>\n </tr>\n</ng-template>\n", styles: [":host{display:block}table{table-layout:fixed}.table-header td{padding:0!important}.table-content{width:100%;height:100%;border:none;border-spacing:0}.table-content td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:1.425rem}.table-content .row-day-number[rtl=true] td:first-child{border-right:none}.table-content .row-day-number[rtl=\"fa;se\"] td:first-child{border-left:none}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}.weekday-header,.row-day-number td{width:100%}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.more-fd{text-align:center!important}.more-fd button{font-size:12px}.fd-calendar__item{font-size:.875rem;font-size:var(--sapFontSize, .875rem);line-height:1.4;line-height:var(--sapContent_LineHeight, 1.4);color:#32363a;color:var(--sapTextColor, #32363a);font-family:\"72\",\"72full\",Arial,Helvetica,sans-serif;font-family:var(--sapFontFamily, \"72\", \"72full\", Arial, Helvetica, sans-serif);font-weight:400;box-sizing:border-box;padding:0;border:0;overflow:hidden;position:relative;height:2.75rem;margin:.0625rem;min-width:2.125rem;border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem);background-color:#fafafa;background-color:var(--sapLegend_WorkingBackground, #fafafa);flex:1 1 .375rem;border:none!important;padding:1px!important}.fd-calendar__item.fd-calendar__item--other-month{background-color:var(--sapList_Background, #fff)}.fd-calendar__item.fd-calendar__item--weekend{background-color:var(--sapLegend_NotWorkingBackground, #dedede)}.fd-calendar__item.is-active{background-color:var(--sapContent_Selected_Background, #0854a0);border:var(--fdCalendar_Active_Item_Border, none)}.fd-calendar__item.is-active ::ng-deep span{color:var(--sapContent_Selected_TextColor, #fff)}.fd-calendar__item.fd-calendar__item--range{border:.0625rem solid var(--sapList_SelectionBorderColor, #0854a0);background-color:var(--sapList_SelectionBackgroundColor, #e5f0fa)}.noborder{border:none!important}table[picker=true] thead,table[picker=true] tbody{border:none}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "directive", type: i4.DeprecatedButtonContentDensityDirective, selector: "[fd-button][compact]" }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i6$1.TableComponent, selector: "table[fd-table]", inputs: ["noBorderX", "noBorderY", "popIn", "responsive", "keys", "allCellsFocusable"], exportAs: ["fd-table"] }, { kind: "directive", type: i6$1.TableHeaderDirective, selector: "[fdTableHeader], [fd-table-header]", inputs: ["noBorderX", "noBorderY"] }, { kind: "directive", type: i6$1.TableBodyDirective, selector: "[fdTableBody], [fd-table-body]", inputs: ["noBorderX", "noBorderY"] }, { kind: "directive", type: i6$1.TableRowDirective, selector: "[fdTableRow], [fd-table-row]", inputs: ["activable", "highlightActive", "hoverable", "focusable", "main", "secondary", "active"] }, { kind: "directive", type: i6$1.TableCellDirective, selector: "[fdTableCell], [fd-table-cell]", inputs: ["noBorderX", "noBorderY", "activable", "focusable", "tabindex", "hoverable", "fitContent", "noPadding", "noData", "key", "cellFocusedEventAnnouncer"] }, { kind: "directive", type: i6$1.DeprecatedTableCompactDirective, selector: "table[fd-table][compact]" }, { kind: "component", type: DayNumberBoxComponent, selector: "bc-day-number-box", inputs: ["isWeekMode", "isSingleDay", "day", "isPickerMode", "itemInRange", "isActive"], outputs: ["dayClick", "dayMouseDown", "dayMouseUp", "dayMouseMove"] }, { kind: "component", type: EventButtonComponent, selector: "bc-event-button", inputs: ["buttonTemplate", "calendarFields", "task", "rtl", "canDelete", "canEdit", "deviceSize"], outputs: ["deleteEvent", "editEvent", "openPopoverChange"] }, { kind: "component", type: DayEventListComponent, selector: "bc-day-event-list", inputs: ["day", "deviceSize", "weekDays", "calendarFields", "rtl", "canDelete", "canEdit", "popover"], outputs: ["deleteEvent", "editEvent", "openPopOver"] }, { kind: "pipe", type: i2.BbbTranslatePipe, name: "bbbTranslate" }, { kind: "pipe", type: DaysInWeekPipe, name: "daysInWeek" }, { kind: "pipe", type: EqualDatePipe, name: "equalDate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarMonthComponent, decorators: [{
|
|
1148
|
+
type: Component,
|
|
1149
|
+
args: [{ selector: 'bc-calendar-month', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table fd-table class=\"table-header\" [compact]=\"true\" [attr.picker]=\"datePicker\">\n <thead fd-table-header>\n <tr fd-table-row>\n <th\n class=\"weekday-header\"\n *ngFor=\"let weekDay of selectedWeekDays\"\n fd-table-cell\n [class.noborder]=\"isPickerMode\"\n >\n {{ weekDay }}\n </th>\n </tr>\n </thead>\n <tbody fd-table-body>\n <ng-container *ngFor=\"let weekDay of numberOfWeek\">\n <tr fd-table-row>\n <td\n [style.height.px]=\"dayHeight\"\n fd-table-cell\n colspan=\"7\"\n [style.border]=\"isPickerMode ? 'none' : null\"\n >\n <ng-container\n *ngTemplateOutlet=\"\n renderTasks;\n context: {\n $implicit: isPickerMode ? null : moDataList[weekDay],\n weekIndex: weekDay,\n days: days | daysInWeek: weekDay,\n maxRowTasks: maxRowTasks,\n weekDays: weekDays,\n calendarFields: calendarFields,\n rtl: rtl,\n isPickerMode: isPickerMode\n }\n \"\n ></ng-container>\n </td>\n </tr>\n </ng-container>\n </tbody>\n</table>\n<ng-template\n #renderTasks\n let-task\n let-weekIndex=\"weekIndex\"\n let-weekDays=\"weekDays\"\n let-days=\"days\"\n let-maxRowTasks=\"maxRowTasks\"\n let-calendarFields=\"calendarFields\"\n let-deviceSize=\"deviceSize\"\n let-rtl=\"rtl\"\n let-isPickerMode=\"isPickerMode\"\n>\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\n <tbody>\n <tr fd-table-row class=\"row-day-number\" [attr.rtl]=\"rtl\">\n <td fd-table-cell *ngFor=\"let day of days\" [class.noborder]=\"isPickerMode\">\n <bc-day-number-box\n [class.fd-calendar__item]=\"isPickerMode\"\n [class.fd-calendar__item--other-month]=\"isPickerMode && !day.isInMonth\"\n [class.fd-calendar__item--weekend]=\"isPickerMode && day.isWeekend\"\n [isPickerMode]=\"isPickerMode\"\n [day]=\"day\"\n [isActive]=\"\n day.index === startSelectedDayIndex || day.index === endSelectedDayIndex || day.date\n | equalDate: selectedDate\n \"\n [itemInRange]=\"\n startSelectedDayIndex !== undefined &&\n endSelectedDayIndex !== undefined &&\n day.index >= startSelectedDayIndex &&\n day.index <= endSelectedDayIndex\n \"\n (dayClick)=\"onDayClick(day)\"\n (dayMouseMove)=\"onDayMouseMove(day)\"\n (dayMouseDown)=\"onDayMouseDown(day)\"\n (dayMouseUp)=\"onDayMouseUp(day)\"\n ></bc-day-number-box>\n </td>\n </tr>\n <ng-container *ngIf=\"!isPickerMode\">\n <ng-container\n *ngTemplateOutlet=\"\n renderDayTasks;\n context: {\n $implicit: weekTasksArray[weekIndex],\n maxRowTasks: maxRowTasks,\n weekIndex: weekIndex,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n weekDays: weekDays\n }\n \"\n ></ng-container>\n <tr fd-table-row>\n <td fd-table-cell *ngFor=\"let day of days\" class=\"more-fd\" (click)=\"onDayBoxSelect(day)\">\n <ng-container *ngIf=\"maxRowTasks?.length < day.tasks.length\">\n <button\n fd-button\n (click)=\"onMoreButton($event, popover)\"\n [fdType]=\"'transparent'\"\n [compact]=\"true\"\n >\n {{ day.tasks?.length - maxRowTasks?.length }}\n {{ 'More' | bbbTranslate }}\n </button>\n <fd-popover\n #popover\n [mobile]=\"deviceSize === 's'\"\n placement=\"bottom\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n (isOpenChange)=\"onOpenPopoverChange($event)\"\n >\n <bc-day-event-list\n [day]=\"day\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [weekDays]=\"weekDays\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [popover]=\"popover\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-day-event-list>\n </fd-popover>\n </ng-container>\n </td>\n </tr>\n </ng-container>\n </tbody>\n </table>\n</ng-template>\n\n<ng-template\n #renderDayTasks\n let-weekTasks\n let-maxRowTasks=\"maxRowTasks\"\n let-weekIndex=\"weekIndex\"\n let-deviceSize=\"deviceSize\"\n let-calendarFields=\"calendarFields\"\n let-weekDays=\"weekDays\"\n>\n <tr fd-table-row *ngFor=\"let rowTask of maxRowTasks; let i = index\">\n <ng-container *ngIf=\"!weekTasks[i] || weekTasks[i].length === 0\">\n <td fd-table-cell *ngFor=\"let day of weekDays\"></td>\n </ng-container>\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\n <td fd-table-cell [attr.colspan]=\"task.colSpan\" *ngIf=\"task.colSpan\">\n <ng-container *ngIf=\"task.event; else newDaySelect\">\n <bc-event-button\n [task]=\"task\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\n ></bc-event-button>\n </ng-container>\n <ng-template #newDaySelect>\n <div style=\"width: 100%; height: 100%\" (click)=\"onDaySelect(weekIndex, dayIndex)\"></div>\n </ng-template>\n </td>\n </ng-container>\n </tr>\n</ng-template>\n", styles: [":host{display:block}table{table-layout:fixed}.table-header td{padding:0!important}.table-content{width:100%;height:100%;border:none;border-spacing:0}.table-content td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:1.425rem}.table-content .row-day-number[rtl=true] td:first-child{border-right:none}.table-content .row-day-number[rtl=\"fa;se\"] td:first-child{border-left:none}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}.weekday-header,.row-day-number td{width:100%}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.more-fd{text-align:center!important}.more-fd button{font-size:12px}.fd-calendar__item{font-size:.875rem;font-size:var(--sapFontSize, .875rem);line-height:1.4;line-height:var(--sapContent_LineHeight, 1.4);color:#32363a;color:var(--sapTextColor, #32363a);font-family:\"72\",\"72full\",Arial,Helvetica,sans-serif;font-family:var(--sapFontFamily, \"72\", \"72full\", Arial, Helvetica, sans-serif);font-weight:400;box-sizing:border-box;padding:0;border:0;overflow:hidden;position:relative;height:2.75rem;margin:.0625rem;min-width:2.125rem;border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem);background-color:#fafafa;background-color:var(--sapLegend_WorkingBackground, #fafafa);flex:1 1 .375rem;border:none!important;padding:1px!important}.fd-calendar__item.fd-calendar__item--other-month{background-color:var(--sapList_Background, #fff)}.fd-calendar__item.fd-calendar__item--weekend{background-color:var(--sapLegend_NotWorkingBackground, #dedede)}.fd-calendar__item.is-active{background-color:var(--sapContent_Selected_Background, #0854a0);border:var(--fdCalendar_Active_Item_Border, none)}.fd-calendar__item.is-active ::ng-deep span{color:var(--sapContent_Selected_TextColor, #fff)}.fd-calendar__item.fd-calendar__item--range{border:.0625rem solid var(--sapList_SelectionBorderColor, #0854a0);background-color:var(--sapList_SelectionBackgroundColor, #e5f0fa)}.noborder{border:none!important}table[picker=true] thead,table[picker=true] tbody{border:none}\n"] }]
|
|
1150
|
+
}], ctorParameters: function () { return [{ type: DaysInWeekPipe }, { type: i0.ChangeDetectorRef }, { type: CalendarService }]; }, propDecorators: { monthWeeksCount: [{
|
|
1151
|
+
type: Input
|
|
1152
|
+
}], weekDays: [{
|
|
1153
|
+
type: Input
|
|
1154
|
+
}], weekDaysMin: [{
|
|
1155
|
+
type: Input
|
|
1156
|
+
}], today: [{
|
|
1157
|
+
type: Input
|
|
1158
|
+
}], containerHeight: [{
|
|
1159
|
+
type: Input
|
|
1160
|
+
}], days: [{
|
|
1161
|
+
type: Input
|
|
1162
|
+
}], calendarFields: [{
|
|
1163
|
+
type: Input
|
|
1164
|
+
}], rtl: [{
|
|
1165
|
+
type: Input
|
|
1166
|
+
}], deviceSize: [{
|
|
1167
|
+
type: Input
|
|
1168
|
+
}], moDataList: [{
|
|
1169
|
+
type: Input
|
|
1170
|
+
}], datePicker: [{
|
|
1171
|
+
type: Input
|
|
1172
|
+
}], rangePicker: [{
|
|
1173
|
+
type: Input
|
|
1174
|
+
}], canDelete: [{
|
|
1175
|
+
type: Input
|
|
1176
|
+
}], canAdd: [{
|
|
1177
|
+
type: Input
|
|
1178
|
+
}], canEdit: [{
|
|
1179
|
+
type: Input
|
|
1180
|
+
}], selectedDate: [{
|
|
1181
|
+
type: Input
|
|
1182
|
+
}], startSelectedDayIndex: [{
|
|
1183
|
+
type: Input
|
|
1184
|
+
}], endSelectedDayIndex: [{
|
|
1185
|
+
type: Input
|
|
1186
|
+
}], editEvent: [{
|
|
1187
|
+
type: Output
|
|
1188
|
+
}], deleteEvent: [{
|
|
1189
|
+
type: Output
|
|
1190
|
+
}], daySelect: [{
|
|
1191
|
+
type: Output
|
|
1192
|
+
}], dayClick: [{
|
|
1193
|
+
type: Output
|
|
1194
|
+
}], dayMouseMove: [{
|
|
1195
|
+
type: Output
|
|
1196
|
+
}], dayMouseUp: [{
|
|
1197
|
+
type: Output
|
|
1198
|
+
}], dayMouseDown: [{
|
|
1199
|
+
type: Output
|
|
1200
|
+
}], showEvent: [{
|
|
1201
|
+
type: Output
|
|
1202
|
+
}] } });
|
|
1203
|
+
|
|
1204
|
+
class CalendarSelectionDaysComponent extends BaseComponent {
|
|
1205
|
+
constructor(_calendarService, _portalService) {
|
|
1206
|
+
super();
|
|
1207
|
+
this._calendarService = _calendarService;
|
|
1208
|
+
this.rangeChange = new EventEmitter();
|
|
1209
|
+
this.selectionMode = 'day';
|
|
1210
|
+
this.months = [];
|
|
1211
|
+
this._isMouseDown = false;
|
|
1212
|
+
this.rtl$ = _portalService.rtl$;
|
|
1213
|
+
this.width$ = _portalService.deviceSize$.pipe(distinctUntilChanged(), map((deviceSize) => {
|
|
1214
|
+
switch (deviceSize) {
|
|
1215
|
+
case 'l':
|
|
1216
|
+
case 'xl':
|
|
1217
|
+
return 480;
|
|
1218
|
+
case 's':
|
|
1219
|
+
return 320;
|
|
1220
|
+
default:
|
|
1221
|
+
return 480;
|
|
1222
|
+
}
|
|
1223
|
+
}));
|
|
1224
|
+
this.weekDaysMin = this._calendarService.weekDaysMin();
|
|
1225
|
+
this.weekDays = this._calendarService.weekDays();
|
|
1226
|
+
this.selectedMonth$ = this._calendarService.selected$;
|
|
1227
|
+
this.today = this._calendarService.today;
|
|
1228
|
+
this.months = this._calendarService.Months;
|
|
1229
|
+
this._prepareYear(this._calendarService.selectedMonth.dateInfo.year);
|
|
1230
|
+
}
|
|
1231
|
+
ngOnChanges(changes) {
|
|
1232
|
+
super.ngOnChanges(changes);
|
|
1233
|
+
const { monthInfo } = changes;
|
|
1234
|
+
if (monthInfo) {
|
|
1235
|
+
this._calendarService.loadCalendarMonthInfo(monthInfo.currentValue);
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
onMonthSelected(monthName, index) {
|
|
1239
|
+
this._calendarService.gotoMonth(monthName, index);
|
|
1240
|
+
}
|
|
1241
|
+
onYearSelected(year) {
|
|
1242
|
+
this._calendarService.gotoYear(+year);
|
|
1243
|
+
}
|
|
1244
|
+
onPrevTap() {
|
|
1245
|
+
if (this.selectionMode === 'day') {
|
|
1246
|
+
this._calendarService.loadPrevious();
|
|
1247
|
+
}
|
|
1248
|
+
else if (this.selectionMode === 'month') {
|
|
1249
|
+
this._calendarService.loadPrevYear();
|
|
1250
|
+
}
|
|
1251
|
+
else if (this.selectionMode === 'year') {
|
|
1252
|
+
this._prepareYear(Number(this.years[0]) - 20);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
onNextTap() {
|
|
1256
|
+
if (this.selectionMode === 'day') {
|
|
1257
|
+
this._calendarService.loadNext();
|
|
1258
|
+
}
|
|
1259
|
+
else if (this.selectionMode === 'month') {
|
|
1260
|
+
this._calendarService.loadNextYear();
|
|
1261
|
+
}
|
|
1262
|
+
else if (this.selectionMode === 'year') {
|
|
1263
|
+
this._prepareYear(Number(this.years[this.years.length - 1]) + 1);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
onToday() {
|
|
1267
|
+
this._calendarService.gotoToday();
|
|
1268
|
+
}
|
|
1269
|
+
onDayMouseMove(day, monthInfo) {
|
|
1270
|
+
var _a, _b;
|
|
1271
|
+
if (this._isMouseDown) {
|
|
1272
|
+
const { endDay, startDay } = this.getStartAndEndDay(monthInfo, day);
|
|
1273
|
+
this.startSelectedDayIndex = startDay === null || startDay === void 0 ? void 0 : startDay.index;
|
|
1274
|
+
this.endSelectedDayIndex = endDay === null || endDay === void 0 ? void 0 : endDay.index;
|
|
1275
|
+
console.log('-move-', (_a = this.startSelectedDay) === null || _a === void 0 ? void 0 : _a.index, (_b = this.endSelectedDay) === null || _b === void 0 ? void 0 : _b.index);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
onDayMouseDown(day) {
|
|
1279
|
+
this._isMouseDown = true;
|
|
1280
|
+
this.startSelectedDay = null;
|
|
1281
|
+
this.endSelectedDay = null;
|
|
1282
|
+
this.startSelectedDay = day;
|
|
1283
|
+
this.startSelectedDayIndex = day.index;
|
|
1284
|
+
}
|
|
1285
|
+
onDayMouseUp(day, monthInfo, popover) {
|
|
1286
|
+
this._isMouseDown = false;
|
|
1287
|
+
const { endDay, startDay } = this.getStartAndEndDay(monthInfo, day);
|
|
1288
|
+
this.startSelectedDay = startDay;
|
|
1289
|
+
this.endSelectedDay = endDay;
|
|
1290
|
+
this._setFirstAndEndDay(monthInfo, popover);
|
|
1291
|
+
}
|
|
1292
|
+
onDayClick(day, monthInfo, popover) {
|
|
1293
|
+
this.startSelectedDay = this.endSelectedDay = day;
|
|
1294
|
+
this._setFirstAndEndDay(monthInfo, popover);
|
|
1295
|
+
}
|
|
1296
|
+
_prepareYear(from) {
|
|
1297
|
+
const years = [];
|
|
1298
|
+
for (let i = 0; i < 20; i++) {
|
|
1299
|
+
years.push(`${from + i}`);
|
|
1300
|
+
}
|
|
1301
|
+
this.years = years;
|
|
1302
|
+
}
|
|
1303
|
+
getStartAndEndDay(monthInfo, day) {
|
|
1304
|
+
let startDay = null;
|
|
1305
|
+
let endDay = null;
|
|
1306
|
+
if (this.startSelectedDay && !this.endSelectedDay) {
|
|
1307
|
+
if (day && this.startSelectedDay.date > day.date) {
|
|
1308
|
+
startDay = day;
|
|
1309
|
+
endDay = this.startSelectedDay;
|
|
1310
|
+
}
|
|
1311
|
+
else {
|
|
1312
|
+
startDay = this.startSelectedDay;
|
|
1313
|
+
endDay = day;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
else if (this.startSelectedDay && this.endSelectedDay) {
|
|
1317
|
+
if (day && this.startSelectedDay.date < day.date) {
|
|
1318
|
+
startDay = this.startSelectedDay;
|
|
1319
|
+
endDay = day;
|
|
1320
|
+
}
|
|
1321
|
+
else {
|
|
1322
|
+
startDay = day;
|
|
1323
|
+
endDay = this.endSelectedDay;
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
console.log('-2-', startDay, endDay);
|
|
1327
|
+
if (startDay && endDay) {
|
|
1328
|
+
const diff = Math.abs(startDay.momentOfDate.diff(endDay.momentOfDate, 'day'));
|
|
1329
|
+
if (diff > 6) {
|
|
1330
|
+
startDay = monthInfo.days[Math.floor(startDay.index / 7) * 7];
|
|
1331
|
+
// const end = endDay.index % 7;
|
|
1332
|
+
const indexEnd = Math.ceil((endDay.index + 1) / 7);
|
|
1333
|
+
// if (end > 0) {
|
|
1334
|
+
// indexEnd++;
|
|
1335
|
+
// }
|
|
1336
|
+
endDay = monthInfo.days[indexEnd * 7 - 1];
|
|
1337
|
+
console.log('-3-', startDay, endDay);
|
|
1338
|
+
}
|
|
1339
|
+
}
|
|
1340
|
+
return { endDay, startDay };
|
|
1341
|
+
}
|
|
1342
|
+
_setFirstAndEndDay(monthInfo, popover) {
|
|
1343
|
+
console.log('-finish-', this.startSelectedDay, this.endSelectedDay);
|
|
1344
|
+
if (this.startSelectedDay && this.endSelectedDay) {
|
|
1345
|
+
if (popover) {
|
|
1346
|
+
popover.close();
|
|
1347
|
+
}
|
|
1348
|
+
this.rangeChange.emit({
|
|
1349
|
+
startDay: this.startSelectedDay,
|
|
1350
|
+
endDay: this.endSelectedDay,
|
|
1351
|
+
monthInfo
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
CalendarSelectionDaysComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarSelectionDaysComponent, deps: [{ token: CalendarService, self: true }, { token: i2.PortalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1357
|
+
CalendarSelectionDaysComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarSelectionDaysComponent, selector: "bc-calendar-selection-days", inputs: { startSelectedDayIndex: "startSelectedDayIndex", endSelectedDayIndex: "endSelectedDayIndex", monthInfo: "monthInfo" }, outputs: { rangeChange: "rangeChange" }, providers: [
|
|
1358
|
+
{
|
|
1359
|
+
provide: DateService,
|
|
1360
|
+
useFactory: getDateService
|
|
1361
|
+
},
|
|
1362
|
+
CalendarService
|
|
1363
|
+
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<fdp-button glyph=\"calendar\" buttonType=\"transparent\" [fdPopoverTrigger]=\"popover\"></fdp-button>\n<fd-popover #popover [focusTrapped]=\"true\" [focusAutoCapture]=\"true\" [mobile]=\"(deviceSize$ | async) === 's'\">\n <fd-popover-body [style.width.px]=\"width$ | async\">\n <ng-container\n *ngTemplateOutlet=\"\n month;\n context: {\n $implicit: selectedMonth$ | async,\n width: width$ | async,\n height: height,\n rtl: rtl$ | async,\n weekDays: weekDays,\n weekDaysMin: weekDaysMin,\n today: today,\n deviceSize: deviceSize$ | async,\n popover: popover\n }\n \"\n >\n </ng-container>\n </fd-popover-body>\n</fd-popover>\n\n<ng-template\n #month\n let-selectedMonth\n let-width=\"width\"\n let-height=\"height\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-popover=\"popover\"\n>\n <fd-toolbar [fdType]=\"'transparent'\">\n <fdp-button fd-toolbar-item [label]=\"'DateR_Today' | bbbTranslate\" (click)=\"onToday()\"></fdp-button>\n <fdp-button\n buttonType=\"transparent\"\n fd-toolbar-item\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\n (click)=\"onPrevTap()\"\n ></fdp-button>\n <fdp-button\n buttonType=\"transparent\"\n fd-toolbar-item\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\n (click)=\"onNextTap()\"\n ></fdp-button>\n <div class=\"month-years-wrapper\" fd-title fd-toolbar-item>\n <button\n *ngIf=\"selectionMode === 'day' || selectionMode === 'month'\"\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.monthName\"\n (click)=\"selectionMode = 'month'\"\n ></button>\n <button\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.year\"\n (click)=\"selectionMode = 'year'\"\n ></button>\n </div>\n </fd-toolbar>\n <ng-container [ngSwitch]=\"selectionMode\">\n <ng-container *ngSwitchCase=\"'month'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 33%\"\n *ngFor=\"let month of months; let i = index\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.monthName === month ? 'emphasized' : 'transparent'\"\n [label]=\"month\"\n (click)=\"selectionMode = 'day'; onMonthSelected(month, i)\"\n ></button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 25%\"\n *ngFor=\"let year of years\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.year === +year ? 'emphasized' : 'transparent'\"\n [label]=\"year\"\n (click)=\"selectionMode = 'day'; onYearSelected(year)\"\n ></button>\n </div>\n </ng-container>\n <bc-calendar-month\n *ngSwitchDefault\n [style.width]=\"width\"\n [containerHeight]=\"height\"\n [containerWidth]=\"width\"\n [rtl]=\"rtl\"\n [monthWeeksCount]=\"6\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [datePicker]=\"true\"\n [dateRange]=\"true\"\n [days]=\"selectedMonth.days\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event, selectedMonth, popover)\"\n (dayMouseMove)=\"onDayMouseMove($event, selectedMonth)\"\n (dayMouseUp)=\"onDayMouseUp($event, selectedMonth, popover)\"\n (dayMouseDown)=\"onDayMouseDown($event)\"\n [startSelectedDayIndex]=\"startSelectedDayIndex\"\n [endSelectedDayIndex]=\"endSelectedDayIndex\"\n ></bc-calendar-month>\n </ng-container>\n</ng-template>\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "component", type: i5$1.PopoverBodyComponent, selector: "fd-popover-body" }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "directive", type: i5$1.PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: i6.ToolbarComponent, selector: "fd-toolbar", inputs: ["class", "shouldOverflow", "fdType", "hasTitle", "title", "active", "clearBorder", "forceOverflow", "tabindex"] }, { kind: "directive", type: i6.ToolbarItemDirective, selector: "[fd-toolbar-item]" }, { kind: "component", type: i7.ButtonComponent, selector: "fdp-button", inputs: ["glyphPosition", "label", "glyph", "buttonType", "title", "ariaSelected", "ariaDisabled", "ariaExpanded", "ariaControlsId", "ariaPressed", "name", "type", "value"], outputs: ["buttonClicked"] }, { kind: "component", type: CalendarMonthComponent, selector: "bc-calendar-month", inputs: ["monthWeeksCount", "weekDays", "weekDaysMin", "today", "containerHeight", "days", "calendarFields", "rtl", "deviceSize", "moDataList", "datePicker", "rangePicker", "canDelete", "canAdd", "canEdit", "selectedDate", "startSelectedDayIndex", "endSelectedDayIndex"], outputs: ["editEvent", "deleteEvent", "daySelect", "dayClick", "dayMouseMove", "dayMouseUp", "dayMouseDown", "showEvent"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.BbbTranslatePipe, name: "bbbTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1364
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarSelectionDaysComponent, decorators: [{
|
|
1365
|
+
type: Component,
|
|
1366
|
+
args: [{ selector: 'bc-calendar-selection-days', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1367
|
+
{
|
|
1368
|
+
provide: DateService,
|
|
1369
|
+
useFactory: getDateService
|
|
1370
|
+
},
|
|
1371
|
+
CalendarService
|
|
1372
|
+
], template: "<fdp-button glyph=\"calendar\" buttonType=\"transparent\" [fdPopoverTrigger]=\"popover\"></fdp-button>\n<fd-popover #popover [focusTrapped]=\"true\" [focusAutoCapture]=\"true\" [mobile]=\"(deviceSize$ | async) === 's'\">\n <fd-popover-body [style.width.px]=\"width$ | async\">\n <ng-container\n *ngTemplateOutlet=\"\n month;\n context: {\n $implicit: selectedMonth$ | async,\n width: width$ | async,\n height: height,\n rtl: rtl$ | async,\n weekDays: weekDays,\n weekDaysMin: weekDaysMin,\n today: today,\n deviceSize: deviceSize$ | async,\n popover: popover\n }\n \"\n >\n </ng-container>\n </fd-popover-body>\n</fd-popover>\n\n<ng-template\n #month\n let-selectedMonth\n let-width=\"width\"\n let-height=\"height\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-popover=\"popover\"\n>\n <fd-toolbar [fdType]=\"'transparent'\">\n <fdp-button fd-toolbar-item [label]=\"'DateR_Today' | bbbTranslate\" (click)=\"onToday()\"></fdp-button>\n <fdp-button\n buttonType=\"transparent\"\n fd-toolbar-item\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\n (click)=\"onPrevTap()\"\n ></fdp-button>\n <fdp-button\n buttonType=\"transparent\"\n fd-toolbar-item\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\n (click)=\"onNextTap()\"\n ></fdp-button>\n <div class=\"month-years-wrapper\" fd-title fd-toolbar-item>\n <button\n *ngIf=\"selectionMode === 'day' || selectionMode === 'month'\"\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.monthName\"\n (click)=\"selectionMode = 'month'\"\n ></button>\n <button\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.year\"\n (click)=\"selectionMode = 'year'\"\n ></button>\n </div>\n </fd-toolbar>\n <ng-container [ngSwitch]=\"selectionMode\">\n <ng-container *ngSwitchCase=\"'month'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 33%\"\n *ngFor=\"let month of months; let i = index\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.monthName === month ? 'emphasized' : 'transparent'\"\n [label]=\"month\"\n (click)=\"selectionMode = 'day'; onMonthSelected(month, i)\"\n ></button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 25%\"\n *ngFor=\"let year of years\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.year === +year ? 'emphasized' : 'transparent'\"\n [label]=\"year\"\n (click)=\"selectionMode = 'day'; onYearSelected(year)\"\n ></button>\n </div>\n </ng-container>\n <bc-calendar-month\n *ngSwitchDefault\n [style.width]=\"width\"\n [containerHeight]=\"height\"\n [containerWidth]=\"width\"\n [rtl]=\"rtl\"\n [monthWeeksCount]=\"6\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [datePicker]=\"true\"\n [dateRange]=\"true\"\n [days]=\"selectedMonth.days\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event, selectedMonth, popover)\"\n (dayMouseMove)=\"onDayMouseMove($event, selectedMonth)\"\n (dayMouseUp)=\"onDayMouseUp($event, selectedMonth, popover)\"\n (dayMouseDown)=\"onDayMouseDown($event)\"\n [startSelectedDayIndex]=\"startSelectedDayIndex\"\n [endSelectedDayIndex]=\"endSelectedDayIndex\"\n ></bc-calendar-month>\n </ng-container>\n</ng-template>\n" }]
|
|
1373
|
+
}], ctorParameters: function () {
|
|
1374
|
+
return [{ type: CalendarService, decorators: [{
|
|
1375
|
+
type: Self
|
|
1376
|
+
}] }, { type: i2.PortalService }];
|
|
1377
|
+
}, propDecorators: { startSelectedDayIndex: [{
|
|
1378
|
+
type: Input
|
|
1379
|
+
}], endSelectedDayIndex: [{
|
|
1380
|
+
type: Input
|
|
1381
|
+
}], monthInfo: [{
|
|
1382
|
+
type: Input
|
|
1383
|
+
}], rangeChange: [{
|
|
1384
|
+
type: Output
|
|
1385
|
+
}] } });
|
|
1386
|
+
|
|
1387
|
+
class TimeConfigI18n {
|
|
1388
|
+
constructor(_bbbTranslate) {
|
|
1389
|
+
this._bbbTranslate = _bbbTranslate;
|
|
1390
|
+
/** Aria label for the 'increase hours' button */
|
|
1391
|
+
this.increaseHoursLabel = 'Increase hours';
|
|
1392
|
+
/** label for the 'hours' column */
|
|
1393
|
+
this.hoursLabel = this._bbbTranslate.transform('Hours');
|
|
1394
|
+
/** Aria label for the 'decrease hours' button */
|
|
1395
|
+
this.decreaseHoursLabel = 'Decrease hours';
|
|
1396
|
+
/** Aria label for the 'increase minutes' button */
|
|
1397
|
+
this.increaseMinutesLabel = 'Increase minutes';
|
|
1398
|
+
/** label for the 'minutes' column */
|
|
1399
|
+
this.minutesLabel = this._bbbTranslate.transform('Minutes');
|
|
1400
|
+
/** Aria label for the 'decrease minutes' button */
|
|
1401
|
+
this.decreaseMinutesLabel = 'Decrease minutes';
|
|
1402
|
+
/** Aria label for the 'increase seconds' button */
|
|
1403
|
+
this.increaseSecondsLabel = 'Increase seconds';
|
|
1404
|
+
/** label for the 'seconds' column */
|
|
1405
|
+
this.secondsLabel = this._bbbTranslate.transform('Sec');
|
|
1406
|
+
/** Aria label for the 'decrease seconds' button */
|
|
1407
|
+
this.decreaseSecondsLabel = 'Decrease seconds';
|
|
1408
|
+
/** Aria label for the 'increase period' button */
|
|
1409
|
+
this.increasePeriodLabel = 'Increase period';
|
|
1410
|
+
/** label for the 'period' column */
|
|
1411
|
+
this.periodLabel = 'Period';
|
|
1412
|
+
/** Aria label for the 'decrease period' button */
|
|
1413
|
+
this.decreasePeriodLabel = 'Decrease period';
|
|
1414
|
+
}
|
|
1415
|
+
}
|
|
1416
|
+
TimeConfigI18n.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TimeConfigI18n, deps: [{ token: i2.BbbTranslatePipe }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1417
|
+
TimeConfigI18n.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TimeConfigI18n });
|
|
1418
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: TimeConfigI18n, decorators: [{
|
|
1419
|
+
type: Injectable
|
|
1420
|
+
}], ctorParameters: function () { return [{ type: i2.BbbTranslatePipe }]; } });
|
|
1421
|
+
class DateTimePickerComponent extends BaseComponent {
|
|
1422
|
+
constructor(_datetimeAdapter, _logService, _portalService) {
|
|
1423
|
+
super();
|
|
1424
|
+
this._datetimeAdapter = _datetimeAdapter;
|
|
1425
|
+
this._logService = _logService;
|
|
1426
|
+
this.rtl = true;
|
|
1427
|
+
this.rangeChange = new EventEmitter();
|
|
1428
|
+
this.valueChange = new EventEmitter();
|
|
1429
|
+
this.valueCaption = '';
|
|
1430
|
+
this.selectionMode = 'day';
|
|
1431
|
+
this.todayIndex = -1;
|
|
1432
|
+
this.isValid = true;
|
|
1433
|
+
this.months = [];
|
|
1434
|
+
this.rtl$ = _portalService.rtl$;
|
|
1435
|
+
this.width$ = _portalService.deviceSize$.pipe(distinctUntilChanged(), map((deviceSize) => {
|
|
1436
|
+
if (!this.showDate) {
|
|
1437
|
+
return 260;
|
|
1438
|
+
}
|
|
1439
|
+
switch (deviceSize) {
|
|
1440
|
+
case 'l':
|
|
1441
|
+
case 'xl':
|
|
1442
|
+
return 560;
|
|
1443
|
+
case 's':
|
|
1444
|
+
return 320;
|
|
1445
|
+
default:
|
|
1446
|
+
return 520;
|
|
1447
|
+
}
|
|
1448
|
+
}));
|
|
1449
|
+
this.height = 420;
|
|
1450
|
+
}
|
|
1451
|
+
ngOnInit() {
|
|
1452
|
+
super.ngOnInit();
|
|
1453
|
+
let culture = 'en-US';
|
|
1454
|
+
switch (this.primaryCalendarType) {
|
|
1455
|
+
case 'HijriShamsi':
|
|
1456
|
+
culture = 'fa-IR';
|
|
1457
|
+
break;
|
|
1458
|
+
}
|
|
1459
|
+
this.culture = culture;
|
|
1460
|
+
this._calendarService = new CalendarService(this._logService, culture);
|
|
1461
|
+
this.weekDaysMin = this._calendarService.weekDaysMin();
|
|
1462
|
+
this.weekDays = this._calendarService.weekDays();
|
|
1463
|
+
this.selectedMonth$ = this._calendarService.selected$;
|
|
1464
|
+
this.today = this._calendarService.today;
|
|
1465
|
+
if (this.value) {
|
|
1466
|
+
this.timeValue = FdDate.getFdDateByDate(this.value);
|
|
1467
|
+
this._setCaption(this.value);
|
|
1468
|
+
this._calendarService.loadMonthByDate(this.value);
|
|
1469
|
+
}
|
|
1470
|
+
else {
|
|
1471
|
+
this.timeValue = FdDate.getFdDateByDate(new Date());
|
|
1472
|
+
}
|
|
1473
|
+
// if (this.isRangePicker) {
|
|
1474
|
+
// if (this.startRangeDate) {
|
|
1475
|
+
// this._calendarService.loadMonthByDate(this.startRangeDate);
|
|
1476
|
+
// }
|
|
1477
|
+
// if (this.endRangeDate) {
|
|
1478
|
+
// }
|
|
1479
|
+
// } else {
|
|
1480
|
+
// this._calendarService.loadMonthByDate(this.value);
|
|
1481
|
+
// }
|
|
1482
|
+
this.months = this._calendarService.Months;
|
|
1483
|
+
this._prepareYear(this._calendarService.selectedMonth.dateInfo.year);
|
|
1484
|
+
}
|
|
1485
|
+
onOpenPopover(popover) {
|
|
1486
|
+
if (this.readonly || this.disabled) {
|
|
1487
|
+
return;
|
|
1488
|
+
}
|
|
1489
|
+
if (this.timeComponent) {
|
|
1490
|
+
setTimeout(() => this.timeComponent.refreshColumns(), 0);
|
|
1491
|
+
}
|
|
1492
|
+
popover.open();
|
|
1493
|
+
}
|
|
1494
|
+
onMonthSelected(monthName, index) {
|
|
1495
|
+
this._calendarService.gotoMonth(monthName, index);
|
|
1496
|
+
}
|
|
1497
|
+
onYearSelected(year) {
|
|
1498
|
+
this._calendarService.gotoYear(+year);
|
|
1499
|
+
}
|
|
1500
|
+
onCaptionChanged(e) {
|
|
1501
|
+
if (e.length < 10) {
|
|
1502
|
+
return;
|
|
1503
|
+
}
|
|
1504
|
+
const englishDateStr = BarsaApi.Common.Util.ReplaceFaToArCharchter(e);
|
|
1505
|
+
const moment = this._calendarService._dateService.stringToMoment(englishDateStr, 'jYYYY/jM/jD');
|
|
1506
|
+
const isValid = moment.isValid();
|
|
1507
|
+
const date = moment.toDate();
|
|
1508
|
+
if (isValid) {
|
|
1509
|
+
this.startSelectedDay = this.endSelectedDay = null;
|
|
1510
|
+
this._raisValueChanged(date, false);
|
|
1511
|
+
}
|
|
1512
|
+
this.isValid = isValid;
|
|
1513
|
+
}
|
|
1514
|
+
onPrevTap() {
|
|
1515
|
+
if (this.selectionMode === 'day') {
|
|
1516
|
+
this._calendarService.loadPrevious();
|
|
1517
|
+
}
|
|
1518
|
+
else if (this.selectionMode === 'month') {
|
|
1519
|
+
this._calendarService.loadPrevYear();
|
|
1520
|
+
}
|
|
1521
|
+
else if (this.selectionMode === 'year') {
|
|
1522
|
+
this._prepareYear(Number(this.years[0]) - 20);
|
|
1523
|
+
}
|
|
1524
|
+
}
|
|
1525
|
+
onNextTap() {
|
|
1526
|
+
if (this.selectionMode === 'day') {
|
|
1527
|
+
this._calendarService.loadNext();
|
|
1528
|
+
}
|
|
1529
|
+
else if (this.selectionMode === 'month') {
|
|
1530
|
+
this._calendarService.loadNextYear();
|
|
1531
|
+
}
|
|
1532
|
+
else if (this.selectionMode === 'year') {
|
|
1533
|
+
this._prepareYear(Number(this.years[this.years.length - 1]) + 1);
|
|
1534
|
+
}
|
|
1535
|
+
}
|
|
1536
|
+
onToday() {
|
|
1537
|
+
const today = new Date();
|
|
1538
|
+
this.timeValue = this._datetimeAdapter.setTime(this.timeValue, today.getHours(), today.getMinutes(), today.getSeconds());
|
|
1539
|
+
if (this._calendarService.todayDay) {
|
|
1540
|
+
this.startSelectedDay = this._calendarService.todayDay;
|
|
1541
|
+
}
|
|
1542
|
+
this._calendarService.gotoToday();
|
|
1543
|
+
}
|
|
1544
|
+
onDayClick(day, popover) {
|
|
1545
|
+
this.isValid = true;
|
|
1546
|
+
this.startSelectedDay = this.endSelectedDay = day;
|
|
1547
|
+
if (this.showTime) {
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
this._setFirstAndEndDay(day, popover);
|
|
1551
|
+
}
|
|
1552
|
+
onPopoverOpenChange(isOpen) {
|
|
1553
|
+
if (isOpen) {
|
|
1554
|
+
this._lastValue = this.value;
|
|
1555
|
+
}
|
|
1556
|
+
else {
|
|
1557
|
+
this._lastValue = undefined;
|
|
1558
|
+
}
|
|
1559
|
+
}
|
|
1560
|
+
onOk(popover) {
|
|
1561
|
+
var _a, _b, _c, _d, _e;
|
|
1562
|
+
popover.close();
|
|
1563
|
+
this.value = this.showDate ? (_b = (_a = this.startSelectedDay) === null || _a === void 0 ? void 0 : _a.date) !== null && _b !== void 0 ? _b : this.value : new Date();
|
|
1564
|
+
(_c = this.value) === null || _c === void 0 ? void 0 : _c.setHours(this.timeValue.hour);
|
|
1565
|
+
(_d = this.value) === null || _d === void 0 ? void 0 : _d.setMinutes(this.timeValue.minute);
|
|
1566
|
+
(_e = this.value) === null || _e === void 0 ? void 0 : _e.setSeconds(this.timeValue.second);
|
|
1567
|
+
this._raisValueChanged(this.value);
|
|
1568
|
+
}
|
|
1569
|
+
onCancel(popover) {
|
|
1570
|
+
if (this._lastValue !== this.value) {
|
|
1571
|
+
this.value = this._lastValue;
|
|
1572
|
+
this._setCaption(this.value);
|
|
1573
|
+
}
|
|
1574
|
+
popover.close();
|
|
1575
|
+
}
|
|
1576
|
+
_prepareYear(from) {
|
|
1577
|
+
const years = [];
|
|
1578
|
+
for (let i = 0; i < 20; i++) {
|
|
1579
|
+
years.push(`${from + i}`);
|
|
1580
|
+
}
|
|
1581
|
+
this.years = years;
|
|
1582
|
+
}
|
|
1583
|
+
_setCaption(value) {
|
|
1584
|
+
if (!value) {
|
|
1585
|
+
this.valueCaption = '';
|
|
1586
|
+
return;
|
|
1587
|
+
}
|
|
1588
|
+
let formatPattern = this.formatPattern.replace('YYYY', 'jYYYY');
|
|
1589
|
+
formatPattern = formatPattern.replace('MM', 'jMM');
|
|
1590
|
+
formatPattern = formatPattern.replace('DD', 'jDD');
|
|
1591
|
+
this.valueCaption = this._calendarService._dateService.getMoment(value).format(formatPattern);
|
|
1592
|
+
}
|
|
1593
|
+
_raisValueChanged(date, setCaption = true) {
|
|
1594
|
+
this.value = date;
|
|
1595
|
+
if (setCaption) {
|
|
1596
|
+
this._setCaption(date);
|
|
1597
|
+
}
|
|
1598
|
+
this.valueChange.emit(date);
|
|
1599
|
+
}
|
|
1600
|
+
_setFirstAndEndDay(day, popover) {
|
|
1601
|
+
if (popover) {
|
|
1602
|
+
popover.close();
|
|
1603
|
+
}
|
|
1604
|
+
if (!this.isRangePicker) {
|
|
1605
|
+
this._raisValueChanged(day.date);
|
|
1606
|
+
return;
|
|
1607
|
+
}
|
|
1608
|
+
if (this.startSelectedDay) {
|
|
1609
|
+
this.endSelectedDay = day;
|
|
1610
|
+
}
|
|
1611
|
+
else {
|
|
1612
|
+
this.startSelectedDay = day;
|
|
1613
|
+
}
|
|
1614
|
+
if (this.startSelectedDay && this.endSelectedDay && this.startSelectedDay.date > this.endSelectedDay.date) {
|
|
1615
|
+
const temp = this.startSelectedDay;
|
|
1616
|
+
this.startSelectedDay = this.endSelectedDay;
|
|
1617
|
+
this.endSelectedDay = temp;
|
|
1618
|
+
}
|
|
1619
|
+
if (this.startSelectedDay && this.endSelectedDay) {
|
|
1620
|
+
this.rangeChange.emit({
|
|
1621
|
+
startDay: this.startSelectedDay.date,
|
|
1622
|
+
endDay: this.endSelectedDay.date
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
}
|
|
1627
|
+
DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: i2$3.DatetimeAdapter }, { token: i2.LogService }, { token: i2.PortalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1628
|
+
DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: DateTimePickerComponent, selector: "bc-date-time-picker", inputs: { placeholder: "placeholder", primaryCalendarType: "primaryCalendarType", formatPattern: "formatPattern", value: "value", timeValue: "timeValue", startRangeDate: "startRangeDate", endRangeDate: "endRangeDate", isRangePicker: "isRangePicker", showTime: "showTime", showDate: "showDate", rtl: "rtl", readonly: "readonly", disabled: "disabled" }, outputs: { rangeChange: "rangeChange", valueChange: "valueChange" }, providers: [
|
|
1629
|
+
{
|
|
1630
|
+
provide: DatetimeAdapter,
|
|
1631
|
+
useClass: FdDatetimeAdapter
|
|
1632
|
+
},
|
|
1633
|
+
{
|
|
1634
|
+
provide: TimeI18n,
|
|
1635
|
+
useClass: TimeConfigI18n
|
|
1636
|
+
},
|
|
1637
|
+
{
|
|
1638
|
+
provide: DateService,
|
|
1639
|
+
useFactory: getDateService
|
|
1640
|
+
},
|
|
1641
|
+
CalendarService
|
|
1642
|
+
], viewQueries: [{ propertyName: "timeComponent", first: true, predicate: TimeComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<fd-input-group\n placement=\"after\"\n glyph=\"calendar\"\n glyphAriaLabel=\"select day\"\n [placeholder]=\"placeholder\"\n ariaLabelledby=\"fd-input-group-icon-label-2\"\n [button]=\"true\"\n [state]=\"isValid ? 'success' : 'error'\"\n [showFocus]=\"true\"\n (addOnButtonClicked)=\"onOpenPopover(popover)\"\n [ngModel]=\"value | dateTimeToCaption: formatPattern:culture:showDate:showTime\"\n (ngModelChange)=\"onCaptionChanged($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n>\n</fd-input-group>\n<fd-popover\n #popover\n (isOpenChange)=\"onPopoverOpenChange($event)\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [mobile]=\"(deviceSize$ | async) === 's'\"\n>\n <fd-popover-body [style.width.px]=\"width$ | async\">\n <ng-container\n *ngTemplateOutlet=\"\n month;\n context: {\n $implicit: selectedMonth$ | async,\n width: width$ | async,\n height: height,\n rtl: rtl$ | async,\n weekDays: weekDays,\n weekDaysMin: weekDaysMin,\n today: today,\n deviceSize: deviceSize$ | async,\n popover: popover\n }\n \"\n >\n </ng-container>\n <div fd-popover-body-footer *ngIf=\"showTime\">\n <div fd-bar [barDesign]=\"'footer'\">\n <div fd-bar-left *ngIf=\"rtl\">\n <container *ngTemplateOutlet=\"footerButtons\"></container>\n </div>\n <div fd-bar-right *ngIf=\"!rtl\">\n <container *ngTemplateOutlet=\"footerButtons\"></container>\n </div>\n </div>\n </div>\n </fd-popover-body>\n</fd-popover>\n<ng-template #footerButtons>\n <fd-button-bar [label]=\"'Cancel' | bbbTranslate\" (click)=\"onCancel(popover)\"></fd-button-bar>\n <fd-button-bar [label]=\"'Ok' | bbbTranslate\" fdType=\"emphasized\" (click)=\"onOk(popover)\"></fd-button-bar>\n</ng-template>\n<ng-template\n #month\n let-selectedMonth\n let-width=\"width\"\n let-height=\"height\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-popover=\"popover\"\n>\n <fd-toolbar [fdType]=\"'transparent'\">\n <button\n fd-button\n fd-toolbar-item\n [label]=\"(showDate ? 'DateR_Today' : 'Now') | bbbTranslate\"\n (click)=\"onToday()\"\n ></button>\n <button\n *ngIf=\"showDate\"\n fd-button\n fd-toolbar-item\n [fdType]=\"'transparent'\"\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\n (click)=\"onPrevTap()\"\n ></button>\n <button\n *ngIf=\"showDate\"\n fd-button\n fd-toolbar-item\n [fdType]=\"'transparent'\"\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\n (click)=\"onNextTap()\"\n ></button>\n <div class=\"month-years-wrapper\" *ngIf=\"showDate\" fd-title fd-toolbar-item>\n <button\n *ngIf=\"selectionMode === 'day' || selectionMode === 'month'\"\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.monthName\"\n (click)=\"selectionMode = 'month'\"\n ></button>\n <button\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.year\"\n (click)=\"selectionMode = 'year'\"\n ></button>\n </div>\n </fd-toolbar>\n <div style=\"display: flex\">\n <ng-container [ngSwitch]=\"selectionMode\">\n <ng-container *ngSwitchCase=\"'month'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 33%\"\n *ngFor=\"let month of months; let i = index\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.monthName === month ? 'emphasized' : 'transparent'\"\n [label]=\"month\"\n (click)=\"selectionMode = 'day'; onMonthSelected(month, i)\"\n ></button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 25%\"\n *ngFor=\"let year of years\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.year === +year ? 'emphasized' : 'transparent'\"\n [label]=\"year\"\n (click)=\"selectionMode = 'day'; onYearSelected(year)\"\n ></button>\n </div>\n </ng-container>\n <div *ngSwitchDefault style=\"display: flex\">\n <bc-calendar-month\n *ngIf=\"showDate\"\n [style.width]=\"width\"\n [containerHeight]=\"height\"\n [containerWidth]=\"width\"\n [rtl]=\"rtl\"\n [monthWeeksCount]=\"selectedMonth.weeksCount\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [datePicker]=\"true\"\n [dateRange]=\"true\"\n [selectedDate]=\"startSelectedDay ? startSelectedDay.date : value\"\n [days]=\"selectedMonth.days\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event, popover)\"\n ></bc-calendar-month>\n <div class=\"seperator\"></div>\n <fd-time\n *ngIf=\"showTime\"\n [(ngModel)]=\"timeValue\"\n [compact]=\"(deviceSize$ | async) !== 's'\"\n [displaySeconds]=\"false\"\n ></fd-time>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{display:block}fd-popover{display:block}fd-input-group ::ng-deep input{direction:ltr}fd-time ::ng-deep .fd-time{padding-top:0}.seperator{border-left:.0625rem solid var(--sapPageFooter_BorderColor, #d9d9d9)}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i4$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i2$2.BarComponent, selector: "[fd-bar]", inputs: ["class", "barDesign", "inPage", "inHomePage", "size"] }, { kind: "directive", type: i2$2.BarLeftDirective, selector: "[fd-bar-left]" }, { kind: "directive", type: i2$2.BarRightDirective, selector: "[fd-bar-right]" }, { kind: "component", type: i2$2.ButtonBarComponent, selector: "fd-button-bar", inputs: ["fullWidth", "fdType", "title", "ariaLabel", "ariaLabelledby", "id"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "component", type: i7$1.InputGroupComponent, selector: "fd-input-group", inputs: ["inputTemplate", "placement", "required", "inline", "placeholder", "addOnText", "buttonFocusable", "type", "glyph", "button", "disabled", "readonly", "state", "isControl", "showFocus", "isExpanded", "glyphAriaLabel", "iconTitle", "ariaLabelledby", "ariaLabelledBy"], outputs: ["addOnButtonClicked", "search"] }, { kind: "component", type: i5$1.PopoverBodyComponent, selector: "fd-popover-body" }, { kind: "directive", type: i5$1.PopoverBodyFooterDirective, selector: "[fdPopoverBodyFooter], [fd-popover-body-footer]" }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i9.TimeComponent, selector: "fd-time", inputs: ["meridian", "validate", "keepTwoDigits", "disabled", "displaySeconds", "displayMinutes", "displayHours", "tablet", "elementsAtOnce", "time", "spinnerButtons"] }, { kind: "directive", type: i9.DeprecatedTimeContentDensityDirective, selector: "fd-time-column[compact], fd-time[compact]" }, { kind: "component", type: i6.ToolbarComponent, selector: "fd-toolbar", inputs: ["class", "shouldOverflow", "fdType", "hasTitle", "title", "active", "clearBorder", "forceOverflow", "tabindex"] }, { kind: "directive", type: i6.ToolbarItemDirective, selector: "[fd-toolbar-item]" }, { kind: "component", type: CalendarMonthComponent, selector: "bc-calendar-month", inputs: ["monthWeeksCount", "weekDays", "weekDaysMin", "today", "containerHeight", "days", "calendarFields", "rtl", "deviceSize", "moDataList", "datePicker", "rangePicker", "canDelete", "canAdd", "canEdit", "selectedDate", "startSelectedDayIndex", "endSelectedDayIndex"], outputs: ["editEvent", "deleteEvent", "daySelect", "dayClick", "dayMouseMove", "dayMouseUp", "dayMouseDown", "showEvent"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.BbbTranslatePipe, name: "bbbTranslate" }, { kind: "pipe", type: i2.DateTimeToCaptionPipe, name: "dateTimeToCaption" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: DateTimePickerComponent, decorators: [{
|
|
1644
|
+
type: Component,
|
|
1645
|
+
args: [{ selector: 'bc-date-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1646
|
+
{
|
|
1647
|
+
provide: DatetimeAdapter,
|
|
1648
|
+
useClass: FdDatetimeAdapter
|
|
1649
|
+
},
|
|
1650
|
+
{
|
|
1651
|
+
provide: TimeI18n,
|
|
1652
|
+
useClass: TimeConfigI18n
|
|
1653
|
+
},
|
|
1654
|
+
{
|
|
1655
|
+
provide: DateService,
|
|
1656
|
+
useFactory: getDateService
|
|
1657
|
+
},
|
|
1658
|
+
CalendarService
|
|
1659
|
+
], template: "<fd-input-group\n placement=\"after\"\n glyph=\"calendar\"\n glyphAriaLabel=\"select day\"\n [placeholder]=\"placeholder\"\n ariaLabelledby=\"fd-input-group-icon-label-2\"\n [button]=\"true\"\n [state]=\"isValid ? 'success' : 'error'\"\n [showFocus]=\"true\"\n (addOnButtonClicked)=\"onOpenPopover(popover)\"\n [ngModel]=\"value | dateTimeToCaption: formatPattern:culture:showDate:showTime\"\n (ngModelChange)=\"onCaptionChanged($event)\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n>\n</fd-input-group>\n<fd-popover\n #popover\n (isOpenChange)=\"onPopoverOpenChange($event)\"\n [focusTrapped]=\"true\"\n [focusAutoCapture]=\"true\"\n [mobile]=\"(deviceSize$ | async) === 's'\"\n>\n <fd-popover-body [style.width.px]=\"width$ | async\">\n <ng-container\n *ngTemplateOutlet=\"\n month;\n context: {\n $implicit: selectedMonth$ | async,\n width: width$ | async,\n height: height,\n rtl: rtl$ | async,\n weekDays: weekDays,\n weekDaysMin: weekDaysMin,\n today: today,\n deviceSize: deviceSize$ | async,\n popover: popover\n }\n \"\n >\n </ng-container>\n <div fd-popover-body-footer *ngIf=\"showTime\">\n <div fd-bar [barDesign]=\"'footer'\">\n <div fd-bar-left *ngIf=\"rtl\">\n <container *ngTemplateOutlet=\"footerButtons\"></container>\n </div>\n <div fd-bar-right *ngIf=\"!rtl\">\n <container *ngTemplateOutlet=\"footerButtons\"></container>\n </div>\n </div>\n </div>\n </fd-popover-body>\n</fd-popover>\n<ng-template #footerButtons>\n <fd-button-bar [label]=\"'Cancel' | bbbTranslate\" (click)=\"onCancel(popover)\"></fd-button-bar>\n <fd-button-bar [label]=\"'Ok' | bbbTranslate\" fdType=\"emphasized\" (click)=\"onOk(popover)\"></fd-button-bar>\n</ng-template>\n<ng-template\n #month\n let-selectedMonth\n let-width=\"width\"\n let-height=\"height\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-popover=\"popover\"\n>\n <fd-toolbar [fdType]=\"'transparent'\">\n <button\n fd-button\n fd-toolbar-item\n [label]=\"(showDate ? 'DateR_Today' : 'Now') | bbbTranslate\"\n (click)=\"onToday()\"\n ></button>\n <button\n *ngIf=\"showDate\"\n fd-button\n fd-toolbar-item\n [fdType]=\"'transparent'\"\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\n (click)=\"onPrevTap()\"\n ></button>\n <button\n *ngIf=\"showDate\"\n fd-button\n fd-toolbar-item\n [fdType]=\"'transparent'\"\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\n (click)=\"onNextTap()\"\n ></button>\n <div class=\"month-years-wrapper\" *ngIf=\"showDate\" fd-title fd-toolbar-item>\n <button\n *ngIf=\"selectionMode === 'day' || selectionMode === 'month'\"\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.monthName\"\n (click)=\"selectionMode = 'month'\"\n ></button>\n <button\n fd-button\n [fdType]=\"'transparent'\"\n [label]=\"selectedMonth.dateInfo.year\"\n (click)=\"selectionMode = 'year'\"\n ></button>\n </div>\n </fd-toolbar>\n <div style=\"display: flex\">\n <ng-container [ngSwitch]=\"selectionMode\">\n <ng-container *ngSwitchCase=\"'month'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 33%\"\n *ngFor=\"let month of months; let i = index\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.monthName === month ? 'emphasized' : 'transparent'\"\n [label]=\"month\"\n (click)=\"selectionMode = 'day'; onMonthSelected(month, i)\"\n ></button>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <div class=\"month-year-selection-wrapper\">\n <button\n style=\"flex-grow: 1; width: 25%\"\n *ngFor=\"let year of years\"\n fd-button\n [fdType]=\"selectedMonth.dateInfo.year === +year ? 'emphasized' : 'transparent'\"\n [label]=\"year\"\n (click)=\"selectionMode = 'day'; onYearSelected(year)\"\n ></button>\n </div>\n </ng-container>\n <div *ngSwitchDefault style=\"display: flex\">\n <bc-calendar-month\n *ngIf=\"showDate\"\n [style.width]=\"width\"\n [containerHeight]=\"height\"\n [containerWidth]=\"width\"\n [rtl]=\"rtl\"\n [monthWeeksCount]=\"selectedMonth.weeksCount\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [datePicker]=\"true\"\n [dateRange]=\"true\"\n [selectedDate]=\"startSelectedDay ? startSelectedDay.date : value\"\n [days]=\"selectedMonth.days\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event, popover)\"\n ></bc-calendar-month>\n <div class=\"seperator\"></div>\n <fd-time\n *ngIf=\"showTime\"\n [(ngModel)]=\"timeValue\"\n [compact]=\"(deviceSize$ | async) !== 's'\"\n [displaySeconds]=\"false\"\n ></fd-time>\n </div>\n </ng-container>\n </div>\n</ng-template>\n", styles: [":host{display:block}fd-popover{display:block}fd-input-group ::ng-deep input{direction:ltr}fd-time ::ng-deep .fd-time{padding-top:0}.seperator{border-left:.0625rem solid var(--sapPageFooter_BorderColor, #d9d9d9)}\n"] }]
|
|
1660
|
+
}], ctorParameters: function () { return [{ type: i2$3.DatetimeAdapter }, { type: i2.LogService }, { type: i2.PortalService }]; }, propDecorators: { placeholder: [{
|
|
1661
|
+
type: Input
|
|
1662
|
+
}], primaryCalendarType: [{
|
|
1663
|
+
type: Input
|
|
1664
|
+
}], formatPattern: [{
|
|
1665
|
+
type: Input
|
|
1666
|
+
}], value: [{
|
|
1667
|
+
type: Input
|
|
1668
|
+
}], timeValue: [{
|
|
1669
|
+
type: Input
|
|
1670
|
+
}], startRangeDate: [{
|
|
1671
|
+
type: Input
|
|
1672
|
+
}], endRangeDate: [{
|
|
1673
|
+
type: Input
|
|
1674
|
+
}], isRangePicker: [{
|
|
1675
|
+
type: Input
|
|
1676
|
+
}], showTime: [{
|
|
1677
|
+
type: Input
|
|
1678
|
+
}], showDate: [{
|
|
1679
|
+
type: Input
|
|
1680
|
+
}], rtl: [{
|
|
1681
|
+
type: Input
|
|
1682
|
+
}], readonly: [{
|
|
1683
|
+
type: Input
|
|
1684
|
+
}], disabled: [{
|
|
1685
|
+
type: Input
|
|
1686
|
+
}], rangeChange: [{
|
|
1687
|
+
type: Output
|
|
1688
|
+
}], valueChange: [{
|
|
1689
|
+
type: Output
|
|
1690
|
+
}], timeComponent: [{
|
|
1691
|
+
type: ViewChild,
|
|
1692
|
+
args: [TimeComponent]
|
|
1693
|
+
}] } });
|
|
1694
|
+
|
|
1695
|
+
class MonthDaysComponent extends BaseComponent {
|
|
1696
|
+
constructor(daysInWeek, _cdr, _calendarService) {
|
|
1697
|
+
super();
|
|
1698
|
+
this.daysInWeek = daysInWeek;
|
|
1699
|
+
this._cdr = _cdr;
|
|
1700
|
+
this._calendarService = _calendarService;
|
|
1701
|
+
this.datePicker = false;
|
|
1702
|
+
this.rangePicker = false;
|
|
1703
|
+
this.editEvent = new EventEmitter();
|
|
1704
|
+
this.deleteEvent = new EventEmitter();
|
|
1705
|
+
this.daySelect = new EventEmitter();
|
|
1706
|
+
this.dayClick = new EventEmitter();
|
|
1707
|
+
this.dayMouseMove = new EventEmitter();
|
|
1708
|
+
this.dayMouseUp = new EventEmitter();
|
|
1709
|
+
this.dayMouseDown = new EventEmitter();
|
|
1710
|
+
this.showEvent = new EventEmitter();
|
|
1711
|
+
this.taskHeight = 30;
|
|
1712
|
+
this._hasPopoverOpened = [];
|
|
1713
|
+
}
|
|
1714
|
+
ngOnChanges(changes) {
|
|
1715
|
+
super.ngOnChanges(changes);
|
|
1716
|
+
if (changes.containerHeight && !changes.containerHeight.firstChange) {
|
|
1717
|
+
this.fitToContainer(changes.containerHeight.currentValue);
|
|
1718
|
+
}
|
|
1719
|
+
if (changes.deviceSize && !changes.deviceSize.firstChange) {
|
|
1720
|
+
this.prepareWeekDays(changes.deviceSize.currentValue);
|
|
1721
|
+
}
|
|
1722
|
+
if (changes.moDataList && !changes.moDataList.firstChange) {
|
|
1723
|
+
this._prepareDaysTasks(changes.moDataList.currentValue);
|
|
1724
|
+
this._cdr.detectChanges();
|
|
1725
|
+
}
|
|
1726
|
+
if (changes.monthInfo && !changes.monthInfo.firstChange) {
|
|
1727
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1728
|
+
this._cdr.detectChanges();
|
|
1729
|
+
}
|
|
1730
|
+
if (changes.monthWeeksCount && !changes.monthWeeksCount.firstChange) {
|
|
1731
|
+
this.fitToContainer(this.containerHeight);
|
|
1732
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1733
|
+
this._cdr.detectChanges();
|
|
1734
|
+
}
|
|
1735
|
+
}
|
|
1736
|
+
ngOnInit() {
|
|
1737
|
+
super.ngOnInit();
|
|
1738
|
+
this.isPickerMode = this.datePicker || this.rangePicker;
|
|
1739
|
+
this.prepareWeekDays(this.deviceSize);
|
|
1740
|
+
this._prepareDaysTasks(this.moDataList);
|
|
1741
|
+
this.fitToContainer(this.containerHeight);
|
|
1742
|
+
}
|
|
1743
|
+
onDayBoxSelect(day) {
|
|
1744
|
+
this._fireDaySelect(day);
|
|
1745
|
+
}
|
|
1746
|
+
onDaySelect(weekIndex, dayIndex) {
|
|
1747
|
+
const day = this.days[weekIndex * 7 + dayIndex];
|
|
1748
|
+
this._fireDaySelect(day);
|
|
1749
|
+
}
|
|
1750
|
+
onOpenPopoverChange(isOpen) {
|
|
1751
|
+
this._openPopover(isOpen);
|
|
1752
|
+
}
|
|
1753
|
+
onMoreButton(e, popover) {
|
|
1754
|
+
this._preventEvent(e);
|
|
1755
|
+
popover.open();
|
|
1756
|
+
}
|
|
1757
|
+
onTask(e, task) {
|
|
1758
|
+
this.showEvent.emit(task);
|
|
1759
|
+
}
|
|
1760
|
+
onDayClick(day) {
|
|
1761
|
+
this.selected = day;
|
|
1762
|
+
this.dayClick.emit(day);
|
|
1763
|
+
}
|
|
1764
|
+
onDayMouseMove(day) {
|
|
1765
|
+
this.dayMouseMove.emit(day);
|
|
1766
|
+
}
|
|
1767
|
+
onDayMouseDown(day) {
|
|
1768
|
+
this.dayMouseDown.emit(day);
|
|
1769
|
+
}
|
|
1770
|
+
onDayMouseUp(day) {
|
|
1771
|
+
this.dayMouseUp.emit(day);
|
|
1772
|
+
}
|
|
1773
|
+
_preventEvent(e) {
|
|
1774
|
+
e.stopPropagation();
|
|
1775
|
+
e.preventDefault();
|
|
1776
|
+
}
|
|
1777
|
+
_fireDaySelect(day) {
|
|
1778
|
+
if (this._hasPopoverOpened.length === 0) {
|
|
1779
|
+
this.daySelect.emit(moment(day.date));
|
|
1780
|
+
}
|
|
1781
|
+
}
|
|
1782
|
+
_openPopover(isOpen) {
|
|
1783
|
+
if (isOpen) {
|
|
1784
|
+
this._hasPopoverOpened.push(true);
|
|
1785
|
+
}
|
|
1786
|
+
else {
|
|
1787
|
+
setTimeout(() => {
|
|
1788
|
+
this._hasPopoverOpened = [];
|
|
1789
|
+
}, 0);
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
prepareWeekDays(deviceSize) {
|
|
1793
|
+
if (deviceSize !== 's' && deviceSize !== 'm') {
|
|
1794
|
+
this.selectedWeekDays = this.weekDays;
|
|
1795
|
+
}
|
|
1796
|
+
else {
|
|
1797
|
+
this.selectedWeekDays = this.weekDaysMin;
|
|
1798
|
+
}
|
|
1799
|
+
}
|
|
1800
|
+
fitToContainer(containerHeight) {
|
|
1801
|
+
var _a;
|
|
1802
|
+
let _weeksCount;
|
|
1803
|
+
let _firstWeekIndex;
|
|
1804
|
+
if (((_a = this.monthWeeksCount) === null || _a === void 0 ? void 0 : _a.weeksCount) > 0) {
|
|
1805
|
+
const { weeksCount, firstWeekIndex } = this.monthWeeksCount;
|
|
1806
|
+
_weeksCount = weeksCount;
|
|
1807
|
+
_firstWeekIndex = firstWeekIndex;
|
|
1808
|
+
}
|
|
1809
|
+
else {
|
|
1810
|
+
_weeksCount = this.days.length / 7;
|
|
1811
|
+
_firstWeekIndex = 0;
|
|
1812
|
+
}
|
|
1813
|
+
this.numberOfWeek = Array.from(Array(_weeksCount).keys());
|
|
1814
|
+
this.numberOfWeek = this.numberOfWeek.map((value) => value + _firstWeekIndex);
|
|
1815
|
+
if (this.isPickerMode) {
|
|
1816
|
+
this.dayHeight = 40;
|
|
1817
|
+
return;
|
|
1818
|
+
}
|
|
1819
|
+
this.dayHeight = Math.floor(containerHeight / _weeksCount) + 1;
|
|
1820
|
+
this.maxTaskCount = Math.floor((this.dayHeight - this.taskHeight) / this.taskHeight);
|
|
1821
|
+
this.maxRowTasks = new Array(this.maxTaskCount).fill(0).map((x, i) => i);
|
|
1822
|
+
}
|
|
1823
|
+
_prepareDaysTasks(calendarTasks) {
|
|
1824
|
+
if (this.isPickerMode) {
|
|
1825
|
+
this.weekTasksArray = {};
|
|
1826
|
+
return;
|
|
1827
|
+
}
|
|
1828
|
+
const calendarFields = this.calendarFields;
|
|
1829
|
+
// Sort all Tasks
|
|
1830
|
+
const moDataList = this._calendarService.sortTasks(calendarTasks, calendarFields);
|
|
1831
|
+
this.days.forEach((day) => (day.tasks = []));
|
|
1832
|
+
const weekTasksArray = [];
|
|
1833
|
+
for (let j = 0; j < this.days.length / 7; j++) {
|
|
1834
|
+
const days = this.daysInWeek.transform(this.days, j);
|
|
1835
|
+
const week = this._calendarService.createWeekTask(days, moDataList, calendarFields, 0);
|
|
1836
|
+
weekTasksArray.push(week);
|
|
1837
|
+
}
|
|
1838
|
+
weekTasksArray.forEach((week) => {
|
|
1839
|
+
const arr = Object.values(week);
|
|
1840
|
+
for (let i = arr.length; i < this.maxTaskCount; i++) {
|
|
1841
|
+
week[i.toString()] = [];
|
|
1842
|
+
}
|
|
1843
|
+
});
|
|
1844
|
+
// به ازای هر ردیف تسک باید تعداد 7 ستون اضافه گردد و برای ستونی که تسکی ندارد یک جای خالی colspan 1 میگذاریم
|
|
1845
|
+
weekTasksArray.forEach((week) => {
|
|
1846
|
+
this._calendarService.fillWeek(week);
|
|
1847
|
+
});
|
|
1848
|
+
this.weekTasksArray = weekTasksArray;
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
MonthDaysComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MonthDaysComponent, deps: [{ token: DaysInWeekPipe }, { token: i0.ChangeDetectorRef }, { token: CalendarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1852
|
+
MonthDaysComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: MonthDaysComponent, selector: "bc-month-days", inputs: { monthWeeksCount: "monthWeeksCount", weekDays: "weekDays", weekDaysMin: "weekDaysMin", today: "today", containerHeight: "containerHeight", days: "days", calendarFields: "calendarFields", rtl: "rtl", deviceSize: "deviceSize", moDataList: "moDataList", datePicker: "datePicker", rangePicker: "rangePicker", startSelectedDayIndex: "startSelectedDayIndex", endSelectedDayIndex: "endSelectedDayIndex" }, outputs: { editEvent: "editEvent", deleteEvent: "deleteEvent", daySelect: "daySelect", dayClick: "dayClick", dayMouseMove: "dayMouseMove", dayMouseUp: "dayMouseUp", dayMouseDown: "dayMouseDown", showEvent: "showEvent" }, usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<table fd-table class=\"table-header\" [compact]=\"true\">\r\n <thead fd-table-header>\r\n <tr fd-table-row>\r\n <th\r\n class=\"weekday-header\"\r\n *ngFor=\"let weekDay of selectedWeekDays\"\r\n fd-table-cell\r\n [class.noborder]=\"isPickerMode\"\r\n >\r\n {{ weekDay }}\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody fd-table-body>\r\n <ng-container *ngFor=\"let weekDay of numberOfWeek\">\r\n <tr fd-table-row>\r\n <td\r\n [style.height.px]=\"dayHeight\"\r\n fd-table-cell\r\n colspan=\"7\"\r\n [style.border]=\"isPickerMode ? 'none' : null\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n renderTasks;\r\n context: {\r\n $implicit: isPickerMode ? null : moDataList[weekDay],\r\n weekIndex: weekDay,\r\n days: days | daysInWeek: weekDay,\r\n maxRowTasks: maxRowTasks,\r\n weekDays: weekDays,\r\n calendarFields: calendarFields,\r\n rtl: rtl,\r\n isPickerMode: isPickerMode\r\n }\r\n \"\r\n ></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n</table>\r\n<ng-template\r\n #renderTasks\r\n let-task\r\n let-weekIndex=\"weekIndex\"\r\n let-weekDays=\"weekDays\"\r\n let-days=\"days\"\r\n let-maxRowTasks=\"maxRowTasks\"\r\n let-calendarFields=\"calendarFields\"\r\n let-deviceSize=\"deviceSize\"\r\n let-rtl=\"rtl\"\r\n let-isPickerMode=\"isPickerMode\"\r\n>\r\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\r\n <tbody>\r\n <tr fd-table-row class=\"row-day-number\">\r\n <td fd-table-cell *ngFor=\"let day of days | daysInWeek: weekIndex\" [class.noborder]=\"isPickerMode\">\r\n <bc-day-number-box\r\n [class.fd-calendar__item]=\"isPickerMode\"\r\n [class.fd-calendar__item--other-month]=\"isPickerMode && !day.isInMonth\"\r\n [class.fd-calendar__item--weekend]=\"isPickerMode && day.isWeekend\"\r\n [isPickerMode]=\"isPickerMode\"\r\n [day]=\"day\"\r\n [class.is-active]=\"day.index === startSelectedDayIndex || day.index === endSelectedDayIndex\"\r\n [class.fd-calendar__item--range]=\"\r\n startSelectedDayIndex &&\r\n endSelectedDayIndex &&\r\n day.index > startSelectedDayIndex &&\r\n day.index < endSelectedDayIndex\r\n \"\r\n (dayClick)=\"onDayClick(day)\"\r\n (dayMouseMove)=\"onDayMouseMove(day)\"\r\n (dayMouseDown)=\"onDayMouseDown(day)\"\r\n (dayMouseUp)=\"onDayMouseUp(day)\"\r\n ></bc-day-number-box>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"!isPickerMode\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n renderDayTasks;\r\n context: {\r\n $implicit: weekTasksArray[weekIndex],\r\n maxRowTasks: maxRowTasks,\r\n weekIndex: weekIndex,\r\n deviceSize: deviceSize,\r\n calendarFields: calendarFields,\r\n weekDays: weekDays\r\n }\r\n \"\r\n ></ng-container>\r\n <tr fd-table-row>\r\n <td fd-table-cell *ngFor=\"let day of days\" class=\"more-fd\" (click)=\"onDayBoxSelect(day)\">\r\n <ng-container *ngIf=\"maxRowTasks.length < day.tasks.length\">\r\n <button\r\n fd-button\r\n (click)=\"onMoreButton($event, popover)\"\r\n [fdType]=\"'transparent'\"\r\n [compact]=\"true\"\r\n >\r\n {{ day.tasks?.length - maxRowTasks.length }}\r\n {{ 'More' | bbbTranslate }}\r\n </button>\r\n <fd-popover\r\n #popover\r\n [mobile]=\"deviceSize === 's'\"\r\n placement=\"bottom\"\r\n [focusTrapped]=\"true\"\r\n [focusAutoCapture]=\"true\"\r\n (isOpenChange)=\"onOpenPopoverChange($event)\"\r\n >\r\n <bc-day-event-list\r\n [day]=\"day\"\r\n [calendarFields]=\"calendarFields\"\r\n [deviceSize]=\"deviceSize\"\r\n [weekDays]=\"weekDays\"\r\n [rtl]=\"rtl\"\r\n [popover]=\"popover\"\r\n (deleteEvent)=\"deleteEvent.emit($event)\"\r\n (editEvent)=\"editEvent.emit($event)\"\r\n ></bc-day-event-list>\r\n </fd-popover>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n</ng-template>\r\n\r\n<ng-template\r\n #renderDayTasks\r\n let-weekTasks\r\n let-maxRowTasks=\"maxRowTasks\"\r\n let-weekIndex=\"weekIndex\"\r\n let-deviceSize=\"deviceSize\"\r\n let-calendarFields=\"calendarFields\"\r\n let-weekDays=\"weekDays\"\r\n>\r\n <tr fd-table-row *ngFor=\"let rowTask of maxRowTasks; let i = index\">\r\n <ng-container *ngIf=\"!weekTasks[i] || weekTasks[i].length === 0\">\r\n <td fd-table-cell *ngFor=\"let day of weekDays\"></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\r\n <td fd-table-cell [attr.colspan]=\"task.colSpan\" *ngIf=\"task.colSpan\">\r\n <ng-container *ngIf=\"task.event; else newDaySelect\">\r\n <bc-event-button\r\n [task]=\"task\"\r\n [rtl]=\"rtl\"\r\n [calendarFields]=\"calendarFields\"\r\n [deviceSize]=\"deviceSize\"\r\n (deleteEvent)=\"deleteEvent.emit($event)\"\r\n (editEvent)=\"editEvent.emit($event)\"\r\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\r\n ></bc-event-button>\r\n </ng-container>\r\n <ng-template #newDaySelect>\r\n <div style=\"width: 100%; height: 100%\" (click)=\"onDaySelect(weekIndex, dayIndex)\"></div>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n</ng-template>\r\n", styles: [":host{display:block}table{table-layout:fixed}.table-header td{padding:0!important}.table-content{width:100%;height:100%;border:none;border-spacing:0}.table-content td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:1.425rem}.table-content .row-day-number td:first-child{border-right:none}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}.weekday-header,.row-day-number td{width:100%}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.more-fd{text-align:center!important}.more-fd button{font-size:12px}.fd-calendar__item{font-size:.875rem;font-size:var(--sapFontSize, .875rem);line-height:1.4;line-height:var(--sapContent_LineHeight, 1.4);color:#32363a;color:var(--sapTextColor, #32363a);font-family:\"72\",\"72full\",Arial,Helvetica,sans-serif;font-family:var(--sapFontFamily, \"72\", \"72full\", Arial, Helvetica, sans-serif);font-weight:400;box-sizing:border-box;padding:0;border:0;overflow:hidden;position:relative;height:2.75rem;margin:.0625rem;min-width:2.125rem;border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem);background-color:#fafafa;background-color:var(--sapLegend_WorkingBackground, #fafafa);flex:1 1 .375rem;border:none!important;padding:1px!important}.fd-calendar__item.fd-calendar__item--other-month{background-color:var(--sapList_Background, #fff)}.fd-calendar__item.fd-calendar__item--weekend{background-color:var(--sapLegend_NotWorkingBackground, #dedede)}.fd-calendar__item.is-active{background-color:var(--sapContent_Selected_Background, #0854a0);border:var(--fdCalendar_Active_Item_Border, none)}.fd-calendar__item.is-active ::ng-deep span{color:var(--sapContent_Selected_TextColor, #fff)}.fd-calendar__item.fd-calendar__item--range{border:.0625rem solid var(--sapList_SelectionBorderColor, #0854a0);background-color:var(--sapList_SelectionBackgroundColor, #e5f0fa)}.noborder{border:none!important}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "directive", type: i4.DeprecatedButtonContentDensityDirective, selector: "[fd-button][compact]" }, { kind: "component", type: i5$1.PopoverComponent, selector: "fd-popover", inputs: ["title", "trigger", "fixedPosition", "id", "mobile", "mobileConfig"] }, { kind: "component", type: i6$1.TableComponent, selector: "table[fd-table]", inputs: ["noBorderX", "noBorderY", "popIn", "responsive", "keys", "allCellsFocusable"], exportAs: ["fd-table"] }, { kind: "directive", type: i6$1.TableHeaderDirective, selector: "[fdTableHeader], [fd-table-header]", inputs: ["noBorderX", "noBorderY"] }, { kind: "directive", type: i6$1.TableBodyDirective, selector: "[fdTableBody], [fd-table-body]", inputs: ["noBorderX", "noBorderY"] }, { kind: "directive", type: i6$1.TableRowDirective, selector: "[fdTableRow], [fd-table-row]", inputs: ["activable", "highlightActive", "hoverable", "focusable", "main", "secondary", "active"] }, { kind: "directive", type: i6$1.TableCellDirective, selector: "[fdTableCell], [fd-table-cell]", inputs: ["noBorderX", "noBorderY", "activable", "focusable", "tabindex", "hoverable", "fitContent", "noPadding", "noData", "key", "cellFocusedEventAnnouncer"] }, { kind: "directive", type: i6$1.DeprecatedTableCompactDirective, selector: "table[fd-table][compact]" }, { kind: "component", type: DayNumberBoxComponent, selector: "bc-day-number-box", inputs: ["isWeekMode", "isSingleDay", "day", "isPickerMode", "itemInRange", "isActive"], outputs: ["dayClick", "dayMouseDown", "dayMouseUp", "dayMouseMove"] }, { kind: "component", type: EventButtonComponent, selector: "bc-event-button", inputs: ["buttonTemplate", "calendarFields", "task", "rtl", "canDelete", "canEdit", "deviceSize"], outputs: ["deleteEvent", "editEvent", "openPopoverChange"] }, { kind: "component", type: DayEventListComponent, selector: "bc-day-event-list", inputs: ["day", "deviceSize", "weekDays", "calendarFields", "rtl", "canDelete", "canEdit", "popover"], outputs: ["deleteEvent", "editEvent", "openPopOver"] }, { kind: "pipe", type: i2.BbbTranslatePipe, name: "bbbTranslate" }, { kind: "pipe", type: DaysInWeekPipe, name: "daysInWeek" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1853
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: MonthDaysComponent, decorators: [{
|
|
1854
|
+
type: Component,
|
|
1855
|
+
args: [{ selector: 'bc-month-days', changeDetection: ChangeDetectionStrategy.OnPush, template: "<table fd-table class=\"table-header\" [compact]=\"true\">\r\n <thead fd-table-header>\r\n <tr fd-table-row>\r\n <th\r\n class=\"weekday-header\"\r\n *ngFor=\"let weekDay of selectedWeekDays\"\r\n fd-table-cell\r\n [class.noborder]=\"isPickerMode\"\r\n >\r\n {{ weekDay }}\r\n </th>\r\n </tr>\r\n </thead>\r\n <tbody fd-table-body>\r\n <ng-container *ngFor=\"let weekDay of numberOfWeek\">\r\n <tr fd-table-row>\r\n <td\r\n [style.height.px]=\"dayHeight\"\r\n fd-table-cell\r\n colspan=\"7\"\r\n [style.border]=\"isPickerMode ? 'none' : null\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n renderTasks;\r\n context: {\r\n $implicit: isPickerMode ? null : moDataList[weekDay],\r\n weekIndex: weekDay,\r\n days: days | daysInWeek: weekDay,\r\n maxRowTasks: maxRowTasks,\r\n weekDays: weekDays,\r\n calendarFields: calendarFields,\r\n rtl: rtl,\r\n isPickerMode: isPickerMode\r\n }\r\n \"\r\n ></ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n</table>\r\n<ng-template\r\n #renderTasks\r\n let-task\r\n let-weekIndex=\"weekIndex\"\r\n let-weekDays=\"weekDays\"\r\n let-days=\"days\"\r\n let-maxRowTasks=\"maxRowTasks\"\r\n let-calendarFields=\"calendarFields\"\r\n let-deviceSize=\"deviceSize\"\r\n let-rtl=\"rtl\"\r\n let-isPickerMode=\"isPickerMode\"\r\n>\r\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\r\n <tbody>\r\n <tr fd-table-row class=\"row-day-number\">\r\n <td fd-table-cell *ngFor=\"let day of days | daysInWeek: weekIndex\" [class.noborder]=\"isPickerMode\">\r\n <bc-day-number-box\r\n [class.fd-calendar__item]=\"isPickerMode\"\r\n [class.fd-calendar__item--other-month]=\"isPickerMode && !day.isInMonth\"\r\n [class.fd-calendar__item--weekend]=\"isPickerMode && day.isWeekend\"\r\n [isPickerMode]=\"isPickerMode\"\r\n [day]=\"day\"\r\n [class.is-active]=\"day.index === startSelectedDayIndex || day.index === endSelectedDayIndex\"\r\n [class.fd-calendar__item--range]=\"\r\n startSelectedDayIndex &&\r\n endSelectedDayIndex &&\r\n day.index > startSelectedDayIndex &&\r\n day.index < endSelectedDayIndex\r\n \"\r\n (dayClick)=\"onDayClick(day)\"\r\n (dayMouseMove)=\"onDayMouseMove(day)\"\r\n (dayMouseDown)=\"onDayMouseDown(day)\"\r\n (dayMouseUp)=\"onDayMouseUp(day)\"\r\n ></bc-day-number-box>\r\n </td>\r\n </tr>\r\n <ng-container *ngIf=\"!isPickerMode\">\r\n <ng-container\r\n *ngTemplateOutlet=\"\r\n renderDayTasks;\r\n context: {\r\n $implicit: weekTasksArray[weekIndex],\r\n maxRowTasks: maxRowTasks,\r\n weekIndex: weekIndex,\r\n deviceSize: deviceSize,\r\n calendarFields: calendarFields,\r\n weekDays: weekDays\r\n }\r\n \"\r\n ></ng-container>\r\n <tr fd-table-row>\r\n <td fd-table-cell *ngFor=\"let day of days\" class=\"more-fd\" (click)=\"onDayBoxSelect(day)\">\r\n <ng-container *ngIf=\"maxRowTasks.length < day.tasks.length\">\r\n <button\r\n fd-button\r\n (click)=\"onMoreButton($event, popover)\"\r\n [fdType]=\"'transparent'\"\r\n [compact]=\"true\"\r\n >\r\n {{ day.tasks?.length - maxRowTasks.length }}\r\n {{ 'More' | bbbTranslate }}\r\n </button>\r\n <fd-popover\r\n #popover\r\n [mobile]=\"deviceSize === 's'\"\r\n placement=\"bottom\"\r\n [focusTrapped]=\"true\"\r\n [focusAutoCapture]=\"true\"\r\n (isOpenChange)=\"onOpenPopoverChange($event)\"\r\n >\r\n <bc-day-event-list\r\n [day]=\"day\"\r\n [calendarFields]=\"calendarFields\"\r\n [deviceSize]=\"deviceSize\"\r\n [weekDays]=\"weekDays\"\r\n [rtl]=\"rtl\"\r\n [popover]=\"popover\"\r\n (deleteEvent)=\"deleteEvent.emit($event)\"\r\n (editEvent)=\"editEvent.emit($event)\"\r\n ></bc-day-event-list>\r\n </fd-popover>\r\n </ng-container>\r\n </td>\r\n </tr>\r\n </ng-container>\r\n </tbody>\r\n </table>\r\n</ng-template>\r\n\r\n<ng-template\r\n #renderDayTasks\r\n let-weekTasks\r\n let-maxRowTasks=\"maxRowTasks\"\r\n let-weekIndex=\"weekIndex\"\r\n let-deviceSize=\"deviceSize\"\r\n let-calendarFields=\"calendarFields\"\r\n let-weekDays=\"weekDays\"\r\n>\r\n <tr fd-table-row *ngFor=\"let rowTask of maxRowTasks; let i = index\">\r\n <ng-container *ngIf=\"!weekTasks[i] || weekTasks[i].length === 0\">\r\n <td fd-table-cell *ngFor=\"let day of weekDays\"></td>\r\n </ng-container>\r\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\r\n <td fd-table-cell [attr.colspan]=\"task.colSpan\" *ngIf=\"task.colSpan\">\r\n <ng-container *ngIf=\"task.event; else newDaySelect\">\r\n <bc-event-button\r\n [task]=\"task\"\r\n [rtl]=\"rtl\"\r\n [calendarFields]=\"calendarFields\"\r\n [deviceSize]=\"deviceSize\"\r\n (deleteEvent)=\"deleteEvent.emit($event)\"\r\n (editEvent)=\"editEvent.emit($event)\"\r\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\r\n ></bc-event-button>\r\n </ng-container>\r\n <ng-template #newDaySelect>\r\n <div style=\"width: 100%; height: 100%\" (click)=\"onDaySelect(weekIndex, dayIndex)\"></div>\r\n </ng-template>\r\n </td>\r\n </ng-container>\r\n </tr>\r\n</ng-template>\r\n", styles: [":host{display:block}table{table-layout:fixed}.table-header td{padding:0!important}.table-content{width:100%;height:100%;border:none;border-spacing:0}.table-content td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:1.425rem}.table-content .row-day-number td:first-child{border-right:none}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}.weekday-header,.row-day-number td{width:100%}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.more-fd{text-align:center!important}.more-fd button{font-size:12px}.fd-calendar__item{font-size:.875rem;font-size:var(--sapFontSize, .875rem);line-height:1.4;line-height:var(--sapContent_LineHeight, 1.4);color:#32363a;color:var(--sapTextColor, #32363a);font-family:\"72\",\"72full\",Arial,Helvetica,sans-serif;font-family:var(--sapFontFamily, \"72\", \"72full\", Arial, Helvetica, sans-serif);font-weight:400;box-sizing:border-box;padding:0;border:0;overflow:hidden;position:relative;height:2.75rem;margin:.0625rem;min-width:2.125rem;border-radius:.25rem;border-radius:var(--sapElement_BorderCornerRadius, .25rem);background-color:#fafafa;background-color:var(--sapLegend_WorkingBackground, #fafafa);flex:1 1 .375rem;border:none!important;padding:1px!important}.fd-calendar__item.fd-calendar__item--other-month{background-color:var(--sapList_Background, #fff)}.fd-calendar__item.fd-calendar__item--weekend{background-color:var(--sapLegend_NotWorkingBackground, #dedede)}.fd-calendar__item.is-active{background-color:var(--sapContent_Selected_Background, #0854a0);border:var(--fdCalendar_Active_Item_Border, none)}.fd-calendar__item.is-active ::ng-deep span{color:var(--sapContent_Selected_TextColor, #fff)}.fd-calendar__item.fd-calendar__item--range{border:.0625rem solid var(--sapList_SelectionBorderColor, #0854a0);background-color:var(--sapList_SelectionBackgroundColor, #e5f0fa)}.noborder{border:none!important}\n"] }]
|
|
1856
|
+
}], ctorParameters: function () { return [{ type: DaysInWeekPipe }, { type: i0.ChangeDetectorRef }, { type: CalendarService }]; }, propDecorators: { monthWeeksCount: [{
|
|
1857
|
+
type: Input
|
|
1858
|
+
}], weekDays: [{
|
|
1859
|
+
type: Input
|
|
1860
|
+
}], weekDaysMin: [{
|
|
1861
|
+
type: Input
|
|
1862
|
+
}], today: [{
|
|
1863
|
+
type: Input
|
|
1864
|
+
}], containerHeight: [{
|
|
1865
|
+
type: Input
|
|
1866
|
+
}], days: [{
|
|
1867
|
+
type: Input
|
|
1868
|
+
}], calendarFields: [{
|
|
1869
|
+
type: Input
|
|
1870
|
+
}], rtl: [{
|
|
1871
|
+
type: Input
|
|
1872
|
+
}], deviceSize: [{
|
|
1873
|
+
type: Input
|
|
1874
|
+
}], moDataList: [{
|
|
1875
|
+
type: Input
|
|
1876
|
+
}], datePicker: [{
|
|
1877
|
+
type: Input
|
|
1878
|
+
}], rangePicker: [{
|
|
1879
|
+
type: Input
|
|
1880
|
+
}], startSelectedDayIndex: [{
|
|
1881
|
+
type: Input
|
|
1882
|
+
}], endSelectedDayIndex: [{
|
|
1883
|
+
type: Input
|
|
1884
|
+
}], editEvent: [{
|
|
1885
|
+
type: Output
|
|
1886
|
+
}], deleteEvent: [{
|
|
1887
|
+
type: Output
|
|
1888
|
+
}], daySelect: [{
|
|
1889
|
+
type: Output
|
|
1890
|
+
}], dayClick: [{
|
|
1891
|
+
type: Output
|
|
1892
|
+
}], dayMouseMove: [{
|
|
1893
|
+
type: Output
|
|
1894
|
+
}], dayMouseUp: [{
|
|
1895
|
+
type: Output
|
|
1896
|
+
}], dayMouseDown: [{
|
|
1897
|
+
type: Output
|
|
1898
|
+
}], showEvent: [{
|
|
1899
|
+
type: Output
|
|
1900
|
+
}] } });
|
|
1901
|
+
|
|
1902
|
+
class CalendarHeaderComponent extends BaseComponent {
|
|
1903
|
+
constructor() {
|
|
1904
|
+
super(...arguments);
|
|
1905
|
+
this.hideMode = false;
|
|
1906
|
+
this.prevTap = new EventEmitter();
|
|
1907
|
+
this.nextTap = new EventEmitter();
|
|
1908
|
+
this.modeChange = new EventEmitter();
|
|
1909
|
+
this.rangeChange = new EventEmitter();
|
|
1910
|
+
this.today = new EventEmitter();
|
|
1911
|
+
this.monthName = '';
|
|
1912
|
+
}
|
|
1913
|
+
onModeChange(mode) {
|
|
1914
|
+
this.modeChange.emit(mode);
|
|
1915
|
+
}
|
|
1916
|
+
onRangeChange(range) {
|
|
1917
|
+
this.rangeChange.emit(range);
|
|
1918
|
+
}
|
|
1919
|
+
onPrint() { }
|
|
1920
|
+
}
|
|
1921
|
+
CalendarHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarHeaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1922
|
+
CalendarHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarHeaderComponent, selector: "bc-calendar-header", inputs: { monthInfo: "monthInfo", weekModeDays: "weekModeDays", hideMode: "hideMode", modeTitle: "modeTitle", title: "title", rtl: "rtl", mode: "mode" }, outputs: { prevTap: "prevTap", nextTap: "nextTap", modeChange: "modeChange", rangeChange: "rangeChange", today: "today" }, usesInheritance: true, ngImport: i0, template: "<fd-toolbar [shouldOverflow]=\"true\" [fdType]=\"'transparent'\">\r\n <fdp-button fd-toolbar-item [label]=\"'DateR_Today' | bbbTranslate\" (click)=\"today.emit()\"></fdp-button>\r\n <fdp-button\r\n buttonType=\"transparent\"\r\n fd-toolbar-item\r\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\r\n (click)=\"prevTap.emit()\"\r\n ></fdp-button>\r\n <fdp-button\r\n buttonType=\"transparent\"\r\n fd-toolbar-item\r\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\r\n (click)=\"nextTap.emit()\"\r\n ></fdp-button>\r\n <h3 fd-title fd-toolbar-item>{{ title }}</h3>\r\n <fd-toolbar-spacer></fd-toolbar-spacer>\r\n <fdp-button fd-toolbar-item glyph=\"print\" (click)=\"onPrint()\" buttonType=\"transparent\"></fdp-button>\r\n <bc-calendar-selection-days\r\n fd-toolbar-item\r\n [monthInfo]=\"monthInfo\"\r\n (rangeChange)=\"onRangeChange($event)\"\r\n ></bc-calendar-selection-days>\r\n\r\n <fd-split-button\r\n *ngIf=\"!hideMode\"\r\n fd-toolbar-item\r\n [fixedWidth]=\"false\"\r\n [mainAction]=\"{\r\n mainActionTitle: modeTitle,\r\n keepMainAction: true\r\n }\"\r\n >\r\n <fd-menu>\r\n <li fd-menu-item (click)=\"onModeChange('day')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Day' | bbbTranslate }}</span>\r\n </div>\r\n </li>\r\n <li fd-menu-item (click)=\"onModeChange('week')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Week' | bbbTranslate }} </span>\r\n </div>\r\n </li>\r\n <li fd-menu-item (click)=\"onModeChange('month')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Month' | bbbTranslate }}</span>\r\n </div>\r\n </li>\r\n <!-- <li fd-menu-item (click)=\"onModeChange('year')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ \"Year\" | bbbTranslate }}</span>\r\n </div>\r\n </li> -->\r\n </fd-menu>\r\n </fd-split-button>\r\n</fd-toolbar>\r\n", styles: [":host{display:block;background-color:var(--sapList_Background, #fff)}::ng-deep span.fd-toolbar__spacer{display:none}::ng-deep .fd-toolbar{border:none}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$4.MenuComponent, selector: "fd-menu", inputs: ["mobile", "disabled", "focusTrapped", "openOnHoverTime", "mobileConfig", "ariaLabel", "ariaLabelledby", "id"], outputs: ["activePath"] }, { kind: "component", type: i2$4.MenuItemComponent, selector: "li[fd-menu-item]", inputs: ["disabled", "itemId", "submenu"], outputs: ["onSelect"], exportAs: ["fd-menu-item"] }, { kind: "directive", type: i2$4.MenuInteractiveDirective, selector: "[fd-menu-interactive]" }, { kind: "directive", type: i2$4.MenuTitleDirective, selector: "[fd-menu-title]" }, { kind: "component", type: i3$3.TitleComponent, selector: "h1[fd-title], h2[fd-title], h3[fd-title], h4[fd-title], h5[fd-title], h6[fd-title]", inputs: ["headerSize", "wrap"], exportAs: ["fd-title"] }, { kind: "component", type: i4$3.SplitButtonComponent, selector: "fd-split-button", inputs: ["glyph", "disabled", "mainActionTitle", "fdType", "expandButtonAriaLabel", "expandButtonTitle", "selected", "fixedWidth", "mainAction", "arialLabel"], outputs: ["primaryButtonClicked"] }, { kind: "component", type: i6.ToolbarComponent, selector: "fd-toolbar", inputs: ["class", "shouldOverflow", "fdType", "hasTitle", "title", "active", "clearBorder", "forceOverflow", "tabindex"] }, { kind: "directive", type: i6.ToolbarItemDirective, selector: "[fd-toolbar-item]" }, { kind: "component", type: i6.ToolbarSpacerComponent, selector: "fd-toolbar-spacer", inputs: ["width", "class", "fixed"] }, { kind: "component", type: i7.ButtonComponent, selector: "fdp-button", inputs: ["glyphPosition", "label", "glyph", "buttonType", "title", "ariaSelected", "ariaDisabled", "ariaExpanded", "ariaControlsId", "ariaPressed", "name", "type", "value"], outputs: ["buttonClicked"] }, { kind: "component", type: CalendarSelectionDaysComponent, selector: "bc-calendar-selection-days", inputs: ["startSelectedDayIndex", "endSelectedDayIndex", "monthInfo"], outputs: ["rangeChange"] }, { kind: "pipe", type: i2.BbbTranslatePipe, name: "bbbTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1923
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarHeaderComponent, decorators: [{
|
|
1924
|
+
type: Component,
|
|
1925
|
+
args: [{ selector: 'bc-calendar-header', changeDetection: ChangeDetectionStrategy.OnPush, template: "<fd-toolbar [shouldOverflow]=\"true\" [fdType]=\"'transparent'\">\r\n <fdp-button fd-toolbar-item [label]=\"'DateR_Today' | bbbTranslate\" (click)=\"today.emit()\"></fdp-button>\r\n <fdp-button\r\n buttonType=\"transparent\"\r\n fd-toolbar-item\r\n [glyph]=\"rtl ? 'navigation-right-arrow' : 'navigation-left-arrow'\"\r\n (click)=\"prevTap.emit()\"\r\n ></fdp-button>\r\n <fdp-button\r\n buttonType=\"transparent\"\r\n fd-toolbar-item\r\n [glyph]=\"rtl ? 'navigation-left-arrow' : 'navigation-right-arrow'\"\r\n (click)=\"nextTap.emit()\"\r\n ></fdp-button>\r\n <h3 fd-title fd-toolbar-item>{{ title }}</h3>\r\n <fd-toolbar-spacer></fd-toolbar-spacer>\r\n <fdp-button fd-toolbar-item glyph=\"print\" (click)=\"onPrint()\" buttonType=\"transparent\"></fdp-button>\r\n <bc-calendar-selection-days\r\n fd-toolbar-item\r\n [monthInfo]=\"monthInfo\"\r\n (rangeChange)=\"onRangeChange($event)\"\r\n ></bc-calendar-selection-days>\r\n\r\n <fd-split-button\r\n *ngIf=\"!hideMode\"\r\n fd-toolbar-item\r\n [fixedWidth]=\"false\"\r\n [mainAction]=\"{\r\n mainActionTitle: modeTitle,\r\n keepMainAction: true\r\n }\"\r\n >\r\n <fd-menu>\r\n <li fd-menu-item (click)=\"onModeChange('day')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Day' | bbbTranslate }}</span>\r\n </div>\r\n </li>\r\n <li fd-menu-item (click)=\"onModeChange('week')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Week' | bbbTranslate }} </span>\r\n </div>\r\n </li>\r\n <li fd-menu-item (click)=\"onModeChange('month')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ 'Month' | bbbTranslate }}</span>\r\n </div>\r\n </li>\r\n <!-- <li fd-menu-item (click)=\"onModeChange('year')\">\r\n <div fd-menu-interactive>\r\n <span fd-menu-title>{{ \"Year\" | bbbTranslate }}</span>\r\n </div>\r\n </li> -->\r\n </fd-menu>\r\n </fd-split-button>\r\n</fd-toolbar>\r\n", styles: [":host{display:block;background-color:var(--sapList_Background, #fff)}::ng-deep span.fd-toolbar__spacer{display:none}::ng-deep .fd-toolbar{border:none}\n"] }]
|
|
1926
|
+
}], propDecorators: { monthInfo: [{
|
|
1927
|
+
type: Input
|
|
1928
|
+
}], weekModeDays: [{
|
|
1929
|
+
type: Input
|
|
1930
|
+
}], hideMode: [{
|
|
1931
|
+
type: Input
|
|
1932
|
+
}], modeTitle: [{
|
|
1933
|
+
type: Input
|
|
1934
|
+
}], title: [{
|
|
1935
|
+
type: Input
|
|
1936
|
+
}], rtl: [{
|
|
1937
|
+
type: Input
|
|
1938
|
+
}], mode: [{
|
|
1939
|
+
type: Input
|
|
1940
|
+
}], prevTap: [{
|
|
1941
|
+
type: Output
|
|
1942
|
+
}], nextTap: [{
|
|
1943
|
+
type: Output
|
|
1944
|
+
}], modeChange: [{
|
|
1945
|
+
type: Output
|
|
1946
|
+
}], rangeChange: [{
|
|
1947
|
+
type: Output
|
|
1948
|
+
}], today: [{
|
|
1949
|
+
type: Output
|
|
1950
|
+
}] } });
|
|
1951
|
+
|
|
1952
|
+
class FromToTimePipe {
|
|
1953
|
+
constructor() { }
|
|
1954
|
+
transform(task) {
|
|
1955
|
+
const event = task.event;
|
|
1956
|
+
const fromDateInfo = event.$StartDateInfo;
|
|
1957
|
+
const toDateInfo = event.$EndDateInfo;
|
|
1958
|
+
const fromTime = `${getPadedTime(fromDateInfo.hour)}:${getPadedTime(fromDateInfo.minutes)}`;
|
|
1959
|
+
const toTime = `${getPadedTime(toDateInfo.hour)}:${getPadedTime(toDateInfo.minutes)}`;
|
|
1960
|
+
return `${fromTime} - ${toTime}`;
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
FromToTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FromToTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1964
|
+
FromToTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: FromToTimePipe, name: "fromToTime" });
|
|
1965
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: FromToTimePipe, decorators: [{
|
|
1966
|
+
type: Pipe,
|
|
1967
|
+
args: [{
|
|
1968
|
+
name: 'fromToTime'
|
|
1969
|
+
}]
|
|
1970
|
+
}], ctorParameters: function () { return []; } });
|
|
1971
|
+
|
|
1972
|
+
class CalendarWeekComponent extends BaseComponent {
|
|
1973
|
+
constructor(_cdr, _calendarService) {
|
|
1974
|
+
super();
|
|
1975
|
+
this._cdr = _cdr;
|
|
1976
|
+
this._calendarService = _calendarService;
|
|
1977
|
+
this.canDelete = false;
|
|
1978
|
+
this.canAdd = false;
|
|
1979
|
+
this.canEdit = false;
|
|
1980
|
+
this.editEvent = new EventEmitter();
|
|
1981
|
+
this.deleteEvent = new EventEmitter();
|
|
1982
|
+
this.showEvent = new EventEmitter();
|
|
1983
|
+
this.daySelect = new EventEmitter();
|
|
1984
|
+
this.dayClick = new EventEmitter();
|
|
1985
|
+
this.taskHeight = 30;
|
|
1986
|
+
this.maxTaskCount = 4;
|
|
1987
|
+
this._hasPopoverOpened = [];
|
|
1988
|
+
}
|
|
1989
|
+
ngOnChanges(changes) {
|
|
1990
|
+
super.ngOnChanges(changes);
|
|
1991
|
+
if (changes.deviceSize && !changes.deviceSize.firstChange) {
|
|
1992
|
+
this.prepareWeekDays(changes.deviceSize.currentValue);
|
|
1993
|
+
}
|
|
1994
|
+
if (changes.moDataList && !changes.moDataList.firstChange) {
|
|
1995
|
+
this._prepareDaysTasks(changes.moDataList.currentValue);
|
|
1996
|
+
this._cdr.detectChanges();
|
|
1997
|
+
}
|
|
1998
|
+
if (changes.days && !changes.days.firstChange) {
|
|
1999
|
+
this._prepareDaysTasks(this.moDataList);
|
|
2000
|
+
this._cdr.detectChanges();
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
ngOnInit() {
|
|
2004
|
+
super.ngOnInit();
|
|
2005
|
+
this.hours = new Array(24).fill(0).map((x, i) => `${i > 9 ? '' + i : '0' + i}:00`);
|
|
2006
|
+
this.prepareWeekDays(this.deviceSize);
|
|
2007
|
+
this._prepareDaysTasks(this.moDataList);
|
|
2008
|
+
}
|
|
2009
|
+
onDayBoxSelect(day) {
|
|
2010
|
+
if (!this.canAdd) {
|
|
2011
|
+
return;
|
|
2012
|
+
}
|
|
2013
|
+
this._fireDaySelect(day.date);
|
|
2014
|
+
}
|
|
2015
|
+
onOpenPopoverChange(isOpen) {
|
|
2016
|
+
if (isOpen) {
|
|
2017
|
+
this._hasPopoverOpened.push(true);
|
|
2018
|
+
}
|
|
2019
|
+
else {
|
|
2020
|
+
setTimeout(() => {
|
|
2021
|
+
this._hasPopoverOpened = [];
|
|
2022
|
+
}, 0);
|
|
2023
|
+
}
|
|
2024
|
+
}
|
|
2025
|
+
onColumnClick(e, day) {
|
|
2026
|
+
const { offsetY } = e;
|
|
2027
|
+
const hour = Math.floor(offsetY / 50);
|
|
2028
|
+
const minutes = Math.floor((offsetY % 50) / 15) * 15;
|
|
2029
|
+
const date = new Date(day.date);
|
|
2030
|
+
date.setHours(hour);
|
|
2031
|
+
date.setMinutes(minutes);
|
|
2032
|
+
this._fireDaySelect(date);
|
|
2033
|
+
}
|
|
2034
|
+
onEventButton(e) {
|
|
2035
|
+
var _a;
|
|
2036
|
+
if (((_a = e.currentTarget) === null || _a === void 0 ? void 0 : _a.localName) === 'bc-event-button') {
|
|
2037
|
+
PreventDefaulEvent(e);
|
|
2038
|
+
}
|
|
2039
|
+
}
|
|
2040
|
+
onMoreButton(e, popover) {
|
|
2041
|
+
PreventDefaulEvent(e);
|
|
2042
|
+
this._openPopover(popover);
|
|
2043
|
+
}
|
|
2044
|
+
onDayClick(day) {
|
|
2045
|
+
this.selected = day;
|
|
2046
|
+
this.dayClick.emit(day);
|
|
2047
|
+
}
|
|
2048
|
+
_fireDaySelect(date) {
|
|
2049
|
+
if (this._hasPopoverOpened.length === 0) {
|
|
2050
|
+
this.daySelect.emit(moment(date));
|
|
2051
|
+
}
|
|
2052
|
+
}
|
|
2053
|
+
_openPopover(popover) {
|
|
2054
|
+
if (popover.isOpen) {
|
|
2055
|
+
this._hasPopoverOpened.push(popover);
|
|
2056
|
+
}
|
|
2057
|
+
else {
|
|
2058
|
+
this._hasPopoverOpened.pop();
|
|
2059
|
+
}
|
|
2060
|
+
}
|
|
2061
|
+
prepareWeekDays(deviceSize) {
|
|
2062
|
+
if (deviceSize !== 's' && deviceSize !== 'm') {
|
|
2063
|
+
this.selectedWeekDays = this.weekDays;
|
|
2064
|
+
}
|
|
2065
|
+
else {
|
|
2066
|
+
this.selectedWeekDays = this.weekDaysMin;
|
|
2067
|
+
}
|
|
2068
|
+
}
|
|
2069
|
+
_prepareDaysTasks(calendarTasks) {
|
|
2070
|
+
const calendarFields = this.calendarFields;
|
|
2071
|
+
// Sort all Tasks
|
|
2072
|
+
const moDataList = this._calendarService.sortTasks(calendarTasks, calendarFields);
|
|
2073
|
+
const taskHeight = 50;
|
|
2074
|
+
this.days.forEach((day) => (day.tasks = []));
|
|
2075
|
+
const weekTasksArray = [];
|
|
2076
|
+
const days = this.days;
|
|
2077
|
+
const week = this._calendarService.createWeekTask(days, moDataList, calendarFields, taskHeight);
|
|
2078
|
+
weekTasksArray.push(week);
|
|
2079
|
+
// به ازای هر ردیف تسک باید تعداد 7 ستون اضافه گردد و برای ستونی که تسکی ندارد یک جای خالی colspan 1 میگذاریم
|
|
2080
|
+
weekTasksArray.forEach((weekTask) => {
|
|
2081
|
+
this._calendarService.fillWeek(weekTask, days.length);
|
|
2082
|
+
});
|
|
2083
|
+
const tasks = [];
|
|
2084
|
+
let counter = 0;
|
|
2085
|
+
Object.values(weekTasksArray).forEach(() => {
|
|
2086
|
+
Object.values(week).forEach((element) => {
|
|
2087
|
+
const filtered = element.some((c) => c.colSpan > 1 || (c.colSpan === 1 && !c.inDay && c.event));
|
|
2088
|
+
if (filtered) {
|
|
2089
|
+
tasks[counter.toString()] = element;
|
|
2090
|
+
counter++;
|
|
2091
|
+
}
|
|
2092
|
+
});
|
|
2093
|
+
});
|
|
2094
|
+
this.weekTasksArray = tasks;
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
CalendarWeekComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarWeekComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: CalendarService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2098
|
+
CalendarWeekComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarWeekComponent, selector: "bc-calendar-week", inputs: { weekDays: "weekDays", weekDaysMin: "weekDaysMin", today: "today", containerHeight: "containerHeight", calendarFields: "calendarFields", rtl: "rtl", inDialog: "inDialog", deviceSize: "deviceSize", moDataList: "moDataList", days: "days", canDelete: "canDelete", canAdd: "canAdd", canEdit: "canEdit" }, outputs: { editEvent: "editEvent", deleteEvent: "deleteEvent", showEvent: "showEvent", daySelect: "daySelect", dayClick: "dayClick" }, viewQueries: [{ propertyName: "tableTopEl", first: true, predicate: ["tableTop"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"table-container\"\n [style.overflow-y]=\"inDialog ? 'scroll' : 'hidden'\"\n style=\"overflow-y: hidden; flex-shrink: 0\"\n #tableTop\n>\n <table fd-table class=\"table-top\" [compact]=\"true\" [attr.daysCount]=\"days.length\">\n <tbody fd-table-body>\n <tr fd-table-row class=\"week-days\">\n <td class=\"td-time\"></td>\n <td [attr.rtl]=\"rtl\" class=\"weekday-header\" *ngFor=\"let day of days\" fd-table-cell style=\"width: 100%\">\n {{ day.dayName }}\n </td>\n </tr>\n <tr fd-table-row class=\"week-numbers\">\n <td class=\"td-time\"></td>\n <td fd-table-cell *ngFor=\"let day of days\" [attr.rtl]=\"rtl\">\n <bc-day-number-box\n [day]=\"day\"\n [isWeekMode]=\"true\"\n [isSingleDay]=\"days.length === 1\"\n (dayClick)=\"onDayClick(day)\"\n ></bc-day-number-box>\n </td>\n </tr>\n <ng-container\n *ngTemplateOutlet=\"\n renderDayTasks;\n context: {\n $implicit: weekTasksArray,\n maxRowTasks: maxRowTasks,\n weekIndex: 0\n }\n \"\n ></ng-container>\n </tbody>\n </table>\n</div>\n<ng-template #renderDayTasks let-weekTasks let-maxRowTasks=\"maxRowTasks\" let-weekIndex=\"weekIndex\">\n <ng-container *ngFor=\"let rowTask of weekTasks | keyvalue; let i = index\">\n <tr fd-table-row class=\"task-row\">\n <td fd-table-cell class=\"fd-time\" style=\"border: none\"></td>\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\n <td\n fd-table-cell\n *ngIf=\"task.colSpan && dayIndex < days.length\"\n [attr.colspan]=\"task.colSpan > days.length ? days.length : task.colSpan\"\n class=\"td-button\"\n [attr.hasevent]=\"!!task.event\"\n >\n <bc-event-button\n *ngIf=\"task.event && !task.inDay; else newDaySelect\"\n [task]=\"task\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-button>\n <ng-template #newDaySelect>\n <div style=\"width: 100%; height: 100%\" [attr.newDay]=\"true\"></div>\n </ng-template>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n</ng-template>\n<div\n class=\"table-container\"\n style=\"overflow-y: hidden; overflow-x: auto; flex-grow: 1\"\n [style.height.px]=\"inDialog ? containerHeight : null\"\n [style.overflow-y]=\"inDialog ? 'scroll' : 'hidden'\"\n>\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\n <tbody>\n <tr class=\"tr-time\" style=\"height: 0rem\">\n <td class=\"td-time\" style=\"height: 0rem\"></td>\n <td [colspan]=\"days.length\" style=\"position: relative\" style=\"height: 0rem\">\n <div class=\"tasks-wrapper\">\n <div *ngFor=\"let hour of hours\" class=\"row-border\"></div>\n </div>\n </td>\n </tr>\n <tr fd-table-row style=\"height: 100%\">\n <td fd-table-cell class=\"td-time\">\n <div class=\"calc-time\">\n <div *ngFor=\"let hour of hours\">{{ hour }}</div>\n </div>\n </td>\n <td *ngFor=\"let day of days\" fd-table-cell (click)=\"onColumnClick($event, day)\">\n <div style=\"position: relative; width: 100%; height: 100%\">\n <ng-container *ngFor=\"let task of day.tasks; let index = index\">\n <bc-event-button\n (click)=\"onEventButton($event)\"\n *ngIf=\"task.inDay\"\n [style.background]=\"task.event[calendarFields.Color]\"\n [style.top.px]=\"task.top\"\n [style.right]=\"rtl ? 'calc(' + index * (100 / day.tasks.length) + '%)' : null\"\n [style.left]=\"rtl ? null : 'calc(' + index * (100 / day.tasks.length) + '%)'\"\n [style.width]=\"'calc(100% - ' + index * (100 / day.tasks.length) + '%)'\"\n [style.height.px]=\"task.height\"\n [style.maxHeight.px]=\"task.height\"\n [style.opacity]=\"task.opacity\"\n [style.zIndex]=\"index\"\n [buttonTemplate]=\"eventButtonTemplate\"\n class=\"task-day\"\n [task]=\"task\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\n ></bc-event-button>\n </ng-container>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n<ng-template #eventButtonTemplate let-task let-popover=\"popover\" let-calendarFields=\"calendarFields\">\n <button\n [style.background]=\"task.event[calendarFields.Color]\"\n class=\"task-title\"\n [style.border]=\"'1px solid white'\"\n fd-button\n [compact]=\"true\"\n [fdType]=\"'emphasized'\"\n [fdPopoverTrigger]=\"popover\"\n [label]=\"task.height > 49 ? '' : task.event[calendarFields.Title] + ' ' + (task | fromToTime)\"\n >\n <ng-container *ngIf=\"task.height > 49\">\n <span class=\"ellipsis\">{{ task.event[calendarFields.Title] }}</span>\n <span class=\"ellipsis\">{{ task | fromToTime }}</span>\n </ng-container>\n </button>\n</ng-template>\n", styles: [":host{display:flex;height:95%;width:100%;flex-direction:column;align-items:stretch;justify-content:stretch}table.table-top{border-top:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.table-top{table-layout:fixed}.table-top td{padding-right:1px!important;padding-left:1px!important}.tr-time{height:1px;max-height:1px!important;width:100%}.tr-time td{height:1px!important;max-height:1px!important;padding:0!important}.task-row td{height:1.425rem!important;padding:0!important}.table-content{width:100%;border-spacing:0;position:relative}.table-content .tasks-wrapper{position:absolute;opacity:.3;height:100%;width:calc(100% - 50px)}.table-content .td-time{padding:0!important}.table-content .td-time .calc-time{display:flex;flex-direction:column;height:100%;justify-content:start;align-items:center}.table-content .td-time .calc-time div{height:50px;border-bottom:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);width:100%;display:flex;justify-content:center}.table-content .td-time tbody{border-spacing:0}.td-time{width:50px!important;max-width:50px!important}.row-border{border-bottom:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);border-top:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:50px}.task-day{position:absolute!important;display:flex;flex-direction:column;align-items:start}.weekday-header td,.week-days td,.week-numbers td{text-align:right}table[dayscount=\"1\"] .week-days td[rtl=true],table[dayscount=\"1\"] .week-numbers td[rtl=true]{text-align:right!important}table[dayscount=\"1\"] .week-days td[rtl=false],table[dayscount=\"1\"] .week-numbers td[rtl=false]{text-align:left!important}table[dayscount=\"1\"] .week-days td,table[dayscount=\"1\"] .week-numbers td{padding-left:1rem!important;padding-right:1rem!important}table[dayscount=\"1\"] .week-days td.weekday-header,table[dayscount=\"1\"] .week-numbers td.weekday-header{padding-left:2rem!important;padding-right:2rem!important}.week-days td{border:none;text-align:center;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}.week-numbers td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}.td-button{border:none!important;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)!important;padding:1px!important}.task-title{display:flex;flex-direction:column;align-items:start!important;font-weight:400;width:100%;max-width:100%;min-width:100%;height:100%;max-height:100%;min-height:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i4.ButtonComponent, selector: "button[fd-button], a[fd-button]", inputs: ["class"], exportAs: ["fd-button"] }, { kind: "directive", type: i4.DeprecatedButtonContentDensityDirective, selector: "[fd-button][compact]" }, { kind: "directive", type: i5$1.PopoverTriggerDirective, selector: "[fdPopoverTrigger], [fd-popover-trigger]", inputs: ["fdPopoverTrigger"] }, { kind: "component", type: i6$1.TableComponent, selector: "table[fd-table]", inputs: ["noBorderX", "noBorderY", "popIn", "responsive", "keys", "allCellsFocusable"], exportAs: ["fd-table"] }, { kind: "directive", type: i6$1.TableBodyDirective, selector: "[fdTableBody], [fd-table-body]", inputs: ["noBorderX", "noBorderY"] }, { kind: "directive", type: i6$1.TableRowDirective, selector: "[fdTableRow], [fd-table-row]", inputs: ["activable", "highlightActive", "hoverable", "focusable", "main", "secondary", "active"] }, { kind: "directive", type: i6$1.TableCellDirective, selector: "[fdTableCell], [fd-table-cell]", inputs: ["noBorderX", "noBorderY", "activable", "focusable", "tabindex", "hoverable", "fitContent", "noPadding", "noData", "key", "cellFocusedEventAnnouncer"] }, { kind: "directive", type: i6$1.DeprecatedTableCompactDirective, selector: "table[fd-table][compact]" }, { kind: "component", type: DayNumberBoxComponent, selector: "bc-day-number-box", inputs: ["isWeekMode", "isSingleDay", "day", "isPickerMode", "itemInRange", "isActive"], outputs: ["dayClick", "dayMouseDown", "dayMouseUp", "dayMouseMove"] }, { kind: "component", type: EventButtonComponent, selector: "bc-event-button", inputs: ["buttonTemplate", "calendarFields", "task", "rtl", "canDelete", "canEdit", "deviceSize"], outputs: ["deleteEvent", "editEvent", "openPopoverChange"] }, { kind: "pipe", type: i3.KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: FromToTimePipe, name: "fromToTime" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarWeekComponent, decorators: [{
|
|
2100
|
+
type: Component,
|
|
2101
|
+
args: [{ selector: 'bc-calendar-week', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"table-container\"\n [style.overflow-y]=\"inDialog ? 'scroll' : 'hidden'\"\n style=\"overflow-y: hidden; flex-shrink: 0\"\n #tableTop\n>\n <table fd-table class=\"table-top\" [compact]=\"true\" [attr.daysCount]=\"days.length\">\n <tbody fd-table-body>\n <tr fd-table-row class=\"week-days\">\n <td class=\"td-time\"></td>\n <td [attr.rtl]=\"rtl\" class=\"weekday-header\" *ngFor=\"let day of days\" fd-table-cell style=\"width: 100%\">\n {{ day.dayName }}\n </td>\n </tr>\n <tr fd-table-row class=\"week-numbers\">\n <td class=\"td-time\"></td>\n <td fd-table-cell *ngFor=\"let day of days\" [attr.rtl]=\"rtl\">\n <bc-day-number-box\n [day]=\"day\"\n [isWeekMode]=\"true\"\n [isSingleDay]=\"days.length === 1\"\n (dayClick)=\"onDayClick(day)\"\n ></bc-day-number-box>\n </td>\n </tr>\n <ng-container\n *ngTemplateOutlet=\"\n renderDayTasks;\n context: {\n $implicit: weekTasksArray,\n maxRowTasks: maxRowTasks,\n weekIndex: 0\n }\n \"\n ></ng-container>\n </tbody>\n </table>\n</div>\n<ng-template #renderDayTasks let-weekTasks let-maxRowTasks=\"maxRowTasks\" let-weekIndex=\"weekIndex\">\n <ng-container *ngFor=\"let rowTask of weekTasks | keyvalue; let i = index\">\n <tr fd-table-row class=\"task-row\">\n <td fd-table-cell class=\"fd-time\" style=\"border: none\"></td>\n <ng-container *ngFor=\"let task of weekTasks[i]; let dayIndex = index\">\n <td\n fd-table-cell\n *ngIf=\"task.colSpan && dayIndex < days.length\"\n [attr.colspan]=\"task.colSpan > days.length ? days.length : task.colSpan\"\n class=\"td-button\"\n [attr.hasevent]=\"!!task.event\"\n >\n <bc-event-button\n *ngIf=\"task.event && !task.inDay; else newDaySelect\"\n [task]=\"task\"\n [rtl]=\"rtl\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n ></bc-event-button>\n <ng-template #newDaySelect>\n <div style=\"width: 100%; height: 100%\" [attr.newDay]=\"true\"></div>\n </ng-template>\n </td>\n </ng-container>\n </tr>\n </ng-container>\n</ng-template>\n<div\n class=\"table-container\"\n style=\"overflow-y: hidden; overflow-x: auto; flex-grow: 1\"\n [style.height.px]=\"inDialog ? containerHeight : null\"\n [style.overflow-y]=\"inDialog ? 'scroll' : 'hidden'\"\n>\n <table fd-table-body class=\"table-content\" [compact]=\"true\">\n <tbody>\n <tr class=\"tr-time\" style=\"height: 0rem\">\n <td class=\"td-time\" style=\"height: 0rem\"></td>\n <td [colspan]=\"days.length\" style=\"position: relative\" style=\"height: 0rem\">\n <div class=\"tasks-wrapper\">\n <div *ngFor=\"let hour of hours\" class=\"row-border\"></div>\n </div>\n </td>\n </tr>\n <tr fd-table-row style=\"height: 100%\">\n <td fd-table-cell class=\"td-time\">\n <div class=\"calc-time\">\n <div *ngFor=\"let hour of hours\">{{ hour }}</div>\n </div>\n </td>\n <td *ngFor=\"let day of days\" fd-table-cell (click)=\"onColumnClick($event, day)\">\n <div style=\"position: relative; width: 100%; height: 100%\">\n <ng-container *ngFor=\"let task of day.tasks; let index = index\">\n <bc-event-button\n (click)=\"onEventButton($event)\"\n *ngIf=\"task.inDay\"\n [style.background]=\"task.event[calendarFields.Color]\"\n [style.top.px]=\"task.top\"\n [style.right]=\"rtl ? 'calc(' + index * (100 / day.tasks.length) + '%)' : null\"\n [style.left]=\"rtl ? null : 'calc(' + index * (100 / day.tasks.length) + '%)'\"\n [style.width]=\"'calc(100% - ' + index * (100 / day.tasks.length) + '%)'\"\n [style.height.px]=\"task.height\"\n [style.maxHeight.px]=\"task.height\"\n [style.opacity]=\"task.opacity\"\n [style.zIndex]=\"index\"\n [buttonTemplate]=\"eventButtonTemplate\"\n class=\"task-day\"\n [task]=\"task\"\n [calendarFields]=\"calendarFields\"\n [deviceSize]=\"deviceSize\"\n [canDelete]=\"canDelete\"\n [canEdit]=\"canEdit\"\n (deleteEvent)=\"deleteEvent.emit($event)\"\n (editEvent)=\"editEvent.emit($event)\"\n (openPopoverChange)=\"onOpenPopoverChange($event)\"\n ></bc-event-button>\n </ng-container>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</div>\n<ng-template #eventButtonTemplate let-task let-popover=\"popover\" let-calendarFields=\"calendarFields\">\n <button\n [style.background]=\"task.event[calendarFields.Color]\"\n class=\"task-title\"\n [style.border]=\"'1px solid white'\"\n fd-button\n [compact]=\"true\"\n [fdType]=\"'emphasized'\"\n [fdPopoverTrigger]=\"popover\"\n [label]=\"task.height > 49 ? '' : task.event[calendarFields.Title] + ' ' + (task | fromToTime)\"\n >\n <ng-container *ngIf=\"task.height > 49\">\n <span class=\"ellipsis\">{{ task.event[calendarFields.Title] }}</span>\n <span class=\"ellipsis\">{{ task | fromToTime }}</span>\n </ng-container>\n </button>\n</ng-template>\n", styles: [":host{display:flex;height:95%;width:100%;flex-direction:column;align-items:stretch;justify-content:stretch}table.table-top{border-top:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}table td{overflow:hidden}thead tr{border-bottom:none!important}thead tr th{text-align:center!important;background-color:var(--sapList_Background, #fff)}tbody tr td{padding-top:5px}tbody tr:first-child td{padding-top:0}.fd-table__cell{padding:0 .5rem!important}.table-top{table-layout:fixed}.table-top td{padding-right:1px!important;padding-left:1px!important}.tr-time{height:1px;max-height:1px!important;width:100%}.tr-time td{height:1px!important;max-height:1px!important;padding:0!important}.task-row td{height:1.425rem!important;padding:0!important}.table-content{width:100%;border-spacing:0;position:relative}.table-content .tasks-wrapper{position:absolute;opacity:.3;height:100%;width:calc(100% - 50px)}.table-content .td-time{padding:0!important}.table-content .td-time .calc-time{display:flex;flex-direction:column;height:100%;justify-content:start;align-items:center}.table-content .td-time .calc-time div{height:50px;border-bottom:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);width:100%;display:flex;justify-content:center}.table-content .td-time tbody{border-spacing:0}.td-time{width:50px!important;max-width:50px!important}.row-border{border-bottom:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);border-top:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5);height:50px}.task-day{position:absolute!important;display:flex;flex-direction:column;align-items:start}.weekday-header td,.week-days td,.week-numbers td{text-align:right}table[dayscount=\"1\"] .week-days td[rtl=true],table[dayscount=\"1\"] .week-numbers td[rtl=true]{text-align:right!important}table[dayscount=\"1\"] .week-days td[rtl=false],table[dayscount=\"1\"] .week-numbers td[rtl=false]{text-align:left!important}table[dayscount=\"1\"] .week-days td,table[dayscount=\"1\"] .week-numbers td{padding-left:1rem!important;padding-right:1rem!important}table[dayscount=\"1\"] .week-days td.weekday-header,table[dayscount=\"1\"] .week-numbers td.weekday-header{padding-left:2rem!important;padding-right:2rem!important}.week-days td{border:none;text-align:center;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}.week-numbers td{border:none;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)}.td-button{border:none!important;border-right:var(--sapList_BorderWidth, .0625rem) solid var(--sapList_BorderColor, #e5e5e5)!important;padding:1px!important}.task-title{display:flex;flex-direction:column;align-items:start!important;font-weight:400;width:100%;max-width:100%;min-width:100%;height:100%;max-height:100%;min-height:100%}\n"] }]
|
|
2102
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: CalendarService }]; }, propDecorators: { tableTopEl: [{
|
|
2103
|
+
type: ViewChild,
|
|
2104
|
+
args: ['tableTop']
|
|
2105
|
+
}], weekDays: [{
|
|
2106
|
+
type: Input
|
|
2107
|
+
}], weekDaysMin: [{
|
|
2108
|
+
type: Input
|
|
2109
|
+
}], today: [{
|
|
2110
|
+
type: Input
|
|
2111
|
+
}], containerHeight: [{
|
|
2112
|
+
type: Input
|
|
2113
|
+
}], calendarFields: [{
|
|
2114
|
+
type: Input
|
|
2115
|
+
}], rtl: [{
|
|
2116
|
+
type: Input
|
|
2117
|
+
}], inDialog: [{
|
|
2118
|
+
type: Input
|
|
2119
|
+
}], deviceSize: [{
|
|
2120
|
+
type: Input
|
|
2121
|
+
}], moDataList: [{
|
|
2122
|
+
type: Input
|
|
2123
|
+
}], days: [{
|
|
2124
|
+
type: Input
|
|
2125
|
+
}], canDelete: [{
|
|
2126
|
+
type: Input
|
|
2127
|
+
}], canAdd: [{
|
|
2128
|
+
type: Input
|
|
2129
|
+
}], canEdit: [{
|
|
2130
|
+
type: Input
|
|
2131
|
+
}], editEvent: [{
|
|
2132
|
+
type: Output
|
|
2133
|
+
}], deleteEvent: [{
|
|
2134
|
+
type: Output
|
|
2135
|
+
}], showEvent: [{
|
|
2136
|
+
type: Output
|
|
2137
|
+
}], daySelect: [{
|
|
2138
|
+
type: Output
|
|
2139
|
+
}], dayClick: [{
|
|
2140
|
+
type: Output
|
|
2141
|
+
}] } });
|
|
2142
|
+
|
|
2143
|
+
class CalendarListItemComponent extends BaseComponent {
|
|
2144
|
+
}
|
|
2145
|
+
CalendarListItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListItemComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2146
|
+
CalendarListItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarListItemComponent, selector: "bc-calendar-list-item", inputs: { mo: "mo" }, usesInheritance: true, ngImport: i0, template: "<div class=\"wrapper\">\r\n <div flexShrink=\"1\" class=\"day-wrapper\">\r\n <Label [text]=\"mo.$StartTimes\"></Label>\r\n <Label class=\"ela\" [text]=\"'\u0627\u0644\u06CC'\"></Label>\r\n <Label [text]=\"mo.$EndTimes\"></Label>\r\n </div>\r\n <div class=\"color\" [style.background-color]=\"mo.$Color\"></div>\r\n <div class=\"event-wrapper\">\r\n <Label class=\"title\" [text]=\"mo.$Title\"></Label>\r\n <Label class=\"desc\" [text]=\"mo.$Notes\"></Label>\r\n </div>\r\n</div>\r\n", styles: [".wrapper{display:flex;flex-direction:row}.day-wrapper{display:flex;flex-shrink:1}.color{width:1}.event-wrapper{display:flex;flex-grow:1}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListItemComponent, decorators: [{
|
|
2148
|
+
type: Component,
|
|
2149
|
+
args: [{ selector: 'bc-calendar-list-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"wrapper\">\r\n <div flexShrink=\"1\" class=\"day-wrapper\">\r\n <Label [text]=\"mo.$StartTimes\"></Label>\r\n <Label class=\"ela\" [text]=\"'\u0627\u0644\u06CC'\"></Label>\r\n <Label [text]=\"mo.$EndTimes\"></Label>\r\n </div>\r\n <div class=\"color\" [style.background-color]=\"mo.$Color\"></div>\r\n <div class=\"event-wrapper\">\r\n <Label class=\"title\" [text]=\"mo.$Title\"></Label>\r\n <Label class=\"desc\" [text]=\"mo.$Notes\"></Label>\r\n </div>\r\n</div>\r\n", styles: [".wrapper{display:flex;flex-direction:row}.day-wrapper{display:flex;flex-shrink:1}.color{width:1}.event-wrapper{display:flex;flex-grow:1}\n"] }]
|
|
2150
|
+
}], propDecorators: { mo: [{
|
|
2151
|
+
type: Input
|
|
2152
|
+
}] } });
|
|
2153
|
+
|
|
2154
|
+
class CalendarListComponent extends BaseComponent {
|
|
2155
|
+
trackById(index, item) {
|
|
2156
|
+
return item.Id;
|
|
2157
|
+
}
|
|
2158
|
+
}
|
|
2159
|
+
CalendarListComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2160
|
+
CalendarListComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarListComponent, selector: "bc-calendar-list", inputs: { moDataList: "moDataList" }, usesInheritance: true, ngImport: i0, template: "<bc-calendar-list-item *ngFor=\"let item of moDataList; trackBy: trackById\" [mo]=\"item\"> </bc-calendar-list-item>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: CalendarListItemComponent, selector: "bc-calendar-list-item", inputs: ["mo"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListComponent, decorators: [{
|
|
2162
|
+
type: Component,
|
|
2163
|
+
args: [{ selector: 'bc-calendar-list', changeDetection: ChangeDetectionStrategy.OnPush, template: "<bc-calendar-list-item *ngFor=\"let item of moDataList; trackBy: trackById\" [mo]=\"item\"> </bc-calendar-list-item>\r\n" }]
|
|
2164
|
+
}], propDecorators: { moDataList: [{
|
|
2165
|
+
type: Input
|
|
2166
|
+
}] } });
|
|
2167
|
+
|
|
2168
|
+
class CalendarListContainerComponent extends BaseComponent {
|
|
2169
|
+
constructor() {
|
|
2170
|
+
super(...arguments);
|
|
2171
|
+
this.showEventsTap = new EventEmitter();
|
|
2172
|
+
}
|
|
2173
|
+
}
|
|
2174
|
+
CalendarListContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListContainerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
2175
|
+
CalendarListContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarListContainerComponent, selector: "bc-calendar-list-container", inputs: { view: "view", reportItemComponentName: "reportItemComponentName", showEvents: "showEvents", selectedDay: "selectedDay", calendarFields: "calendarFields" }, outputs: { showEventsTap: "showEventsTap" }, usesInheritance: true, ngImport: i0, template: "<bc-calendar-list *ngIf=\"selectedDay\" [moDataList]=\"selectedDay.tasks\"></bc-calendar-list>\r\n", styles: [""], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: CalendarListComponent, selector: "bc-calendar-list", inputs: ["moDataList"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2176
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarListContainerComponent, decorators: [{
|
|
2177
|
+
type: Component,
|
|
2178
|
+
args: [{ selector: 'bc-calendar-list-container', changeDetection: ChangeDetectionStrategy.OnPush, template: "<bc-calendar-list *ngIf=\"selectedDay\" [moDataList]=\"selectedDay.tasks\"></bc-calendar-list>\r\n" }]
|
|
2179
|
+
}], propDecorators: { view: [{
|
|
2180
|
+
type: Input
|
|
2181
|
+
}], reportItemComponentName: [{
|
|
2182
|
+
type: Input
|
|
2183
|
+
}], showEvents: [{
|
|
2184
|
+
type: Input
|
|
2185
|
+
}], selectedDay: [{
|
|
2186
|
+
type: Input
|
|
2187
|
+
}], calendarFields: [{
|
|
2188
|
+
type: Input
|
|
2189
|
+
}], showEventsTap: [{
|
|
2190
|
+
type: Output
|
|
2191
|
+
}] } });
|
|
2192
|
+
|
|
2193
|
+
class CalendarContainerComponent extends ReportViewBaseComponent {
|
|
2194
|
+
constructor(_titleCase, _bbbTranslate, _calendarService, _dateService, _el, _cdr, _renderer2, _findColumnByDbName, _ulvMainService, _portalService) {
|
|
2195
|
+
super(_el, _cdr, _renderer2, _findColumnByDbName, _ulvMainService, _portalService);
|
|
2196
|
+
this._titleCase = _titleCase;
|
|
2197
|
+
this._bbbTranslate = _bbbTranslate;
|
|
2198
|
+
this._calendarService = _calendarService;
|
|
2199
|
+
this._dateService = _dateService;
|
|
2200
|
+
this._el = _el;
|
|
2201
|
+
this._cdr = _cdr;
|
|
2202
|
+
this._renderer2 = _renderer2;
|
|
2203
|
+
this._findColumnByDbName = _findColumnByDbName;
|
|
2204
|
+
this._ulvMainService = _ulvMainService;
|
|
2205
|
+
this._portalService = _portalService;
|
|
2206
|
+
this.deleteTask = new EventEmitter();
|
|
2207
|
+
this.editTask = new EventEmitter();
|
|
2208
|
+
this.daySelect = new EventEmitter();
|
|
2209
|
+
this.loadData = new EventEmitter();
|
|
2210
|
+
this.todayIndex = -1;
|
|
2211
|
+
this.eventMoDataList$ = new BehaviorSubject([]);
|
|
2212
|
+
}
|
|
2213
|
+
ngOnInit() {
|
|
2214
|
+
super.ngOnInit();
|
|
2215
|
+
this.prepare();
|
|
2216
|
+
this._setWidthAndHeight();
|
|
2217
|
+
this.prepareMoDataList(this.moDataList);
|
|
2218
|
+
this.selectedMonth$.pipe(takeUntil(this._onDestroy$)).subscribe((month) => {
|
|
2219
|
+
this.loadData.emit({
|
|
2220
|
+
start: month.days[0].date,
|
|
2221
|
+
end: month.days[month.days.length - 1].date
|
|
2222
|
+
});
|
|
2223
|
+
});
|
|
2224
|
+
// this.setTasks(this.calendars, this.moDataList, this.calendarFields);
|
|
2225
|
+
}
|
|
2226
|
+
ngOnChanges(changes) {
|
|
2227
|
+
super.ngOnChanges(changes);
|
|
2228
|
+
const { moDataList, deviceSize } = changes;
|
|
2229
|
+
if (moDataList && !moDataList.firstChange) {
|
|
2230
|
+
this.prepareMoDataList(changes.moDataList.currentValue);
|
|
2231
|
+
this._cdr.detectChanges();
|
|
2232
|
+
}
|
|
2233
|
+
if (deviceSize && !deviceSize.firstChange) {
|
|
2234
|
+
this._setWidthAndHeight();
|
|
2235
|
+
this._cdr.detectChanges();
|
|
2236
|
+
}
|
|
2237
|
+
}
|
|
2238
|
+
onDayClick(day) {
|
|
2239
|
+
this._calendarService.setMode('day', day);
|
|
2240
|
+
}
|
|
2241
|
+
onShowTask() { }
|
|
2242
|
+
onSlideChange(selected) {
|
|
2243
|
+
this._calendarService.setSelected(selected);
|
|
2244
|
+
}
|
|
2245
|
+
onMonthCarouselLoaded({ object }) {
|
|
2246
|
+
object.selectedPage = 1;
|
|
2247
|
+
}
|
|
2248
|
+
onToday() {
|
|
2249
|
+
this._calendarService.gotoToday();
|
|
2250
|
+
}
|
|
2251
|
+
onModeChange(mode) {
|
|
2252
|
+
this._calendarService.setMode(mode);
|
|
2253
|
+
}
|
|
2254
|
+
onRangeChange(e) {
|
|
2255
|
+
this._calendarService.rangeSelect(e.startDay, e.endDay, e.monthInfo);
|
|
2256
|
+
}
|
|
2257
|
+
onPrevTap() {
|
|
2258
|
+
// this.gotoPage(this.monthCarouselView.nativeElement.selectedPage - 1);
|
|
2259
|
+
this._calendarService.loadPrevious();
|
|
2260
|
+
}
|
|
2261
|
+
onNextTap() {
|
|
2262
|
+
this._calendarService.loadNext();
|
|
2263
|
+
// this.gotoPage(this.monthCarouselView.nativeElement.selectedPage + 1);
|
|
2264
|
+
}
|
|
2265
|
+
onSelectedChange(day) {
|
|
2266
|
+
this.selectedDay = Object.assign({}, day);
|
|
2267
|
+
}
|
|
2268
|
+
prepareMoDataList(moDataList) {
|
|
2269
|
+
this.eventMoDataList$.next(moDataList.map((event) => (Object.assign(Object.assign({}, event), { id: event.Id, $StartDateInfo: this._dateService.getDateInfo(event[this.calendarFields.StartDate]), $EndDateInfo: this._dateService.getDateInfo(event[this.calendarFields.EndDate]) }))));
|
|
2270
|
+
}
|
|
2271
|
+
addTd(table, tr, event, colSpan) {
|
|
2272
|
+
const colSpanCount = tr.length > 0 ? tr.map((c) => c.colSpan).reduce((a, b) => a + b) > 6 : 0;
|
|
2273
|
+
if (colSpanCount) {
|
|
2274
|
+
table.push(tr);
|
|
2275
|
+
tr = [];
|
|
2276
|
+
}
|
|
2277
|
+
tr.push({ type: 'td', colSpan, event });
|
|
2278
|
+
}
|
|
2279
|
+
prepare() {
|
|
2280
|
+
this.weekDaysMin = this._calendarService.weekDaysMin();
|
|
2281
|
+
this.weekDays = this._calendarService.weekDays();
|
|
2282
|
+
this.selectedMonth$ = this._calendarService.selected$;
|
|
2283
|
+
this.days$ = this._calendarService.days$;
|
|
2284
|
+
this.today = this._calendarService.today;
|
|
2285
|
+
this.mode$ = this._calendarService.mode$;
|
|
2286
|
+
this.monthWeeksCount$ = this.mode$.pipe(map((mode) => {
|
|
2287
|
+
if (mode === 'month') {
|
|
2288
|
+
return this._calendarService.selectedMonth.weeksCount;
|
|
2289
|
+
}
|
|
2290
|
+
return 0;
|
|
2291
|
+
}));
|
|
2292
|
+
this.modeTitle$ = combineLatest([this.days$, this.mode$]).pipe(takeUntil(this._onDestroy$), switchMap(([, mode]) => {
|
|
2293
|
+
if (mode === 'customMonth') {
|
|
2294
|
+
return of(`${this._calendarService.weeksCount} ${this._bbbTranslate.transform('Week')}`);
|
|
2295
|
+
}
|
|
2296
|
+
return of(this._bbbTranslate.transform(this._titleCase.transform(mode)));
|
|
2297
|
+
}));
|
|
2298
|
+
this.weekModeDays$ = this._calendarService.weekModeDays$;
|
|
2299
|
+
this._calendarService.calendars$.pipe(takeUntil(this._onDestroy$)).subscribe((calendars) => {
|
|
2300
|
+
const eventCalendars = [...calendars];
|
|
2301
|
+
// eventCalendars = eventCalendars.splice(this.selectedIndex, 3);
|
|
2302
|
+
this.calendars = eventCalendars;
|
|
2303
|
+
// if (this.monthCarouselView) {
|
|
2304
|
+
// this.monthCarouselView.nativeElement.selectedPage = 1;
|
|
2305
|
+
// }
|
|
2306
|
+
});
|
|
2307
|
+
// .pipe(takeUntil(this._onDestroy$))
|
|
2308
|
+
// .subscribe((todayIndex) => {
|
|
2309
|
+
// this.selectedIndex = this.todayIndex = todayIndex;
|
|
2310
|
+
// this.gotoPage(this.todayIndex);
|
|
2311
|
+
// });
|
|
2312
|
+
this.title$ = combineLatest([this.weekModeDays$, this.selectedMonth$, this.days$, this.mode$]).pipe(takeUntil(this._onDestroy$), switchMap(([weekModeDays, monthInfo, days, mode]) => {
|
|
2313
|
+
let monthName = monthInfo.dateInfo.monthName;
|
|
2314
|
+
const year = monthInfo.dateInfo.strYear;
|
|
2315
|
+
if (mode !== 'month') {
|
|
2316
|
+
let firstDayInfo;
|
|
2317
|
+
let lastDayInfo;
|
|
2318
|
+
const daysTemp = mode === 'customMonth' ? days : weekModeDays;
|
|
2319
|
+
if (daysTemp.length > 0) {
|
|
2320
|
+
firstDayInfo = daysTemp[0];
|
|
2321
|
+
lastDayInfo = daysTemp[daysTemp.length - 1];
|
|
2322
|
+
monthName = firstDayInfo.monthName;
|
|
2323
|
+
if (firstDayInfo.month !== lastDayInfo.month) {
|
|
2324
|
+
monthName = `${firstDayInfo.monthName} -
|
|
2325
|
+
${lastDayInfo.monthName}`;
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
2329
|
+
return of(`${monthName} ${year}`);
|
|
2330
|
+
}));
|
|
2331
|
+
}
|
|
2332
|
+
_setWidthAndHeight() {
|
|
2333
|
+
this.width = this._el.nativeElement.offsetWidth;
|
|
2334
|
+
this.height = this._el.nativeElement.offsetHeight - 45;
|
|
2335
|
+
}
|
|
2336
|
+
}
|
|
2337
|
+
CalendarContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarContainerComponent, deps: [{ token: i3.TitleCasePipe }, { token: i2.BbbTranslatePipe }, { token: CalendarService }, { token: i2.DateService }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }, { token: i2.FindColumnByDbNamePipe }, { token: i2.UlvMainService }, { token: i2.PortalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
2338
|
+
CalendarContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.7", type: CalendarContainerComponent, selector: "bc-calendar-container", inputs: { calendarFields: "calendarFields" }, outputs: { deleteTask: "deleteTask", editTask: "editTask", daySelect: "daySelect", loadData: "loadData" }, providers: [
|
|
2339
|
+
{
|
|
2340
|
+
provide: DateService,
|
|
2341
|
+
useFactory: getDateService,
|
|
2342
|
+
deps: [LogService]
|
|
2343
|
+
}
|
|
2344
|
+
], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<bc-calendar-header\n [monthInfo]=\"(selectedMonth$ | async)!!\"\n [weekModeDays]=\"(weekModeDays$ | async)!!\"\n [rtl]=\"rtl\"\n [mode]=\"(mode$ | async)!!\"\n [modeTitle]=\"(modeTitle$ | async)!!\"\n [title]=\"(title$ | async)!!\"\n (modeChange)=\"onModeChange($event)\"\n (prevTap)=\"onPrevTap()\"\n (nextTap)=\"onNextTap()\"\n (today)=\"onToday()\"\n (rangeChange)=\"onRangeChange($event)\"\n>\n</bc-calendar-header>\n\n<ng-container [ngSwitch]=\"mode$ | async\">\n <ng-container *ngSwitchCase=\"'week'\">\n <ng-container\n *ngTemplateOutlet=\"\n weekCalendar;\n context: {\n $implicit: selectedMonth$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n weekModeDays: weekModeDays$ | async,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'day'\">\n <ng-container\n *ngTemplateOutlet=\"\n weekCalendar;\n context: {\n $implicit: selectedMonth$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n weekModeDays: weekModeDays$ | async,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'list'\"></ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"\n monthCalendar;\n context: {\n $implicit: days$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n monthWeeksCount: monthWeeksCount$ | async,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template\n #monthCalendar\n let-days\n let-moDataList=\"moDataList\"\n let-width=\"width\"\n let-height=\"height\"\n let-calendarFields=\"calendarFields\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-monthWeeksCount=\"monthWeeksCount\"\n let-access=\"access\"\n>\n <bc-calendar-month\n [style.width]=\"width\"\n [containerHeight]=\"parentHeight !== 0 ? parentHeight : height\"\n [containerWidth]=\"width\"\n [calendarFields]=\"calendarFields\"\n [moDataList]=\"moDataList\"\n [monthWeeksCount]=\"monthWeeksCount\"\n [rtl]=\"rtl\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [showEvents]=\"showEvents\"\n [days]=\"days\"\n [canAdd]=\"access.Add\"\n [canEdit]=\"access.Edit\"\n [canDelete]=\"access.Delete\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event)\"\n (showEvent)=\"onShowTask()\"\n (deleteEvent)=\"deleteTask.emit($event)\"\n (editEvent)=\"editTask.emit($event)\"\n (daySelect)=\"daySelect.emit($event)\"\n ></bc-calendar-month>\n</ng-template>\n\n<ng-template #listCalendar>\n <bc-calendar-list-container\n [showEvents]=\"showEvents\"\n [selectedDay]=\"selectedDay\"\n [calendarFields]=\"calendarFields\"\n (showEventsTap)=\"showEvents = !showEvents\"\n ></bc-calendar-list-container>\n</ng-template>\n\n<ng-template\n #weekCalendar\n let-selectedMonth\n let-moDataList=\"moDataList\"\n let-width=\"width\"\n let-height=\"height\"\n let-calendarFields=\"calendarFields\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-weekModeDays=\"weekModeDays\"\n let-access=\"access\"\n>\n <bc-calendar-week\n [style.width]=\"width\"\n [containerHeight]=\"parentHeight !== 0 ? parentHeight : height\"\n [containerWidth]=\"width\"\n [inDialog]=\"inDialog\"\n [calendarFields]=\"calendarFields\"\n [moDataList]=\"moDataList\"\n [rtl]=\"rtl\"\n [canAdd]=\"access.Add\"\n [canEdit]=\"access.Edit\"\n [canDelete]=\"access.Delete\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [showEvents]=\"showEvents\"\n [days]=\"weekModeDays\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event)\"\n (showEvent)=\"onShowTask()\"\n (deleteEvent)=\"deleteTask.emit($event)\"\n (editEvent)=\"editTask.emit($event)\"\n (daySelect)=\"daySelect.emit($event)\"\n ></bc-calendar-week>\n</ng-template>\n", styles: [":host{display:block;width:100%;height:100%}\n"], dependencies: [{ kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i3.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "component", type: CalendarListContainerComponent, selector: "bc-calendar-list-container", inputs: ["view", "reportItemComponentName", "showEvents", "selectedDay", "calendarFields"], outputs: ["showEventsTap"] }, { kind: "component", type: CalendarWeekComponent, selector: "bc-calendar-week", inputs: ["weekDays", "weekDaysMin", "today", "containerHeight", "calendarFields", "rtl", "inDialog", "deviceSize", "moDataList", "days", "canDelete", "canAdd", "canEdit"], outputs: ["editEvent", "deleteEvent", "showEvent", "daySelect", "dayClick"] }, { kind: "component", type: CalendarMonthComponent, selector: "bc-calendar-month", inputs: ["monthWeeksCount", "weekDays", "weekDaysMin", "today", "containerHeight", "days", "calendarFields", "rtl", "deviceSize", "moDataList", "datePicker", "rangePicker", "canDelete", "canAdd", "canEdit", "selectedDate", "startSelectedDayIndex", "endSelectedDayIndex"], outputs: ["editEvent", "deleteEvent", "daySelect", "dayClick", "dayMouseMove", "dayMouseUp", "dayMouseDown", "showEvent"] }, { kind: "component", type: CalendarHeaderComponent, selector: "bc-calendar-header", inputs: ["monthInfo", "weekModeDays", "hideMode", "modeTitle", "title", "rtl", "mode"], outputs: ["prevTap", "nextTap", "modeChange", "rangeChange", "today"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
2345
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: CalendarContainerComponent, decorators: [{
|
|
2346
|
+
type: Component,
|
|
2347
|
+
args: [{ selector: 'bc-calendar-container', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2348
|
+
{
|
|
2349
|
+
provide: DateService,
|
|
2350
|
+
useFactory: getDateService,
|
|
2351
|
+
deps: [LogService]
|
|
2352
|
+
}
|
|
2353
|
+
], template: "<bc-calendar-header\n [monthInfo]=\"(selectedMonth$ | async)!!\"\n [weekModeDays]=\"(weekModeDays$ | async)!!\"\n [rtl]=\"rtl\"\n [mode]=\"(mode$ | async)!!\"\n [modeTitle]=\"(modeTitle$ | async)!!\"\n [title]=\"(title$ | async)!!\"\n (modeChange)=\"onModeChange($event)\"\n (prevTap)=\"onPrevTap()\"\n (nextTap)=\"onNextTap()\"\n (today)=\"onToday()\"\n (rangeChange)=\"onRangeChange($event)\"\n>\n</bc-calendar-header>\n\n<ng-container [ngSwitch]=\"mode$ | async\">\n <ng-container *ngSwitchCase=\"'week'\">\n <ng-container\n *ngTemplateOutlet=\"\n weekCalendar;\n context: {\n $implicit: selectedMonth$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n weekModeDays: weekModeDays$ | async,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'day'\">\n <ng-container\n *ngTemplateOutlet=\"\n weekCalendar;\n context: {\n $implicit: selectedMonth$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n weekModeDays: weekModeDays$ | async,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'list'\"></ng-container>\n <ng-container *ngSwitchDefault>\n <ng-container\n *ngTemplateOutlet=\"\n monthCalendar;\n context: {\n $implicit: days$ | async,\n moDataList: eventMoDataList$ | async,\n width: width,\n height: height,\n rtl: rtl,\n showEvents: showEvents,\n today: today,\n deviceSize: deviceSize,\n calendarFields: calendarFields,\n monthWeeksCount: monthWeeksCount$ | async,\n access: access\n }\n \"\n ></ng-container>\n </ng-container>\n</ng-container>\n\n<ng-template\n #monthCalendar\n let-days\n let-moDataList=\"moDataList\"\n let-width=\"width\"\n let-height=\"height\"\n let-calendarFields=\"calendarFields\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-monthWeeksCount=\"monthWeeksCount\"\n let-access=\"access\"\n>\n <bc-calendar-month\n [style.width]=\"width\"\n [containerHeight]=\"parentHeight !== 0 ? parentHeight : height\"\n [containerWidth]=\"width\"\n [calendarFields]=\"calendarFields\"\n [moDataList]=\"moDataList\"\n [monthWeeksCount]=\"monthWeeksCount\"\n [rtl]=\"rtl\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [showEvents]=\"showEvents\"\n [days]=\"days\"\n [canAdd]=\"access.Add\"\n [canEdit]=\"access.Edit\"\n [canDelete]=\"access.Delete\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event)\"\n (showEvent)=\"onShowTask()\"\n (deleteEvent)=\"deleteTask.emit($event)\"\n (editEvent)=\"editTask.emit($event)\"\n (daySelect)=\"daySelect.emit($event)\"\n ></bc-calendar-month>\n</ng-template>\n\n<ng-template #listCalendar>\n <bc-calendar-list-container\n [showEvents]=\"showEvents\"\n [selectedDay]=\"selectedDay\"\n [calendarFields]=\"calendarFields\"\n (showEventsTap)=\"showEvents = !showEvents\"\n ></bc-calendar-list-container>\n</ng-template>\n\n<ng-template\n #weekCalendar\n let-selectedMonth\n let-moDataList=\"moDataList\"\n let-width=\"width\"\n let-height=\"height\"\n let-calendarFields=\"calendarFields\"\n let-rtl=\"rtl\"\n let-today=\"today\"\n let-showEvents=\"showEvents\"\n let-deviceSize=\"deviceSize\"\n let-weekModeDays=\"weekModeDays\"\n let-access=\"access\"\n>\n <bc-calendar-week\n [style.width]=\"width\"\n [containerHeight]=\"parentHeight !== 0 ? parentHeight : height\"\n [containerWidth]=\"width\"\n [inDialog]=\"inDialog\"\n [calendarFields]=\"calendarFields\"\n [moDataList]=\"moDataList\"\n [rtl]=\"rtl\"\n [canAdd]=\"access.Add\"\n [canEdit]=\"access.Edit\"\n [canDelete]=\"access.Delete\"\n [weekDays]=\"weekDays\"\n [weekDaysMin]=\"weekDaysMin\"\n [today]=\"today\"\n [showEvents]=\"showEvents\"\n [days]=\"weekModeDays\"\n [deviceSize]=\"deviceSize\"\n (dayClick)=\"onDayClick($event)\"\n (showEvent)=\"onShowTask()\"\n (deleteEvent)=\"deleteTask.emit($event)\"\n (editEvent)=\"editTask.emit($event)\"\n (daySelect)=\"daySelect.emit($event)\"\n ></bc-calendar-week>\n</ng-template>\n", styles: [":host{display:block;width:100%;height:100%}\n"] }]
|
|
2354
|
+
}], ctorParameters: function () { return [{ type: i3.TitleCasePipe }, { type: i2.BbbTranslatePipe }, { type: CalendarService }, { type: i2.DateService }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }, { type: i2.FindColumnByDbNamePipe }, { type: i2.UlvMainService }, { type: i2.PortalService }]; }, propDecorators: { calendarFields: [{
|
|
2355
|
+
type: Input
|
|
2356
|
+
}], deleteTask: [{
|
|
2357
|
+
type: Output
|
|
2358
|
+
}], editTask: [{
|
|
2359
|
+
type: Output
|
|
2360
|
+
}], daySelect: [{
|
|
2361
|
+
type: Output
|
|
2362
|
+
}], loadData: [{
|
|
2363
|
+
type: Output
|
|
2364
|
+
}] } });
|
|
2365
|
+
|
|
2366
|
+
const components = [
|
|
2367
|
+
CalendarContainerComponent,
|
|
2368
|
+
CalendarListComponent,
|
|
2369
|
+
CalendarListContainerComponent,
|
|
2370
|
+
CalendarListItemComponent,
|
|
2371
|
+
CalendarWeekComponent,
|
|
2372
|
+
CalendarMonthComponent,
|
|
2373
|
+
MonthDaysComponent,
|
|
2374
|
+
CalendarHeaderComponent,
|
|
2375
|
+
EventPreviewComponent,
|
|
2376
|
+
DayNumberBoxComponent,
|
|
2377
|
+
EventButtonComponent,
|
|
2378
|
+
DayEventListComponent
|
|
2379
|
+
];
|
|
2380
|
+
const pipes = [DaysInWeekPipe, EventDatePipe, EventTimePipe, FromToTimePipe, EqualDatePipe];
|
|
2381
|
+
class BarsaCalendarModule {
|
|
2382
|
+
}
|
|
2383
|
+
BarsaCalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaCalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2384
|
+
BarsaCalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.7", ngImport: i0, type: BarsaCalendarModule, declarations: [CalendarContainerComponent,
|
|
2385
|
+
CalendarListComponent,
|
|
2386
|
+
CalendarListContainerComponent,
|
|
2387
|
+
CalendarListItemComponent,
|
|
2388
|
+
CalendarWeekComponent,
|
|
2389
|
+
CalendarMonthComponent,
|
|
2390
|
+
MonthDaysComponent,
|
|
2391
|
+
CalendarHeaderComponent,
|
|
2392
|
+
EventPreviewComponent,
|
|
2393
|
+
DayNumberBoxComponent,
|
|
2394
|
+
EventButtonComponent,
|
|
2395
|
+
DayEventListComponent, DaysInWeekPipe, EventDatePipe, EventTimePipe, FromToTimePipe, EqualDatePipe, DateTimePickerComponent, CalendarSelectionDaysComponent], imports: [CommonModule,
|
|
2396
|
+
FormsModule,
|
|
2397
|
+
BarsaNovinRayCoreModule,
|
|
2398
|
+
FundamentalNgxCoreModule,
|
|
2399
|
+
FundamentalNgxPlatformModule,
|
|
2400
|
+
PopoverModule,
|
|
2401
|
+
CardModule,
|
|
2402
|
+
QuickViewModule], exports: [CalendarContainerComponent,
|
|
2403
|
+
CalendarListComponent,
|
|
2404
|
+
CalendarListContainerComponent,
|
|
2405
|
+
CalendarListItemComponent,
|
|
2406
|
+
CalendarWeekComponent,
|
|
2407
|
+
CalendarMonthComponent,
|
|
2408
|
+
MonthDaysComponent,
|
|
2409
|
+
CalendarHeaderComponent,
|
|
2410
|
+
EventPreviewComponent,
|
|
2411
|
+
DayNumberBoxComponent,
|
|
2412
|
+
EventButtonComponent,
|
|
2413
|
+
DayEventListComponent, DateTimePickerComponent, CalendarSelectionDaysComponent] });
|
|
2414
|
+
BarsaCalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaCalendarModule, providers: [TitleCasePipe, CalendarService, ...pipes], imports: [CommonModule,
|
|
2415
|
+
FormsModule,
|
|
2416
|
+
BarsaNovinRayCoreModule,
|
|
2417
|
+
FundamentalNgxCoreModule,
|
|
2418
|
+
FundamentalNgxPlatformModule,
|
|
2419
|
+
PopoverModule,
|
|
2420
|
+
CardModule,
|
|
2421
|
+
QuickViewModule] });
|
|
2422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.7", ngImport: i0, type: BarsaCalendarModule, decorators: [{
|
|
2423
|
+
type: NgModule,
|
|
2424
|
+
args: [{
|
|
2425
|
+
schemas: [NO_ERRORS_SCHEMA],
|
|
2426
|
+
imports: [
|
|
2427
|
+
CommonModule,
|
|
2428
|
+
FormsModule,
|
|
2429
|
+
BarsaNovinRayCoreModule,
|
|
2430
|
+
FundamentalNgxCoreModule,
|
|
2431
|
+
FundamentalNgxPlatformModule,
|
|
2432
|
+
PopoverModule,
|
|
2433
|
+
CardModule,
|
|
2434
|
+
QuickViewModule
|
|
2435
|
+
],
|
|
2436
|
+
declarations: [...components, ...pipes, DateTimePickerComponent, CalendarSelectionDaysComponent],
|
|
2437
|
+
providers: [TitleCasePipe, CalendarService, ...pipes],
|
|
2438
|
+
exports: [...components, DateTimePickerComponent, CalendarSelectionDaysComponent]
|
|
2439
|
+
}]
|
|
2440
|
+
}] });
|
|
2441
|
+
|
|
2442
|
+
/**
|
|
2443
|
+
* Generated bundle index. Do not edit.
|
|
2444
|
+
*/
|
|
2445
|
+
|
|
2446
|
+
export { BarsaCalendarModule, CalendarContainerComponent, CalendarHeaderComponent, CalendarListComponent, CalendarListContainerComponent, CalendarListItemComponent, CalendarMonthComponent, CalendarMonthInfo, CalendarSelectionDaysComponent, CalendarService, CalendarWeekComponent, DateTimePickerComponent, DayEventListComponent, DayNumberBoxComponent, DayStatus, EventButtonComponent, EventPreviewComponent, MonthDaysComponent, TimeConfigI18n };
|
|
2447
|
+
//# sourceMappingURL=barsa-calendar.mjs.map
|