angular-mydatepicker
Version:
Angular datepicker and date range picker
988 lines • 132 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { Component, ElementRef, ViewEncapsulation, ViewChild, Renderer2, ChangeDetectorRef, HostBinding } from "@angular/core";
import { UtilService } from "../../services/angular-mydatepicker.util.service";
import { KeyCode } from "../../enums/key-code.enum";
import { MonthId } from "../../enums/month-id.enum";
import { DefaultView } from "../../enums/default-view.enum";
import { CalAnimation } from "../../enums/cal-animation.enum";
import { HeaderAction } from "../../enums/header-action.enum";
import { DOT, UNDER_LINE, D, M, Y, DATE_ROW_COUNT, DATE_COL_COUNT, MONTH_ROW_COUNT, MONTH_COL_COUNT, YEAR_ROW_COUNT, YEAR_COL_COUNT, SU, MO, TU, WE, TH, FR, SA, EMPTY_STR, CLICK, STYLE, MY_DP_ANIMATION, ANIMATION_NAMES, IN, OUT, TABINDEX, TD_SELECTOR, ZERO_STR, YEAR_SEPARATOR } from "../../constants/constants";
export class CalendarComponent {
/**
* @param {?} elem
* @param {?} renderer
* @param {?} cdr
* @param {?} utilService
*/
constructor(elem, renderer, cdr, utilService) {
this.elem = elem;
this.renderer = renderer;
this.cdr = cdr;
this.utilService = utilService;
this.position = "static";
this.visibleMonth = { monthTxt: EMPTY_STR, monthNbr: 0, year: 0 };
this.selectedMonth = { monthNbr: 0, year: 0 };
this.selectedDate = { year: 0, month: 0, day: 0 };
this.selectedDateRange = { begin: { year: 0, month: 0, day: 0 }, end: { year: 0, month: 0, day: 0 } };
this.weekDays = [];
this.dates = [];
this.months = [];
this.years = [];
this.yearsDuration = "";
this.dayIdx = 0;
this.weekDayOpts = [SU, MO, TU, WE, TH, FR, SA];
this.selectMonth = false;
this.selectYear = false;
this.viewChanged = false;
this.selectorPos = null;
this.prevViewDisabled = false;
this.nextViewDisabled = false;
this.clickListener = renderer.listen(elem.nativeElement, CLICK, (/**
* @param {?} event
* @return {?}
*/
(event) => {
if ((this.opts.monthSelector || this.opts.yearSelector) && event.target) {
this.resetMonthYearSelect();
}
}));
}
/**
* @return {?}
*/
ngAfterViewInit() {
const { stylesData, calendarAnimation, inline } = this.opts;
if (stylesData.styles.length) {
/** @type {?} */
const styleElTemp = this.renderer.createElement(STYLE);
this.renderer.appendChild(styleElTemp, this.renderer.createText(stylesData.styles));
this.renderer.appendChild(this.styleEl.nativeElement, styleElTemp);
}
if (calendarAnimation.in !== CalAnimation.None) {
this.setCalendarAnimation(calendarAnimation, true);
}
if (!inline) {
this.focusToSelector();
}
}
/**
* @return {?}
*/
ngOnDestroy() {
this.clickListener();
}
/**
* @param {?} opts
* @param {?} defaultMonth
* @param {?} selectedValue
* @param {?} inputValue
* @param {?} selectorPos
* @param {?} dc
* @param {?} cvc
* @param {?} rds
* @param {?} va
* @param {?} cbe
* @return {?}
*/
initializeComponent(opts, defaultMonth, selectedValue, inputValue, selectorPos, dc, cvc, rds, va, cbe) {
this.opts = opts;
this.selectorPos = selectorPos;
this.dateChanged = dc;
this.calendarViewChanged = cvc;
this.rangeDateSelection = rds;
this.viewActivated = va;
this.closedByEsc = cbe;
const { defaultView, firstDayOfWeek, dayLabels } = opts;
this.weekDays.length = 0;
this.dayIdx = this.weekDayOpts.indexOf(firstDayOfWeek);
if (this.dayIdx !== -1) {
/** @type {?} */
let idx = this.dayIdx;
for (let i = 0; i < this.weekDayOpts.length; i++) {
this.weekDays.push(dayLabels[this.weekDayOpts[idx]]);
idx = this.weekDayOpts[idx] === SA ? 0 : idx + 1;
}
}
this.initializeView(defaultMonth, selectedValue, inputValue);
this.setCalendarVisibleMonth();
this.setDefaultView(defaultView);
}
/**
* @param {?} defaultMonth
* @param {?} selectedValue
* @param {?} inputValue
* @return {?}
*/
initializeView(defaultMonth, selectedValue, inputValue) {
const { dateRange } = this.opts;
// use today as a selected month
/** @type {?} */
const today = this.utilService.getToday();
this.selectedMonth = { monthNbr: today.month, year: today.year };
// If default month attribute valur given use it as a selected month
const { defMonth, overrideSelection } = defaultMonth;
if (defMonth && defMonth.length) {
this.selectedMonth = this.utilService.parseDefaultMonth(defMonth);
}
/** @type {?} */
let validateOpts = null;
if (!dateRange) {
// Single date mode - If date selected use it as selected month
validateOpts = { validateDisabledDates: false, selectedValue: this.utilService.getSelectedValue(selectedValue, dateRange) };
/** @type {?} */
const date = this.utilService.isDateValid(inputValue, this.opts, validateOpts);
if (this.utilService.isInitializedDate(date)) {
this.selectedDate = date;
if (!overrideSelection) {
this.selectedMonth = { monthNbr: date.month, year: date.year };
}
}
}
else {
// Date range mode - If date range selected use begin date as selected month
validateOpts = { validateDisabledDates: false, selectedValue: this.utilService.getSelectedValue(selectedValue, dateRange) };
const { begin, end } = this.utilService.isDateValidDateRange(inputValue, this.opts, validateOpts);
if (this.utilService.isInitializedDate(begin) && this.utilService.isInitializedDate(end)) {
this.selectedDateRange = { begin, end };
if (!overrideSelection) {
this.selectedMonth = { monthNbr: begin.month, year: begin.year };
}
}
}
}
/**
* @param {?} opts
* @param {?} defaultMonth
* @param {?} selectedValue
* @param {?} inputValue
* @return {?}
*/
refreshComponent(opts, defaultMonth, selectedValue, inputValue) {
this.opts = opts;
const { defaultView } = opts;
this.initializeView(defaultMonth, selectedValue, inputValue);
this.setCalendarVisibleMonth();
this.setDefaultView(defaultView);
}
/**
* @param {?} headerAction
* @return {?}
*/
headerAction(headerAction) {
const { monthSelector, yearSelector } = this.opts;
if (headerAction === HeaderAction.PrevBtnClick) {
if (!this.prevViewDisabled) {
this.onPrevNavigateBtnClicked();
}
}
else if (headerAction === HeaderAction.NextBtnClick) {
if (!this.nextViewDisabled) {
this.onNextNavigateBtnClicked();
}
}
else if (headerAction === HeaderAction.MonthBtnClick) {
if (monthSelector) {
this.onMonthViewBtnClicked();
}
}
else if (headerAction === HeaderAction.YearBtnClick) {
if (yearSelector) {
this.onYearViewBtnClicked();
}
}
}
/**
* @param {?} defaultView
* @return {?}
*/
setDefaultView(defaultView) {
if (defaultView === DefaultView.Month) {
this.monthViewBtnClicked();
}
else if (defaultView === DefaultView.Year) {
this.yearViewBtnClicked();
}
}
/**
* @param {?} calAnimation
* @param {?} isOpen
* @return {?}
*/
setCalendarAnimation(calAnimation, isOpen) {
const { nativeElement } = this.selectorEl;
const { renderer } = this;
/** @type {?} */
const classIn = MY_DP_ANIMATION + ANIMATION_NAMES[calAnimation.in - 1];
if (isOpen) {
renderer.addClass(nativeElement, classIn + IN);
}
else {
/** @type {?} */
const classOut = MY_DP_ANIMATION + ANIMATION_NAMES[calAnimation.out - 1];
renderer.removeClass(nativeElement, classIn + IN);
renderer.addClass(nativeElement, classOut + OUT);
}
}
/**
* @return {?}
*/
resetDateValue() {
if (!this.opts.dateRange) {
this.selectedDate = this.utilService.resetDate();
}
else {
this.selectedDateRange.begin = this.utilService.resetDate();
this.selectedDateRange.end = this.utilService.resetDate();
}
}
/**
* @return {?}
*/
clearDate() {
const { month, year } = this.utilService.getToday();
this.selectedMonth = { monthNbr: month, year: year };
this.resetDateValue();
this.setCalendarVisibleMonth();
this.resetMonthYearSelect();
}
/**
* @return {?}
*/
resetMonthYearSelect() {
this.selectMonth = false;
this.selectYear = false;
}
/**
* @return {?}
*/
onMonthViewBtnClicked() {
this.viewChanged = true;
this.monthViewBtnClicked();
}
/**
* @return {?}
*/
monthViewBtnClicked() {
this.selectMonth = !this.selectMonth;
this.selectYear = false;
this.cdr.detectChanges();
if (this.selectMonth) {
this.generateMonths();
}
else {
const { year, monthNbr } = this.selectedMonth;
this.visibleMonth = { monthTxt: this.opts.monthLabels[monthNbr], monthNbr, year };
this.generateCalendar(monthNbr, year, true);
}
}
/**
* @param {?} cell
* @return {?}
*/
onMonthCellClicked(cell) {
this.viewChanged = true;
const { year, monthNbr } = this.visibleMonth;
/** @type {?} */
const monthChange = cell.nbr !== monthNbr;
this.visibleMonth = { monthTxt: this.opts.monthLabels[cell.nbr], monthNbr: cell.nbr, year };
this.selectedMonth.year = year;
this.generateCalendar(cell.nbr, year, monthChange);
this.selectMonth = false;
this.focusToSelector();
}
/**
* @param {?} event
* @return {?}
*/
onMonthCellKeyDown(event) {
// Move focus by arrow keys
const { sourceRow, sourceCol } = this.getSourceRowAndColumnFromEvent(event);
const { moveFocus, targetRow, targetCol, direction } = this.getTargetFocusRowAndColumn(event, sourceRow, sourceCol, MONTH_ROW_COUNT, MONTH_COL_COUNT);
if (moveFocus) {
this.focusCellElement(M, targetRow, targetCol, direction, MONTH_COL_COUNT);
}
}
/**
* @return {?}
*/
onYearViewBtnClicked() {
this.viewChanged = true;
this.yearViewBtnClicked();
}
/**
* @return {?}
*/
yearViewBtnClicked() {
this.selectYear = !this.selectYear;
this.selectMonth = false;
this.cdr.detectChanges();
if (this.selectYear) {
this.generateYears(this.visibleMonth.year);
}
else {
const { year, monthNbr } = this.selectedMonth;
this.visibleMonth = { monthTxt: this.opts.monthLabels[monthNbr], monthNbr, year };
this.generateCalendar(monthNbr, year, true);
}
}
/**
* @param {?} cell
* @return {?}
*/
onYearCellClicked(cell) {
this.viewChanged = true;
const { year, monthNbr, monthTxt } = this.visibleMonth;
/** @type {?} */
const yc = cell.year !== year;
this.visibleMonth = { monthTxt, monthNbr, year: cell.year };
this.selectedMonth.year = cell.year;
this.generateCalendar(monthNbr, cell.year, yc);
this.selectYear = false;
this.focusToSelector();
}
/**
* @param {?} event
* @return {?}
*/
onYearCellKeyDown(event) {
// Move focus by arrow keys
const { sourceRow, sourceCol } = this.getSourceRowAndColumnFromEvent(event);
const { moveFocus, targetRow, targetCol, direction } = this.getTargetFocusRowAndColumn(event, sourceRow, sourceCol, YEAR_ROW_COUNT, YEAR_COL_COUNT);
if (moveFocus) {
this.focusCellElement(Y, targetRow, targetCol, direction, YEAR_COL_COUNT);
}
}
/**
* @return {?}
*/
generateMonths() {
/** @type {?} */
const today = this.utilService.getToday();
this.months.length = 0;
const { year, monthNbr } = this.visibleMonth;
const { rtl, monthLabels } = this.opts;
/** @type {?} */
let row = 0;
for (let i = 1; i <= 12; i += 3) {
/** @type {?} */
const rowData = [];
/** @type {?} */
let col = rtl ? 2 : 0;
for (let j = i; j < i + 3; j++) {
/** @type {?} */
const disabled = this.utilService.isDisabledMonth(year, j, this.opts);
rowData.push({
nbr: j,
year,
name: monthLabels[j],
currMonth: j === today.month && year === today.year,
selected: j === monthNbr && year === this.selectedMonth.year,
disabled,
row,
col: rtl ? col-- : col++
});
}
row++;
this.months.push(rowData);
}
this.setMonthViewHeaderBtnDisabledState(year);
}
/**
* @param {?} inputYear
* @return {?}
*/
generateYears(inputYear) {
const { minYear, maxYear, rtl } = this.opts;
/** @type {?} */
let y = inputYear - 12;
if (inputYear < minYear) {
y = minYear;
}
if (inputYear + 25 > maxYear) {
y = maxYear - 24;
}
const { year } = this.visibleMonth;
this.years.length = 0;
/** @type {?} */
const today = this.utilService.getToday();
/** @type {?} */
let row = 0;
for (let i = y; i < y + 25; i += 5) {
/** @type {?} */
const rowData = [];
/** @type {?} */
let col = rtl ? 4 : 0;
for (let j = i; j < i + 5; j++) {
/** @type {?} */
const disabled = this.utilService.isDisabledYear(j, this.opts);
rowData.push({
year: j,
currYear: j === today.year,
selected: j === year,
disabled,
row,
col: rtl ? col-- : col++
});
}
row++;
this.years.push(rowData);
}
/** @type {?} */
const beginYear = this.getYearValueByRowAndCol(0, 0);
/** @type {?} */
const endYear = beginYear + 24;
this.yearsDuration = (!rtl ? beginYear : endYear) + YEAR_SEPARATOR + (!rtl ? endYear : beginYear);
this.setYearViewHeaderBtnDisabledState(beginYear, endYear);
}
/**
* @return {?}
*/
onTodayFooterClicked() {
/** @type {?} */
const date = this.utilService.getToday();
this.selectDate(date);
}
/**
* @param {?} row
* @param {?} col
* @return {?}
*/
getYearValueByRowAndCol(row, col) {
const { years } = this;
if (!years || years.length === 0) {
const { year } = this.utilService.getToday();
return year;
}
return years[row][col].year;
}
/**
* @return {?}
*/
setCalendarVisibleMonth() {
// Sets visible month of calendar
const { year, monthNbr } = this.selectedMonth;
this.visibleMonth = { monthTxt: this.opts.monthLabels[monthNbr], monthNbr, year };
// Create current month
this.generateCalendar(monthNbr, year, true);
}
/**
* @param {?} event
* @return {?}
*/
onViewActivated(event) {
this.viewActivated(event);
}
/**
* @return {?}
*/
onPrevNavigateBtnClicked() {
if (!this.selectMonth && !this.selectYear) {
this.setDateViewMonth(false);
}
else if (this.selectMonth) {
this.visibleMonth.year--;
this.generateMonths();
}
else if (this.selectYear) {
this.generateYears(this.getYearValueByRowAndCol(2, 2) - 25);
}
}
/**
* @return {?}
*/
onNextNavigateBtnClicked() {
if (!this.selectMonth && !this.selectYear) {
this.setDateViewMonth(true);
}
else if (this.selectMonth) {
this.visibleMonth.year++;
this.generateMonths();
}
else if (this.selectYear) {
this.generateYears(this.getYearValueByRowAndCol(2, 2) + 25);
}
}
/**
* @param {?} isNext
* @return {?}
*/
setDateViewMonth(isNext) {
/** @type {?} */
let change = isNext ? 1 : -1;
const { year, monthNbr } = this.visibleMonth;
/** @type {?} */
const d = this.utilService.getJsDate(year, monthNbr, 1);
d.setMonth(d.getMonth() + change);
/** @type {?} */
const y = d.getFullYear();
/** @type {?} */
const m = d.getMonth() + 1;
this.visibleMonth = { monthTxt: this.opts.monthLabels[m], monthNbr: m, year: y };
this.generateCalendar(m, y, true);
}
/**
* @param {?} event
* @return {?}
*/
onCloseSelector(event) {
/** @type {?} */
const keyCode = this.utilService.getKeyCodeFromEvent(event);
if (keyCode === KeyCode.esc) {
this.closedByEsc();
}
}
/**
* @param {?} cell
* @return {?}
*/
onDayCellClicked(cell) {
// Cell clicked on the calendar
this.selectDate(cell.dateObj);
this.resetMonthYearSelect();
}
/**
* @param {?} event
* @return {?}
*/
onDayCellKeyDown(event) {
// Move focus by arrow keys
const { sourceRow, sourceCol } = this.getSourceRowAndColumnFromEvent(event);
const { moveFocus, targetRow, targetCol, direction } = this.getTargetFocusRowAndColumn(event, sourceRow, sourceCol, DATE_ROW_COUNT, DATE_COL_COUNT);
if (moveFocus) {
this.focusCellElement(D, targetRow, targetCol, direction, DATE_COL_COUNT);
}
}
/**
* @param {?} event
* @return {?}
*/
getSourceRowAndColumnFromEvent(event) {
/** @type {?} */
let sourceRow = 0;
/** @type {?} */
let sourceCol = 0;
if (event.target && event.target.id) {
// value of id is for example: m_0_1 (first number = row, second number = column)
/** @type {?} */
const arr = event.target.id.split(UNDER_LINE);
sourceRow = Number(arr[1]);
sourceCol = Number(arr[2]);
}
return { sourceRow, sourceCol };
}
/**
* @param {?} event
* @param {?} row
* @param {?} col
* @param {?} rowCount
* @param {?} colCount
* @return {?}
*/
getTargetFocusRowAndColumn(event, row, col, rowCount, colCount) {
/** @type {?} */
let moveFocus = true;
/** @type {?} */
let targetRow = row;
/** @type {?} */
let targetCol = col;
/** @type {?} */
let direction = false;
/** @type {?} */
const keyCode = this.utilService.getKeyCodeFromEvent(event);
if (keyCode === KeyCode.upArrow && row > 0) {
targetRow--;
}
else if (keyCode === KeyCode.downArrow && row < rowCount) {
targetRow++;
direction = true;
}
else if (keyCode === KeyCode.leftArrow && col > 0) {
targetCol--;
}
else if (keyCode === KeyCode.rightArrow && col < colCount) {
targetCol++;
direction = true;
}
else {
moveFocus = false;
}
return { moveFocus, targetRow, targetCol, direction };
}
/**
* @param {?} type
* @param {?} row
* @param {?} col
* @param {?} direction
* @param {?} colCount
* @return {?}
*/
focusCellElement(type, row, col, direction, colCount) {
/** @type {?} */
const className = type + UNDER_LINE + row + UNDER_LINE + col;
/** @type {?} */
let elem = this.selectorEl.nativeElement.querySelector(DOT + className);
if (elem.getAttribute(TABINDEX) !== ZERO_STR) {
// if the selected element is disabled move a focus to next/previous enabled element
/** @type {?} */
let tdList = this.getCalendarElements();
/** @type {?} */
const idx = row * (colCount + 1) + col;
/** @type {?} */
let enabledElem = null;
if (direction) {
// find next enabled
enabledElem = tdList.slice(idx).find((/**
* @param {?} td
* @return {?}
*/
(td) => td.getAttribute(TABINDEX) === ZERO_STR));
}
else {
// find previous enabled
enabledElem = tdList.slice(0, idx).reverse().find((/**
* @param {?} td
* @return {?}
*/
(td) => td.getAttribute(TABINDEX) === ZERO_STR));
}
elem = enabledElem ? enabledElem : this.selectorEl.nativeElement;
}
else {
elem.focus();
}
}
/**
* @return {?}
*/
focusToSelector() {
this.selectorEl.nativeElement.focus();
}
/**
* @return {?}
*/
getCalendarElements() {
return Array.from(this.selectorEl.nativeElement.querySelectorAll(TD_SELECTOR));
}
/**
* @param {?} date
* @return {?}
*/
selectDate(date) {
const { dateRange, dateFormat, monthLabels, dateRangeDatesDelimiter, closeSelectorOnDateSelect } = this.opts;
if (dateRange) {
// Date range
/** @type {?} */
const isBeginDateInitialized = this.utilService.isInitializedDate(this.selectedDateRange.begin);
/** @type {?} */
const isEndDateInitialized = this.utilService.isInitializedDate(this.selectedDateRange.end);
if (isBeginDateInitialized && isEndDateInitialized) {
// both already selected - set begin date and reset end date
this.selectedDateRange.begin = date;
this.selectedDateRange.end = this.utilService.resetDate();
this.rangeDateSelection({
isBegin: true,
date,
jsDate: this.utilService.myDateToJsDate(date),
dateFormat: dateFormat,
formatted: this.utilService.formatDate(date, dateFormat, monthLabels),
epoc: this.utilService.getEpocTime(date)
});
}
else if (!isBeginDateInitialized) {
// begin date
this.selectedDateRange.begin = date;
this.rangeDateSelection({
isBegin: true,
date,
jsDate: this.utilService.myDateToJsDate(date),
dateFormat: dateFormat,
formatted: this.utilService.formatDate(date, dateFormat, monthLabels),
epoc: this.utilService.getEpocTime(date)
});
}
else {
// second selection
/** @type {?} */
const firstDateEarlier = this.utilService.isDateEarlier(date, this.selectedDateRange.begin);
if (firstDateEarlier) {
this.selectedDateRange.begin = date;
this.rangeDateSelection({
isBegin: true,
date,
jsDate: this.utilService.myDateToJsDate(date),
dateFormat: dateFormat,
formatted: this.utilService.formatDate(date, dateFormat, monthLabels),
epoc: this.utilService.getEpocTime(date)
});
}
else {
this.selectedDateRange.end = date;
this.rangeDateSelection({
isBegin: false,
date,
jsDate: this.utilService.myDateToJsDate(date),
dateFormat: dateFormat,
formatted: this.utilService.formatDate(date, dateFormat, monthLabels),
epoc: this.utilService.getEpocTime(date)
});
this.dateChanged(this.utilService.getDateModel(null, this.selectedDateRange, dateFormat, monthLabels, dateRangeDatesDelimiter), closeSelectorOnDateSelect);
}
}
}
else {
// Single date
this.selectedDate = date;
this.dateChanged(this.utilService.getDateModel(this.selectedDate, null, dateFormat, monthLabels, dateRangeDatesDelimiter), closeSelectorOnDateSelect);
}
}
/**
* @param {?} y
* @param {?} m
* @return {?}
*/
monthStartIdx(y, m) {
// Month start index
/** @type {?} */
const d = new Date();
d.setDate(1);
d.setMonth(m - 1);
d.setFullYear(y);
/** @type {?} */
const idx = d.getDay() + this.sundayIdx();
return idx >= 7 ? idx - 7 : idx;
}
/**
* @param {?} d
* @param {?} m
* @param {?} y
* @param {?} today
* @return {?}
*/
isCurrDay(d, m, y, today) {
// Check is a given date the today
return d === today.day && m === today.month && y === today.year;
}
/**
* @param {?} date
* @return {?}
*/
getDayNumber(date) {
// Get day number: su=0, mo=1, tu=2, we=3 ...
const { year, month, day } = date;
/** @type {?} */
const d = this.utilService.getJsDate(year, month, day);
return d.getDay();
}
/**
* @param {?} date
* @return {?}
*/
getWeekday(date) {
// Get weekday: su, mo, tu, we ...
return this.weekDayOpts[this.getDayNumber(date)];
}
/**
* @return {?}
*/
sundayIdx() {
// Index of Sunday day
return this.dayIdx > 0 ? 7 - this.dayIdx : 0;
}
/**
* @param {?} m
* @param {?} y
* @param {?} notifyChange
* @return {?}
*/
generateCalendar(m, y, notifyChange) {
this.dates.length = 0;
/** @type {?} */
const today = this.utilService.getToday();
/** @type {?} */
const monthStart = this.monthStartIdx(y, m);
/** @type {?} */
const dInThisM = this.utilService.datesInMonth(m, y);
/** @type {?} */
const dInPrevM = this.utilService.datesInPrevMonth(m, y);
/** @type {?} */
let dayNbr = 1;
/** @type {?} */
let month = m;
/** @type {?} */
let cmo = MonthId.prev;
const { rtl, showWeekNumbers, firstDayOfWeek } = this.opts;
for (let i = 1; i < 7; i++) {
/** @type {?} */
let col = rtl ? 6 : 0;
/** @type {?} */
const week = [];
if (i === 1) {
// First week
/** @type {?} */
const pm = dInPrevM - monthStart + 1;
// Previous month
for (let j = pm; j <= dInPrevM; j++) {
/** @type {?} */
const date = { year: m === 1 ? y - 1 : y, month: m === 1 ? 12 : m - 1, day: j };
week.push({
dateObj: date,
cmo,
currDay: this.isCurrDay(j, month - 1, y, today),
disabledDate: this.utilService.isDisabledDate(date, this.opts),
markedDate: this.utilService.isMarkedDate(date, this.opts),
highlight: this.utilService.isHighlightedDate(date, this.opts),
row: i - 1,
col: rtl ? col-- : col++
});
}
cmo = MonthId.curr;
// Current month
/** @type {?} */
const daysLeft = 7 - week.length;
for (let j = 0; j < daysLeft; j++) {
/** @type {?} */
const date = { year: y, month: m, day: dayNbr };
week.push({
dateObj: date,
cmo,
currDay: this.isCurrDay(dayNbr, m, y, today),
disabledDate: this.utilService.isDisabledDate(date, this.opts),
markedDate: this.utilService.isMarkedDate(date, this.opts),
highlight: this.utilService.isHighlightedDate(date, this.opts),
row: i - 1,
col: rtl ? col-- : col++
});
dayNbr++;
}
}
else {
// Rest of the weeks
for (let j = 1; j < 8; j++) {
if (dayNbr > dInThisM) {
// Next month
dayNbr = 1;
cmo = MonthId.next;
month = m + 1;
}
/** @type {?} */
const date = { year: cmo === MonthId.next && m === 12 ? y + 1 : y, month: cmo === MonthId.curr ? m : cmo === MonthId.next && m < 12 ? m + 1 : 1, day: dayNbr };
week.push({
dateObj: date,
cmo,
currDay: this.isCurrDay(dayNbr, month, y, today),
disabledDate: this.utilService.isDisabledDate(date, this.opts),
markedDate: this.utilService.isMarkedDate(date, this.opts),
highlight: this.utilService.isHighlightedDate(date, this.opts),
row: i - 1,
col: rtl ? col-- : col++
});
dayNbr++;
}
}
/** @type {?} */
const weekNbr = showWeekNumbers && firstDayOfWeek === MO ? this.utilService.getWeekNumber(week[0].dateObj) : 0;
this.dates.push({ week, weekNbr });
}
this.setDateViewHeaderBtnDisabledState(m, y);
if (notifyChange) {
// Notify parent
this.calendarViewChanged({ year: y, month: m, first: { number: 1, weekday: this.getWeekday({ year: y, month: m, day: 1 }) }, last: { number: dInThisM, weekday: this.getWeekday({ year: y, month: m, day: dInThisM }) } });
}
}
/**
* @param {?} m
* @param {?} y
* @return {?}
*/
setDateViewHeaderBtnDisabledState(m, y) {
/** @type {?} */
let dpm = false;
/** @type {?} */
let dnm = false;
const { disableHeaderButtons, disableUntil, disableSince, enableDates, minYear, maxYear, rtl } = this.opts;
if (disableHeaderButtons) {
/** @type {?} */
const duDate = { year: m === 1 ? y - 1 : y, month: m === 1 ? 12 : m - 1, day: this.utilService.datesInMonth(m === 1 ? 12 : m - 1, m === 1 ? y - 1 : y) };
/** @type {?} */
const dsDate = { year: m === 12 ? y + 1 : y, month: m === 12 ? 1 : m + 1, day: 1 };
dpm = this.utilService.isDisabledByDisableUntil(duDate, disableUntil)
&& !this.utilService.isPastDatesEnabled(duDate, enableDates);
dnm = this.utilService.isDisabledByDisableSince(dsDate, disableSince)
&& !this.utilService.isFutureDatesEnabled(dsDate, enableDates);
}
this.prevViewDisabled = m === 1 && y === minYear || dpm;
this.nextViewDisabled = m === 12 && y === maxYear || dnm;
if (rtl) {
this.swapHeaderBtnDisabled();
}
}
/**
* @param {?} y
* @return {?}
*/
setMonthViewHeaderBtnDisabledState(y) {
/** @type {?} */
let dpm = false;
/** @type {?} */
let dnm = false;
const { disableHeaderButtons, disableUntil, disableSince, enableDates, minYear, maxYear, rtl } = this.opts;
if (disableHeaderButtons) {
/** @type {?} */
const duDate = { year: y - 1, month: 12, day: 31 };
/** @type {?} */
const dsDate = { year: y + 1, month: 1, day: 1 };
dpm = this.utilService.isDisabledByDisableUntil(duDate, disableUntil)
&& !this.utilService.isPastDatesEnabled(duDate, enableDates);
dnm = this.utilService.isDisabledByDisableSince(dsDate, disableSince)
&& !this.utilService.isFutureDatesEnabled(dsDate, enableDates);
}
this.prevViewDisabled = y === minYear || dpm;
this.nextViewDisabled = y === maxYear || dnm;
if (rtl) {
this.swapHeaderBtnDisabled();
}
}
/**
* @param {?} yp
* @param {?} yn
* @return {?}
*/
setYearViewHeaderBtnDisabledState(yp, yn) {
/** @type {?} */
let dpy = false;
/** @type {?} */
let dny = false;
const { disableHeaderButtons, disableUntil, disableSince, enableDates, minYear, maxYear, rtl } = this.opts;
if (disableHeaderButtons) {
/** @type {?} */
const duDate = { year: yp - 1, month: 12, day: 31 };
/** @type {?} */
const dsDate = { year: yn + 1, month: 1, day: 1 };
dpy = this.utilService.isDisabledByDisableUntil(duDate, disableUntil)
&& !this.utilService.isPastDatesEnabled(duDate, enableDates);
dny = this.utilService.isDisabledByDisableSince(dsDate, disableSince)
&& !this.utilService.isFutureDatesEnabled(dsDate, enableDates);
}
this.prevViewDisabled = yp <= minYear || dpy;
this.nextViewDisabled = yn >= maxYear || dny;
if (rtl) {
this.swapHeaderBtnDisabled();
}
}
/**
* @return {?}
*/
swapHeaderBtnDisabled() {
[this.prevViewDisabled, this.nextViewDisabled] = [this.nextViewDisabled, this.prevViewDisabled];
}
}
CalendarComponent.decorators = [
{ type: Component, args: [{
selector: "lib-angular-mydatepicker-calendar",
template: "<span #styleEl></span>\n<div class=\"ng-mydp {{opts.stylesData?.selector || ''}}\">\n <div class=\"myDpSelector\" #selectorEl \n [libAngularMyDatePickerCalendar]=\"{inline: opts.inline, selectorWidth: opts.selectorWidth, selectorHeight: opts.selectorHeight, selectorPos: selectorPos}\" \n [ngClass]=\"{'myDpSelectorArrow': opts.showSelectorArrow, 'myDpSelectorArrowLeft': opts.showSelectorArrow && !opts.alignSelectorRight, \n 'myDpSelectorArrowRight': opts.showSelectorArrow&&opts.alignSelectorRight, 'myDpSelectorAbsolute': !opts.inline, 'myDpSelectorPosInitial': opts.inline}\" \n (keyup)=\"onCloseSelector($event)\" tabindex=\"0\">\n\n <lib-selection-bar [opts]=\"opts\" [yearsDuration]=\"yearsDuration\" [visibleMonth]=\"visibleMonth\" [selectMonth]=\"selectMonth\" [selectYear]=\"selectYear\"\n [prevViewDisabled]=\"prevViewDisabled\" [nextViewDisabled]=\"nextViewDisabled\"\n (prevNavigateBtnClicked)=\"onPrevNavigateBtnClicked()\" (nextNavigateBtnClicked)=\"onNextNavigateBtnClicked()\"\n (monthViewBtnClicked)=\"onMonthViewBtnClicked()\" (yearViewBtnClicked)=\"onYearViewBtnClicked()\"></lib-selection-bar>\n\n <lib-day-view *ngIf=\"!selectMonth && !selectYear\" [opts]=\"opts\" [dates]=\"dates\" [weekDays]=\"weekDays\"\n [selectedDate]=\"selectedDate\" [selectedDateRange]=\"selectedDateRange\" [viewChanged]=\"viewChanged\"\n (dayCellClicked)=\"onDayCellClicked($event)\"\n (dayCellKeyDown)=\"onDayCellKeyDown($event)\"\n (viewActivated)=\"onViewActivated($event)\"></lib-day-view>\n\n <lib-month-view *ngIf=\"selectMonth\" [opts]=\"opts\" [months]=\"months\" [viewChanged]=\"viewChanged\"\n (monthCellClicked)=\"onMonthCellClicked($event)\"\n (monthCellKeyDown)=\"onMonthCellKeyDown($event)\"\n (viewActivated)=\"onViewActivated($event)\"></lib-month-view>\n\n <lib-year-view *ngIf=\"selectYear\" [opts]=\"opts\" [years]=\"years\" [viewChanged]=\"viewChanged\"\n (yearCellClicked)=\"onYearCellClicked($event)\"\n (yearCellKeyDown)=\"onYearCellKeyDown($event)\"\n (viewActivated)=\"onViewActivated($event)\"></lib-year-view>\n\n <lib-footer-bar *ngIf=\"opts.showFooterToday\" [opts]=\"opts\"\n (footerBarTxtClicked)=\"onTodayFooterClicked()\"></lib-footer-bar>\n </div>\n</div>\n",
providers: [UtilService],
encapsulation: ViewEncapsulation.None,
styles: [".ng-mydp{position:static}.ng-myrtl{direction:rtl}.ng-mydp *{box-sizing:border-box;font-family:Arial,Helvetica,sans-serif;padding:0;margin:0}.ng-mydp table{display:table;border-spacing:0}.ng-mydp table td,.ng-mydp table th{padding:0;margin:0;vertical-align:middle;border:none}.myDpSelector{padding:4px;border:1px solid #ccc;background-color:#fff;border-radius:4px;z-index:100000}.myDpViewChangeAnimation{-webkit-animation:.2s linear myDpViewChangeAnimation;animation:.2s linear myDpViewChangeAnimation}@-webkit-keyframes myDpViewChangeAnimation{0%{transform:scale(.75);opacity:.1}100%{transform:scale(1);opacity:1}}@keyframes myDpViewChangeAnimation{0%{transform:scale(.75);opacity:.1}100%{transform:scale(1);opacity:1}}.myDpAnimationFadeIn{-webkit-animation:.5s linear myDpAnimationFadeIn;animation:.5s linear myDpAnimationFadeIn}@-webkit-keyframes myDpAnimationFadeIn{0%{transform:translateY(-50px);opacity:0}100%{transform:translateY(0);opacity:1}}@keyframes myDpAnimationFadeIn{0%{transform:translateY(-50px);opacity:0}100%{transform:translateY(0);opacity:1}}.myDpAnimationFadeOut{-webkit-animation:.3s linear forwards myDpAnimationFadeOut;animation:.3s linear forwards myDpAnimationFadeOut}@-webkit-keyframes myDpAnimationFadeOut{0%{transform:translateY(0);opacity:1}100%{transform:translateY(-50px);opacity:0}}@keyframes myDpAnimationFadeOut{0%{transform:translateY(0);opacity:1}100%{transform:translateY(-50px);opacity:0}}.myDpAnimationScaleTopIn{-webkit-animation:.3s linear myDpAnimationScaleTopIn;animation:.3s linear myDpAnimationScaleTopIn}@-webkit-keyframes myDpAnimationScaleTopIn{0%{transform:scaleY(0);transform-origin:100% 0}100%{transform:scaleY(1);transform-origin:100% 0}}@keyframes myDpAnimationScaleTopIn{0%{transform:scaleY(0);transform-origin:100% 0}100%{transform:scaleY(1);transform-origin:100% 0}}.myDpAnimationScaleTopOut{-webkit-animation:.3s linear forwards myDpAnimationScaleTopOut;animation:.3s linear forwards myDpAnimationScaleTopOut}@-webkit-keyframes myDpAnimationScaleTopOut{0%{transform:scaleY(1);transform-origin:100% 0;opacity:1}100%{transform:scaleY(0);transform-origin:100% 0;opacity:0}}@keyframes myDpAnimationScaleTopOut{0%{transform:scaleY(1);transform-origin:100% 0;opacity:1}100%{transform:scaleY(0);transform-origin:100% 0;opacity:0}}.myDpAnimationScaleCenterIn{-webkit-animation:.3s linear myDpAnimationScaleCenterIn;animation:.3s linear myDpAnimationScaleCenterIn}@-webkit-keyframes myDpAnimationScaleCenterIn{0%{transform:scale(0)}100%{transform:scale(1)}}@keyframes myDpAnimationScaleCenterIn{0%{transform:scale(0)}100%{transform:scale(1)}}.myDpAnimationScaleCenterOut{-webkit-animation:.3s linear forwards myDpAnimationScaleCenterOut;animation:.3s linear forwards myDpAnimationScaleCenterOut}@-webkit-keyframes myDpAnimationScaleCenterOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}@keyframes myDpAnimationScaleCenterOut{0%{transform:scale(1);opacity:1}100%{transform:scale(0);opacity:0}}.myDpAnimationRotateIn{-webkit-animation:.3s linear myDpAnimationRotateIn;animation:.3s linear myDpAnimationRotateIn}@-webkit-keyframes myDpAnimationRotateIn{0%{transform:scale(.3) rotate(-45deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}@keyframes myDpAnimationRotateIn{0%{transform:scale(.3) rotate(-45deg);opacity:0}100%{transform:scale(1) rotate(0);opacity:1}}.myDpAnimationRotateOut{-webkit-animation:.3s linear forwards myDpAnimationRotateOut;animation:.3s linear forwards myDpAnimationRotateOut}@-webkit-keyframes myDpAnimationRotateOut{0%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(.3) rotate(-45deg);opacity:0}}@keyframes myDpAnimationRotateOut{0%{transform:scale(1) rotate(0);opacity:1}100%{transform:scale(.3) rotate(-45deg);opacity:0}}.myDpAnimationFlipDiagonalIn{-webkit-animation:.3s linear myDpAnimationFlipDiagonalIn;animation:.3s linear myDpAnimationFlipDiagonalIn}@-webkit-keyframes myDpAnimationFlipDiagonalIn{0%{transform:rotate3d(1,1,0,-78deg)}100%{transform:rotate3d(1,1,0,0deg)}}@keyframes myDpAnimationFlipDiagonalIn{0%{transform:rotate3d(1,1,0,-78deg)}100%{transform:rotate3d(1,1,0,0deg)}}.myDpAnimationFlipDiagonalOut{-webkit-animation:.3s linear forwards myDpAnimationFlipDiagonalOut;animation:.3s linear forwards myDpAnimationFlipDiagonalOut}@-webkit-keyframes myDpAnimationFlipDiagonalOut{0%{transform:rotate3d(1,1,0,0deg);opacity:1}100%{transform:rotate3d(1,1,0,78deg);opacity:0}}@keyframes myDpAnimationFlipDiagonalOut{0%{transform:rotate3d(1,1,0,0deg);opacity:1}100%{transform:rotate3d(1,1,0,78deg);opacity:0}}.myDpSelectorAbsolute{position:absolute}.myDpSelectorPosInitial{position:initial}.myDpSelector:focus{box-shadow:-1px 1px 6px 0 #add8e6;outline:0}.myDpSelectorArrow{background:#fff}.myDpSelectorArrow:after,.myDpSelectorArrow:before{bottom:100%;border:solid transparent;content:\" \";height:0;width:0;position:absolute}.myDpSelectorArrow:after{border-color:rgba(250,250,250,0);border-bottom-color:#fafafa;border-width:10px;margin-left:-10px}.myDpSelectorArrow:before{border-color:rgba(204,204,204,0);border-bottom-color:#ccc;border-width:11px;margin-left:-11px}.myDpSelectorArrow:focus:before{border-bottom-color:#add8e6}.myDpSelectorArrowLeft:after,.myDpSelectorArrowLeft:before{left:24px}.myDpSelectorArrowRight:after,.myDpSelectorArrowRight:before{left:86%}::-ms-clear{display:none}.myDpCalTable,.myDpFooterBar,.myDpMonthTable,.myDpYearTable{border-radius:0 0 4px 4px}.myDpCalTable.myDpNoFooter tbody tr:nth-child(6) td:first-child,.myDpMonthTable.myDpNoFooter tbody tr:nth-child(4) td:first-child,.myDpYearTable.myDpNoFooter tbody tr:nth-child(5) td:first-child{border-bottom-left-radius:4px}.myDpCalTable.myDpNoFooter tbody tr:nth-child(6) td:last-child,.myDpMonthTable.myDpNoFooter tbody tr:nth-child(4) td:last-child,.myDpYearTable.myDpNoFooter tbody tr:nth-child(5) td:last-child{border-bottom-right-radius:4px}.myDpCalTable,.myDpMonthTable,.myDpYearTable{table-layout:fixed;width:100%;background-color:#fff;font-size:14px}.myDpFooter{height:calc(100% - 60px)}.myDpNoFooter{height:calc(100% - 30px)}.myDpCalTable,.myDpDaycell,.myDpMonthTable,.myDpMonthcell,.myDpWeekDayTitle,.myDpYearTable,.myDpYearcell{border-collapse:collapse;color:#333;line-height:1.1}.myDpDaycell,.myDpMonthcell,.myDpYearcell{padding:4px;text-align:center;outline:0}.myDpDaycell{background-color:#fff;position:relative}.myDpWeekDayTitle{background-color:transparent;color:#333;font-size:13px;font-weight:400;vertical-align:middle;max-width:36px;overflow:hidden;white-space:nowrap;height:23px;text-align:center}.myDpWeekDayTitleWeekNbr{width:20px}.myDpMonthcell{background-color:#fff;overflow:hidden;white-space:nowrap}.myDpYearcell{background-color:#fff;width:20%}.myDpMonthNbr{font-size:10px;display:block}.myDpDaycellWeekNbr{font-size:9px;cursor:default;text-align:center;color:#333}.myDpNextMonth,.myDpPrevMonth{color:#999}.myDpMonthYearSelBar{display:flex;height:30px;background-color:#fff;border-top-left-radius:4px;border-top-right-radius:4px}.myDpPrevBtn{margin-left:10px}.myDpNextBtn{margin-left:auto;margin-right:10px}.myDpMonthYearText{width:100%;line-height:30px;text-align:center}.myDpFooterBar{display:flex;align-items:center;justify-content:center;height:30px;background-color:#fff}.myDpHeaderBtn{background:0 0;padding:0;border:none;line-height:30px;height:28px;margin-top:1px;color:#000;outline:0;cursor:default}.myDpFooterBtn{margin:0 10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.myDpMonthBtn,.myDpYearBtn{font-size:16px}.myDpMonthBtn{margin-right:6px}.myDpHighlight{color:#c30000}.myDpDimDay{opacity:.5}.myDpCurrMonth{background-color:#fff;font-weight:400}.myDpMarkDate{position:absolute;top:2px;left:2px;border-right:8px solid transparent}.myDpMarkCurrDay,.myDpMarkCurrMonth,.myDpMarkCurrYear{border-bottom:2px solid #333}.myDpHeaderLabelBtnNotEdit{cursor:default}.myDpHeaderBtn::-moz-focus-inner,.myDpNextBtn::-moz-focus-inner,.myDpPrevBtn::-moz-focus-inner{border:0}.myDpFooterBtn:focus,.myDpHeaderBtn:focus,.myDpMonthLabel:focus,.myDpYearLabel:focus{color:#66afe9;outline:0}.myDpDaycell:focus,.myDpMonthcell:focus,.myDpYearcell:focus{box-shadow:inset 0 0 0 1px #66afe9}.myDpTableSingleDay:hover,.myDpTableSingleMonth:hover,.myDpTableSingleYear:hover{background-color:#ddd}.myDpDaycell,.myDpMonthLabel,.myDpMonthcell,.myDpYearLabel,.myDpYearcell{cursor:pointer}.myDpFooterBtn:hover,.myDpHeaderBtnEnabled:hover,.myDpMonthLabel:hover,.myDpYearLabel:hover{color:#777}.myDpHeaderBtnEnabled{cursor:pointer}.myDpHeaderBtnDisabled{cursor:not-allowed;opacity:.65}.myDpDisabled{cursor:default;color:#777;background:repeating-linear-gradient(-45deg,#ccc 7px,#ccc 8px,transparent 7px,transparent 14px)}.myDpRangeColor{background-color:#dbeaff}.myDpRangeBegin,.myDpRangeEnd,.myDpSelectedDay,.myDpSelectedMonth,.myDpSelectedYear{border:none;background-color:#8ebfff}@font-face{font-family:angular-mydatepicker;src:url(data:application/octet-stream;base64,d09GRgABAAAAAAs4AA8AAAAAE+gAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+IEi5Y21hcAAAAdgAAABQAAABfohD7KljdnQgAAACKAAAABMAAAAgBtX/BGZwZ20AAAI8AAAFkAAAC3CKkZBZZ2FzcAAAB8wAAAAIAAAACAAAABBnbHlmAAAH1AAAAL8AAAEAS//bfWhlYWQAAAiUAAAAMQAAADYW6nhraGhlYQAACMgAAAAbAAAAJAc8A1ZobXR4AAAI5AAAAAwAAAAMCXwAAGxvY2EAAAjwAAAACAAAAAgAQACAbWF4cAAACPgAAAAgAAAAIACmC5tuYW1lAAAJGAAAAXcAAALNzJ0fIXBvc3QAAAqQAAAAKwAAAEAj+eC8cHJlcAAACrwAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYHJx8wlh4MtJLMljkGJgYYAAkDwymzEnMz2RgQPGA8qxgGkOIGaDiAIAJjsFSAB4nGNgZNZknMDAysDAVMW0h4GBoQdCMz5gMGRkAooysDIzY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