UNPKG

4.09 kBTypeScriptView Raw
1/// <reference types="react" />
2import { DayPickerProps, LocaleUtils } from "react-day-picker";
3import { TimePickerProps, TimePrecision } from "./timePicker";
4/**
5 * Collection of functions that determine which modifier classes get applied to which days.
6 * See the [**react-day-picker** documentation](https://react-day-picker-v7.netlify.app/api/ModifiersUtils)
7 * to learn more.
8 *
9 * @deprecated use DatePickerModifiers
10 */
11export interface IDatePickerModifiers {
12 [name: string]: (date: Date) => boolean;
13}
14export declare type DatePickerModifiers = IDatePickerModifiers;
15export interface DatePickerBaseProps {
16 /**
17 * Props to pass to ReactDayPicker. See API documentation
18 * [here](https://react-day-picker-v7.netlify.app/api/DayPicker).
19 *
20 * The following props are managed by the component and cannot be configured:
21 * `canChangeMonth`, `captionElement`, `fromMonth` (use `minDate`), `month` (use
22 * `initialMonth`), `toMonth` (use `maxDate`).
23 *
24 * In case of supplying your owner `renderDay` function, make sure to apply the appropriate
25 * CSS wrapper class to obtain default Blueprint styling.
26 * eg.
27 * `<div className={Classes.DATEPICKER_DAY_WRAPPER}>{CONTENT_HERE}</div>`
28 *
29 */
30 dayPickerProps?: DayPickerProps;
31 /**
32 * An additional element to show below the date picker.
33 */
34 footerElement?: JSX.Element;
35 /**
36 * Whether the current day should be highlighted in the calendar.
37 *
38 * @default false
39 */
40 highlightCurrentDay?: boolean;
41 /**
42 * The initial month the calendar displays.
43 */
44 initialMonth?: Date;
45 /**
46 * The locale name, which is passed to the functions in `localeUtils`
47 * (and `formatDate` and `parseDate` if supported).
48 */
49 locale?: string;
50 /**
51 * Collection of functions that provide internationalization support.
52 */
53 localeUtils?: typeof LocaleUtils;
54 /**
55 * The latest date the user can select.
56 *
57 * @default 6 months from now.
58 */
59 maxDate?: Date;
60 /**
61 * The earliest date the user can select.
62 *
63 * @default Jan. 1st, 20 years in the past.
64 */
65 minDate?: Date;
66 /**
67 * Collection of functions that determine which modifier classes get applied to which days.
68 * Each function should accept a `Date` and return a boolean.
69 * See the [**react-day-picker** documentation](https://react-day-picker-v7.netlify.app/api/ModifiersUtils)
70 * to learn more.
71 */
72 modifiers?: DatePickerModifiers;
73 /**
74 * If `true`, the month menu will appear to the left of the year menu.
75 * Otherwise, the month menu will apear to the right of the year menu.
76 *
77 * @default false
78 */
79 reverseMonthAndYearMenus?: boolean;
80 /**
81 * The precision of time selection that accompanies the calendar. Passing a
82 * `TimePrecision` value (or providing `timePickerProps`) shows a
83 * `TimePicker` below the calendar. Time is preserved across date changes.
84 *
85 * This is shorthand for `timePickerProps.precision` and is a quick way to
86 * enable time selection.
87 */
88 timePrecision?: TimePrecision;
89 /**
90 * Further configure the `TimePicker` that appears beneath the calendar.
91 * `onChange` and `value` are ignored in favor of the corresponding
92 * top-level props on this component.
93 *
94 * Passing any non-empty object to this prop will cause the `TimePicker` to appear.
95 */
96 timePickerProps?: TimePickerProps;
97}
98export declare const DISABLED_MODIFIER = "disabled";
99export declare const HOVERED_RANGE_MODIFIER = "hovered-range";
100export declare const OUTSIDE_MODIFIER = "outside";
101export declare const SELECTED_MODIFIER = "selected";
102export declare const SELECTED_RANGE_MODIFIER = "selected-range";
103export declare const DISALLOWED_MODIFIERS: string[];
104export declare function getDefaultMaxDate(): Date;
105export declare function getDefaultMinDate(): Date;
106export declare function combineModifiers(baseModifiers: DatePickerModifiers, userModifiers: DatePickerModifiers): IDatePickerModifiers;