@clr/angular
Version:
Angular components for Clarity
65 lines (64 loc) • 2.29 kB
TypeScript
import { Observable } from 'rxjs';
import { CalendarModel } from '../model/calendar.model';
import { DayModel } from '../model/day.model';
import * as i0 from "@angular/core";
/**
* This service is responsible for:
* 1. Initializing the displayed calendar.
* 2. Moving the calendar to the next, previous or current months
* 3. Managing the focused and selected day models.
*/
export declare class DateNavigationService {
selectedDay: DayModel;
focusedDay: DayModel;
private _displayedCalendar;
private _todaysFullDate;
private _today;
private _selectedDayChange;
private _displayedCalendarChange;
private _focusOnCalendarChange;
private _focusedDayChange;
get today(): DayModel;
get displayedCalendar(): CalendarModel;
get selectedDayChange(): Observable<DayModel>;
/**
* This observable lets the subscriber know that the displayed calendar has changed.
*/
get displayedCalendarChange(): Observable<void>;
/**
* This observable lets the subscriber know that the focus should be applied on the calendar.
*/
get focusOnCalendarChange(): Observable<void>;
/**
* This observable lets the subscriber know that the focused day in the displayed calendar has changed.
*/
get focusedDayChange(): Observable<DayModel>;
/**
* Notifies that the selected day has changed so that the date can be emitted to the user.
* Note: Only to be called from day.ts
*/
notifySelectedDayChanged(dayModel: DayModel): void;
/**
* Initializes the calendar based on the selected day.
*/
initializeCalendar(): void;
changeMonth(month: number): void;
changeYear(year: number): void;
/**
* Moves the displayed calendar to the next month.
*/
moveToNextMonth(): void;
/**
* Moves the displayed calendar to the previous month.
*/
moveToPreviousMonth(): void;
/**
* Moves the displayed calendar to the current month and year.
*/
moveToCurrentMonth(): void;
incrementFocusDay(value: number): void;
private setDisplayedCalendar;
private initializeTodaysDate;
static ɵfac: i0.ɵɵFactoryDeclaration<DateNavigationService, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DateNavigationService>;
}