UNPKG

@ipi-soft/ng-components

Version:

Custom Angular Components

83 lines (82 loc) 4.11 kB
import { ChangeDetectorRef, EventEmitter, SimpleChanges } from '@angular/core'; import { IpiDatepickerService } from './../../datepicker-service'; import { CalendarBody, CalendarCell } from './../calendar-body/calendar-body.component'; import { DateRange, DateSelectionEvent } from './../../datepicker.component'; import { DefaultCalendarRangeStrategy } from './../../datepicker-selection-strategy.component'; import * as i0 from "@angular/core"; export declare class IpiCalendarMonthView { datepickerService: IpiDatepickerService; private changeDetectorRef; private rangeSelectionStartegy; constructor(datepickerService: IpiDatepickerService, changeDetectorRef: ChangeDetectorRef, rangeSelectionStartegy: DefaultCalendarRangeStrategy); calendarBody: CalendarBody; get activeDate(): Date; set activeDate(value: Date | null); get selected(): DateRange | Date | null; set selected(value: DateRange | Date | null); get minDate(): Date | null; set minDate(value: Date | null); get maxDate(): Date | null; set maxDate(value: Date | null); activeDrag: DateSelectionEvent<Date> | null; dragStarted: EventEmitter<DateSelectionEvent<Date>>; dragEnded: EventEmitter<DateSelectionEvent<DateRange | null>>; activeDateChange: EventEmitter<Date>; userSelection: EventEmitter<DateSelectionEvent<Date | null>>; selectedChange: EventEmitter<Date | null>; monthLabel: string; /** Grid of calendar cells representing the dates of the month. */ weeks: CalendarCell[][]; /** The number of blank cells in the first row before the 1st of the month. */ firstWeekOffset: number; /** Start value of the currently-shown date range. */ rangeStart: number | null; /** End value of the currently-shown date range. */ rangeEnd: number | null; /** Start of the preview range. */ previewStart: number | null; /** End of the preview range. */ previewEnd: number | null; /** Whether the user is currently selecting a range of dates. */ isRange: boolean; /** The date of the month that today falls on. Null if today is in another month. */ todayDate: number | null; weekdays: { long: string; narrow: string; id: number; }[]; private selectionKeyPressed; private _minDate; private _maxDate; private _selected; private _activeDate; private uniqueIdCounter; ngOnChanges(changes: SimpleChanges): void; ngAfterContentInit(): void; getActiveCell(): number; updateActiveDate(event: DateSelectionEvent<number>): void; /** Handles when a new date is selected. */ dateSelected(event: DateSelectionEvent<number>): void; handleCalendarBodyKeydown(event: KeyboardEvent): void; previewChanged({ value: cell }: DateSelectionEvent<CalendarCell<Date> | null>): void; handleCalendarBodyKeyup(event: KeyboardEvent): void; focusActiveCellAfterViewChecked(): void; private clearPreview; /** * Gets the date in this month that the given Date falls on. * Returns null if the given Date is in another month. */ private getDateInCurrentMonth; private init; private setRanges; private getCellCompareValue; private initWeekdays; private createWeekCells; private hasSameMonthAndYear; protected onDragEnded(event: DateSelectionEvent<Date | null>): void; private shouldEnableDate; private getDateFromDayOfMonth; static ɵfac: i0.ɵɵFactoryDeclaration<IpiCalendarMonthView, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IpiCalendarMonthView, "ipi-calendar-month-view", never, { "activeDate": { "alias": "activeDate"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "activeDrag": { "alias": "activeDrag"; "required": false; }; }, { "dragStarted": "dragStarted"; "dragEnded": "dragEnded"; "activeDateChange": "activeDateChange"; "userSelection": "userSelection"; "selectedChange": "selectedChange"; }, never, never, true, never>; }