UNPKG

@eclipse-scout/core

Version:
92 lines 3.6 kB
/// <reference types="jquery" /> import { DateFormat, DatePickerEventMap, DatePickerModel, InitModelOf, JQueryWheelEvent, Widget } from '../index'; export type DatePickerMonth = { viewDate: Date; rendered: boolean; $container: JQuery; $weekendSeparator?: JQuery; }; export declare class DatePicker extends Widget implements DatePickerModel { model: DatePickerModel; eventMap: DatePickerEventMap; self: DatePicker; preselectedDate: Date; selectedDate: Date; dateFormat: DateFormat; viewDate: Date; allowedDates: Date[]; touch: boolean; currentMonth: DatePickerMonth; /** * Contains the months to be rendered. * Only the this.currentMonth is visible, the others are needed for the swipe animation. */ months: DatePickerMonth[]; $scrollable: JQuery; swiped: boolean; protected _showWeekendSeparator: boolean; protected _boxWidth: number; protected _$header: JQuery; constructor(); protected _init(options: InitModelOf<this>): void; protected _render(): void; protected _setDateFormat(dateFormat?: DateFormat | string): void; prependMonth(month: Date): void; appendMonth(month: Date): void; /** * Resets the month boxes. Always render 3 months to make swiping more smooth (especially on mobile devices). */ resetMonths(viewDate?: Date): void; setMonths(months: (Date | DatePickerMonth)[]): void; protected _renderMonths(): void; protected _findMonthByViewDate(viewDate: Date): DatePickerMonth; /** * @returns the x coordinate of the scrollable if the given month should be displayed */ protected _scrollableLeftForMonth(month: DatePickerMonth): number; protected _renderMonth(month: DatePickerMonth): void; /** * @internal, use showDate, selectDate, shiftViewDate, etc. to change the view date */ setViewDate(viewDate: Date, animated?: boolean): void; protected _renderViewDate(animated?: boolean): void; /** @internal */ _layoutWeekendSeparators(): void; protected _layoutWeekendSeparator(month: DatePickerMonth): void; /** * @param animated default is true */ preselectDate(date: Date, animated?: boolean): void; /** * @internal, use preselectDate to preselect a date */ setPreselectedDate(preselectedDate: Date): void; protected _renderPreselectedDate(): void; /** * @param animated default is true */ selectDate(date: Date, animated?: boolean): void; /** * @internal, use selectDate to select a date */ setSelectedDate(selectedDate: Date): void; protected _renderSelectedDate(): void; /** * Shows the month which contains the given date. * @param animated Default is true */ showDate(viewDate: Date, animated?: boolean): void; shiftViewDate(years: number, months: number, days: number): void; shiftSelectedDate(years: number, months: number, days: number): void; protected _findNextAllowedDate(years: number, months: number, days: number): Date; protected _isDateAllowed(date: Date): boolean; protected _build$DateBox(viewDate: Date): JQuery; protected _append$Header(): JQuery; protected _updateHeader(viewDate: Date): void; protected _createHeaderText(viewDate: Date): string; protected _registerSwipeHandlers(): void; protected _onNavigationMouseDown(event: JQuery.MouseDownEvent): void; protected _onDayClick(event: JQuery.ClickEvent): void; protected _onMouseWheel(event: JQueryWheelEvent): void; } //# sourceMappingURL=DatePicker.d.ts.map