devextreme
Version:
HTML5 JavaScript Component Suite for Responsive Web Development
135 lines (122 loc) • 4.41 kB
TypeScript
/**
* DevExtreme (ui/calendar.d.ts)
* Version: 21.1.4
* Build date: Mon Jun 21 2021
*
* Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
import {
UserDefinedElement,
DxElement
} from '../core/element';
import {
EventInfo,
NativeEventInfo
} from '../events/index';
import {
template
} from '../core/templates/template';
import Editor, {
ValueChangedInfo,
EditorOptions
} from './editor/editor';
/**
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface ComponentDisabledDate<T> {
component: T;
readonly date: Date;
readonly view: string;
}
export type ContentReadyEvent = EventInfo<dxCalendar>;
export type ValueChangedEvent = NativeEventInfo<dxCalendar> & ValueChangedInfo;
export type CellTemplateData = {
readonly date: Date,
readonly view: string,
readonly text?: string
}
export type DisabledDate = ComponentDisabledDate<dxCalendar>;
/**
* @deprecated use Properties instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export interface dxCalendarOptions extends EditorOptions<dxCalendar> {
/**
*
*/
activeStateEnabled?: boolean;
/**
* Specifies a custom template for calendar cells.
*/
cellTemplate?: template | ((itemData: CellTemplateData, itemIndex: number, itemElement: DxElement) => string | UserDefinedElement);
/**
* Specifies the date-time value serialization format. Use it only if you do not specify the value at design time.
*/
dateSerializationFormat?: string;
/**
* Specifies dates that users cannot select.
*/
disabledDates?: Array<Date> | ((data: DisabledDate) => boolean);
/**
* Specifies the first day of a week.
*/
firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
/**
*
*/
focusStateEnabled?: boolean;
/**
*
*/
hoverStateEnabled?: boolean;
/**
* The latest date the UI component allows to select.
*/
max?: Date | number | string;
/**
* Specifies the maximum zoom level of the calendar.
*/
maxZoomLevel?: 'century' | 'decade' | 'month' | 'year';
/**
* The earliest date the UI component allows to select.
*/
min?: Date | number | string;
/**
* Specifies the minimum zoom level of the calendar.
*/
minZoomLevel?: 'century' | 'decade' | 'month' | 'year';
/**
*
*/
name?: string;
/**
* Specifies whether or not the UI component displays a button that selects the current date.
*/
showTodayButton?: boolean;
/**
* An object or a value specifying the date and time currently selected in the calendar.
*/
value?: Date | number | string;
/**
* Specifies the current calendar zoom level.
*/
zoomLevel?: 'century' | 'decade' | 'month' | 'year';
}
/**
* The Calendar is a UI component that displays a calendar and allows an end user to select the required date within a specified date range.
*/
export default class dxCalendar extends Editor {
constructor(element: UserDefinedElement, options?: dxCalendarOptions)
}
export type Properties = dxCalendarOptions;
/**
* @deprecated use Properties instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type Options = dxCalendarOptions;
/**
* @deprecated use Properties instead
* @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}.
*/
export type IOptions = dxCalendarOptions;