nativescript-ui-calendar
Version:
Month, year, week and day views. Single, multiple and range date Selection. Special and disabled dates.
371 lines (370 loc) • 21.7 kB
TypeScript
import { Color } from '@nativescript/core';
import * as commonModule from './common';
export * from './common';
export declare class CalendarEvent extends commonModule.CalendarEvent {
private _android;
get android(): com.telerik.widget.calendar.events.Event;
protected _setIsAllDay(value: boolean): void;
protected _getIsAllDay(): boolean;
protected _setEndDate(date: Date): void;
protected _getEndDate(): Date;
protected _setStartDate(date: Date): void;
protected _getStartDate(): Date;
protected _setTitle(value: string): void;
protected _getTitle(): string;
protected _setEventColor(value: Color): void;
protected _getEventColor(): Color;
}
/**
* Enum values identify to what type of cells is related the style object
*/
export declare enum CellStyleType {
RegularDayStyle = 0,
SelectedDayStyle = 1,
TodayStyle = 2,
WeekNumberStyle = 3,
WeekendStyle = 4,
DayNameStyle = 5,
TitleStyle = 6,
MonthNameStyle = 7
}
export declare class CellStyleInitializer {
applyStyle(value: any): void;
private changeCellBorderWidth;
onCellBorderWidthChanged(value: any, style: any): void;
private changeCellBorderColor;
onCellBorderColorChanged(value: Color, style: any): void;
private changeCellBackgroundColor;
onCellBackgroundColorChanged(value: Color, style: any): void;
private changeCellAlignment;
onCellAlignmentChanged(value: commonModule.CalendarCellAlignment, style: any): void;
private changeCellPaddingHorizontal;
onCellPaddingHorizontalChanged(value: any, style: any): void;
private changeCellPaddingVertical;
onCellPaddingVerticalChanged(value: any, style: any): void;
private changeCellTextColor;
onCellTextColorChanged(value: Color, style: any): void;
private changeCellTextFontName;
onCellTextFontNameChanged(value: any, style: any): void;
private changeCellTextFontStyle;
onCellTextFontStyleChanged(value: commonModule.CalendarFontStyle, style: any): void;
private changeCellTextSize;
onCellTextSizeChanged(value: any, style: any): void;
makeDayCellFilter(cellStyleType: CellStyleType, displayMode: com.telerik.widget.calendar.CalendarDisplayMode): com.telerik.widget.calendar.CalendarDayCellFilter;
makeMonthCellFilter(): com.telerik.widget.calendar.CalendarMonthCellFilter;
}
export declare class CellStyle extends commonModule.CellStyle {
private _nativeIsYear;
set nativeIsYear(value: boolean);
private _owner;
set owner(value: com.telerik.widget.calendar.RadCalendarView);
private _initializer;
get initializer(): CellStyleInitializer;
private _android;
get android(): com.telerik.widget.calendar.CalendarCellStyle;
updateNativeStyleFilters(cellStyleType: CellStyleType, displayMode: com.telerik.widget.calendar.CalendarDisplayMode): void;
onStyleChanged(): void;
protected onCellBorderWidthChanged(oldValue: number, newValue: number): void;
protected onCellBorderColorChanged(oldValue: Color, newValue: Color): void;
protected onCellBackgroundColorChanged(oldValue: Color, newValue: Color): void;
protected onCellTextColorChanged(oldValue: Color, newValue: Color): void;
protected onCellTextFontNameChanged(oldValue: string, newValue: string): void;
protected onCellTextFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onCellTextSizeChanged(oldValue: number, newValue: number): void;
protected onCellPaddingHorizontalChanged(oldValue: number, newValue: number): void;
protected onCellPaddingVerticalChanged(oldValue: number, newValue: number): void;
protected onCellAlignmentChanged(oldValue: commonModule.CalendarCellAlignment, newValue: commonModule.CalendarCellAlignment): void;
}
export declare class DayEventsViewStyle extends commonModule.DayEventsViewStyle {
private _owner;
set owner(value: com.telerik.widget.calendar.RadCalendarView);
private _android;
get android(): com.telerik.widget.calendar.dayview.DayEventsViewStyle;
applyStyles(): void;
protected onBackgroundColorChanged(oldValue: Color, newValue: Color): void;
private changeBackgroundColor;
protected onTimeLabelFormatChanged(oldValue: string, newValue: string): void;
private changeTimeLabelFormat;
protected onTimeLabelTextColorChanged(oldValue: Color, newValue: Color): void;
private changeTimeLabelTextColor;
protected onTimeLabelTextSizeChanged(oldValue: number, newValue: number): void;
private changeTimeLabelTextSize;
protected onTimeLinesWidthChanged(oldValue: number, newValue: number): void;
private changeTimeLinesWidth;
protected onTimeLinesColorChanged(oldValue: Color, newValue: Color): void;
private changeTimeLinesColor;
}
export declare class AllDayEventsViewStyle extends commonModule.AllDayEventsViewStyle {
private _owner;
set owner(value: com.telerik.widget.calendar.RadCalendarView);
private _android;
get android(): com.telerik.widget.calendar.dayview.AllDayEventsViewStyle;
applyStyles(): void;
protected onBackgroundColorChanged(oldValue: Color, newValue: Color): void;
private changeBackgroundColor;
protected onAllDayTextChanged(oldValue: string, newValue: string): void;
private changeAllDayText;
protected onAllDayTextIsVisibleChanged(oldValue: boolean, newValue: boolean): void;
private changeAllDayTextIsVisible;
}
export declare class DayCellStyle extends commonModule.DayCellStyle {
private _owner;
set owner(value: com.telerik.widget.calendar.RadCalendarView);
private _eventAdapter;
set eventAdapter(value: com.telerik.widget.calendar.events.EventAdapter);
private _initializer;
get initializer(): CellStyleInitializer;
private _android;
get android(): com.telerik.widget.calendar.CalendarDayCellStyle;
updateNativeStyleFilters(cellStyleType: CellStyleType, displayMode: com.telerik.widget.calendar.CalendarDisplayMode): void;
protected onCellBorderWidthChanged(oldValue: number, newValue: number): void;
protected onCellBorderColorChanged(oldValue: Color, newValue: Color): void;
protected onCellBackgroundColorChanged(oldValue: Color, newValue: Color): void;
protected onCellTextColorChanged(oldValue: Color, newValue: Color): void;
protected onCellTextFontNameChanged(oldValue: string, newValue: string): void;
protected onCellTextFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onCellTextSizeChanged(oldValue: number, newValue: number): void;
protected onCellPaddingHorizontalChanged(oldValue: number, newValue: number): void;
protected onCellPaddingVerticalChanged(oldValue: number, newValue: number): void;
protected onCellAlignmentChanged(oldValue: commonModule.CalendarCellAlignment, newValue: commonModule.CalendarCellAlignment): void;
onStyleChanged(): void;
protected onShowEventsTextChanged(oldValue: boolean, newValue: boolean): void;
protected onEventTextColorChanged(oldValue: Color, newValue: Color): void;
protected onEventFontNameChanged(oldValue: string, newValue: string): void;
protected onEventFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onEventTextSizeChanged(oldValue: number, newValue: number): void;
}
/**
* Cell style class for months in year view mode
*/
export declare class MonthCellStyle extends commonModule.MonthCellStyle {
private _regularDayStyle;
get regularDayStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
private _weekendStyle;
get weekendStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
private _todayStyle;
get todayStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
private _dayNameStyle;
get dayNameStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
private _monthNameStyle;
get monthNameStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
private _monthCellStyle;
get monthCellStyle(): com.telerik.widget.calendar.CalendarMonthCellStyle;
onStyleChanged(): void;
protected onWeekendTextColorChanged(oldValue: Color, newValue: Color): void;
protected onTodayTextColorChanged(oldValue: Color, newValue: Color): void;
protected onDayTextColorChanged(oldValue: Color, newValue: Color): void;
protected onDayFontNameChanged(oldValue: string, newValue: string): void;
protected onDayFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onDayTextSizeChanged(oldValue: number, newValue: number): void;
protected onDayNameTextColorChanged(oldValue: Color, newValue: Color): void;
protected onDayNameFontNameChanged(oldValue: string, newValue: string): void;
protected onDayNameFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onDayNameTextSizeChanged(oldValue: number, newValue: number): void;
protected onMonthNameTextColorChanged(oldValue: Color, newValue: Color): void;
protected onMonthNameFontNameChanged(oldValue: string, newValue: string): void;
protected onMonthNameFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onMonthNameTextSizeChanged(oldValue: number, newValue: number): void;
}
/**
* Cell style class for inline events cells in month view
*/
export declare class InlineEventCellStyle extends commonModule.InlineEventCellStyle {
private _adapter;
apply(adapter: com.telerik.widget.calendar.CalendarAdapter): void;
protected onCellBackgroundColorChanged(oldValue: Color, newValue: Color): void;
protected onEventTextColorChanged(oldValue: Color, newValue: Color): void;
protected onEventFontNameChanged(oldValue: string, newValue: string): void;
protected onEventFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onEventTextSizeChanged(oldValue: number, newValue: number): void;
protected onTimeTextColorChanged(oldValue: Color, newValue: Color): void;
protected onTimeFontNameChanged(oldValue: string, newValue: string): void;
protected onTimeFontStyleChanged(oldValue: commonModule.CalendarFontStyle, newValue: commonModule.CalendarFontStyle): void;
protected onTimeTextSizeChanged(oldValue: number, newValue: number): void;
}
export declare class CalendarStyleInitializer {
updateNativeStyles(style: any): void;
onShowWeekNumbersChanged(oldValue: boolean, newValue: boolean, style: any): void;
private changeShowWeekNumbers;
onShowTitleChanged(oldValue: boolean, newValue: boolean, style: any): void;
private changeShowTitle;
onShowDayNamesChanged(oldValue: boolean, newValue: boolean, style: any): void;
private changeShowDayNames;
onBackgroundColorChanged(oldValue: Color, newValue: Color, style: any): void;
private changeBackgroundColor;
onDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle, style: any): void;
private changeDayCellStyle;
onSelectedDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle, style: any): void;
private changeSelectedDayCellStyle;
onTodayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle, style: any): void;
private changeTodayCellStyle;
onWeekNumberCellStyleChanged(oldValue: CellStyle, newValue: CellStyle, style: any): void;
private changeWeekNumberCellStyle;
onWeekendCellStyleChanged(oldValue: CellStyle, newValue: CellStyle, style: any): void;
private changeWeekendCellStyle;
onDayNameCellStyleChanged(oldValue: CellStyle, newValue: CellStyle, style: any): void;
private changeDayNameCellStyle;
onTitleCellStyleChanged(oldValue: CellStyle, newValue: CellStyle, style: any): void;
protected changeTitleCellStyle(oldValue: CellStyle, newValue: CellStyle, style: any): void;
syncSelectionShape(style: any): void;
}
/**
* Class for month view style
*/
export declare class CalendarMonthViewStyle extends commonModule.CalendarMonthViewStyle {
private _initializer;
get initializer(): CalendarStyleInitializer;
_owner: RadCalendar;
set owner(value: RadCalendar);
updateNativeStyles(): void;
prepareNativeStyle(style: any, cellType: CellStyleType): void;
protected updateNativeStyleFilters(style: any, cellType: CellStyleType): void;
protected onShowWeekNumbersChanged(oldValue: boolean, newValue: boolean): void;
protected onSelectionShapeChanged(oldValue: commonModule.CalendarSelectionShape, newValue: commonModule.CalendarSelectionShape): void;
protected onSelectionShapeSizeChanged(oldValue: number, newValue: number): void;
protected onSelectionShapeColorChanged(oldValue: Color, newValue: Color): void;
protected onShowTitleChanged(oldValue: boolean, newValue: boolean): void;
protected onShowDayNamesChanged(oldValue: boolean, newValue: boolean): void;
protected onBackgroundColorChanged(oldValue: Color, newValue: Color): void;
protected onDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onSelectedDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onTodayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onWeekNumberCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onWeekendCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onDayNameCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onTitleCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onInlineEventCellStyleChanged(oldValue: InlineEventCellStyle, newValue: InlineEventCellStyle): void;
}
/**
* The style class for week mode.
* NOTE: we should consider if we need an explicit class that is the same as the base one
*/
export declare class CalendarWeekViewStyle extends CalendarMonthViewStyle {
protected updateNativeStyleFilters(style: any, cellType: CellStyleType): void;
}
/**
* The style class for day mode.
*/
export declare class CalendarDayViewStyle extends commonModule.CalendarDayViewStyle {
private _initializer;
get initializer(): CalendarStyleInitializer;
_owner: RadCalendar;
set owner(value: RadCalendar);
updateNativeStyles(): void;
private updateNativeDayStyles;
prepareNativeStyle(style: any, cellType: CellStyleType): void;
protected updateNativeStyleFilters(style: any, cellType: CellStyleType): void;
protected onShowWeekNumbersChanged(oldValue: boolean, newValue: boolean): void;
protected onSelectionShapeChanged(oldValue: commonModule.CalendarSelectionShape, newValue: commonModule.CalendarSelectionShape): void;
protected onSelectionShapeSizeChanged(oldValue: number, newValue: number): void;
protected onSelectionShapeColorChanged(oldValue: Color, newValue: Color): void;
protected onShowTitleChanged(oldValue: boolean, newValue: boolean): void;
protected onShowDayNamesChanged(oldValue: boolean, newValue: boolean): void;
protected onBackgroundColorChanged(oldValue: Color, newValue: Color): void;
protected onDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onSelectedDayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onTodayCellStyleChanged(oldValue: DayCellStyle, newValue: DayCellStyle): void;
protected onWeekNumberCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onWeekendCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onDayNameCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onTitleCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onDayEventsViewStyleChanged(oldValue: commonModule.DayEventsViewStyle, newValue: commonModule.DayEventsViewStyle): void;
private changeDayEventsViewStyle;
protected onAllDayEventsViewStyleChanged(oldValue: commonModule.AllDayEventsViewStyle, newValue: commonModule.AllDayEventsViewStyle): void;
private changeAllDayEventsViewStyle;
protected onInlineEventCellStyleChanged(oldValue: InlineEventCellStyle, newValue: InlineEventCellStyle): void;
protected onShowWeekChanged(oldValue: boolean, newValue: boolean): void;
private changeShowWeek;
}
/**
* The year mode style class
*/
export declare class CalendarYearViewStyle extends commonModule.CalendarYearViewStyle {
constructor();
protected _owner: RadCalendar;
set owner(value: RadCalendar);
updateNativeStyles(): void;
protected onTitleCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onMonthCellStyleChanged(oldValue: MonthCellStyle, newValue: MonthCellStyle): void;
}
/**
* The year view mode in compact view
*/
export declare class CalendarMonthNamesViewStyle extends commonModule.CalendarMonthNamesViewStyle {
constructor();
protected _owner: RadCalendar;
set owner(value: RadCalendar);
updateNativeStyles(): void;
protected updateFilterDisplayMode(filter: com.telerik.widget.calendar.CalendarMonthCellFilter): void;
protected onTitleCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
protected onMonthNameCellStyleChanged(oldValue: CellStyle, newValue: CellStyle): void;
}
export declare class RadCalendar extends commonModule.RadCalendar {
private _android;
private _forbidNativeSelection;
private _androidViewId;
private systemAppearanceChangedHandler;
get _nativeView(): any;
constructor();
createNativeView(): any;
initNativeView(): void;
disposeNativeView(): void;
private updateCalendarStyle;
private getStyleForSystemAppearance;
private loadNativeDisplayedDate;
private addOnCellClickListener;
_syncSelectionShape(): void;
private addOnInlineEventsClickedListener;
private addOnDisplayDateChangedListener;
private addOnDisplayModeChangedListener;
notifyViewModeChanged(oldMode: any, newMode: any): void;
private setDayViewEventSelectedListener;
private addOnSelectedDatesChangedListener;
notifySingleDateSelected(calendar: RadCalendar, date: Date): void;
notifyDateDeselected(calendar: RadCalendar, date: Date): void;
notifyRangeSelectionChanged(calendar: RadCalendar, firstSelected: Date, lastSelected: Date): void;
private setNativeViewMode;
private setNativeSelectionMode;
private setNativeTransitionMode;
private setNativeEventsViewMode;
private setNativeMaxDate;
private setNativeMinDate;
private setNativeDisplayedDate;
private setNativeSelectedDate;
private setNativeSelectedDates;
private setNativeSelectedDateRange;
private setNativeHorizontalTransition;
protected getDisplayedDate(): number;
protected onLocalePropertyChanged(oldValue: string, newValue: string): void;
private setNativeLocale;
protected onViewModeChanged(oldValue: commonModule.CalendarViewMode, newValue: commonModule.CalendarViewMode): void;
protected onSelectionModeChanged(oldValue: commonModule.CalendarSelectionMode, newValue: commonModule.CalendarSelectionMode): void;
protected onTransitionModeChanged(oldValue: commonModule.CalendarTransitionMode, newValue: commonModule.CalendarTransitionMode): void;
protected onEventsViewModeChanged(oldValue: commonModule.CalendarEventsViewMode, newValue: commonModule.CalendarEventsViewMode): void;
protected onMaxDateChanged(oldValue: Date, newValue: Date): void;
protected onMinDateChanged(oldValue: Date, newValue: Date): void;
protected onDisplayedDateChanged(oldValue: Date, newValue: Date): void;
protected onSelectedDateChanged(oldValue: Date, newValue: Date): void;
protected onSelectedDatesChanged(oldValue: string, newValue: string): void;
protected onSelectedDateRangeChanged(oldValue: commonModule.DateRange, newValue: commonModule.DateRange): void;
protected onHorizontalTransitionChanged(oldValue: boolean, newValue: boolean): void;
protected onMonthViewStyleChanged(oldValue: commonModule.CalendarMonthViewStyle, newValue: commonModule.CalendarMonthViewStyle): void;
protected onWeekViewStyleChanged(oldValue: commonModule.CalendarWeekViewStyle, newValue: commonModule.CalendarWeekViewStyle): void;
protected onDayViewStyleChanged(oldValue: commonModule.CalendarDayViewStyle, newValue: commonModule.CalendarDayViewStyle): void;
protected onMonthNamesViewStyleChanged(oldValue: CalendarMonthNamesViewStyle, newValue: CalendarMonthNamesViewStyle): void;
protected onYearViewStyleChanged(oldValue: CalendarYearViewStyle, newValue: CalendarYearViewStyle): void;
reload(): void;
navigateForward(): void;
navigateBack(): void;
goToDate(date: Date): void;
getEventsForDate(date: Date): Array<CalendarEvent>;
static getCalendarFromDate(date: Date): java.util.Calendar;
static getDateFromCalendar(calendar: java.util.Calendar): Date;
clearSelection(): void;
private initOnInlineEventsClickedListener;
updateEventSource(): void;
static getAndroidViewModeFromViewMode(viewMode: commonModule.CalendarViewMode): com.telerik.widget.calendar.CalendarDisplayMode;
static getViewModeFromAndroidViewMode(calendar: RadCalendar, viewMode: com.telerik.widget.calendar.CalendarDisplayMode): commonModule.CalendarViewMode;
private static getAndroidTransitonModeFromTransitionMode;
private static getAndroidEventsViewModeFromEventsViewMode;
}