import { TemplateResult } from 'lit'; import { Cre8Element } from '../../cre8-element'; import '../../icon/icon'; import '../calendar-month-modal/calendar-month-modal'; import '../calendar-year-modal/calendar-year-modal'; import '../calendar-navigation/calendar-navigation'; import '../../button/button'; export interface DateConfig { locale: string; today: Date; weekInfo: { firstDay: number; weekend: Array; }; } export interface DateFormatOptions { weekday: string; year: string; month: string; day: string; } export declare enum CalendarModal { Month = "month", Year = "year", None = "none" } export declare class Cre8Calendar extends Cre8Element { static styles: import("lit").CSSResult[]; /** * Query the navigation wrapper */ _navWrapper: HTMLElement; hasShortcuts?: boolean; _activeModal?: CalendarModal; get activeModal(): CalendarModal; set activeModal(activeModal: CalendarModal); _fieldDate?: string; get fieldDate(): string; set fieldDate(newFieldDate: string); _currentDate?: Date; get currentDate(): Date; set currentDate(newDate: Date); locale: string; weekDays: Array; dateConfig: DateConfig; dateFormatOptions: DateFormatOptions; constructor(); connectedCallback(): void; disconnectedCallback(): void; private _handleOnClickOutside; private emitSelectedDate; private changeYear; private changeMonth; private activateModal; static formatMonthOrDayIndex(val: number): string; static formatDate(val: number): string; private numberOfDaysinMonth; private getMonth; private getMonthName; private getYear; static dateToString(date: Date): string; private updateFocusForKeydown; private _handleCalendarKeyDown; private changeMonthFromNav; private changeYearFromNav; private getDaysOfWeekAbbreviations; /** * Create array of Day Buttons to fill in excess calendar space at the beginning of the month. * * 1. Map from empty array of length equal to the amount of access calendar "slots" in the beginning of the month. * (i.e. if the month starts on Wednesday (getDay = 3), there are 3 days prior that week from last month.) * * 2. Based on the indice of array, get the given day button's date, where the date is * the last day of last month minus the max of the array plus the indice plus one -> x = lastday - (max - (i + 1)) * (Note: (max - (i + 1) equals the keys of the array in reverse order: * [max - i + 1] -> [3-1, 3-2, 3-3] -> [2,1,0] for an array of [3]) * (i.e. if the calendar is starting on Wednesday June 1st, the access days on the calendar will be * Sunday May 29th (31 - (2)), Monday May 30th (31 - (1)), Tuesday May 31st (31 - (0))) * * 3. Build out day button with necessary props * */ private getPreviousMonthDayButtons; /** * Create array of Day Buttons to fill out current month * * 1. Map from empty array of length equal to the amount days in this month * * 2. Get the date of the current month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...) * * 3. Build out day button with necessary props * */ private getCurrentMonthDayButtons; /** * Create array of Day Buttons to fill in excess calendar space at the end of the month. * * 1. Map from empty array of length equal to the amount of access calendar "slots" at the end of the month. * The array have an amount of slots equal to the number of days in a week minus how many days have already past * and since getDay returns the index of the day of the week (Sunday = 0, Monday = 1 ...) our equations is * x = 7 - (getDay() + 1) * Note: (we need to add 1 because indexing starts at 0) * so if the month ends on Monday (getDay() = 1), 5 = 7 - (1 + 1), there are 5 days that week from the new month * * 2. Get the date from the next month based on indice of array (i.e. 0 -> 1st, 1 -> 2nd ...) * * 3. Build out day button with necessary props * */ private getNextMonthDayButtons; render(): TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'cre8-calendar': Cre8Calendar; } } //# sourceMappingURL=calendar.d.ts.map