source: trip-planner-front/node_modules/primeng/fesm2015/primeng-calendar.mjs@ 76712b2

Last change on this file since 76712b2 was 59329aa, checked in by Ema <ema_spirova@…>, 3 years ago

adding photos

  • Property mode set to 100644
File size: 111.1 KB
RevLine 
[59329aa]1import * as i0 from '@angular/core';
2import { forwardRef, EventEmitter, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, ContentChildren, ViewChild, NgModule } from '@angular/core';
3import { trigger, state, style, transition, animate } from '@angular/animations';
4import * as i2 from '@angular/common';
5import { CommonModule } from '@angular/common';
6import * as i3 from 'primeng/button';
7import { ButtonModule } from 'primeng/button';
8import * as i4 from 'primeng/ripple';
9import { RippleModule } from 'primeng/ripple';
10import { DomHandler, ConnectedOverlayScrollHandler } from 'primeng/dom';
11import * as i1 from 'primeng/api';
12import { TranslationKeys, PrimeTemplate, SharedModule } from 'primeng/api';
13import { NG_VALUE_ACCESSOR } from '@angular/forms';
14import { ZIndexUtils } from 'primeng/utils';
15
16const CALENDAR_VALUE_ACCESSOR = {
17 provide: NG_VALUE_ACCESSOR,
18 useExisting: forwardRef(() => Calendar),
19 multi: true
20};
21class Calendar {
22 constructor(el, renderer, cd, zone, config, overlayService) {
23 this.el = el;
24 this.renderer = renderer;
25 this.cd = cd;
26 this.zone = zone;
27 this.config = config;
28 this.overlayService = overlayService;
29 this.multipleSeparator = ',';
30 this.rangeSeparator = '-';
31 this.inline = false;
32 this.showOtherMonths = true;
33 this.icon = 'pi pi-calendar';
34 this.shortYearCutoff = '+10';
35 this.hourFormat = '24';
36 this.stepHour = 1;
37 this.stepMinute = 1;
38 this.stepSecond = 1;
39 this.showSeconds = false;
40 this.showOnFocus = true;
41 this.showWeek = false;
42 this.dataType = 'date';
43 this.selectionMode = 'single';
44 this.todayButtonStyleClass = 'p-button-text';
45 this.clearButtonStyleClass = 'p-button-text';
46 this.autoZIndex = true;
47 this.baseZIndex = 0;
48 this.keepInvalid = false;
49 this.hideOnDateTimeSelect = true;
50 this.numberOfMonths = 1;
51 this.view = 'date';
52 this.timeSeparator = ":";
53 this.focusTrap = true;
54 this.firstDayOfWeek = 0;
55 this.showTransitionOptions = '.12s cubic-bezier(0, 0, 0.2, 1)';
56 this.hideTransitionOptions = '.1s linear';
57 this.onFocus = new EventEmitter();
58 this.onBlur = new EventEmitter();
59 this.onClose = new EventEmitter();
60 this.onSelect = new EventEmitter();
61 this.onInput = new EventEmitter();
62 this.onTodayClick = new EventEmitter();
63 this.onClearClick = new EventEmitter();
64 this.onMonthChange = new EventEmitter();
65 this.onYearChange = new EventEmitter();
66 this.onClickOutside = new EventEmitter();
67 this.onShow = new EventEmitter();
68 this.onModelChange = () => { };
69 this.onModelTouched = () => { };
70 this.inputFieldValue = null;
71 this.navigationState = null;
72 this.convertTo24Hour = function (hours, pm) {
73 if (this.hourFormat == '12') {
74 if (hours === 12) {
75 return (pm ? 12 : 0);
76 }
77 else {
78 return (pm ? hours + 12 : hours);
79 }
80 }
81 return hours;
82 };
83 }
84 set content(content) {
85 this.contentViewChild = content;
86 if (this.contentViewChild) {
87 if (this.isMonthNavigate) {
88 Promise.resolve(null).then(() => this.updateFocus());
89 this.isMonthNavigate = false;
90 }
91 else {
92 this.initFocusableCell();
93 }
94 }
95 }
96 ;
97 get defaultDate() {
98 return this._defaultDate;
99 }
100 ;
101 set defaultDate(defaultDate) {
102 this._defaultDate = defaultDate;
103 if (this.initialized) {
104 const date = defaultDate || new Date();
105 this.currentMonth = date.getMonth();
106 this.currentYear = date.getFullYear();
107 this.initTime(date);
108 this.createMonths(this.currentMonth, this.currentYear);
109 }
110 }
111 get minDate() {
112 return this._minDate;
113 }
114 set minDate(date) {
115 this._minDate = date;
116 if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
117 this.createMonths(this.currentMonth, this.currentYear);
118 }
119 }
120 get maxDate() {
121 return this._maxDate;
122 }
123 set maxDate(date) {
124 this._maxDate = date;
125 if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
126 this.createMonths(this.currentMonth, this.currentYear);
127 }
128 }
129 get disabledDates() {
130 return this._disabledDates;
131 }
132 set disabledDates(disabledDates) {
133 this._disabledDates = disabledDates;
134 if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
135 this.createMonths(this.currentMonth, this.currentYear);
136 }
137 }
138 get disabledDays() {
139 return this._disabledDays;
140 }
141 set disabledDays(disabledDays) {
142 this._disabledDays = disabledDays;
143 if (this.currentMonth != undefined && this.currentMonth != null && this.currentYear) {
144 this.createMonths(this.currentMonth, this.currentYear);
145 }
146 }
147 get yearRange() {
148 return this._yearRange;
149 }
150 set yearRange(yearRange) {
151 this._yearRange = yearRange;
152 if (yearRange) {
153 const years = yearRange.split(':');
154 const yearStart = parseInt(years[0]);
155 const yearEnd = parseInt(years[1]);
156 this.populateYearOptions(yearStart, yearEnd);
157 }
158 }
159 get showTime() {
160 return this._showTime;
161 }
162 set showTime(showTime) {
163 this._showTime = showTime;
164 if (this.currentHour === undefined) {
165 this.initTime(this.value || new Date());
166 }
167 this.updateInputfield();
168 }
169 get locale() {
170 return this._locale;
171 }
172 set locale(newLocale) {
173 console.warn("Locale property has no effect, use new i18n API instead.");
174 }
175 ngOnInit() {
176 const date = this.defaultDate || new Date();
177 this.currentMonth = date.getMonth();
178 this.currentYear = date.getFullYear();
179 if (this.view === 'date') {
180 this.createWeekDays();
181 this.initTime(date);
182 this.createMonths(this.currentMonth, this.currentYear);
183 this.ticksTo1970 = (((1970 - 1) * 365 + Math.floor(1970 / 4) - Math.floor(1970 / 100) + Math.floor(1970 / 400)) * 24 * 60 * 60 * 10000000);
184 }
185 else if (this.view === 'month') {
186 this.createMonthPickerValues();
187 }
188 this.translationSubscription = this.config.translationObserver.subscribe(() => {
189 this.createWeekDays();
190 });
191 this.initialized = true;
192 }
193 ngAfterContentInit() {
194 this.templates.forEach((item) => {
195 switch (item.getType()) {
196 case 'date':
197 this.dateTemplate = item.template;
198 break;
199 case 'disabledDate':
200 this.disabledDateTemplate = item.template;
201 break;
202 case 'header':
203 this.headerTemplate = item.template;
204 break;
205 case 'footer':
206 this.footerTemplate = item.template;
207 break;
208 default:
209 this.dateTemplate = item.template;
210 break;
211 }
212 });
213 }
214 getTranslation(option) {
215 return this.config.getTranslation(option);
216 }
217 populateYearOptions(start, end) {
218 this.yearOptions = [];
219 for (let i = start; i <= end; i++) {
220 this.yearOptions.push(i);
221 }
222 }
223 createWeekDays() {
224 this.weekDays = [];
225 let dayIndex = this.firstDayOfWeek;
226 let dayLabels = this.getTranslation(TranslationKeys.DAY_NAMES_MIN);
227 for (let i = 0; i < 7; i++) {
228 this.weekDays.push(dayLabels[dayIndex]);
229 dayIndex = (dayIndex == 6) ? 0 : ++dayIndex;
230 }
231 }
232 createMonthPickerValues() {
233 this.monthPickerValues = [];
234 let monthLabels = this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT);
235 for (let i = 0; i <= 11; i++) {
236 this.monthPickerValues.push(monthLabels[i]);
237 }
238 }
239 createMonths(month, year) {
240 this.months = this.months = [];
241 for (let i = 0; i < this.numberOfMonths; i++) {
242 let m = month + i;
243 let y = year;
244 if (m > 11) {
245 m = m % 11 - 1;
246 y = year + 1;
247 }
248 this.months.push(this.createMonth(m, y));
249 }
250 }
251 getWeekNumber(date) {
252 let checkDate = new Date(date.getTime());
253 checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
254 let time = checkDate.getTime();
255 checkDate.setMonth(0);
256 checkDate.setDate(1);
257 return Math.floor(Math.round((time - checkDate.getTime()) / 86400000) / 7) + 1;
258 }
259 createMonth(month, year) {
260 let dates = [];
261 let firstDay = this.getFirstDayOfMonthIndex(month, year);
262 let daysLength = this.getDaysCountInMonth(month, year);
263 let prevMonthDaysLength = this.getDaysCountInPrevMonth(month, year);
264 let dayNo = 1;
265 let today = new Date();
266 let weekNumbers = [];
267 let monthRows = Math.ceil((daysLength + firstDay) / 7);
268 for (let i = 0; i < monthRows; i++) {
269 let week = [];
270 if (i == 0) {
271 for (let j = (prevMonthDaysLength - firstDay + 1); j <= prevMonthDaysLength; j++) {
272 let prev = this.getPreviousMonthAndYear(month, year);
273 week.push({ day: j, month: prev.month, year: prev.year, otherMonth: true,
274 today: this.isToday(today, j, prev.month, prev.year), selectable: this.isSelectable(j, prev.month, prev.year, true) });
275 }
276 let remainingDaysLength = 7 - week.length;
277 for (let j = 0; j < remainingDaysLength; j++) {
278 week.push({ day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
279 selectable: this.isSelectable(dayNo, month, year, false) });
280 dayNo++;
281 }
282 }
283 else {
284 for (let j = 0; j < 7; j++) {
285 if (dayNo > daysLength) {
286 let next = this.getNextMonthAndYear(month, year);
287 week.push({ day: dayNo - daysLength, month: next.month, year: next.year, otherMonth: true,
288 today: this.isToday(today, dayNo - daysLength, next.month, next.year),
289 selectable: this.isSelectable((dayNo - daysLength), next.month, next.year, true) });
290 }
291 else {
292 week.push({ day: dayNo, month: month, year: year, today: this.isToday(today, dayNo, month, year),
293 selectable: this.isSelectable(dayNo, month, year, false) });
294 }
295 dayNo++;
296 }
297 }
298 if (this.showWeek) {
299 weekNumbers.push(this.getWeekNumber(new Date(week[0].year, week[0].month, week[0].day)));
300 }
301 dates.push(week);
302 }
303 return {
304 month: month,
305 year: year,
306 dates: dates,
307 weekNumbers: weekNumbers
308 };
309 }
310 initTime(date) {
311 this.pm = date.getHours() > 11;
312 if (this.showTime) {
313 this.currentMinute = date.getMinutes();
314 this.currentSecond = date.getSeconds();
315 this.setCurrentHourPM(date.getHours());
316 }
317 else if (this.timeOnly) {
318 this.currentMinute = 0;
319 this.currentHour = 0;
320 this.currentSecond = 0;
321 }
322 }
323 navBackward(event) {
324 event.stopPropagation();
325 if (this.disabled) {
326 event.preventDefault();
327 return;
328 }
329 this.isMonthNavigate = true;
330 if (this.view === 'month') {
331 this.decrementYear();
332 setTimeout(() => {
333 this.updateFocus();
334 }, 1);
335 }
336 else {
337 if (this.currentMonth === 0) {
338 this.currentMonth = 11;
339 this.decrementYear();
340 }
341 else {
342 this.currentMonth--;
343 }
344 this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
345 this.createMonths(this.currentMonth, this.currentYear);
346 }
347 }
348 navForward(event) {
349 event.stopPropagation();
350 if (this.disabled) {
351 event.preventDefault();
352 return;
353 }
354 this.isMonthNavigate = true;
355 if (this.view === 'month') {
356 this.incrementYear();
357 setTimeout(() => {
358 this.updateFocus();
359 }, 1);
360 }
361 else {
362 if (this.currentMonth === 11) {
363 this.currentMonth = 0;
364 this.incrementYear();
365 }
366 else {
367 this.currentMonth++;
368 }
369 this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
370 this.createMonths(this.currentMonth, this.currentYear);
371 }
372 }
373 decrementYear() {
374 this.currentYear--;
375 if (this.yearNavigator && this.currentYear < this.yearOptions[0]) {
376 let difference = this.yearOptions[this.yearOptions.length - 1] - this.yearOptions[0];
377 this.populateYearOptions(this.yearOptions[0] - difference, this.yearOptions[this.yearOptions.length - 1] - difference);
378 }
379 }
380 incrementYear() {
381 this.currentYear++;
382 if (this.yearNavigator && this.currentYear > this.yearOptions[this.yearOptions.length - 1]) {
383 let difference = this.yearOptions[this.yearOptions.length - 1] - this.yearOptions[0];
384 this.populateYearOptions(this.yearOptions[0] + difference, this.yearOptions[this.yearOptions.length - 1] + difference);
385 }
386 }
387 onDateSelect(event, dateMeta) {
388 if (this.disabled || !dateMeta.selectable) {
389 event.preventDefault();
390 return;
391 }
392 if (this.isMultipleSelection() && this.isSelected(dateMeta)) {
393 this.value = this.value.filter((date, i) => {
394 return !this.isDateEquals(date, dateMeta);
395 });
396 if (this.value.length === 0) {
397 this.value = null;
398 }
399 this.updateModel(this.value);
400 }
401 else {
402 if (this.shouldSelectDate(dateMeta)) {
403 this.selectDate(dateMeta);
404 }
405 }
406 if (this.isSingleSelection() && this.hideOnDateTimeSelect) {
407 setTimeout(() => {
408 event.preventDefault();
409 this.hideOverlay();
410 if (this.mask) {
411 this.disableModality();
412 }
413 this.cd.markForCheck();
414 }, 150);
415 }
416 this.updateInputfield();
417 event.preventDefault();
418 }
419 shouldSelectDate(dateMeta) {
420 if (this.isMultipleSelection())
421 return this.maxDateCount != null ? this.maxDateCount > (this.value ? this.value.length : 0) : true;
422 else
423 return true;
424 }
425 onMonthSelect(event, index) {
426 if (!DomHandler.hasClass(event.target, 'p-disabled')) {
427 this.onDateSelect(event, { year: this.currentYear, month: index, day: 1, selectable: true });
428 }
429 }
430 updateInputfield() {
431 let formattedValue = '';
432 if (this.value) {
433 if (this.isSingleSelection()) {
434 formattedValue = this.formatDateTime(this.value);
435 }
436 else if (this.isMultipleSelection()) {
437 for (let i = 0; i < this.value.length; i++) {
438 let dateAsString = this.formatDateTime(this.value[i]);
439 formattedValue += dateAsString;
440 if (i !== (this.value.length - 1)) {
441 formattedValue += this.multipleSeparator + ' ';
442 }
443 }
444 }
445 else if (this.isRangeSelection()) {
446 if (this.value && this.value.length) {
447 let startDate = this.value[0];
448 let endDate = this.value[1];
449 formattedValue = this.formatDateTime(startDate);
450 if (endDate) {
451 formattedValue += ' ' + this.rangeSeparator + ' ' + this.formatDateTime(endDate);
452 }
453 }
454 }
455 }
456 this.inputFieldValue = formattedValue;
457 this.updateFilledState();
458 if (this.inputfieldViewChild && this.inputfieldViewChild.nativeElement) {
459 this.inputfieldViewChild.nativeElement.value = this.inputFieldValue;
460 }
461 }
462 formatDateTime(date) {
463 let formattedValue = null;
464 if (date) {
465 if (this.timeOnly) {
466 formattedValue = this.formatTime(date);
467 }
468 else {
469 formattedValue = this.formatDate(date, this.getDateFormat());
470 if (this.showTime) {
471 formattedValue += ' ' + this.formatTime(date);
472 }
473 }
474 }
475 return formattedValue;
476 }
477 setCurrentHourPM(hours) {
478 if (this.hourFormat == '12') {
479 this.pm = hours > 11;
480 if (hours >= 12) {
481 this.currentHour = (hours == 12) ? 12 : hours - 12;
482 }
483 else {
484 this.currentHour = (hours == 0) ? 12 : hours;
485 }
486 }
487 else {
488 this.currentHour = hours;
489 }
490 }
491 selectDate(dateMeta) {
492 let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
493 if (this.showTime) {
494 if (this.hourFormat == '12') {
495 if (this.currentHour === 12)
496 date.setHours(this.pm ? 12 : 0);
497 else
498 date.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
499 }
500 else {
501 date.setHours(this.currentHour);
502 }
503 date.setMinutes(this.currentMinute);
504 date.setSeconds(this.currentSecond);
505 }
506 if (this.minDate && this.minDate > date) {
507 date = this.minDate;
508 this.setCurrentHourPM(date.getHours());
509 this.currentMinute = date.getMinutes();
510 this.currentSecond = date.getSeconds();
511 }
512 if (this.maxDate && this.maxDate < date) {
513 date = this.maxDate;
514 this.setCurrentHourPM(date.getHours());
515 this.currentMinute = date.getMinutes();
516 this.currentSecond = date.getSeconds();
517 }
518 if (this.isSingleSelection()) {
519 this.updateModel(date);
520 }
521 else if (this.isMultipleSelection()) {
522 this.updateModel(this.value ? [...this.value, date] : [date]);
523 }
524 else if (this.isRangeSelection()) {
525 if (this.value && this.value.length) {
526 let startDate = this.value[0];
527 let endDate = this.value[1];
528 if (!endDate && date.getTime() >= startDate.getTime()) {
529 endDate = date;
530 }
531 else {
532 startDate = date;
533 endDate = null;
534 }
535 this.updateModel([startDate, endDate]);
536 }
537 else {
538 this.updateModel([date, null]);
539 }
540 }
541 this.onSelect.emit(date);
542 }
543 updateModel(value) {
544 this.value = value;
545 if (this.dataType == 'date') {
546 this.onModelChange(this.value);
547 }
548 else if (this.dataType == 'string') {
549 if (this.isSingleSelection()) {
550 this.onModelChange(this.formatDateTime(this.value));
551 }
552 else {
553 let stringArrValue = null;
554 if (this.value) {
555 stringArrValue = this.value.map(date => this.formatDateTime(date));
556 }
557 this.onModelChange(stringArrValue);
558 }
559 }
560 }
561 getFirstDayOfMonthIndex(month, year) {
562 let day = new Date();
563 day.setDate(1);
564 day.setMonth(month);
565 day.setFullYear(year);
566 let dayIndex = day.getDay() + this.getSundayIndex();
567 return dayIndex >= 7 ? dayIndex - 7 : dayIndex;
568 }
569 getDaysCountInMonth(month, year) {
570 return 32 - this.daylightSavingAdjust(new Date(year, month, 32)).getDate();
571 }
572 getDaysCountInPrevMonth(month, year) {
573 let prev = this.getPreviousMonthAndYear(month, year);
574 return this.getDaysCountInMonth(prev.month, prev.year);
575 }
576 getPreviousMonthAndYear(month, year) {
577 let m, y;
578 if (month === 0) {
579 m = 11;
580 y = year - 1;
581 }
582 else {
583 m = month - 1;
584 y = year;
585 }
586 return { 'month': m, 'year': y };
587 }
588 getNextMonthAndYear(month, year) {
589 let m, y;
590 if (month === 11) {
591 m = 0;
592 y = year + 1;
593 }
594 else {
595 m = month + 1;
596 y = year;
597 }
598 return { 'month': m, 'year': y };
599 }
600 getSundayIndex() {
601 return this.firstDayOfWeek > 0 ? 7 - this.firstDayOfWeek : 0;
602 }
603 isSelected(dateMeta) {
604 if (this.value) {
605 if (this.isSingleSelection()) {
606 return this.isDateEquals(this.value, dateMeta);
607 }
608 else if (this.isMultipleSelection()) {
609 let selected = false;
610 for (let date of this.value) {
611 selected = this.isDateEquals(date, dateMeta);
612 if (selected) {
613 break;
614 }
615 }
616 return selected;
617 }
618 else if (this.isRangeSelection()) {
619 if (this.value[1])
620 return this.isDateEquals(this.value[0], dateMeta) || this.isDateEquals(this.value[1], dateMeta) || this.isDateBetween(this.value[0], this.value[1], dateMeta);
621 else
622 return this.isDateEquals(this.value[0], dateMeta);
623 }
624 }
625 else {
626 return false;
627 }
628 }
629 isMonthSelected(month) {
630 let day = this.value ? (Array.isArray(this.value) ? this.value[0].getDate() : this.value.getDate()) : 1;
631 return this.isSelected({ year: this.currentYear, month: month, day: day, selectable: true });
632 }
633 isDateEquals(value, dateMeta) {
634 if (value)
635 return value.getDate() === dateMeta.day && value.getMonth() === dateMeta.month && value.getFullYear() === dateMeta.year;
636 else
637 return false;
638 }
639 isDateBetween(start, end, dateMeta) {
640 let between = false;
641 if (start && end) {
642 let date = new Date(dateMeta.year, dateMeta.month, dateMeta.day);
643 return start.getTime() <= date.getTime() && end.getTime() >= date.getTime();
644 }
645 return between;
646 }
647 isSingleSelection() {
648 return this.selectionMode === 'single';
649 }
650 isRangeSelection() {
651 return this.selectionMode === 'range';
652 }
653 isMultipleSelection() {
654 return this.selectionMode === 'multiple';
655 }
656 isToday(today, day, month, year) {
657 return today.getDate() === day && today.getMonth() === month && today.getFullYear() === year;
658 }
659 isSelectable(day, month, year, otherMonth) {
660 let validMin = true;
661 let validMax = true;
662 let validDate = true;
663 let validDay = true;
664 if (otherMonth && !this.selectOtherMonths) {
665 return false;
666 }
667 if (this.minDate) {
668 if (this.minDate.getFullYear() > year) {
669 validMin = false;
670 }
671 else if (this.minDate.getFullYear() === year) {
672 if (this.minDate.getMonth() > month) {
673 validMin = false;
674 }
675 else if (this.minDate.getMonth() === month) {
676 if (this.minDate.getDate() > day) {
677 validMin = false;
678 }
679 }
680 }
681 }
682 if (this.maxDate) {
683 if (this.maxDate.getFullYear() < year) {
684 validMax = false;
685 }
686 else if (this.maxDate.getFullYear() === year) {
687 if (this.maxDate.getMonth() < month) {
688 validMax = false;
689 }
690 else if (this.maxDate.getMonth() === month) {
691 if (this.maxDate.getDate() < day) {
692 validMax = false;
693 }
694 }
695 }
696 }
697 if (this.disabledDates) {
698 validDate = !this.isDateDisabled(day, month, year);
699 }
700 if (this.disabledDays) {
701 validDay = !this.isDayDisabled(day, month, year);
702 }
703 return validMin && validMax && validDate && validDay;
704 }
705 isDateDisabled(day, month, year) {
706 if (this.disabledDates) {
707 for (let disabledDate of this.disabledDates) {
708 if (disabledDate.getFullYear() === year && disabledDate.getMonth() === month && disabledDate.getDate() === day) {
709 return true;
710 }
711 }
712 }
713 return false;
714 }
715 isDayDisabled(day, month, year) {
716 if (this.disabledDays) {
717 let weekday = new Date(year, month, day);
718 let weekdayNumber = weekday.getDay();
719 return this.disabledDays.indexOf(weekdayNumber) !== -1;
720 }
721 return false;
722 }
723 onInputFocus(event) {
724 this.focus = true;
725 if (this.showOnFocus) {
726 this.showOverlay();
727 }
728 this.onFocus.emit(event);
729 }
730 onInputClick() {
731 if (this.showOnFocus && !this.overlayVisible) {
732 this.showOverlay();
733 }
734 }
735 onInputBlur(event) {
736 this.focus = false;
737 this.onBlur.emit(event);
738 if (!this.keepInvalid) {
739 this.updateInputfield();
740 }
741 this.onModelTouched();
742 }
743 onButtonClick(event, inputfield) {
744 if (!this.overlayVisible) {
745 inputfield.focus();
746 this.showOverlay();
747 }
748 else {
749 this.hideOverlay();
750 }
751 }
752 onOverlayClick(event) {
753 this.overlayService.add({
754 originalEvent: event,
755 target: this.el.nativeElement
756 });
757 }
758 onPrevButtonClick(event) {
759 this.navigationState = { backward: true, button: true };
760 this.navBackward(event);
761 }
762 onNextButtonClick(event) {
763 this.navigationState = { backward: false, button: true };
764 this.navForward(event);
765 }
766 onContainerButtonKeydown(event) {
767 switch (event.which) {
768 //tab
769 case 9:
770 if (!this.inline) {
771 this.trapFocus(event);
772 }
773 break;
774 //escape
775 case 27:
776 this.overlayVisible = false;
777 event.preventDefault();
778 break;
779 default:
780 //Noop
781 break;
782 }
783 }
784 onInputKeydown(event) {
785 this.isKeydown = true;
786 if (event.keyCode === 40 && this.contentViewChild) {
787 this.trapFocus(event);
788 }
789 else if (event.keyCode === 27) {
790 if (this.overlayVisible) {
791 this.overlayVisible = false;
792 event.preventDefault();
793 }
794 }
795 else if (event.keyCode === 13) {
796 if (this.overlayVisible) {
797 this.overlayVisible = false;
798 event.preventDefault();
799 }
800 }
801 else if (event.keyCode === 9 && this.contentViewChild) {
802 DomHandler.getFocusableElements(this.contentViewChild.nativeElement).forEach(el => el.tabIndex = '-1');
803 if (this.overlayVisible) {
804 this.overlayVisible = false;
805 }
806 }
807 }
808 onDateCellKeydown(event, date, groupIndex) {
809 const cellContent = event.currentTarget;
810 const cell = cellContent.parentElement;
811 switch (event.which) {
812 //down arrow
813 case 40: {
814 cellContent.tabIndex = '-1';
815 let cellIndex = DomHandler.index(cell);
816 let nextRow = cell.parentElement.nextElementSibling;
817 if (nextRow) {
818 let focusCell = nextRow.children[cellIndex].children[0];
819 if (DomHandler.hasClass(focusCell, 'p-disabled')) {
820 this.navigationState = { backward: false };
821 this.navForward(event);
822 }
823 else {
824 nextRow.children[cellIndex].children[0].tabIndex = '0';
825 nextRow.children[cellIndex].children[0].focus();
826 }
827 }
828 else {
829 this.navigationState = { backward: false };
830 this.navForward(event);
831 }
832 event.preventDefault();
833 break;
834 }
835 //up arrow
836 case 38: {
837 cellContent.tabIndex = '-1';
838 let cellIndex = DomHandler.index(cell);
839 let prevRow = cell.parentElement.previousElementSibling;
840 if (prevRow) {
841 let focusCell = prevRow.children[cellIndex].children[0];
842 if (DomHandler.hasClass(focusCell, 'p-disabled')) {
843 this.navigationState = { backward: true };
844 this.navBackward(event);
845 }
846 else {
847 focusCell.tabIndex = '0';
848 focusCell.focus();
849 }
850 }
851 else {
852 this.navigationState = { backward: true };
853 this.navBackward(event);
854 }
855 event.preventDefault();
856 break;
857 }
858 //left arrow
859 case 37: {
860 cellContent.tabIndex = '-1';
861 let prevCell = cell.previousElementSibling;
862 if (prevCell) {
863 let focusCell = prevCell.children[0];
864 if (DomHandler.hasClass(focusCell, 'p-disabled') || DomHandler.hasClass(focusCell.parentElement, 'p-datepicker-weeknumber')) {
865 this.navigateToMonth(true, groupIndex);
866 }
867 else {
868 focusCell.tabIndex = '0';
869 focusCell.focus();
870 }
871 }
872 else {
873 this.navigateToMonth(true, groupIndex);
874 }
875 event.preventDefault();
876 break;
877 }
878 //right arrow
879 case 39: {
880 cellContent.tabIndex = '-1';
881 let nextCell = cell.nextElementSibling;
882 if (nextCell) {
883 let focusCell = nextCell.children[0];
884 if (DomHandler.hasClass(focusCell, 'p-disabled')) {
885 this.navigateToMonth(false, groupIndex);
886 }
887 else {
888 focusCell.tabIndex = '0';
889 focusCell.focus();
890 }
891 }
892 else {
893 this.navigateToMonth(false, groupIndex);
894 }
895 event.preventDefault();
896 break;
897 }
898 //enter
899 case 13: {
900 this.onDateSelect(event, date);
901 event.preventDefault();
902 break;
903 }
904 //escape
905 case 27: {
906 this.overlayVisible = false;
907 event.preventDefault();
908 break;
909 }
910 //tab
911 case 9: {
912 if (!this.inline) {
913 this.trapFocus(event);
914 }
915 break;
916 }
917 default:
918 //no op
919 break;
920 }
921 }
922 onMonthCellKeydown(event, index) {
923 const cell = event.currentTarget;
924 switch (event.which) {
925 //arrows
926 case 38:
927 case 40: {
928 cell.tabIndex = '-1';
929 var cells = cell.parentElement.children;
930 var cellIndex = DomHandler.index(cell);
931 let nextCell = cells[event.which === 40 ? cellIndex + 3 : cellIndex - 3];
932 if (nextCell) {
933 nextCell.tabIndex = '0';
934 nextCell.focus();
935 }
936 event.preventDefault();
937 break;
938 }
939 //left arrow
940 case 37: {
941 cell.tabIndex = '-1';
942 let prevCell = cell.previousElementSibling;
943 if (prevCell) {
944 prevCell.tabIndex = '0';
945 prevCell.focus();
946 }
947 event.preventDefault();
948 break;
949 }
950 //right arrow
951 case 39: {
952 cell.tabIndex = '-1';
953 let nextCell = cell.nextElementSibling;
954 if (nextCell) {
955 nextCell.tabIndex = '0';
956 nextCell.focus();
957 }
958 event.preventDefault();
959 break;
960 }
961 //enter
962 case 13: {
963 this.onMonthSelect(event, index);
964 event.preventDefault();
965 break;
966 }
967 //escape
968 case 27: {
969 this.overlayVisible = false;
970 event.preventDefault();
971 break;
972 }
973 //tab
974 case 9: {
975 if (!this.inline) {
976 this.trapFocus(event);
977 }
978 break;
979 }
980 default:
981 //no op
982 break;
983 }
984 }
985 navigateToMonth(prev, groupIndex) {
986 if (prev) {
987 if (this.numberOfMonths === 1 || (groupIndex === 0)) {
988 this.navigationState = { backward: true };
989 this.navBackward(event);
990 }
991 else {
992 let prevMonthContainer = this.contentViewChild.nativeElement.children[groupIndex - 1];
993 let cells = DomHandler.find(prevMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
994 let focusCell = cells[cells.length - 1];
995 focusCell.tabIndex = '0';
996 focusCell.focus();
997 }
998 }
999 else {
1000 if (this.numberOfMonths === 1 || (groupIndex === this.numberOfMonths - 1)) {
1001 this.navigationState = { backward: false };
1002 this.navForward(event);
1003 }
1004 else {
1005 let nextMonthContainer = this.contentViewChild.nativeElement.children[groupIndex + 1];
1006 let focusCell = DomHandler.findSingle(nextMonthContainer, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
1007 focusCell.tabIndex = '0';
1008 focusCell.focus();
1009 }
1010 }
1011 }
1012 updateFocus() {
1013 let cell;
1014 if (this.navigationState) {
1015 if (this.navigationState.button) {
1016 this.initFocusableCell();
1017 if (this.navigationState.backward)
1018 DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-prev').focus();
1019 else
1020 DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-next').focus();
1021 }
1022 else {
1023 if (this.navigationState.backward) {
1024 let cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
1025 cell = cells[cells.length - 1];
1026 }
1027 else {
1028 cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
1029 }
1030 if (cell) {
1031 cell.tabIndex = '0';
1032 cell.focus();
1033 }
1034 }
1035 this.navigationState = null;
1036 }
1037 else {
1038 this.initFocusableCell();
1039 }
1040 }
1041 initFocusableCell() {
1042 let cell;
1043 if (this.view === 'month') {
1044 let cells = DomHandler.find(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month:not(.p-disabled)');
1045 let selectedCell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month.p-highlight');
1046 cells.forEach(cell => cell.tabIndex = -1);
1047 cell = selectedCell || cells[0];
1048 if (cells.length === 0) {
1049 let disabledCells = DomHandler.find(this.contentViewChild.nativeElement, '.p-monthpicker .p-monthpicker-month.p-disabled[tabindex = "0"]');
1050 disabledCells.forEach(cell => cell.tabIndex = -1);
1051 }
1052 }
1053 else {
1054 cell = DomHandler.findSingle(this.contentViewChild.nativeElement, 'span.p-highlight');
1055 if (!cell) {
1056 let todayCell = DomHandler.findSingle(this.contentViewChild.nativeElement, 'td.p-datepicker-today span:not(.p-disabled):not(.p-ink)');
1057 if (todayCell)
1058 cell = todayCell;
1059 else
1060 cell = DomHandler.findSingle(this.contentViewChild.nativeElement, '.p-datepicker-calendar td span:not(.p-disabled):not(.p-ink)');
1061 }
1062 }
1063 if (cell) {
1064 cell.tabIndex = '0';
1065 }
1066 }
1067 trapFocus(event) {
1068 let focusableElements = DomHandler.getFocusableElements(this.contentViewChild.nativeElement);
1069 if (focusableElements && focusableElements.length > 0) {
1070 if (!focusableElements[0].ownerDocument.activeElement) {
1071 focusableElements[0].focus();
1072 }
1073 else {
1074 let focusedIndex = focusableElements.indexOf(focusableElements[0].ownerDocument.activeElement);
1075 if (event.shiftKey) {
1076 if (focusedIndex == -1 || focusedIndex === 0) {
1077 if (this.focusTrap) {
1078 focusableElements[focusableElements.length - 1].focus();
1079 }
1080 else {
1081 if (focusedIndex === -1)
1082 return this.hideOverlay();
1083 else if (focusedIndex === 0)
1084 return;
1085 }
1086 }
1087 else {
1088 focusableElements[focusedIndex - 1].focus();
1089 }
1090 }
1091 else {
1092 if (focusedIndex == -1 || focusedIndex === (focusableElements.length - 1)) {
1093 if (!this.focusTrap && focusedIndex != -1)
1094 return this.hideOverlay();
1095 else
1096 focusableElements[0].focus();
1097 }
1098 else {
1099 focusableElements[focusedIndex + 1].focus();
1100 }
1101 }
1102 }
1103 }
1104 event.preventDefault();
1105 }
1106 onMonthDropdownChange(m) {
1107 this.currentMonth = parseInt(m);
1108 this.onMonthChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1109 this.createMonths(this.currentMonth, this.currentYear);
1110 }
1111 onYearDropdownChange(y) {
1112 this.currentYear = parseInt(y);
1113 this.onYearChange.emit({ month: this.currentMonth + 1, year: this.currentYear });
1114 this.createMonths(this.currentMonth, this.currentYear);
1115 }
1116 validateTime(hour, minute, second, pm) {
1117 let value = this.value;
1118 const convertedHour = this.convertTo24Hour(hour, pm);
1119 if (this.isRangeSelection()) {
1120 value = this.value[1] || this.value[0];
1121 }
1122 if (this.isMultipleSelection()) {
1123 value = this.value[this.value.length - 1];
1124 }
1125 const valueDateString = value ? value.toDateString() : null;
1126 if (this.minDate && valueDateString && this.minDate.toDateString() === valueDateString) {
1127 if (this.minDate.getHours() > convertedHour) {
1128 return false;
1129 }
1130 if (this.minDate.getHours() === convertedHour) {
1131 if (this.minDate.getMinutes() > minute) {
1132 return false;
1133 }
1134 if (this.minDate.getMinutes() === minute) {
1135 if (this.minDate.getSeconds() > second) {
1136 return false;
1137 }
1138 }
1139 }
1140 }
1141 if (this.maxDate && valueDateString && this.maxDate.toDateString() === valueDateString) {
1142 if (this.maxDate.getHours() < convertedHour) {
1143 return false;
1144 }
1145 if (this.maxDate.getHours() === convertedHour) {
1146 if (this.maxDate.getMinutes() < minute) {
1147 return false;
1148 }
1149 if (this.maxDate.getMinutes() === minute) {
1150 if (this.maxDate.getSeconds() < second) {
1151 return false;
1152 }
1153 }
1154 }
1155 }
1156 return true;
1157 }
1158 incrementHour(event) {
1159 const prevHour = this.currentHour;
1160 let newHour = this.currentHour + this.stepHour;
1161 let newPM = this.pm;
1162 if (this.hourFormat == '24')
1163 newHour = (newHour >= 24) ? (newHour - 24) : newHour;
1164 else if (this.hourFormat == '12') {
1165 // Before the AM/PM break, now after
1166 if (prevHour < 12 && newHour > 11) {
1167 newPM = !this.pm;
1168 }
1169 newHour = (newHour >= 13) ? (newHour - 12) : newHour;
1170 }
1171 if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
1172 this.currentHour = newHour;
1173 this.pm = newPM;
1174 }
1175 event.preventDefault();
1176 }
1177 onTimePickerElementMouseDown(event, type, direction) {
1178 if (!this.disabled) {
1179 this.repeat(event, null, type, direction);
1180 event.preventDefault();
1181 }
1182 }
1183 onTimePickerElementMouseUp(event) {
1184 if (!this.disabled) {
1185 this.clearTimePickerTimer();
1186 this.updateTime();
1187 }
1188 }
1189 onTimePickerElementMouseLeave() {
1190 if (!this.disabled && this.timePickerTimer) {
1191 this.clearTimePickerTimer();
1192 this.updateTime();
1193 }
1194 }
1195 repeat(event, interval, type, direction) {
1196 let i = interval || 500;
1197 this.clearTimePickerTimer();
1198 this.timePickerTimer = setTimeout(() => {
1199 this.repeat(event, 100, type, direction);
1200 this.cd.markForCheck();
1201 }, i);
1202 switch (type) {
1203 case 0:
1204 if (direction === 1)
1205 this.incrementHour(event);
1206 else
1207 this.decrementHour(event);
1208 break;
1209 case 1:
1210 if (direction === 1)
1211 this.incrementMinute(event);
1212 else
1213 this.decrementMinute(event);
1214 break;
1215 case 2:
1216 if (direction === 1)
1217 this.incrementSecond(event);
1218 else
1219 this.decrementSecond(event);
1220 break;
1221 }
1222 this.updateInputfield();
1223 }
1224 clearTimePickerTimer() {
1225 if (this.timePickerTimer) {
1226 clearTimeout(this.timePickerTimer);
1227 this.timePickerTimer = null;
1228 }
1229 }
1230 decrementHour(event) {
1231 let newHour = this.currentHour - this.stepHour;
1232 let newPM = this.pm;
1233 if (this.hourFormat == '24')
1234 newHour = (newHour < 0) ? (24 + newHour) : newHour;
1235 else if (this.hourFormat == '12') {
1236 // If we were at noon/midnight, then switch
1237 if (this.currentHour === 12) {
1238 newPM = !this.pm;
1239 }
1240 newHour = (newHour <= 0) ? (12 + newHour) : newHour;
1241 }
1242 if (this.validateTime(newHour, this.currentMinute, this.currentSecond, newPM)) {
1243 this.currentHour = newHour;
1244 this.pm = newPM;
1245 }
1246 event.preventDefault();
1247 }
1248 incrementMinute(event) {
1249 let newMinute = this.currentMinute + this.stepMinute;
1250 newMinute = (newMinute > 59) ? newMinute - 60 : newMinute;
1251 if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {
1252 this.currentMinute = newMinute;
1253 }
1254 event.preventDefault();
1255 }
1256 decrementMinute(event) {
1257 let newMinute = this.currentMinute - this.stepMinute;
1258 newMinute = (newMinute < 0) ? 60 + newMinute : newMinute;
1259 if (this.validateTime(this.currentHour, newMinute, this.currentSecond, this.pm)) {
1260 this.currentMinute = newMinute;
1261 }
1262 event.preventDefault();
1263 }
1264 incrementSecond(event) {
1265 let newSecond = this.currentSecond + this.stepSecond;
1266 newSecond = (newSecond > 59) ? newSecond - 60 : newSecond;
1267 if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {
1268 this.currentSecond = newSecond;
1269 }
1270 event.preventDefault();
1271 }
1272 decrementSecond(event) {
1273 let newSecond = this.currentSecond - this.stepSecond;
1274 newSecond = (newSecond < 0) ? 60 + newSecond : newSecond;
1275 if (this.validateTime(this.currentHour, this.currentMinute, newSecond, this.pm)) {
1276 this.currentSecond = newSecond;
1277 }
1278 event.preventDefault();
1279 }
1280 updateTime() {
1281 let value = this.value;
1282 if (this.isRangeSelection()) {
1283 value = this.value[1] || this.value[0];
1284 }
1285 if (this.isMultipleSelection()) {
1286 value = this.value[this.value.length - 1];
1287 }
1288 value = value ? new Date(value.getTime()) : new Date();
1289 if (this.hourFormat == '12') {
1290 if (this.currentHour === 12)
1291 value.setHours(this.pm ? 12 : 0);
1292 else
1293 value.setHours(this.pm ? this.currentHour + 12 : this.currentHour);
1294 }
1295 else {
1296 value.setHours(this.currentHour);
1297 }
1298 value.setMinutes(this.currentMinute);
1299 value.setSeconds(this.currentSecond);
1300 if (this.isRangeSelection()) {
1301 if (this.value[1])
1302 value = [this.value[0], value];
1303 else
1304 value = [value, null];
1305 }
1306 if (this.isMultipleSelection()) {
1307 value = [...this.value.slice(0, -1), value];
1308 }
1309 this.updateModel(value);
1310 this.onSelect.emit(value);
1311 this.updateInputfield();
1312 }
1313 toggleAMPM(event) {
1314 const newPM = !this.pm;
1315 if (this.validateTime(this.currentHour, this.currentMinute, this.currentSecond, newPM)) {
1316 this.pm = newPM;
1317 this.updateTime();
1318 }
1319 event.preventDefault();
1320 }
1321 onUserInput(event) {
1322 // IE 11 Workaround for input placeholder : https://github.com/primefaces/primeng/issues/2026
1323 if (!this.isKeydown) {
1324 return;
1325 }
1326 this.isKeydown = false;
1327 let val = event.target.value;
1328 try {
1329 let value = this.parseValueFromString(val);
1330 if (this.isValidSelection(value)) {
1331 this.updateModel(value);
1332 this.updateUI();
1333 }
1334 }
1335 catch (err) {
1336 //invalid date
1337 this.updateModel(null);
1338 }
1339 this.filled = val != null && val.length;
1340 this.onInput.emit(event);
1341 }
1342 isValidSelection(value) {
1343 let isValid = true;
1344 if (this.isSingleSelection()) {
1345 if (!this.isSelectable(value.getDate(), value.getMonth(), value.getFullYear(), false)) {
1346 isValid = false;
1347 }
1348 }
1349 else if (value.every(v => this.isSelectable(v.getDate(), v.getMonth(), v.getFullYear(), false))) {
1350 if (this.isRangeSelection()) {
1351 isValid = value.length > 1 && value[1] > value[0] ? true : false;
1352 }
1353 }
1354 return isValid;
1355 }
1356 parseValueFromString(text) {
1357 if (!text || text.trim().length === 0) {
1358 return null;
1359 }
1360 let value;
1361 if (this.isSingleSelection()) {
1362 value = this.parseDateTime(text);
1363 }
1364 else if (this.isMultipleSelection()) {
1365 let tokens = text.split(this.multipleSeparator);
1366 value = [];
1367 for (let token of tokens) {
1368 value.push(this.parseDateTime(token.trim()));
1369 }
1370 }
1371 else if (this.isRangeSelection()) {
1372 let tokens = text.split(' ' + this.rangeSeparator + ' ');
1373 value = [];
1374 for (let i = 0; i < tokens.length; i++) {
1375 value[i] = this.parseDateTime(tokens[i].trim());
1376 }
1377 }
1378 return value;
1379 }
1380 parseDateTime(text) {
1381 let date;
1382 let parts = text.split(' ');
1383 if (this.timeOnly) {
1384 date = new Date();
1385 this.populateTime(date, parts[0], parts[1]);
1386 }
1387 else {
1388 const dateFormat = this.getDateFormat();
1389 if (this.showTime) {
1390 let ampm = this.hourFormat == '12' ? parts.pop() : null;
1391 let timeString = parts.pop();
1392 date = this.parseDate(parts.join(' '), dateFormat);
1393 this.populateTime(date, timeString, ampm);
1394 }
1395 else {
1396 date = this.parseDate(text, dateFormat);
1397 }
1398 }
1399 return date;
1400 }
1401 populateTime(value, timeString, ampm) {
1402 if (this.hourFormat == '12' && !ampm) {
1403 throw 'Invalid Time';
1404 }
1405 this.pm = (ampm === 'PM' || ampm === 'pm');
1406 let time = this.parseTime(timeString);
1407 value.setHours(time.hour);
1408 value.setMinutes(time.minute);
1409 value.setSeconds(time.second);
1410 }
1411 updateUI() {
1412 let val = this.value || this.defaultDate || new Date();
1413 if (Array.isArray(val)) {
1414 val = val[0];
1415 }
1416 this.currentMonth = val.getMonth();
1417 this.currentYear = val.getFullYear();
1418 this.createMonths(this.currentMonth, this.currentYear);
1419 if (this.showTime || this.timeOnly) {
1420 this.setCurrentHourPM(val.getHours());
1421 this.currentMinute = val.getMinutes();
1422 this.currentSecond = val.getSeconds();
1423 }
1424 }
1425 showOverlay() {
1426 if (!this.overlayVisible) {
1427 this.updateUI();
1428 this.overlayVisible = true;
1429 }
1430 }
1431 hideOverlay() {
1432 this.overlayVisible = false;
1433 this.clearTimePickerTimer();
1434 if (this.touchUI) {
1435 this.disableModality();
1436 }
1437 this.cd.markForCheck();
1438 }
1439 toggle() {
1440 if (!this.inline) {
1441 if (!this.overlayVisible) {
1442 this.showOverlay();
1443 this.inputfieldViewChild.nativeElement.focus();
1444 }
1445 else {
1446 this.hideOverlay();
1447 }
1448 }
1449 }
1450 onOverlayAnimationStart(event) {
1451 switch (event.toState) {
1452 case 'visible':
1453 case 'visibleTouchUI':
1454 if (!this.inline) {
1455 this.overlay = event.element;
1456 this.appendOverlay();
1457 if (this.autoZIndex) {
1458 if (this.touchUI)
1459 ZIndexUtils.set('modal', this.overlay, this.baseZIndex || this.config.zIndex.modal);
1460 else
1461 ZIndexUtils.set('overlay', this.overlay, this.baseZIndex || this.config.zIndex.overlay);
1462 }
1463 this.alignOverlay();
1464 this.onShow.emit(event);
1465 }
1466 break;
1467 case 'void':
1468 this.onOverlayHide();
1469 this.onClose.emit(event);
1470 break;
1471 }
1472 }
1473 onOverlayAnimationDone(event) {
1474 switch (event.toState) {
1475 case 'visible':
1476 case 'visibleTouchUI':
1477 if (!this.inline) {
1478 this.bindDocumentClickListener();
1479 this.bindDocumentResizeListener();
1480 this.bindScrollListener();
1481 }
1482 break;
1483 case 'void':
1484 if (this.autoZIndex) {
1485 ZIndexUtils.clear(event.element);
1486 }
1487 break;
1488 }
1489 }
1490 appendOverlay() {
1491 if (this.appendTo) {
1492 if (this.appendTo === 'body')
1493 document.body.appendChild(this.overlay);
1494 else
1495 DomHandler.appendChild(this.overlay, this.appendTo);
1496 }
1497 }
1498 restoreOverlayAppend() {
1499 if (this.overlay && this.appendTo) {
1500 this.el.nativeElement.appendChild(this.overlay);
1501 }
1502 }
1503 alignOverlay() {
1504 if (this.touchUI) {
1505 this.enableModality(this.overlay);
1506 }
1507 else {
1508 if (this.appendTo)
1509 DomHandler.absolutePosition(this.overlay, this.inputfieldViewChild.nativeElement);
1510 else
1511 DomHandler.relativePosition(this.overlay, this.inputfieldViewChild.nativeElement);
1512 }
1513 }
1514 enableModality(element) {
1515 if (!this.mask) {
1516 this.mask = document.createElement('div');
1517 this.mask.style.zIndex = String(parseInt(element.style.zIndex) - 1);
1518 let maskStyleClass = 'p-component-overlay p-datepicker-mask p-datepicker-mask-scrollblocker p-component-overlay p-component-overlay-enter';
1519 DomHandler.addMultipleClasses(this.mask, maskStyleClass);
1520 this.maskClickListener = this.renderer.listen(this.mask, 'click', (event) => {
1521 this.disableModality();
1522 });
1523 document.body.appendChild(this.mask);
1524 DomHandler.addClass(document.body, 'p-overflow-hidden');
1525 }
1526 }
1527 disableModality() {
1528 if (this.mask) {
1529 DomHandler.addClass(this.mask, 'p-component-overlay-leave');
1530 this.animationEndListener = this.destroyMask.bind(this);
1531 this.mask.addEventListener('animationend', this.animationEndListener);
1532 }
1533 }
1534 destroyMask() {
1535 document.body.removeChild(this.mask);
1536 let bodyChildren = document.body.children;
1537 let hasBlockerMasks;
1538 for (let i = 0; i < bodyChildren.length; i++) {
1539 let bodyChild = bodyChildren[i];
1540 if (DomHandler.hasClass(bodyChild, 'p-datepicker-mask-scrollblocker')) {
1541 hasBlockerMasks = true;
1542 break;
1543 }
1544 }
1545 if (!hasBlockerMasks) {
1546 DomHandler.removeClass(document.body, 'p-overflow-hidden');
1547 }
1548 this.unbindAnimationEndListener();
1549 this.unbindMaskClickListener();
1550 this.mask = null;
1551 }
1552 unbindMaskClickListener() {
1553 if (this.maskClickListener) {
1554 this.maskClickListener();
1555 this.maskClickListener = null;
1556 }
1557 }
1558 unbindAnimationEndListener() {
1559 if (this.animationEndListener && this.mask) {
1560 this.mask.removeEventListener('animationend', this.animationEndListener);
1561 this.animationEndListener = null;
1562 }
1563 }
1564 writeValue(value) {
1565 this.value = value;
1566 if (this.value && typeof this.value === 'string') {
1567 this.value = this.parseValueFromString(this.value);
1568 }
1569 this.updateInputfield();
1570 this.updateUI();
1571 this.cd.markForCheck();
1572 }
1573 registerOnChange(fn) {
1574 this.onModelChange = fn;
1575 }
1576 registerOnTouched(fn) {
1577 this.onModelTouched = fn;
1578 }
1579 setDisabledState(val) {
1580 this.disabled = val;
1581 this.cd.markForCheck();
1582 }
1583 getDateFormat() {
1584 return this.dateFormat || this.getTranslation('dateFormat');
1585 }
1586 // Ported from jquery-ui datepicker formatDate
1587 formatDate(date, format) {
1588 if (!date) {
1589 return '';
1590 }
1591 let iFormat;
1592 const lookAhead = (match) => {
1593 const matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
1594 if (matches) {
1595 iFormat++;
1596 }
1597 return matches;
1598 }, formatNumber = (match, value, len) => {
1599 let num = '' + value;
1600 if (lookAhead(match)) {
1601 while (num.length < len) {
1602 num = '0' + num;
1603 }
1604 }
1605 return num;
1606 }, formatName = (match, value, shortNames, longNames) => {
1607 return (lookAhead(match) ? longNames[value] : shortNames[value]);
1608 };
1609 let output = '';
1610 let literal = false;
1611 if (date) {
1612 for (iFormat = 0; iFormat < format.length; iFormat++) {
1613 if (literal) {
1614 if (format.charAt(iFormat) === '\'' && !lookAhead('\'')) {
1615 literal = false;
1616 }
1617 else {
1618 output += format.charAt(iFormat);
1619 }
1620 }
1621 else {
1622 switch (format.charAt(iFormat)) {
1623 case 'd':
1624 output += formatNumber('d', date.getDate(), 2);
1625 break;
1626 case 'D':
1627 output += formatName('D', date.getDay(), this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));
1628 break;
1629 case 'o':
1630 output += formatNumber('o', Math.round((new Date(date.getFullYear(), date.getMonth(), date.getDate()).getTime() -
1631 new Date(date.getFullYear(), 0, 0).getTime()) / 86400000), 3);
1632 break;
1633 case 'm':
1634 output += formatNumber('m', date.getMonth() + 1, 2);
1635 break;
1636 case 'M':
1637 output += formatName('M', date.getMonth(), this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));
1638 break;
1639 case 'y':
1640 output += lookAhead('y') ? date.getFullYear() : (date.getFullYear() % 100 < 10 ? '0' : '') + (date.getFullYear() % 100);
1641 break;
1642 case '@':
1643 output += date.getTime();
1644 break;
1645 case '!':
1646 output += date.getTime() * 10000 + this.ticksTo1970;
1647 break;
1648 case '\'':
1649 if (lookAhead('\'')) {
1650 output += '\'';
1651 }
1652 else {
1653 literal = true;
1654 }
1655 break;
1656 default:
1657 output += format.charAt(iFormat);
1658 }
1659 }
1660 }
1661 }
1662 return output;
1663 }
1664 formatTime(date) {
1665 if (!date) {
1666 return '';
1667 }
1668 let output = '';
1669 let hours = date.getHours();
1670 let minutes = date.getMinutes();
1671 let seconds = date.getSeconds();
1672 if (this.hourFormat == '12' && hours > 11 && hours != 12) {
1673 hours -= 12;
1674 }
1675 if (this.hourFormat == '12') {
1676 output += hours === 0 ? 12 : (hours < 10) ? '0' + hours : hours;
1677 }
1678 else {
1679 output += (hours < 10) ? '0' + hours : hours;
1680 }
1681 output += ':';
1682 output += (minutes < 10) ? '0' + minutes : minutes;
1683 if (this.showSeconds) {
1684 output += ':';
1685 output += (seconds < 10) ? '0' + seconds : seconds;
1686 }
1687 if (this.hourFormat == '12') {
1688 output += date.getHours() > 11 ? ' PM' : ' AM';
1689 }
1690 return output;
1691 }
1692 parseTime(value) {
1693 let tokens = value.split(':');
1694 let validTokenLength = this.showSeconds ? 3 : 2;
1695 if (tokens.length !== validTokenLength) {
1696 throw "Invalid time";
1697 }
1698 let h = parseInt(tokens[0]);
1699 let m = parseInt(tokens[1]);
1700 let s = this.showSeconds ? parseInt(tokens[2]) : null;
1701 if (isNaN(h) || isNaN(m) || h > 23 || m > 59 || (this.hourFormat == '12' && h > 12) || (this.showSeconds && (isNaN(s) || s > 59))) {
1702 throw "Invalid time";
1703 }
1704 else {
1705 if (this.hourFormat == '12') {
1706 if (h !== 12 && this.pm) {
1707 h += 12;
1708 }
1709 else if (!this.pm && h === 12) {
1710 h -= 12;
1711 }
1712 }
1713 return { hour: h, minute: m, second: s };
1714 }
1715 }
1716 // Ported from jquery-ui datepicker parseDate
1717 parseDate(value, format) {
1718 if (format == null || value == null) {
1719 throw "Invalid arguments";
1720 }
1721 value = (typeof value === "object" ? value.toString() : value + "");
1722 if (value === "") {
1723 return null;
1724 }
1725 let iFormat, dim, extra, iValue = 0, shortYearCutoff = (typeof this.shortYearCutoff !== "string" ? this.shortYearCutoff : new Date().getFullYear() % 100 + parseInt(this.shortYearCutoff, 10)), year = -1, month = -1, day = -1, doy = -1, literal = false, date, lookAhead = (match) => {
1726 let matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
1727 if (matches) {
1728 iFormat++;
1729 }
1730 return matches;
1731 }, getNumber = (match) => {
1732 let isDoubled = lookAhead(match), size = (match === "@" ? 14 : (match === "!" ? 20 :
1733 (match === "y" && isDoubled ? 4 : (match === "o" ? 3 : 2)))), minSize = (match === "y" ? size : 1), digits = new RegExp("^\\d{" + minSize + "," + size + "}"), num = value.substring(iValue).match(digits);
1734 if (!num) {
1735 throw "Missing number at position " + iValue;
1736 }
1737 iValue += num[0].length;
1738 return parseInt(num[0], 10);
1739 }, getName = (match, shortNames, longNames) => {
1740 let index = -1;
1741 let arr = lookAhead(match) ? longNames : shortNames;
1742 let names = [];
1743 for (let i = 0; i < arr.length; i++) {
1744 names.push([i, arr[i]]);
1745 }
1746 names.sort((a, b) => {
1747 return -(a[1].length - b[1].length);
1748 });
1749 for (let i = 0; i < names.length; i++) {
1750 let name = names[i][1];
1751 if (value.substr(iValue, name.length).toLowerCase() === name.toLowerCase()) {
1752 index = names[i][0];
1753 iValue += name.length;
1754 break;
1755 }
1756 }
1757 if (index !== -1) {
1758 return index + 1;
1759 }
1760 else {
1761 throw "Unknown name at position " + iValue;
1762 }
1763 }, checkLiteral = () => {
1764 if (value.charAt(iValue) !== format.charAt(iFormat)) {
1765 throw "Unexpected literal at position " + iValue;
1766 }
1767 iValue++;
1768 };
1769 if (this.view === 'month') {
1770 day = 1;
1771 }
1772 for (iFormat = 0; iFormat < format.length; iFormat++) {
1773 if (literal) {
1774 if (format.charAt(iFormat) === "'" && !lookAhead("'")) {
1775 literal = false;
1776 }
1777 else {
1778 checkLiteral();
1779 }
1780 }
1781 else {
1782 switch (format.charAt(iFormat)) {
1783 case "d":
1784 day = getNumber("d");
1785 break;
1786 case "D":
1787 getName("D", this.getTranslation(TranslationKeys.DAY_NAMES_SHORT), this.getTranslation(TranslationKeys.DAY_NAMES));
1788 break;
1789 case "o":
1790 doy = getNumber("o");
1791 break;
1792 case "m":
1793 month = getNumber("m");
1794 break;
1795 case "M":
1796 month = getName("M", this.getTranslation(TranslationKeys.MONTH_NAMES_SHORT), this.getTranslation(TranslationKeys.MONTH_NAMES));
1797 break;
1798 case "y":
1799 year = getNumber("y");
1800 break;
1801 case "@":
1802 date = new Date(getNumber("@"));
1803 year = date.getFullYear();
1804 month = date.getMonth() + 1;
1805 day = date.getDate();
1806 break;
1807 case "!":
1808 date = new Date((getNumber("!") - this.ticksTo1970) / 10000);
1809 year = date.getFullYear();
1810 month = date.getMonth() + 1;
1811 day = date.getDate();
1812 break;
1813 case "'":
1814 if (lookAhead("'")) {
1815 checkLiteral();
1816 }
1817 else {
1818 literal = true;
1819 }
1820 break;
1821 default:
1822 checkLiteral();
1823 }
1824 }
1825 }
1826 if (iValue < value.length) {
1827 extra = value.substr(iValue);
1828 if (!/^\s+/.test(extra)) {
1829 throw "Extra/unparsed characters found in date: " + extra;
1830 }
1831 }
1832 if (year === -1) {
1833 year = new Date().getFullYear();
1834 }
1835 else if (year < 100) {
1836 year += new Date().getFullYear() - new Date().getFullYear() % 100 +
1837 (year <= shortYearCutoff ? 0 : -100);
1838 }
1839 if (doy > -1) {
1840 month = 1;
1841 day = doy;
1842 do {
1843 dim = this.getDaysCountInMonth(year, month - 1);
1844 if (day <= dim) {
1845 break;
1846 }
1847 month++;
1848 day -= dim;
1849 } while (true);
1850 }
1851 date = this.daylightSavingAdjust(new Date(year, month - 1, day));
1852 if (date.getFullYear() !== year || date.getMonth() + 1 !== month || date.getDate() !== day) {
1853 throw "Invalid date"; // E.g. 31/02/00
1854 }
1855 return date;
1856 }
1857 daylightSavingAdjust(date) {
1858 if (!date) {
1859 return null;
1860 }
1861 date.setHours(date.getHours() > 12 ? date.getHours() + 2 : 0);
1862 return date;
1863 }
1864 updateFilledState() {
1865 this.filled = this.inputFieldValue && this.inputFieldValue != '';
1866 }
1867 onTodayButtonClick(event) {
1868 let date = new Date();
1869 let dateMeta = { day: date.getDate(), month: date.getMonth(), year: date.getFullYear(), otherMonth: date.getMonth() !== this.currentMonth || date.getFullYear() !== this.currentYear, today: true, selectable: true };
1870 this.onDateSelect(event, dateMeta);
1871 this.onTodayClick.emit(event);
1872 }
1873 onClearButtonClick(event) {
1874 this.updateModel(null);
1875 this.updateInputfield();
1876 this.hideOverlay();
1877 this.onClearClick.emit(event);
1878 }
1879 bindDocumentClickListener() {
1880 if (!this.documentClickListener) {
1881 this.zone.runOutsideAngular(() => {
1882 const documentTarget = this.el ? this.el.nativeElement.ownerDocument : 'document';
1883 this.documentClickListener = this.renderer.listen(documentTarget, 'click', (event) => {
1884 if (this.isOutsideClicked(event) && this.overlayVisible) {
1885 this.zone.run(() => {
1886 this.hideOverlay();
1887 this.onClickOutside.emit(event);
1888 this.cd.markForCheck();
1889 });
1890 }
1891 });
1892 });
1893 }
1894 }
1895 unbindDocumentClickListener() {
1896 if (this.documentClickListener) {
1897 this.documentClickListener();
1898 this.documentClickListener = null;
1899 }
1900 }
1901 bindDocumentResizeListener() {
1902 if (!this.documentResizeListener && !this.touchUI) {
1903 this.documentResizeListener = this.onWindowResize.bind(this);
1904 window.addEventListener('resize', this.documentResizeListener);
1905 }
1906 }
1907 unbindDocumentResizeListener() {
1908 if (this.documentResizeListener) {
1909 window.removeEventListener('resize', this.documentResizeListener);
1910 this.documentResizeListener = null;
1911 }
1912 }
1913 bindScrollListener() {
1914 if (!this.scrollHandler) {
1915 this.scrollHandler = new ConnectedOverlayScrollHandler(this.containerViewChild.nativeElement, () => {
1916 if (this.overlayVisible) {
1917 this.hideOverlay();
1918 }
1919 });
1920 }
1921 this.scrollHandler.bindScrollListener();
1922 }
1923 unbindScrollListener() {
1924 if (this.scrollHandler) {
1925 this.scrollHandler.unbindScrollListener();
1926 }
1927 }
1928 isOutsideClicked(event) {
1929 return !(this.el.nativeElement.isSameNode(event.target) || this.isNavIconClicked(event) ||
1930 this.el.nativeElement.contains(event.target) || (this.overlay && this.overlay.contains(event.target)));
1931 }
1932 isNavIconClicked(event) {
1933 return (DomHandler.hasClass(event.target, 'p-datepicker-prev') || DomHandler.hasClass(event.target, 'p-datepicker-prev-icon')
1934 || DomHandler.hasClass(event.target, 'p-datepicker-next') || DomHandler.hasClass(event.target, 'p-datepicker-next-icon'));
1935 }
1936 onWindowResize() {
1937 if (this.overlayVisible && !DomHandler.isAndroid()) {
1938 this.hideOverlay();
1939 }
1940 }
1941 onOverlayHide() {
1942 if (this.mask) {
1943 this.destroyMask();
1944 }
1945 this.unbindDocumentClickListener();
1946 this.unbindDocumentResizeListener();
1947 this.unbindScrollListener();
1948 this.overlay = null;
1949 }
1950 ngOnDestroy() {
1951 if (this.scrollHandler) {
1952 this.scrollHandler.destroy();
1953 this.scrollHandler = null;
1954 }
1955 if (this.translationSubscription) {
1956 this.translationSubscription.unsubscribe();
1957 }
1958 if (this.overlay && this.autoZIndex) {
1959 ZIndexUtils.clear(this.overlay);
1960 }
1961 this.clearTimePickerTimer();
1962 this.restoreOverlayAppend();
1963 this.onOverlayHide();
1964 }
1965}
1966Calendar.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Calendar, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }, { token: i0.NgZone }, { token: i1.PrimeNGConfig }, { token: i1.OverlayService }], target: i0.ɵɵFactoryTarget.Component });
1967Calendar.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0", type: Calendar, selector: "p-calendar", inputs: { style: "style", styleClass: "styleClass", inputStyle: "inputStyle", inputId: "inputId", name: "name", inputStyleClass: "inputStyleClass", placeholder: "placeholder", ariaLabelledBy: "ariaLabelledBy", iconAriaLabel: "iconAriaLabel", disabled: "disabled", dateFormat: "dateFormat", multipleSeparator: "multipleSeparator", rangeSeparator: "rangeSeparator", inline: "inline", showOtherMonths: "showOtherMonths", selectOtherMonths: "selectOtherMonths", showIcon: "showIcon", icon: "icon", appendTo: "appendTo", readonlyInput: "readonlyInput", shortYearCutoff: "shortYearCutoff", monthNavigator: "monthNavigator", yearNavigator: "yearNavigator", hourFormat: "hourFormat", timeOnly: "timeOnly", stepHour: "stepHour", stepMinute: "stepMinute", stepSecond: "stepSecond", showSeconds: "showSeconds", required: "required", showOnFocus: "showOnFocus", showWeek: "showWeek", dataType: "dataType", selectionMode: "selectionMode", maxDateCount: "maxDateCount", showButtonBar: "showButtonBar", todayButtonStyleClass: "todayButtonStyleClass", clearButtonStyleClass: "clearButtonStyleClass", autoZIndex: "autoZIndex", baseZIndex: "baseZIndex", panelStyleClass: "panelStyleClass", panelStyle: "panelStyle", keepInvalid: "keepInvalid", hideOnDateTimeSelect: "hideOnDateTimeSelect", numberOfMonths: "numberOfMonths", view: "view", touchUI: "touchUI", timeSeparator: "timeSeparator", focusTrap: "focusTrap", firstDayOfWeek: "firstDayOfWeek", showTransitionOptions: "showTransitionOptions", hideTransitionOptions: "hideTransitionOptions", tabindex: "tabindex", defaultDate: "defaultDate", minDate: "minDate", maxDate: "maxDate", disabledDates: "disabledDates", disabledDays: "disabledDays", yearRange: "yearRange", showTime: "showTime", locale: "locale" }, outputs: { onFocus: "onFocus", onBlur: "onBlur", onClose: "onClose", onSelect: "onSelect", onInput: "onInput", onTodayClick: "onTodayClick", onClearClick: "onClearClick", onMonthChange: "onMonthChange", onYearChange: "onYearChange", onClickOutside: "onClickOutside", onShow: "onShow" }, host: { properties: { "class.p-inputwrapper-filled": "filled", "class.p-inputwrapper-focus": "focus" }, classAttribute: "p-element p-inputwrapper" }, providers: [CALENDAR_VALUE_ACCESSOR], queries: [{ propertyName: "templates", predicate: PrimeTemplate }], viewQueries: [{ propertyName: "containerViewChild", first: true, predicate: ["container"], descendants: true }, { propertyName: "inputfieldViewChild", first: true, predicate: ["inputfield"], descendants: true }, { propertyName: "content", first: true, predicate: ["contentWrapper"], descendants: true }], ngImport: i0, template: `
1968 <span #container [ngClass]="{'p-calendar':true, 'p-calendar-w-btn': showIcon, 'p-calendar-timeonly': timeOnly, 'p-calendar-disabled':disabled, 'p-focus': focus}" [ngStyle]="style" [class]="styleClass">
1969 <ng-template [ngIf]="!inline">
1970 <input #inputfield type="text" [attr.id]="inputId" [attr.name]="name" [attr.required]="required" [attr.aria-required]="required" [value]="inputFieldValue" (focus)="onInputFocus($event)" (keydown)="onInputKeydown($event)" (click)="onInputClick()" (blur)="onInputBlur($event)"
1971 [readonly]="readonlyInput" (input)="onUserInput($event)" [ngStyle]="inputStyle" [class]="inputStyleClass" [placeholder]="placeholder||''" [disabled]="disabled" [attr.tabindex]="tabindex" [attr.inputmode]="touchUI ? 'off' : null"
1972 [ngClass]="'p-inputtext p-component'" autocomplete="off" [attr.aria-labelledby]="ariaLabelledBy"
1973 ><button type="button" [attr.aria-label]="iconAriaLabel" [icon]="icon" pButton pRipple *ngIf="showIcon" (click)="onButtonClick($event,inputfield)" class="p-datepicker-trigger"
1974 [disabled]="disabled" tabindex="0"></button>
1975 </ng-template>
1976 <div #contentWrapper [class]="panelStyleClass" [ngStyle]="panelStyle" [ngClass]="{'p-datepicker p-component': true, 'p-datepicker-inline':inline,
1977 'p-disabled':disabled,'p-datepicker-timeonly':timeOnly,'p-datepicker-multiple-month': this.numberOfMonths > 1, 'p-datepicker-monthpicker': (view === 'month'), 'p-datepicker-touch-ui': touchUI}"
1978 [@overlayAnimation]="touchUI ? {value: 'visibleTouchUI', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}:
1979 {value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}"
1980 [@.disabled]="inline === true" (@overlayAnimation.start)="onOverlayAnimationStart($event)" (@overlayAnimation.done)="onOverlayAnimationDone($event)" (click)="onOverlayClick($event)" *ngIf="inline || overlayVisible">
1981 <ng-content select="p-header"></ng-content>
1982 <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
1983 <ng-container *ngIf="!timeOnly">
1984 <div class="p-datepicker-group-container">
1985 <div class="p-datepicker-group" *ngFor="let month of months; let i = index;">
1986 <div class="p-datepicker-header">
1987 <button (keydown)="onContainerButtonKeydown($event)" class="p-datepicker-prev p-link" (click)="onPrevButtonClick($event)" *ngIf="i === 0" type="button" pRipple>
1988 <span class="p-datepicker-prev-icon pi pi-chevron-left"></span>
1989 </button>
1990 <div class="p-datepicker-title">
1991 <span class="p-datepicker-month" *ngIf="!monthNavigator && (view !== 'month')">{{getTranslation('monthNames')[month.month]}}</span>
1992 <select tabindex="0" class="p-datepicker-month" *ngIf="monthNavigator && (view !== 'month') && numberOfMonths === 1" (change)="onMonthDropdownChange($event.target.value)">
1993 <option [value]="i" *ngFor="let monthName of getTranslation('monthNames');let i = index" [selected]="i === month.month">{{monthName}}</option>
1994 </select>
1995 <select tabindex="0" class="p-datepicker-year" *ngIf="yearNavigator && numberOfMonths === 1" (change)="onYearDropdownChange($event.target.value)">
1996 <option [value]="year" *ngFor="let year of yearOptions" [selected]="year === currentYear">{{year}}</option>
1997 </select>
1998 <span class="p-datepicker-year" *ngIf="!yearNavigator">{{view === 'month' ? currentYear : month.year}}</span>
1999 </div>
2000 <button (keydown)="onContainerButtonKeydown($event)" class="p-datepicker-next p-link" (click)="onNextButtonClick($event)" *ngIf="numberOfMonths === 1 ? true : (i === numberOfMonths -1)" type="button" pRipple>
2001 <span class="p-datepicker-next-icon pi pi-chevron-right"></span>
2002 </button>
2003 </div>
2004 <div class="p-datepicker-calendar-container" *ngIf="view ==='date'">
2005 <table class="p-datepicker-calendar">
2006 <thead>
2007 <tr>
2008 <th *ngIf="showWeek" class="p-datepicker-weekheader p-disabled">
2009 <span>{{getTranslation('weekHeader')}}</span>
2010 </th>
2011 <th scope="col" *ngFor="let weekDay of weekDays;let begin = first; let end = last">
2012 <span>{{weekDay}}</span>
2013 </th>
2014 </tr>
2015 </thead>
2016 <tbody>
2017 <tr *ngFor="let week of month.dates; let j = index;">
2018 <td *ngIf="showWeek" class="p-datepicker-weeknumber">
2019 <span class="p-disabled">
2020 {{month.weekNumbers[j]}}
2021 </span>
2022 </td>
2023 <td *ngFor="let date of week" [ngClass]="{'p-datepicker-other-month': date.otherMonth,'p-datepicker-today':date.today}">
2024 <ng-container *ngIf="date.otherMonth ? showOtherMonths : true">
2025 <span [ngClass]="{'p-highlight':isSelected(date), 'p-disabled': !date.selectable}"
2026 (click)="onDateSelect($event,date)" draggable="false" (keydown)="onDateCellKeydown($event,date,i)" pRipple>
2027 <ng-container *ngIf="!dateTemplate">{{date.day}}</ng-container>
2028 <ng-container *ngTemplateOutlet="dateTemplate; context: {$implicit: date}"></ng-container>
2029 </span>
2030 </ng-container>
2031 </td>
2032 </tr>
2033 </tbody>
2034 </table>
2035 </div>
2036 </div>
2037 </div>
2038 <div class="p-monthpicker" *ngIf="view === 'month'">
2039 <span *ngFor="let m of monthPickerValues; let i = index" (click)="onMonthSelect($event, i)" (keydown)="onMonthCellKeydown($event,i)" class="p-monthpicker-month" [ngClass]="{'p-highlight': isMonthSelected(i), 'p-disabled':!isSelectable(1, i, this.currentYear, false)}" pRipple>
2040 {{m}}
2041 </span>
2042 </div>
2043 </ng-container>
2044 <div class="p-timepicker" *ngIf="showTime||timeOnly">
2045 <div class="p-hour-picker">
2046 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementHour($event)" (mousedown)="onTimePickerElementMouseDown($event, 0, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2047 <span class="pi pi-chevron-up"></span>
2048 </button>
2049 <span><ng-container *ngIf="currentHour < 10">0</ng-container>{{currentHour}}</span>
2050 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementHour($event)" (mousedown)="onTimePickerElementMouseDown($event, 0, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2051 <span class="pi pi-chevron-down"></span>
2052 </button>
2053 </div>
2054 <div class="p-separator">
2055 <span>{{timeSeparator}}</span>
2056 </div>
2057 <div class="p-minute-picker">
2058 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementMinute($event)" (mousedown)="onTimePickerElementMouseDown($event, 1, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2059 <span class="pi pi-chevron-up"></span>
2060 </button>
2061 <span><ng-container *ngIf="currentMinute < 10">0</ng-container>{{currentMinute}}</span>
2062 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementMinute($event)" (mousedown)="onTimePickerElementMouseDown($event, 1, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2063 <span class="pi pi-chevron-down"></span>
2064 </button>
2065 </div>
2066 <div class="p-separator" *ngIf="showSeconds">
2067 <span>{{timeSeparator}}</span>
2068 </div>
2069 <div class="p-second-picker" *ngIf="showSeconds">
2070 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementSecond($event)" (mousedown)="onTimePickerElementMouseDown($event, 2, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2071 <span class="pi pi-chevron-up"></span>
2072 </button>
2073 <span><ng-container *ngIf="currentSecond < 10">0</ng-container>{{currentSecond}}</span>
2074 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementSecond($event)" (mousedown)="onTimePickerElementMouseDown($event, 2, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2075 <span class="pi pi-chevron-down"></span>
2076 </button>
2077 </div>
2078 <div class="p-ampm-picker" *ngIf="hourFormat=='12'">
2079 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (click)="toggleAMPM($event)" (keydown.enter)="toggleAMPM($event)" pRipple>
2080 <span class="pi pi-chevron-up"></span>
2081 </button>
2082 <span>{{pm ? 'PM' : 'AM'}}</span>
2083 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (click)="toggleAMPM($event)" (keydown.enter)="toggleAMPM($event)" pRipple>
2084 <span class="pi pi-chevron-down"></span>
2085 </button>
2086 </div>
2087 </div>
2088 <div class="p-datepicker-buttonbar" *ngIf="showButtonBar">
2089 <button type="button" [label]="getTranslation('today')" (keydown)="onContainerButtonKeydown($event)" (click)="onTodayButtonClick($event)" pButton pRipple [ngClass]="[todayButtonStyleClass]"></button>
2090 <button type="button" [label]="getTranslation('clear')" (keydown)="onContainerButtonKeydown($event)" (click)="onClearButtonClick($event)" pButton pRipple [ngClass]="[clearButtonStyleClass]"></button>
2091 </div>
2092 <ng-content select="p-footer"></ng-content>
2093 <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
2094 </div>
2095 </span>
2096 `, isInline: true, styles: [".p-calendar{position:relative;display:inline-flex}.p-calendar .p-inputtext{flex:1 1 auto;width:1%}.p-calendar-w-btn .p-inputtext{border-top-right-radius:0;border-bottom-right-radius:0}.p-calendar-w-btn .p-datepicker-trigger{border-top-left-radius:0;border-bottom-left-radius:0}.p-fluid .p-calendar{display:flex}.p-fluid .p-calendar .p-inputtext{width:1%}.p-calendar .p-datepicker{min-width:100%}.p-datepicker{width:auto;position:absolute;top:0;left:0}.p-datepicker-inline{position:static}.p-datepicker-header{display:flex;align-items:center;justify-content:space-between}.p-datepicker-header .p-datepicker-title{margin:0 auto}.p-datepicker-prev,.p-datepicker-next{cursor:pointer;display:inline-flex;justify-content:center;align-items:center;overflow:hidden;position:relative}.p-datepicker-multiple-month .p-datepicker-group-container{display:flex}.p-datepicker table{width:100%;border-collapse:collapse}.p-datepicker td>span{display:flex;justify-content:center;align-items:center;cursor:pointer;margin:0 auto;overflow:hidden;position:relative}.p-monthpicker-month{width:33.3%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.p-datepicker-buttonbar{display:flex;justify-content:space-between;align-items:center}.p-timepicker{display:flex;justify-content:center;align-items:center}.p-timepicker button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.p-timepicker>div{display:flex;align-items:center;flex-direction:column}.p-datepicker-touch-ui,.p-calendar .p-datepicker-touch-ui{position:fixed;top:50%;left:50%;min-width:80vw;transform:translate(-50%,-50%)}\n"], directives: [{ type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "label", "icon", "loading"] }, { type: i4.Ripple, selector: "[pRipple]" }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }, { type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [
2097 trigger('overlayAnimation', [
2098 state('visibleTouchUI', style({
2099 transform: 'translate(-50%,-50%)',
2100 opacity: 1
2101 })),
2102 transition('void => visible', [
2103 style({ opacity: 0, transform: 'scaleY(0.8)' }),
2104 animate('{{showTransitionParams}}', style({ opacity: 1, transform: '*' }))
2105 ]),
2106 transition('visible => void', [
2107 animate('{{hideTransitionParams}}', style({ opacity: 0 }))
2108 ]),
2109 transition('void => visibleTouchUI', [
2110 style({ opacity: 0, transform: 'translate3d(-50%, -40%, 0) scale(0.9)' }),
2111 animate('{{showTransitionParams}}')
2112 ]),
2113 transition('visibleTouchUI => void', [
2114 animate(('{{hideTransitionParams}}'), style({
2115 opacity: 0,
2116 transform: 'translate3d(-50%, -40%, 0) scale(0.9)'
2117 }))
2118 ])
2119 ])
2120 ], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2121i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: Calendar, decorators: [{
2122 type: Component,
2123 args: [{ selector: 'p-calendar', template: `
2124 <span #container [ngClass]="{'p-calendar':true, 'p-calendar-w-btn': showIcon, 'p-calendar-timeonly': timeOnly, 'p-calendar-disabled':disabled, 'p-focus': focus}" [ngStyle]="style" [class]="styleClass">
2125 <ng-template [ngIf]="!inline">
2126 <input #inputfield type="text" [attr.id]="inputId" [attr.name]="name" [attr.required]="required" [attr.aria-required]="required" [value]="inputFieldValue" (focus)="onInputFocus($event)" (keydown)="onInputKeydown($event)" (click)="onInputClick()" (blur)="onInputBlur($event)"
2127 [readonly]="readonlyInput" (input)="onUserInput($event)" [ngStyle]="inputStyle" [class]="inputStyleClass" [placeholder]="placeholder||''" [disabled]="disabled" [attr.tabindex]="tabindex" [attr.inputmode]="touchUI ? 'off' : null"
2128 [ngClass]="'p-inputtext p-component'" autocomplete="off" [attr.aria-labelledby]="ariaLabelledBy"
2129 ><button type="button" [attr.aria-label]="iconAriaLabel" [icon]="icon" pButton pRipple *ngIf="showIcon" (click)="onButtonClick($event,inputfield)" class="p-datepicker-trigger"
2130 [disabled]="disabled" tabindex="0"></button>
2131 </ng-template>
2132 <div #contentWrapper [class]="panelStyleClass" [ngStyle]="panelStyle" [ngClass]="{'p-datepicker p-component': true, 'p-datepicker-inline':inline,
2133 'p-disabled':disabled,'p-datepicker-timeonly':timeOnly,'p-datepicker-multiple-month': this.numberOfMonths > 1, 'p-datepicker-monthpicker': (view === 'month'), 'p-datepicker-touch-ui': touchUI}"
2134 [@overlayAnimation]="touchUI ? {value: 'visibleTouchUI', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}:
2135 {value: 'visible', params: {showTransitionParams: showTransitionOptions, hideTransitionParams: hideTransitionOptions}}"
2136 [@.disabled]="inline === true" (@overlayAnimation.start)="onOverlayAnimationStart($event)" (@overlayAnimation.done)="onOverlayAnimationDone($event)" (click)="onOverlayClick($event)" *ngIf="inline || overlayVisible">
2137 <ng-content select="p-header"></ng-content>
2138 <ng-container *ngTemplateOutlet="headerTemplate"></ng-container>
2139 <ng-container *ngIf="!timeOnly">
2140 <div class="p-datepicker-group-container">
2141 <div class="p-datepicker-group" *ngFor="let month of months; let i = index;">
2142 <div class="p-datepicker-header">
2143 <button (keydown)="onContainerButtonKeydown($event)" class="p-datepicker-prev p-link" (click)="onPrevButtonClick($event)" *ngIf="i === 0" type="button" pRipple>
2144 <span class="p-datepicker-prev-icon pi pi-chevron-left"></span>
2145 </button>
2146 <div class="p-datepicker-title">
2147 <span class="p-datepicker-month" *ngIf="!monthNavigator && (view !== 'month')">{{getTranslation('monthNames')[month.month]}}</span>
2148 <select tabindex="0" class="p-datepicker-month" *ngIf="monthNavigator && (view !== 'month') && numberOfMonths === 1" (change)="onMonthDropdownChange($event.target.value)">
2149 <option [value]="i" *ngFor="let monthName of getTranslation('monthNames');let i = index" [selected]="i === month.month">{{monthName}}</option>
2150 </select>
2151 <select tabindex="0" class="p-datepicker-year" *ngIf="yearNavigator && numberOfMonths === 1" (change)="onYearDropdownChange($event.target.value)">
2152 <option [value]="year" *ngFor="let year of yearOptions" [selected]="year === currentYear">{{year}}</option>
2153 </select>
2154 <span class="p-datepicker-year" *ngIf="!yearNavigator">{{view === 'month' ? currentYear : month.year}}</span>
2155 </div>
2156 <button (keydown)="onContainerButtonKeydown($event)" class="p-datepicker-next p-link" (click)="onNextButtonClick($event)" *ngIf="numberOfMonths === 1 ? true : (i === numberOfMonths -1)" type="button" pRipple>
2157 <span class="p-datepicker-next-icon pi pi-chevron-right"></span>
2158 </button>
2159 </div>
2160 <div class="p-datepicker-calendar-container" *ngIf="view ==='date'">
2161 <table class="p-datepicker-calendar">
2162 <thead>
2163 <tr>
2164 <th *ngIf="showWeek" class="p-datepicker-weekheader p-disabled">
2165 <span>{{getTranslation('weekHeader')}}</span>
2166 </th>
2167 <th scope="col" *ngFor="let weekDay of weekDays;let begin = first; let end = last">
2168 <span>{{weekDay}}</span>
2169 </th>
2170 </tr>
2171 </thead>
2172 <tbody>
2173 <tr *ngFor="let week of month.dates; let j = index;">
2174 <td *ngIf="showWeek" class="p-datepicker-weeknumber">
2175 <span class="p-disabled">
2176 {{month.weekNumbers[j]}}
2177 </span>
2178 </td>
2179 <td *ngFor="let date of week" [ngClass]="{'p-datepicker-other-month': date.otherMonth,'p-datepicker-today':date.today}">
2180 <ng-container *ngIf="date.otherMonth ? showOtherMonths : true">
2181 <span [ngClass]="{'p-highlight':isSelected(date), 'p-disabled': !date.selectable}"
2182 (click)="onDateSelect($event,date)" draggable="false" (keydown)="onDateCellKeydown($event,date,i)" pRipple>
2183 <ng-container *ngIf="!dateTemplate">{{date.day}}</ng-container>
2184 <ng-container *ngTemplateOutlet="dateTemplate; context: {$implicit: date}"></ng-container>
2185 </span>
2186 </ng-container>
2187 </td>
2188 </tr>
2189 </tbody>
2190 </table>
2191 </div>
2192 </div>
2193 </div>
2194 <div class="p-monthpicker" *ngIf="view === 'month'">
2195 <span *ngFor="let m of monthPickerValues; let i = index" (click)="onMonthSelect($event, i)" (keydown)="onMonthCellKeydown($event,i)" class="p-monthpicker-month" [ngClass]="{'p-highlight': isMonthSelected(i), 'p-disabled':!isSelectable(1, i, this.currentYear, false)}" pRipple>
2196 {{m}}
2197 </span>
2198 </div>
2199 </ng-container>
2200 <div class="p-timepicker" *ngIf="showTime||timeOnly">
2201 <div class="p-hour-picker">
2202 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementHour($event)" (mousedown)="onTimePickerElementMouseDown($event, 0, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2203 <span class="pi pi-chevron-up"></span>
2204 </button>
2205 <span><ng-container *ngIf="currentHour < 10">0</ng-container>{{currentHour}}</span>
2206 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementHour($event)" (mousedown)="onTimePickerElementMouseDown($event, 0, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2207 <span class="pi pi-chevron-down"></span>
2208 </button>
2209 </div>
2210 <div class="p-separator">
2211 <span>{{timeSeparator}}</span>
2212 </div>
2213 <div class="p-minute-picker">
2214 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementMinute($event)" (mousedown)="onTimePickerElementMouseDown($event, 1, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2215 <span class="pi pi-chevron-up"></span>
2216 </button>
2217 <span><ng-container *ngIf="currentMinute < 10">0</ng-container>{{currentMinute}}</span>
2218 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementMinute($event)" (mousedown)="onTimePickerElementMouseDown($event, 1, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2219 <span class="pi pi-chevron-down"></span>
2220 </button>
2221 </div>
2222 <div class="p-separator" *ngIf="showSeconds">
2223 <span>{{timeSeparator}}</span>
2224 </div>
2225 <div class="p-second-picker" *ngIf="showSeconds">
2226 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="incrementSecond($event)" (mousedown)="onTimePickerElementMouseDown($event, 2, 1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2227 <span class="pi pi-chevron-up"></span>
2228 </button>
2229 <span><ng-container *ngIf="currentSecond < 10">0</ng-container>{{currentSecond}}</span>
2230 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (keydown.enter)="decrementSecond($event)" (mousedown)="onTimePickerElementMouseDown($event, 2, -1)" (mouseup)="onTimePickerElementMouseUp($event)" (mouseleave)="onTimePickerElementMouseLeave()" pRipple>
2231 <span class="pi pi-chevron-down"></span>
2232 </button>
2233 </div>
2234 <div class="p-ampm-picker" *ngIf="hourFormat=='12'">
2235 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (click)="toggleAMPM($event)" (keydown.enter)="toggleAMPM($event)" pRipple>
2236 <span class="pi pi-chevron-up"></span>
2237 </button>
2238 <span>{{pm ? 'PM' : 'AM'}}</span>
2239 <button class="p-link" type="button" (keydown)="onContainerButtonKeydown($event)" (click)="toggleAMPM($event)" (keydown.enter)="toggleAMPM($event)" pRipple>
2240 <span class="pi pi-chevron-down"></span>
2241 </button>
2242 </div>
2243 </div>
2244 <div class="p-datepicker-buttonbar" *ngIf="showButtonBar">
2245 <button type="button" [label]="getTranslation('today')" (keydown)="onContainerButtonKeydown($event)" (click)="onTodayButtonClick($event)" pButton pRipple [ngClass]="[todayButtonStyleClass]"></button>
2246 <button type="button" [label]="getTranslation('clear')" (keydown)="onContainerButtonKeydown($event)" (click)="onClearButtonClick($event)" pButton pRipple [ngClass]="[clearButtonStyleClass]"></button>
2247 </div>
2248 <ng-content select="p-footer"></ng-content>
2249 <ng-container *ngTemplateOutlet="footerTemplate"></ng-container>
2250 </div>
2251 </span>
2252 `, animations: [
2253 trigger('overlayAnimation', [
2254 state('visibleTouchUI', style({
2255 transform: 'translate(-50%,-50%)',
2256 opacity: 1
2257 })),
2258 transition('void => visible', [
2259 style({ opacity: 0, transform: 'scaleY(0.8)' }),
2260 animate('{{showTransitionParams}}', style({ opacity: 1, transform: '*' }))
2261 ]),
2262 transition('visible => void', [
2263 animate('{{hideTransitionParams}}', style({ opacity: 0 }))
2264 ]),
2265 transition('void => visibleTouchUI', [
2266 style({ opacity: 0, transform: 'translate3d(-50%, -40%, 0) scale(0.9)' }),
2267 animate('{{showTransitionParams}}')
2268 ]),
2269 transition('visibleTouchUI => void', [
2270 animate(('{{hideTransitionParams}}'), style({
2271 opacity: 0,
2272 transform: 'translate3d(-50%, -40%, 0) scale(0.9)'
2273 }))
2274 ])
2275 ])
2276 ], host: {
2277 'class': 'p-element p-inputwrapper',
2278 '[class.p-inputwrapper-filled]': 'filled',
2279 '[class.p-inputwrapper-focus]': 'focus'
2280 }, providers: [CALENDAR_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [".p-calendar{position:relative;display:inline-flex}.p-calendar .p-inputtext{flex:1 1 auto;width:1%}.p-calendar-w-btn .p-inputtext{border-top-right-radius:0;border-bottom-right-radius:0}.p-calendar-w-btn .p-datepicker-trigger{border-top-left-radius:0;border-bottom-left-radius:0}.p-fluid .p-calendar{display:flex}.p-fluid .p-calendar .p-inputtext{width:1%}.p-calendar .p-datepicker{min-width:100%}.p-datepicker{width:auto;position:absolute;top:0;left:0}.p-datepicker-inline{position:static}.p-datepicker-header{display:flex;align-items:center;justify-content:space-between}.p-datepicker-header .p-datepicker-title{margin:0 auto}.p-datepicker-prev,.p-datepicker-next{cursor:pointer;display:inline-flex;justify-content:center;align-items:center;overflow:hidden;position:relative}.p-datepicker-multiple-month .p-datepicker-group-container{display:flex}.p-datepicker table{width:100%;border-collapse:collapse}.p-datepicker td>span{display:flex;justify-content:center;align-items:center;cursor:pointer;margin:0 auto;overflow:hidden;position:relative}.p-monthpicker-month{width:33.3%;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.p-datepicker-buttonbar{display:flex;justify-content:space-between;align-items:center}.p-timepicker{display:flex;justify-content:center;align-items:center}.p-timepicker button{display:flex;align-items:center;justify-content:center;cursor:pointer;overflow:hidden;position:relative}.p-timepicker>div{display:flex;align-items:center;flex-direction:column}.p-datepicker-touch-ui,.p-calendar .p-datepicker-touch-ui{position:fixed;top:50%;left:50%;min-width:80vw;transform:translate(-50%,-50%)}\n"] }]
2281 }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }, { type: i0.NgZone }, { type: i1.PrimeNGConfig }, { type: i1.OverlayService }]; }, propDecorators: { style: [{
2282 type: Input
2283 }], styleClass: [{
2284 type: Input
2285 }], inputStyle: [{
2286 type: Input
2287 }], inputId: [{
2288 type: Input
2289 }], name: [{
2290 type: Input
2291 }], inputStyleClass: [{
2292 type: Input
2293 }], placeholder: [{
2294 type: Input
2295 }], ariaLabelledBy: [{
2296 type: Input
2297 }], iconAriaLabel: [{
2298 type: Input
2299 }], disabled: [{
2300 type: Input
2301 }], dateFormat: [{
2302 type: Input
2303 }], multipleSeparator: [{
2304 type: Input
2305 }], rangeSeparator: [{
2306 type: Input
2307 }], inline: [{
2308 type: Input
2309 }], showOtherMonths: [{
2310 type: Input
2311 }], selectOtherMonths: [{
2312 type: Input
2313 }], showIcon: [{
2314 type: Input
2315 }], icon: [{
2316 type: Input
2317 }], appendTo: [{
2318 type: Input
2319 }], readonlyInput: [{
2320 type: Input
2321 }], shortYearCutoff: [{
2322 type: Input
2323 }], monthNavigator: [{
2324 type: Input
2325 }], yearNavigator: [{
2326 type: Input
2327 }], hourFormat: [{
2328 type: Input
2329 }], timeOnly: [{
2330 type: Input
2331 }], stepHour: [{
2332 type: Input
2333 }], stepMinute: [{
2334 type: Input
2335 }], stepSecond: [{
2336 type: Input
2337 }], showSeconds: [{
2338 type: Input
2339 }], required: [{
2340 type: Input
2341 }], showOnFocus: [{
2342 type: Input
2343 }], showWeek: [{
2344 type: Input
2345 }], dataType: [{
2346 type: Input
2347 }], selectionMode: [{
2348 type: Input
2349 }], maxDateCount: [{
2350 type: Input
2351 }], showButtonBar: [{
2352 type: Input
2353 }], todayButtonStyleClass: [{
2354 type: Input
2355 }], clearButtonStyleClass: [{
2356 type: Input
2357 }], autoZIndex: [{
2358 type: Input
2359 }], baseZIndex: [{
2360 type: Input
2361 }], panelStyleClass: [{
2362 type: Input
2363 }], panelStyle: [{
2364 type: Input
2365 }], keepInvalid: [{
2366 type: Input
2367 }], hideOnDateTimeSelect: [{
2368 type: Input
2369 }], numberOfMonths: [{
2370 type: Input
2371 }], view: [{
2372 type: Input
2373 }], touchUI: [{
2374 type: Input
2375 }], timeSeparator: [{
2376 type: Input
2377 }], focusTrap: [{
2378 type: Input
2379 }], firstDayOfWeek: [{
2380 type: Input
2381 }], showTransitionOptions: [{
2382 type: Input
2383 }], hideTransitionOptions: [{
2384 type: Input
2385 }], onFocus: [{
2386 type: Output
2387 }], onBlur: [{
2388 type: Output
2389 }], onClose: [{
2390 type: Output
2391 }], onSelect: [{
2392 type: Output
2393 }], onInput: [{
2394 type: Output
2395 }], onTodayClick: [{
2396 type: Output
2397 }], onClearClick: [{
2398 type: Output
2399 }], onMonthChange: [{
2400 type: Output
2401 }], onYearChange: [{
2402 type: Output
2403 }], onClickOutside: [{
2404 type: Output
2405 }], onShow: [{
2406 type: Output
2407 }], templates: [{
2408 type: ContentChildren,
2409 args: [PrimeTemplate]
2410 }], tabindex: [{
2411 type: Input
2412 }], containerViewChild: [{
2413 type: ViewChild,
2414 args: ['container', { static: false }]
2415 }], inputfieldViewChild: [{
2416 type: ViewChild,
2417 args: ['inputfield', { static: false }]
2418 }], content: [{
2419 type: ViewChild,
2420 args: ['contentWrapper', { static: false }]
2421 }], defaultDate: [{
2422 type: Input
2423 }], minDate: [{
2424 type: Input
2425 }], maxDate: [{
2426 type: Input
2427 }], disabledDates: [{
2428 type: Input
2429 }], disabledDays: [{
2430 type: Input
2431 }], yearRange: [{
2432 type: Input
2433 }], showTime: [{
2434 type: Input
2435 }], locale: [{
2436 type: Input
2437 }] } });
2438class CalendarModule {
2439}
2440CalendarModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CalendarModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
2441CalendarModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CalendarModule, declarations: [Calendar], imports: [CommonModule, ButtonModule, SharedModule, RippleModule], exports: [Calendar, ButtonModule, SharedModule] });
2442CalendarModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CalendarModule, imports: [[CommonModule, ButtonModule, SharedModule, RippleModule], ButtonModule, SharedModule] });
2443i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0", ngImport: i0, type: CalendarModule, decorators: [{
2444 type: NgModule,
2445 args: [{
2446 imports: [CommonModule, ButtonModule, SharedModule, RippleModule],
2447 exports: [Calendar, ButtonModule, SharedModule],
2448 declarations: [Calendar]
2449 }]
2450 }] });
2451
2452/**
2453 * Generated bundle index. Do not edit.
2454 */
2455
2456export { CALENDAR_VALUE_ACCESSOR, Calendar, CalendarModule };
Note: See TracBrowser for help on using the repository browser.