@progress/kendo-react-dateinputs
Version:
KendoReact Date Inputs package
114 lines (113 loc) • 5.51 kB
TypeScript
/// <reference types="react" />
import { DateRangePickerCalendarSettings } from './DateRangePickerCalendarSettings';
import { DateRangePickerDateInputSettings } from './DateRangePickerDateInputSettings';
import { DateRangePickerPopupSettings } from './DateRangePickerPopupSettings';
import { DateInputProps } from '../../dateinput/DateInput';
import { MultiViewCalendarProps } from '../../calendar/components/MultiViewCalendar';
import { PopupProps } from '@progress/kendo-react-popup';
/**
* @hidden
*/
export interface DateRangePickerSettings {
/**
* Enables the customization or the override of the default start DateInput which is rendered by the DateRangePicker
* ([see example]({% slug custom_rendering_daterangepicker %}#toc-customizing-the-dateinputs)).
*/
startDateInput?: React.ComponentType<DateInputProps<any>>;
/**
* Enables the customization or the override of the default end DateInput which is rendered by the DateRangePicker
* ([see example]({% slug custom_rendering_daterangepicker %}#toc-customizing-the-calendar)).
*/
endDateInput?: React.ComponentType<DateInputProps<any>>;
/**
* Enables the customization or the override of the default Popup which is rendered by the DateRangePicker
* ([see example]({% slug custom_rendering_daterangepicker %}#toc-customizing-the-popup)).
*/
popup?: React.ComponentType<PopupProps>;
/**
* Enables the customization or the override of the default Calendar which is rendered by the DateRangePicker.
*/
calendar?: React.ComponentType<MultiViewCalendarProps<any>>;
/**
* If `allowReverse` is set to `true`, the component skips the validation of whether the `from` value is after the `to` value ([see example]({% slug reverse_daterangepicker %})).
*
* > If the [`calendarSettings`](#toc-calendarsettings) property is set, its `allowReverse` will take precedence.
*/
allowReverse?: boolean;
/**
* Represents the additional props that can be passed to the [MultiViewCalendar]({% slug overview_multiviewcalendar %}) inside the DateRangePicker ([see example]({% slug child_settings_daterangepicker %}#toc-configuring-the-multiviewcalendar)).
*/
calendarSettings?: DateRangePickerCalendarSettings;
/**
* Sets the `className` of the DateRangePicker.
*/
className?: string;
/**
* Sets the default state of the DateRangePicker upon render ([see example]({% slug default_value_daterangepicker %})).
*/
defaultShow?: boolean;
/**
* Determines whether the DateRangePicker is disabled ([see example]({% slug disabled_daterangepicker %})).
*/
disabled?: boolean;
/**
* Represents the additional props that can be passed to the end-date [DateInput]({% slug overview_dateinput %}) inside the DateRangePicker ([see example]({% slug child_settings_daterangepicker %}#toc-configuring-dateinputs)).
*/
endDateInputSettings?: DateRangePickerDateInputSettings;
/**
* Specifies the focused date of the DateRangePicker ([see example]({% slug focused_daterangepicker %})).
*/
focusedDate?: Date;
/**
* Specifies the `date` format which is used for formatting the value of the DateInput ([see example]({% slug formats_dateinput %}).
*
* > If [`startDateInputSettings`](#toc-startdateinputsettings) or [`endDateInputSettings`](#toc-enddateinputsettings) are set, their `format` will take precedence.
*/
format?: string;
/**
* Specifies the `id` of the DateRangePicker.
*/
id?: string;
/**
* Specifies the greatest valid date ([see example]({% slug dateranges_daterangepicker %})).
*/
max?: Date;
/**
* Specifies the smallest valid date ([see example]({% slug dateranges_daterangepicker %})).
*/
min?: Date;
/**
* Fires each time any of the DateRangePicker elements gets blurred.
*/
onBlur?: (event: React.FocusEvent<any>) => void;
/**
* Fires each time the user focuses any of the DateRangePicker elements.
*/
onFocus?: (event: React.FocusEvent<any>) => void;
/**
* Represents the additional props that will be passed to the [Popup]({% slug overview_popup %}) inside the DateRangePicker ([see example]({% slug child_settings_daterangepicker %}#toc-configuring-the-popup)).
*/
popupSettings?: DateRangePickerPopupSettings;
/**
* Specifies if the calendar will be displayed ([see example]({% slug controlled_daterangepicker %}#toc-controlling-the-popup-state)).
*/
show?: boolean;
/**
* Represents the additional props that will be passed to the start-date [DateInput]({% slug overview_dateinput %}) inside the DateRangePicker ([see example]({% slug child_settings_daterangepicker %}#toc-configuring-dateinputs)).
*/
startDateInputSettings?: DateRangePickerDateInputSettings;
/**
* Specifies the additional styles that will be applied to the wrapping DateRangePicker element.
*/
style?: React.CSSProperties;
/**
* Determines whether the DateRangePicker will display a **Swap Value** button ([see example]({% slug reverse_daterangepicker %}#toc-swapping-start-and-end-dates-in-ranges)).
*
* > The DateRangePicker will display the swap button only if the [`allowReverse`](#toc-allowreverse) property is also set to `true`.
*/
swapButton?: boolean;
/**
* Sets the `tabIndex` property of the DatePicker.
*/
tabIndex?: number;
}