react-day-picker 8.4.0 → 8.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +123 -70
- package/dist/index.esm.js +14 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +122 -158
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +2 -0
- package/dist/index.min.js.map +1 -0
- package/dist/style.css +2 -1
- package/dist/style.css.d.ts +38 -37
- package/dist/style.css.map +1 -0
- package/dist/style.module.css +0 -1
- package/dist/style.module.css.d.ts +38 -37
- package/package.json +35 -32
- package/src/DayPicker.tsx +1 -1
- package/src/components/Caption/Caption.test.tsx +2 -2
- package/src/components/CaptionDropdowns/CaptionDropdowns.test.tsx +7 -6
- package/src/components/CaptionLabel/CaptionLabel.test.tsx +1 -1
- package/src/components/CaptionLabel/CaptionLabel.tsx +3 -3
- package/src/components/CaptionNavigation/CaptionNavigation.test.tsx +11 -10
- package/src/components/CaptionNavigation/CaptionNavigation.tsx +1 -1
- package/src/components/Day/Day.test.tsx +15 -16
- package/src/components/Day/Day.tsx +1 -1
- package/src/components/DayContent/DayContent.test.tsx +1 -1
- package/src/components/Footer/Footer.test.tsx +1 -1
- package/src/components/HeadRow/HeadRow.test.tsx +1 -20
- package/src/components/HeadRow/HeadRow.tsx +2 -6
- package/src/components/HeadRow/utils/getWeekdays.test.ts +1 -1
- package/src/components/HeadRow/utils/getWeekdays.ts +1 -5
- package/src/components/Month/Month.test.tsx +1 -1
- package/src/components/MonthsDropdown/MonthsDropdown.test.tsx +3 -2
- package/src/components/MonthsDropdown/MonthsDropdown.tsx +1 -3
- package/src/components/Navigation/Navigation.test.tsx +10 -9
- package/src/components/Root/Root.test.tsx +2 -3
- package/src/components/Row/Row.tsx +2 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +219 -210
- package/src/components/Table/utils/daysToMonthWeeks.ts +11 -10
- package/src/components/Table/utils/getMonthWeeks.ts +7 -6
- package/src/components/YearsDropdown/YearsDropdown.test.tsx +3 -2
- package/src/components/YearsDropdown/YearsDropdown.tsx +1 -3
- package/src/contexts/DayPicker/DayPickerContext.test.ts +55 -138
- package/src/contexts/DayPicker/defaultContextValues.ts +1 -1
- package/src/contexts/DayPicker/formatters/formatCaption.test.ts +1 -1
- package/src/contexts/DayPicker/formatters/formatCaption.ts +1 -2
- package/src/contexts/DayPicker/formatters/formatDay.ts +1 -1
- package/src/contexts/DayPicker/formatters/formatMonthCaption.test.ts +1 -1
- package/src/contexts/DayPicker/formatters/formatMonthCaption.ts +1 -1
- package/src/contexts/DayPicker/formatters/formatWeekdayName.test.ts +3 -3
- package/src/contexts/DayPicker/formatters/formatWeekdayName.ts +2 -2
- package/src/contexts/DayPicker/formatters/formatYearCaption.ts +1 -1
- package/src/contexts/DayPicker/labels/labelDay.ts +1 -1
- package/src/contexts/DayPicker/labels/labelWeekday.test.ts +1 -1
- package/src/contexts/DayPicker/labels/labelWeekday.ts +1 -1
- package/src/contexts/DayPicker/utils/parseFromToProps.ts +1 -3
- package/src/contexts/Focus/FocusContext.test.ts +35 -62
- package/src/contexts/Focus/FocusContext.tsx +1 -1
- package/src/contexts/Focus/utils/getInitialFocusTarget.ts +1 -3
- package/src/contexts/Focus/utils/getNextFocus.ts +12 -10
- package/src/contexts/Modifiers/ModifiersContext.test.ts +8 -14
- package/src/contexts/Modifiers/utils/getActiveModifiers.ts +1 -1
- package/src/contexts/Modifiers/utils/isDateInRange.ts +1 -2
- package/src/contexts/Modifiers/utils/isMatch.ts +1 -4
- package/src/contexts/Navigation/NavigationContext.test.ts +12 -17
- package/src/contexts/Navigation/NavigationContext.tsx +1 -3
- package/src/contexts/Navigation/useNavigationState.test.ts +9 -16
- package/src/contexts/Navigation/useNavigationState.ts +6 -4
- package/src/contexts/Navigation/utils/getDisplayMonths.ts +1 -3
- package/src/contexts/Navigation/utils/getInitialMonth.ts +1 -3
- package/src/contexts/Navigation/utils/getNextMonth.ts +1 -3
- package/src/contexts/Navigation/utils/getPreviousMonth.ts +1 -3
- package/src/contexts/SelectMultiple/SelectMultipleContext.test.ts +15 -20
- package/src/contexts/SelectMultiple/SelectMultipleContext.tsx +1 -1
- package/src/contexts/SelectRange/SelectRangeContext.test.ts +23 -29
- package/src/contexts/SelectRange/SelectRangeContext.tsx +6 -4
- package/src/contexts/SelectRange/utils/addToRange.ts +1 -3
- package/src/contexts/SelectSingle/SelectSingleContext.test.ts +18 -15
- package/src/hooks/useActiveModifiers/useActiveModifiers.test.tsx +9 -16
- package/src/hooks/useControlledValue/useControlledValue.test.ts +16 -39
- package/src/hooks/useDayEventHandlers/useDayEventHandlers.test.tsx +18 -78
- package/src/hooks/useDayRender/useDayRender.test.tsx +68 -95
- package/src/hooks/useDayRender/useDayRender.tsx +5 -8
- package/src/hooks/useInput/useInput.ts +2 -4
- package/src/hooks/useSelectedDays/useSelectedDays.test.ts +15 -45
- package/src/index.ts +1 -0
- package/src/style.css +0 -1
- package/src/style.css.d.ts +37 -36
- package/src/types/Labels.ts +1 -0
- package/dist/index.esm.d.ts +0 -1175
- package/dist/react-day-picker.min.js +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { ReactNode, HTMLProps } from "react";
|
|
1
|
+
import { Locale as Locale$1 } from 'date-fns';
|
|
2
|
+
import React$1, { ReactNode, HTMLProps } from 'react';
|
|
3
|
+
|
|
5
4
|
/** Represent the props of the {@link Caption} component. */
|
|
6
5
|
interface CaptionProps {
|
|
7
6
|
/** The ID for the heading element. Must be the same as the labelled-by in Table. */
|
|
@@ -15,12 +14,13 @@ interface CaptionProps {
|
|
|
15
14
|
* - `dropdown`: display dropdowns for choosing the month and the year.
|
|
16
15
|
* - `buttons`: display previous month / next month buttons.
|
|
17
16
|
*/
|
|
18
|
-
type CaptionLayout =
|
|
17
|
+
type CaptionLayout = 'dropdown' | 'buttons';
|
|
19
18
|
/**
|
|
20
19
|
* Render the caption of a month. The caption has a different layout when
|
|
21
20
|
* setting the {@link DayPickerBase.captionLayout} prop.
|
|
22
21
|
*/
|
|
23
22
|
declare function Caption(props: CaptionProps): JSX.Element;
|
|
23
|
+
|
|
24
24
|
/** The props for the {@link CaptionLabel} component. */
|
|
25
25
|
interface CaptionLabelProps {
|
|
26
26
|
/** The ID for the heading element. Must be the same as the labelled-by in Table. */
|
|
@@ -30,6 +30,7 @@ interface CaptionLabelProps {
|
|
|
30
30
|
}
|
|
31
31
|
/** Render the caption for the displayed month. This component is used when `captionLayout="buttons"`. */
|
|
32
32
|
declare function CaptionLabel(props: CaptionLabelProps): JSX.Element;
|
|
33
|
+
|
|
33
34
|
/** Represent the props used by the {@link Day} component. */
|
|
34
35
|
interface DayProps {
|
|
35
36
|
/** The month where the date is displayed. */
|
|
@@ -42,6 +43,7 @@ interface DayProps {
|
|
|
42
43
|
* modifiers.
|
|
43
44
|
*/
|
|
44
45
|
declare function Day(props: DayProps): JSX.Element;
|
|
46
|
+
|
|
45
47
|
/**
|
|
46
48
|
* A value or a function that matches a specific day.
|
|
47
49
|
*
|
|
@@ -126,6 +128,7 @@ declare function isDateAfterType(value: unknown): value is DateAfter;
|
|
|
126
128
|
declare function isDateBeforeType(value: unknown): value is DateBefore;
|
|
127
129
|
/** Returns true if `value` is a {@link DayOfWeek} type. */
|
|
128
130
|
declare function isDayOfWeekType(value: unknown): value is DayOfWeek;
|
|
131
|
+
|
|
129
132
|
/** A _modifier_ represents different styles or states of a day displayed in the calendar. */
|
|
130
133
|
type Modifier = string;
|
|
131
134
|
/** The modifiers used by DayPicker. */
|
|
@@ -173,6 +176,7 @@ type DayModifiers = Record<Modifier, Matcher | Matcher[]>;
|
|
|
173
176
|
* the same as {@link DayModifiers]], but it accepts only array of [[Matcher}s.
|
|
174
177
|
*/
|
|
175
178
|
type CustomModifiers = Record<Modifier, Matcher[]>;
|
|
179
|
+
|
|
176
180
|
/** Represent the props for the {@link DayContent} component. */
|
|
177
181
|
interface DayContentProps {
|
|
178
182
|
/** The date representing the day. */
|
|
@@ -184,25 +188,27 @@ interface DayContentProps {
|
|
|
184
188
|
}
|
|
185
189
|
/** Render the content of the day cell. */
|
|
186
190
|
declare function DayContent(props: DayContentProps): JSX.Element;
|
|
191
|
+
|
|
187
192
|
/** The props for the {@link Dropdown} component. */
|
|
188
193
|
interface DropdownProps {
|
|
189
194
|
/** The name attribute of the element. */
|
|
190
195
|
name?: string;
|
|
191
196
|
/** The caption displayed to replace the hidden select. */
|
|
192
|
-
caption?: React.ReactNode;
|
|
193
|
-
children?: React.SelectHTMLAttributes<HTMLSelectElement>[
|
|
197
|
+
caption?: React$1.ReactNode;
|
|
198
|
+
children?: React$1.SelectHTMLAttributes<HTMLSelectElement>['children'];
|
|
194
199
|
className?: string;
|
|
195
|
-
[
|
|
196
|
-
style?: React.CSSProperties;
|
|
200
|
+
['aria-label']?: string;
|
|
201
|
+
style?: React$1.CSSProperties;
|
|
197
202
|
/** The selected value. */
|
|
198
203
|
value?: string | number;
|
|
199
|
-
onChange?: React.ChangeEventHandler<HTMLSelectElement>;
|
|
204
|
+
onChange?: React$1.ChangeEventHandler<HTMLSelectElement>;
|
|
200
205
|
}
|
|
201
206
|
/**
|
|
202
207
|
* Render a styled select component – displaying a caption and a custom
|
|
203
208
|
* drop-down icon.
|
|
204
209
|
*/
|
|
205
210
|
declare function Dropdown(props: DropdownProps): JSX.Element;
|
|
211
|
+
|
|
206
212
|
/**
|
|
207
213
|
* The props for the {@link Row} component.
|
|
208
214
|
*/
|
|
@@ -216,6 +222,7 @@ interface RowProps {
|
|
|
216
222
|
}
|
|
217
223
|
/** Render a row in the calendar, with the days and the week number. */
|
|
218
224
|
declare function Row(props: RowProps): JSX.Element;
|
|
225
|
+
|
|
219
226
|
/**
|
|
220
227
|
* The props for the {@link WeekNumber} component.
|
|
221
228
|
*/
|
|
@@ -230,6 +237,7 @@ interface WeekNumberProps {
|
|
|
230
237
|
* renders a button, otherwise a span element.
|
|
231
238
|
*/
|
|
232
239
|
declare function WeekNumber(props: WeekNumberProps): JSX.Element;
|
|
240
|
+
|
|
233
241
|
/** The event handler when a day is clicked. */
|
|
234
242
|
type DayClickEventHandler = (day: Date, activeModifiers: ActiveModifiers, e: React.MouseEvent) => void;
|
|
235
243
|
/** The event handler when a day is focused. */
|
|
@@ -243,32 +251,46 @@ type DayPointerEventHandler = (day: Date, activeModifiers: ActiveModifiers, e: R
|
|
|
243
251
|
/** The event handler when a month is changed in the calendar. */
|
|
244
252
|
type MonthChangeEventHandler = (month: Date) => void;
|
|
245
253
|
/** The event handler when selecting multiple days. */
|
|
246
|
-
type SelectMultipleEventHandler = (
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
254
|
+
type SelectMultipleEventHandler = (
|
|
255
|
+
/** The selected days */
|
|
256
|
+
days: Date[] | undefined,
|
|
257
|
+
/** The day that was clicked triggering the event. */
|
|
258
|
+
selectedDay: Date,
|
|
259
|
+
/** The day that was clicked */
|
|
260
|
+
activeModifiers: ActiveModifiers,
|
|
261
|
+
/** The mouse event that triggered this event. */
|
|
250
262
|
e: React.MouseEvent) => void;
|
|
251
263
|
/** The event handler when selecting a range of days. */
|
|
252
|
-
type SelectRangeEventHandler = (
|
|
253
|
-
|
|
254
|
-
|
|
264
|
+
type SelectRangeEventHandler = (
|
|
265
|
+
/** The current range of the selected days. */
|
|
266
|
+
range: DateRange | undefined,
|
|
267
|
+
/** The day that was selected (or clicked) triggering the event. */
|
|
268
|
+
selectedDay: Date,
|
|
269
|
+
/** The modifiers of the selected day. */
|
|
255
270
|
activeModifiers: ActiveModifiers, e: React.MouseEvent) => void;
|
|
256
271
|
/** The event handler when selecting a single day. */
|
|
257
|
-
type SelectSingleEventHandler = (
|
|
258
|
-
|
|
259
|
-
|
|
272
|
+
type SelectSingleEventHandler = (
|
|
273
|
+
/** The selected day, `undefined` when `required={false}` (default) and the day is clicked again. */
|
|
274
|
+
day: Date | undefined,
|
|
275
|
+
/** The day that was selected (or clicked) triggering the event. */
|
|
276
|
+
selectedDay: Date,
|
|
277
|
+
/** The modifiers of the selected day. */
|
|
260
278
|
activeModifiers: ActiveModifiers, e: React.MouseEvent) => void;
|
|
261
279
|
/**The event handler when the week number is clicked. */
|
|
262
|
-
type WeekNumberClickEventHandler = (
|
|
263
|
-
|
|
264
|
-
|
|
280
|
+
type WeekNumberClickEventHandler = (
|
|
281
|
+
/** The week number that has been clicked. */
|
|
282
|
+
weekNumber: number,
|
|
283
|
+
/** The dates in the clicked week. */
|
|
284
|
+
dates: Date[],
|
|
285
|
+
/** The mouse event that triggered this event. */
|
|
265
286
|
e: React.MouseEvent) => void;
|
|
266
287
|
/** The event handler when a day gets a touch event. */
|
|
267
288
|
type DayTouchEventHandler = (day: Date, activeModifiers: ActiveModifiers, e: React.TouchEvent) => void;
|
|
289
|
+
|
|
268
290
|
/** Represents a function to format a date. */
|
|
269
291
|
type DateFormatter = (date: Date, options?: {
|
|
270
292
|
locale?: Locale;
|
|
271
|
-
}) => React.ReactNode;
|
|
293
|
+
}) => React$1.ReactNode;
|
|
272
294
|
/** Represent a map of formatters used to render localized content. */
|
|
273
295
|
type Formatters = {
|
|
274
296
|
/** Format the month in the caption when `captionLayout` is `buttons`. */
|
|
@@ -287,35 +309,38 @@ type Formatters = {
|
|
|
287
309
|
/** Represent a function to format the week number. */
|
|
288
310
|
type WeekNumberFormatter = (weekNumber: number, options?: {
|
|
289
311
|
locale?: Locale;
|
|
290
|
-
}) => React.ReactNode;
|
|
312
|
+
}) => React$1.ReactNode;
|
|
313
|
+
|
|
291
314
|
/** Map of functions to translate ARIA labels for the relative elements. */
|
|
292
315
|
type Labels = {
|
|
293
316
|
labelMonthDropdown: () => string;
|
|
294
317
|
labelYearDropdown: () => string;
|
|
295
318
|
labelNext: NavButtonLabel;
|
|
296
319
|
labelPrevious: NavButtonLabel;
|
|
320
|
+
/** @deprecated This label is not used anymore and this function will be removed in the future. */
|
|
297
321
|
labelDay: DayLabel;
|
|
298
322
|
labelWeekday: WeekdayLabel;
|
|
299
323
|
labelWeekNumber: WeekNumberLabel;
|
|
300
324
|
};
|
|
301
325
|
/** Return the ARIA label for the {@link Day} component. */
|
|
302
326
|
type DayLabel = (day: Date, activeModifiers: ActiveModifiers, options?: {
|
|
303
|
-
locale?: Locale;
|
|
327
|
+
locale?: Locale$1;
|
|
304
328
|
}) => string;
|
|
305
329
|
/** Return the ARIA label for the "next month" / "prev month" buttons in the navigation.*/
|
|
306
330
|
type NavButtonLabel = (month?: Date, options?: {
|
|
307
|
-
locale?: Locale;
|
|
331
|
+
locale?: Locale$1;
|
|
308
332
|
}) => string;
|
|
309
333
|
/** Return the ARIA label for the Head component.*/
|
|
310
334
|
type WeekdayLabel = (day: Date, options?: {
|
|
311
|
-
locale?: Locale;
|
|
335
|
+
locale?: Locale$1;
|
|
312
336
|
}) => string;
|
|
313
337
|
/** Return the ARIA label of the week number.*/
|
|
314
338
|
type WeekNumberLabel = (n: number, options?: {
|
|
315
|
-
locale?: Locale;
|
|
339
|
+
locale?: Locale$1;
|
|
316
340
|
}) => string;
|
|
341
|
+
|
|
317
342
|
/** The style (either via class names or via in-line styles) of an element. */
|
|
318
|
-
type StyledElement<T> = {
|
|
343
|
+
type StyledElement<T = string | React$1.CSSProperties> = {
|
|
319
344
|
/** The root element. */
|
|
320
345
|
readonly root: T;
|
|
321
346
|
/** The root element when `numberOfMonths > 1`. */
|
|
@@ -400,7 +425,7 @@ type StyledElement<T> = {
|
|
|
400
425
|
readonly day_today: T;
|
|
401
426
|
};
|
|
402
427
|
/** These elements must not be in the `styles` or `classNames` records as they are styled via the `modifiersStyles` or `modifiersClassNames` pop */
|
|
403
|
-
type InternalModifiersElement =
|
|
428
|
+
type InternalModifiersElement = 'day_outside' | 'day_selected' | 'day_disabled' | 'day_hidden' | 'day_range_start' | 'day_range_end' | 'day_range_middle' | 'day_today';
|
|
404
429
|
/** The class names of each element. */
|
|
405
430
|
type ClassNames = Partial<StyledElement<string>>;
|
|
406
431
|
/**
|
|
@@ -408,13 +433,14 @@ type ClassNames = Partial<StyledElement<string>>;
|
|
|
408
433
|
* modifiers, such as `today` or `hidden`, should be styled using the
|
|
409
434
|
* `modifiersStyles` prop.
|
|
410
435
|
*/
|
|
411
|
-
type Styles = Partial<Omit<StyledElement<React.CSSProperties>, InternalModifiersElement>>;
|
|
436
|
+
type Styles = Partial<Omit<StyledElement<React$1.CSSProperties>, InternalModifiersElement>>;
|
|
412
437
|
/** Props of a component that can be styled via classNames or inline-styles. */
|
|
413
438
|
type StyledComponent = {
|
|
414
439
|
className?: string;
|
|
415
|
-
style?: React.CSSProperties;
|
|
416
|
-
children?: React.ReactNode;
|
|
440
|
+
style?: React$1.CSSProperties;
|
|
441
|
+
children?: React$1.ReactNode;
|
|
417
442
|
};
|
|
443
|
+
|
|
418
444
|
/**
|
|
419
445
|
* Selection modes supported by DayPicker.
|
|
420
446
|
*
|
|
@@ -423,7 +449,7 @@ type StyledComponent = {
|
|
|
423
449
|
* - `range`: use DayPicker to select a range of days
|
|
424
450
|
* - `default`: disable the built-in selection behavior. Customize what is selected by using {@link DayPickerBase.onDayClick}.
|
|
425
451
|
*/
|
|
426
|
-
type DaySelectionMode =
|
|
452
|
+
type DaySelectionMode = 'single' | 'multiple' | 'range' | 'default';
|
|
427
453
|
/**
|
|
428
454
|
* The base props for the {@link DayPicker} component and the {@link DayPickerContext}.
|
|
429
455
|
*/
|
|
@@ -599,7 +625,7 @@ interface DayPickerBase {
|
|
|
599
625
|
*/
|
|
600
626
|
modifiers?: DayModifiers;
|
|
601
627
|
/** The date-fns locale object used to localize dates. Defaults to* `en-US`. */
|
|
602
|
-
locale?: Locale;
|
|
628
|
+
locale?: Locale$1;
|
|
603
629
|
/**
|
|
604
630
|
* Labels creators to override the defaults. Use this prop to customize the
|
|
605
631
|
* ARIA labels attributes.
|
|
@@ -678,15 +704,17 @@ interface CustomComponents {
|
|
|
678
704
|
/** The component for the week number in the table rows. */
|
|
679
705
|
WeekNumber?: (props: WeekNumberProps) => JSX.Element | null;
|
|
680
706
|
}
|
|
707
|
+
|
|
681
708
|
/** The props for the {@link DayPicker} component when using `mode="default"` or `undefined`. */
|
|
682
709
|
interface DayPickerDefaultProps extends DayPickerBase {
|
|
683
|
-
mode?: undefined |
|
|
710
|
+
mode?: undefined | 'default';
|
|
684
711
|
}
|
|
685
712
|
/** Returns true when the props are of type {@link DayPickerDefaultProps}. */
|
|
686
713
|
declare function isDayPickerDefault(props: DayPickerProps): props is DayPickerDefaultProps;
|
|
714
|
+
|
|
687
715
|
/** The props for the {@link DayPicker} component when using `mode="range"`. */
|
|
688
716
|
interface DayPickerRangeProps extends DayPickerBase {
|
|
689
|
-
mode:
|
|
717
|
+
mode: 'range';
|
|
690
718
|
/** The selected range of days. */
|
|
691
719
|
selected?: DateRange | undefined;
|
|
692
720
|
/** Event fired when a range (or a part of the range) is selected. */
|
|
@@ -698,9 +726,10 @@ interface DayPickerRangeProps extends DayPickerBase {
|
|
|
698
726
|
}
|
|
699
727
|
/** Returns true when the props are of type {@link DayPickerRangeProps}. */
|
|
700
728
|
declare function isDayPickerRange(props: DayPickerProps | DayPickerContextValue): props is DayPickerRangeProps;
|
|
729
|
+
|
|
701
730
|
/** The props for the {@link DayPicker} component when using `mode="single"`. */
|
|
702
731
|
interface DayPickerSingleProps extends DayPickerBase {
|
|
703
|
-
mode:
|
|
732
|
+
mode: 'single';
|
|
704
733
|
/** The selected day. */
|
|
705
734
|
selected?: Date | undefined;
|
|
706
735
|
/** Event fired when a day is selected. */
|
|
@@ -710,13 +739,14 @@ interface DayPickerSingleProps extends DayPickerBase {
|
|
|
710
739
|
}
|
|
711
740
|
/** Returns true when the props are of type {@link DayPickerSingleProps}. */
|
|
712
741
|
declare function isDayPickerSingle(props: DayPickerProps | DayPickerContextValue): props is DayPickerSingleProps;
|
|
742
|
+
|
|
713
743
|
/**
|
|
714
744
|
* The value of the {@link DayPickerContext} extends the props from DayPicker
|
|
715
745
|
* with default and cleaned up values.
|
|
716
746
|
*/
|
|
717
747
|
interface DayPickerContextValue extends DayPickerBase {
|
|
718
748
|
mode: DaySelectionMode;
|
|
719
|
-
onSelect?: DayPickerSingleProps[
|
|
749
|
+
onSelect?: DayPickerSingleProps['onSelect'] | DayPickerMultipleProps['onSelect'] | DayPickerRangeProps['onSelect'];
|
|
720
750
|
required?: boolean;
|
|
721
751
|
min?: number;
|
|
722
752
|
max?: number;
|
|
@@ -739,7 +769,7 @@ interface DayPickerContextValue extends DayPickerBase {
|
|
|
739
769
|
*
|
|
740
770
|
* Access to this context from the {@link useDayPicker} hook.
|
|
741
771
|
*/
|
|
742
|
-
declare const DayPickerContext: React.Context<DayPickerContextValue | undefined>;
|
|
772
|
+
declare const DayPickerContext: React$1.Context<DayPickerContextValue | undefined>;
|
|
743
773
|
/** The props for the {@link DayPickerProvider}. */
|
|
744
774
|
interface DayPickerProviderProps {
|
|
745
775
|
/** The initial props from the DayPicker component. */
|
|
@@ -758,9 +788,10 @@ declare function DayPickerProvider(props: DayPickerProviderProps): JSX.Element;
|
|
|
758
788
|
* internal or custom components.
|
|
759
789
|
*/
|
|
760
790
|
declare function useDayPicker(): DayPickerContextValue;
|
|
791
|
+
|
|
761
792
|
/** The props for the {@link DayPicker} component when using `mode="multiple"`. */
|
|
762
793
|
interface DayPickerMultipleProps extends DayPickerBase {
|
|
763
|
-
mode:
|
|
794
|
+
mode: 'multiple';
|
|
764
795
|
/** The selected days. */
|
|
765
796
|
selected?: Date[] | undefined;
|
|
766
797
|
/** Event fired when a days added or removed to the selection. */
|
|
@@ -772,6 +803,7 @@ interface DayPickerMultipleProps extends DayPickerBase {
|
|
|
772
803
|
}
|
|
773
804
|
/** Returns true when the props are of type {@link DayPickerMultipleProps}. */
|
|
774
805
|
declare function isDayPickerMultiple(props: DayPickerProps | DayPickerContextValue): props is DayPickerMultipleProps;
|
|
806
|
+
|
|
775
807
|
type DayPickerProps = DayPickerDefaultProps | DayPickerSingleProps | DayPickerMultipleProps | DayPickerRangeProps;
|
|
776
808
|
/**
|
|
777
809
|
* DayPicker render a date picker component to let users pick dates from a
|
|
@@ -856,50 +888,60 @@ type DayPickerProps = DayPickerDefaultProps | DayPickerSingleProps | DayPickerMu
|
|
|
856
888
|
* For example, to use Spanish locale:
|
|
857
889
|
*
|
|
858
890
|
* ```
|
|
859
|
-
* import es from 'date-fns/locale
|
|
891
|
+
* import { es } from 'date-fns/locale';
|
|
860
892
|
* <DayPicker locale={es} />
|
|
861
893
|
* ```
|
|
862
894
|
*/
|
|
863
895
|
declare function DayPicker(props: DayPickerDefaultProps | DayPickerSingleProps | DayPickerMultipleProps | DayPickerRangeProps): JSX.Element;
|
|
896
|
+
|
|
864
897
|
/** The props for the {@link Button} component. */
|
|
865
|
-
type ButtonProps = React.HTMLProps<HTMLButtonElement>;
|
|
898
|
+
type ButtonProps = React$1.HTMLProps<HTMLButtonElement>;
|
|
866
899
|
/**
|
|
867
900
|
* Render a button HTML element applying the reset class name.
|
|
868
901
|
*/
|
|
869
|
-
declare const Button: React.ForwardRefExoticComponent<Pick<ButtonProps, "multiple" | "default" | "onSelect" | "required" | "min" | "max" | "selected" | "className" | "style" | "id" | "disabled" | "hidden" | "dir" | "start" | "color" | "content" | "size" | "wrap" | "open" | "value" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "aria-label" | "onChange" | "name" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "
|
|
902
|
+
declare const Button: React$1.ForwardRefExoticComponent<Pick<ButtonProps, "multiple" | "default" | "onSelect" | "required" | "min" | "max" | "selected" | "className" | "style" | "id" | "disabled" | "hidden" | "dir" | "start" | "color" | "content" | "size" | "wrap" | "open" | "value" | "children" | "cite" | "data" | "form" | "label" | "slot" | "span" | "summary" | "title" | "pattern" | "list" | "role" | "aria-label" | "onChange" | "name" | "accept" | "acceptCharset" | "action" | "allowFullScreen" | "allowTransparency" | "alt" | "as" | "async" | "autoComplete" | "autoFocus" | "autoPlay" | "capture" | "cellPadding" | "cellSpacing" | "charSet" | "challenge" | "checked" | "classID" | "cols" | "colSpan" | "controls" | "coords" | "crossOrigin" | "dateTime" | "defer" | "download" | "encType" | "formAction" | "formEncType" | "formMethod" | "formNoValidate" | "formTarget" | "frameBorder" | "headers" | "height" | "high" | "href" | "hrefLang" | "htmlFor" | "httpEquiv" | "integrity" | "keyParams" | "keyType" | "kind" | "loop" | "low" | "manifest" | "marginHeight" | "marginWidth" | "maxLength" | "media" | "mediaGroup" | "method" | "minLength" | "muted" | "noValidate" | "optimum" | "placeholder" | "playsInline" | "poster" | "preload" | "readOnly" | "rel" | "reversed" | "rows" | "rowSpan" | "sandbox" | "scope" | "scoped" | "scrolling" | "seamless" | "shape" | "sizes" | "src" | "srcDoc" | "srcLang" | "srcSet" | "step" | "target" | "type" | "useMap" | "width" | "wmode" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "draggable" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "key"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
903
|
+
|
|
870
904
|
/**
|
|
871
905
|
* Render a caption with the dropdowns to navigate between months and years.
|
|
872
906
|
*/
|
|
873
907
|
declare function CaptionDropdowns(props: CaptionProps): JSX.Element;
|
|
908
|
+
|
|
874
909
|
/**
|
|
875
910
|
* Render a caption with a button-based navigation.
|
|
876
911
|
*/
|
|
877
912
|
declare function CaptionNavigation(props: CaptionProps): JSX.Element;
|
|
913
|
+
|
|
878
914
|
/** Render the Footer component (empty as default).*/
|
|
879
915
|
declare function Footer(): JSX.Element;
|
|
916
|
+
|
|
880
917
|
/** Render the table head. */
|
|
881
918
|
declare function Head(): JSX.Element;
|
|
919
|
+
|
|
882
920
|
/**
|
|
883
921
|
* Render the HeadRow component - i.e. the table head row with the weekday names.
|
|
884
922
|
*/
|
|
885
923
|
declare function HeadRow(): JSX.Element;
|
|
924
|
+
|
|
886
925
|
/**
|
|
887
926
|
* Render the icon in the styled drop-down.
|
|
888
927
|
*/
|
|
889
928
|
declare function IconDropdown(props: StyledComponent): JSX.Element;
|
|
929
|
+
|
|
890
930
|
/**
|
|
891
931
|
* Render the "next month" button in the navigation.
|
|
892
932
|
*/
|
|
893
933
|
declare function IconRight(props: StyledComponent): JSX.Element;
|
|
934
|
+
|
|
894
935
|
/**
|
|
895
936
|
* Render the "previous month" button in the navigation.
|
|
896
937
|
*/
|
|
897
938
|
declare function IconLeft(props: StyledComponent): JSX.Element;
|
|
939
|
+
|
|
898
940
|
/** The props to attach to the input field when using {@link useInput}. */
|
|
899
|
-
type InputHTMLAttributes = Pick<React.InputHTMLAttributes<HTMLInputElement>,
|
|
941
|
+
type InputHTMLAttributes = Pick<React$1.InputHTMLAttributes<HTMLInputElement>, 'onBlur' | 'onChange' | 'onFocus' | 'value' | 'placeholder'>;
|
|
900
942
|
/** The props to attach to the DayPicker component when using {@link useInput}. */
|
|
901
|
-
type InputDayPickerProps = Pick<DayPickerSingleProps,
|
|
902
|
-
interface UseInputOptions extends Pick<DayPickerBase,
|
|
943
|
+
type InputDayPickerProps = Pick<DayPickerSingleProps, 'fromDate' | 'toDate' | 'locale' | 'month' | 'onDayClick' | 'onMonthChange' | 'selected' | 'today'>;
|
|
944
|
+
interface UseInputOptions extends Pick<DayPickerBase, 'locale' | 'fromDate' | 'toDate' | 'fromMonth' | 'toMonth' | 'fromYear' | 'toYear' | 'today'> {
|
|
903
945
|
/** The initially selected date */
|
|
904
946
|
defaultSelected?: Date;
|
|
905
947
|
/** The format string for formatting the input field. See https://date-fns.org/docs/format for a list of format strings. Default to `PP`. */
|
|
@@ -920,9 +962,12 @@ interface UseInputValue {
|
|
|
920
962
|
}
|
|
921
963
|
/** Return props and setters for binding an input field to DayPicker. */
|
|
922
964
|
declare function useInput(options?: UseInputOptions): UseInputValue;
|
|
923
|
-
|
|
965
|
+
|
|
966
|
+
type EventName = 'onClick' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onMouseEnter' | 'onMouseLeave' | 'onPointerEnter' | 'onPointerLeave' | 'onTouchCancel' | 'onTouchEnd' | 'onTouchMove' | 'onTouchStart';
|
|
924
967
|
type DayEventHandlers = Pick<HTMLProps<HTMLButtonElement>, EventName>;
|
|
968
|
+
|
|
925
969
|
type SelectedDays = Date | Date[] | DateRange | undefined;
|
|
970
|
+
|
|
926
971
|
type DayRender = {
|
|
927
972
|
/** Whether the day should be rendered a `button` instead of a `div` */
|
|
928
973
|
isButton: boolean;
|
|
@@ -931,7 +976,7 @@ type DayRender = {
|
|
|
931
976
|
/** The modifiers active for the given day. */
|
|
932
977
|
activeModifiers: ActiveModifiers;
|
|
933
978
|
/** The props to apply to the button element (when `isButton` is true). */
|
|
934
|
-
buttonProps: StyledComponent & Pick<ButtonProps,
|
|
979
|
+
buttonProps: StyledComponent & Pick<ButtonProps, 'disabled' | 'aria-selected' | 'tabIndex'> & DayEventHandlers;
|
|
935
980
|
/** The props to apply to the div element (when `isButton` is false). */
|
|
936
981
|
divProps: StyledComponent;
|
|
937
982
|
selectedDays: SelectedDays;
|
|
@@ -942,10 +987,14 @@ type DayRender = {
|
|
|
942
987
|
* Use this hook when creating a component to replace the built-in `Day`
|
|
943
988
|
* component.
|
|
944
989
|
*/
|
|
945
|
-
declare function useDayRender(
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
990
|
+
declare function useDayRender(
|
|
991
|
+
/** The date to render. */
|
|
992
|
+
day: Date,
|
|
993
|
+
/** The month where the date is displayed (if not the same as `date`, it means it is an "outside" day). */
|
|
994
|
+
displayMonth: Date,
|
|
995
|
+
/** A ref to the button element that will be target of focus when rendered (if required). */
|
|
996
|
+
buttonRef: React$1.RefObject<HTMLButtonElement>): DayRender;
|
|
997
|
+
|
|
949
998
|
/**
|
|
950
999
|
* Return the active modifiers for the specified day.
|
|
951
1000
|
*
|
|
@@ -954,11 +1003,13 @@ buttonRef: React.RefObject<HTMLButtonElement>): DayRender;
|
|
|
954
1003
|
* @param day
|
|
955
1004
|
* @param displayMonth
|
|
956
1005
|
*/
|
|
957
|
-
declare function useActiveModifiers(day: Date,
|
|
1006
|
+
declare function useActiveModifiers(day: Date,
|
|
1007
|
+
/**
|
|
958
1008
|
* The month where the date is displayed. If not the same as `date`, the day
|
|
959
1009
|
* is an "outside day".
|
|
960
1010
|
*/
|
|
961
1011
|
displayMonth?: Date): ActiveModifiers;
|
|
1012
|
+
|
|
962
1013
|
/** Represents the value of the {@link FocusContext}. */
|
|
963
1014
|
type FocusContextValue = {
|
|
964
1015
|
/** The day currently focused. */
|
|
@@ -977,17 +1028,11 @@ type FocusContextValue = {
|
|
|
977
1028
|
focusWeekBefore: () => void;
|
|
978
1029
|
/** Focus the day in the week after the focused day. */
|
|
979
1030
|
focusWeekAfter: () => void;
|
|
980
|
-
/* Focus the day in the month before the focused day. */
|
|
981
1031
|
focusMonthBefore: () => void;
|
|
982
|
-
/* Focus the day in the month after the focused day. */
|
|
983
1032
|
focusMonthAfter: () => void;
|
|
984
|
-
/* Focus the day in the year before the focused day. */
|
|
985
1033
|
focusYearBefore: () => void;
|
|
986
|
-
/* Focus the day in the year after the focused day. */
|
|
987
1034
|
focusYearAfter: () => void;
|
|
988
|
-
/* Focus the day at the start of the week of the focused day. */
|
|
989
1035
|
focusStartOfWeek: () => void;
|
|
990
|
-
/* Focus the day at the end of the week of focused day. */
|
|
991
1036
|
focusEndOfWeek: () => void;
|
|
992
1037
|
};
|
|
993
1038
|
/**
|
|
@@ -995,7 +1040,7 @@ type FocusContextValue = {
|
|
|
995
1040
|
*
|
|
996
1041
|
* Access this context from the {@link useFocusContext} hook.
|
|
997
1042
|
*/
|
|
998
|
-
declare const FocusContext: React.Context<FocusContextValue | undefined>;
|
|
1043
|
+
declare const FocusContext: React$1.Context<FocusContextValue | undefined>;
|
|
999
1044
|
/** The provider for the {@link FocusContext}. */
|
|
1000
1045
|
declare function FocusProvider(props: {
|
|
1001
1046
|
children: ReactNode;
|
|
@@ -1007,6 +1052,7 @@ declare function FocusProvider(props: {
|
|
|
1007
1052
|
* This hook is meant to be used inside internal or custom components.
|
|
1008
1053
|
*/
|
|
1009
1054
|
declare function useFocusContext(): FocusContextValue;
|
|
1055
|
+
|
|
1010
1056
|
/** Represents the value of the {@link NavigationContext}. */
|
|
1011
1057
|
interface NavigationContextValue {
|
|
1012
1058
|
/** The month to display in the calendar. When `numberOfMonths` is greater than one, is the first of the displayed months. */
|
|
@@ -1028,7 +1074,7 @@ interface NavigationContextValue {
|
|
|
1028
1074
|
* The Navigation context shares details and methods to navigate the months in DayPicker.
|
|
1029
1075
|
* Access this context from the {@link useNavigation} hook.
|
|
1030
1076
|
*/
|
|
1031
|
-
declare const NavigationContext: React.Context<NavigationContextValue | undefined>;
|
|
1077
|
+
declare const NavigationContext: React$1.Context<NavigationContextValue | undefined>;
|
|
1032
1078
|
/** Provides the values for the {@link NavigationContext}. */
|
|
1033
1079
|
declare function NavigationProvider(props: {
|
|
1034
1080
|
children?: ReactNode;
|
|
@@ -1040,12 +1086,14 @@ declare function NavigationProvider(props: {
|
|
|
1040
1086
|
* This hook is meant to be used inside internal or custom components.
|
|
1041
1087
|
*/
|
|
1042
1088
|
declare function useNavigation(): NavigationContextValue;
|
|
1089
|
+
|
|
1043
1090
|
/** The props of {@link RootProvider}. */
|
|
1044
1091
|
type RootContext = DayPickerBase & {
|
|
1045
|
-
children: React.ReactNode;
|
|
1092
|
+
children: React$1.ReactNode;
|
|
1046
1093
|
};
|
|
1047
1094
|
/** Provide the value for all the context providers. */
|
|
1048
1095
|
declare function RootProvider(props: RootContext): JSX.Element;
|
|
1096
|
+
|
|
1049
1097
|
/** Represent the modifiers that are changed by the multiple selection. */
|
|
1050
1098
|
type SelectMultipleModifiers = Pick<Modifiers, InternalModifier.Disabled>;
|
|
1051
1099
|
/** Represents the value of a {@link SelectMultipleContext}. */
|
|
@@ -1063,7 +1111,7 @@ interface SelectMultipleContextValue {
|
|
|
1063
1111
|
*
|
|
1064
1112
|
* Access this context from the {@link useSelectMultiple} hook.
|
|
1065
1113
|
*/
|
|
1066
|
-
declare const SelectMultipleContext: React.Context<SelectMultipleContextValue | undefined>;
|
|
1114
|
+
declare const SelectMultipleContext: React$1.Context<SelectMultipleContextValue | undefined>;
|
|
1067
1115
|
type SelectMultipleProviderProps = {
|
|
1068
1116
|
initialProps: DayPickerBase;
|
|
1069
1117
|
children: ReactNode;
|
|
@@ -1081,6 +1129,7 @@ declare function SelectMultipleProviderInternal({ initialProps, children }: Sele
|
|
|
1081
1129
|
* This hook is meant to be used inside internal or custom components.
|
|
1082
1130
|
*/
|
|
1083
1131
|
declare function useSelectMultiple(): SelectMultipleContextValue;
|
|
1132
|
+
|
|
1084
1133
|
/** Represent the modifiers that are changed by the range selection. */
|
|
1085
1134
|
type SelectRangeModifiers = Pick<Modifiers, InternalModifier.Disabled | InternalModifier.RangeEnd | InternalModifier.RangeMiddle | InternalModifier.RangeStart>;
|
|
1086
1135
|
/** Represents the value of a {@link SelectRangeContext}. */
|
|
@@ -1098,7 +1147,7 @@ interface SelectRangeContextValue {
|
|
|
1098
1147
|
*
|
|
1099
1148
|
* Access this context from the {@link useSelectRange} hook.
|
|
1100
1149
|
*/
|
|
1101
|
-
declare const SelectRangeContext: React.Context<SelectRangeContextValue | undefined>;
|
|
1150
|
+
declare const SelectRangeContext: React$1.Context<SelectRangeContextValue | undefined>;
|
|
1102
1151
|
type SelectRangeProviderProps = {
|
|
1103
1152
|
initialProps: DayPickerBase;
|
|
1104
1153
|
children: ReactNode;
|
|
@@ -1116,6 +1165,7 @@ declare function SelectRangeProviderInternal({ initialProps, children }: SelectR
|
|
|
1116
1165
|
* This hook is meant to be used inside internal or custom components.
|
|
1117
1166
|
*/
|
|
1118
1167
|
declare function useSelectRange(): SelectRangeContextValue;
|
|
1168
|
+
|
|
1119
1169
|
/** Represents the value of a {@link SelectSingleContext}. */
|
|
1120
1170
|
interface SelectSingleContextValue {
|
|
1121
1171
|
/** The day that has been selected. */
|
|
@@ -1129,16 +1179,16 @@ interface SelectSingleContextValue {
|
|
|
1129
1179
|
*
|
|
1130
1180
|
* Access this context from the {@link useSelectSingle} hook.
|
|
1131
1181
|
*/
|
|
1132
|
-
declare const SelectSingleContext: React.Context<SelectSingleContextValue | undefined>;
|
|
1182
|
+
declare const SelectSingleContext: React$1.Context<SelectSingleContextValue | undefined>;
|
|
1133
1183
|
type SelectSingleProviderProps = {
|
|
1134
1184
|
initialProps: DayPickerBase;
|
|
1135
|
-
children: React.ReactNode;
|
|
1185
|
+
children: React$1.ReactNode;
|
|
1136
1186
|
};
|
|
1137
1187
|
/** Provides the values for the {@link SelectSingleProvider}. */
|
|
1138
1188
|
declare function SelectSingleProvider(props: SelectSingleProviderProps): JSX.Element;
|
|
1139
1189
|
type SelectSingleProviderInternal = {
|
|
1140
1190
|
initialProps: DayPickerSingleProps;
|
|
1141
|
-
children: React.ReactNode;
|
|
1191
|
+
children: React$1.ReactNode;
|
|
1142
1192
|
};
|
|
1143
1193
|
declare function SelectSingleProviderInternal({ initialProps, children }: SelectSingleProviderInternal): JSX.Element;
|
|
1144
1194
|
/**
|
|
@@ -1147,6 +1197,7 @@ declare function SelectSingleProviderInternal({ initialProps, children }: Select
|
|
|
1147
1197
|
* This hook is meant to be used inside internal or custom components.
|
|
1148
1198
|
*/
|
|
1149
1199
|
declare function useSelectSingle(): SelectSingleContextValue;
|
|
1200
|
+
|
|
1150
1201
|
/**
|
|
1151
1202
|
* Returns whether a day matches against at least one of the given Matchers.
|
|
1152
1203
|
*
|
|
@@ -1165,6 +1216,7 @@ declare function useSelectSingle(): SelectSingleContextValue;
|
|
|
1165
1216
|
* ```
|
|
1166
1217
|
* */
|
|
1167
1218
|
declare function isMatch(day: Date, matchers: Matcher[]): boolean;
|
|
1219
|
+
|
|
1168
1220
|
/**
|
|
1169
1221
|
* Add a day to an existing range.
|
|
1170
1222
|
*
|
|
@@ -1172,4 +1224,5 @@ declare function isMatch(day: Date, matchers: Matcher[]): boolean;
|
|
|
1172
1224
|
* day is already present in the range.
|
|
1173
1225
|
*/
|
|
1174
1226
|
declare function addToRange(day: Date, range?: DateRange): DateRange | undefined;
|
|
1175
|
-
|
|
1227
|
+
|
|
1228
|
+
export { ActiveModifiers, Button, ButtonProps, Caption, CaptionDropdowns, CaptionLabel, CaptionLabelProps, CaptionLayout, CaptionNavigation, CaptionProps, ClassNames, CustomComponents, CustomModifiers, DateAfter, DateBefore, DateFormatter, DateInterval, DateRange, Day, DayClickEventHandler, DayContent, DayContentProps, DayFocusEventHandler, DayKeyboardEventHandler, DayLabel, DayModifiers, DayMouseEventHandler, DayOfWeek, DayPicker, DayPickerBase, DayPickerContext, DayPickerContextValue, DayPickerDefaultProps, DayPickerMultipleProps, DayPickerProps, DayPickerProvider, DayPickerProviderProps, DayPickerRangeProps, DayPickerSingleProps, DayPointerEventHandler, DayProps, DayRender, DaySelectionMode, DayTouchEventHandler, Dropdown, DropdownProps, FocusContext, FocusContextValue, FocusProvider, Footer, Formatters, Head, HeadRow, IconDropdown, IconLeft, IconRight, InputDayPickerProps, InputHTMLAttributes, InternalModifier, InternalModifiers, InternalModifiersElement, Labels, Matcher, Modifier, Modifiers, ModifiersClassNames, ModifiersStyles, MonthChangeEventHandler, NavButtonLabel, NavigationContext, NavigationContextValue, NavigationProvider, RootContext, RootProvider, Row, RowProps, SelectMultipleContext, SelectMultipleContextValue, SelectMultipleEventHandler, SelectMultipleModifiers, SelectMultipleProvider, SelectMultipleProviderInternal, SelectMultipleProviderProps, SelectRangeContext, SelectRangeContextValue, SelectRangeEventHandler, SelectRangeModifiers, SelectRangeProvider, SelectRangeProviderInternal, SelectSingleContext, SelectSingleContextValue, SelectSingleEventHandler, SelectSingleProvider, SelectSingleProviderInternal, StyledComponent, StyledElement, Styles, UseInputOptions, UseInputValue, WeekNumber, WeekNumberClickEventHandler, WeekNumberFormatter, WeekNumberLabel, WeekNumberProps, WeekdayLabel, addToRange, isDateAfterType, isDateBeforeType, isDateInterval, isDateRange, isDayOfWeekType, isDayPickerDefault, isDayPickerMultiple, isDayPickerRange, isDayPickerSingle, isMatch, useActiveModifiers, useDayPicker, useDayRender, useFocusContext, useInput, useNavigation, useSelectMultiple, useSelectRange, useSelectSingle };
|