@fluentui/react-datepicker-compat 0.0.0-beta.1

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.
Files changed (263) hide show
  1. package/.swcrc +30 -0
  2. package/CHANGELOG.json +56 -0
  3. package/CHANGELOG.md +19 -0
  4. package/LICENSE +15 -0
  5. package/README.md +42 -0
  6. package/dist/index.d.ts +1156 -0
  7. package/lib/Calendar.js +2 -0
  8. package/lib/Calendar.js.map +1 -0
  9. package/lib/CalendarDay.js +2 -0
  10. package/lib/CalendarDay.js.map +1 -0
  11. package/lib/CalendarDayGrid.js +2 -0
  12. package/lib/CalendarDayGrid.js.map +1 -0
  13. package/lib/CalendarMonth.js +2 -0
  14. package/lib/CalendarMonth.js.map +1 -0
  15. package/lib/CalendarPicker.js +2 -0
  16. package/lib/CalendarPicker.js.map +1 -0
  17. package/lib/CalendarYear.js +2 -0
  18. package/lib/CalendarYear.js.map +1 -0
  19. package/lib/DatePicker.js +2 -0
  20. package/lib/DatePicker.js.map +1 -0
  21. package/lib/components/Calendar/Calendar.js +319 -0
  22. package/lib/components/Calendar/Calendar.js.map +1 -0
  23. package/lib/components/Calendar/Calendar.types.js +15 -0
  24. package/lib/components/Calendar/Calendar.types.js.map +1 -0
  25. package/lib/components/Calendar/defaults.js +3 -0
  26. package/lib/components/Calendar/defaults.js.map +1 -0
  27. package/lib/components/Calendar/index.js +5 -0
  28. package/lib/components/Calendar/index.js.map +1 -0
  29. package/lib/components/Calendar/useCalendarStyles.js +149 -0
  30. package/lib/components/Calendar/useCalendarStyles.js.map +1 -0
  31. package/lib/components/CalendarDay/CalendarDay.js +143 -0
  32. package/lib/components/CalendarDay/CalendarDay.js.map +1 -0
  33. package/lib/components/CalendarDay/CalendarDay.types.js +2 -0
  34. package/lib/components/CalendarDay/CalendarDay.types.js.map +1 -0
  35. package/lib/components/CalendarDay/index.js +4 -0
  36. package/lib/components/CalendarDay/index.js.map +1 -0
  37. package/lib/components/CalendarDay/useCalendarDayStyles.js +180 -0
  38. package/lib/components/CalendarDay/useCalendarDayStyles.js.map +1 -0
  39. package/lib/components/CalendarDayGrid/CalendarDayGrid.js +183 -0
  40. package/lib/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -0
  41. package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js +2 -0
  42. package/lib/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -0
  43. package/lib/components/CalendarDayGrid/CalendarGridDayCell.js +193 -0
  44. package/lib/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -0
  45. package/lib/components/CalendarDayGrid/CalendarGridRow.js +40 -0
  46. package/lib/components/CalendarDayGrid/CalendarGridRow.js.map +1 -0
  47. package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js +46 -0
  48. package/lib/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -0
  49. package/lib/components/CalendarDayGrid/index.js +5 -0
  50. package/lib/components/CalendarDayGrid/index.js.map +1 -0
  51. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.js +443 -0
  52. package/lib/components/CalendarDayGrid/useCalendarDayGridStyles.js.map +1 -0
  53. package/lib/components/CalendarDayGrid/useWeekCornerStyles.js +98 -0
  54. package/lib/components/CalendarDayGrid/useWeekCornerStyles.js.map +1 -0
  55. package/lib/components/CalendarDayGrid/useWeeks.js +47 -0
  56. package/lib/components/CalendarDayGrid/useWeeks.js.map +1 -0
  57. package/lib/components/CalendarMonth/CalendarMonth.js +282 -0
  58. package/lib/components/CalendarMonth/CalendarMonth.js.map +1 -0
  59. package/lib/components/CalendarMonth/CalendarMonth.types.js +2 -0
  60. package/lib/components/CalendarMonth/CalendarMonth.types.js.map +1 -0
  61. package/lib/components/CalendarMonth/index.js +4 -0
  62. package/lib/components/CalendarMonth/index.js.map +1 -0
  63. package/lib/components/CalendarMonth/useCalendarMonthStyles.js +10 -0
  64. package/lib/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -0
  65. package/lib/components/CalendarPicker/CalendarPicker.types.js +2 -0
  66. package/lib/components/CalendarPicker/CalendarPicker.types.js.map +1 -0
  67. package/lib/components/CalendarPicker/index.js +3 -0
  68. package/lib/components/CalendarPicker/index.js.map +1 -0
  69. package/lib/components/CalendarPicker/useCalendarPickerStyles.js +371 -0
  70. package/lib/components/CalendarPicker/useCalendarPickerStyles.js.map +1 -0
  71. package/lib/components/CalendarYear/CalendarYear.js +350 -0
  72. package/lib/components/CalendarYear/CalendarYear.js.map +1 -0
  73. package/lib/components/CalendarYear/CalendarYear.types.js +2 -0
  74. package/lib/components/CalendarYear/CalendarYear.types.js.map +1 -0
  75. package/lib/components/CalendarYear/index.js +4 -0
  76. package/lib/components/CalendarYear/index.js.map +1 -0
  77. package/lib/components/CalendarYear/useCalendarYearStyles.js +10 -0
  78. package/lib/components/CalendarYear/useCalendarYearStyles.js.map +1 -0
  79. package/lib/components/DatePicker/DatePicker.js +11 -0
  80. package/lib/components/DatePicker/DatePicker.js.map +1 -0
  81. package/lib/components/DatePicker/DatePicker.types.js +2 -0
  82. package/lib/components/DatePicker/DatePicker.types.js.map +1 -0
  83. package/lib/components/DatePicker/defaults.js +13 -0
  84. package/lib/components/DatePicker/defaults.js.map +1 -0
  85. package/lib/components/DatePicker/index.js +7 -0
  86. package/lib/components/DatePicker/index.js.map +1 -0
  87. package/lib/components/DatePicker/renderDatePicker.js +35 -0
  88. package/lib/components/DatePicker/renderDatePicker.js.map +1 -0
  89. package/lib/components/DatePicker/useDatePicker.js +453 -0
  90. package/lib/components/DatePicker/useDatePicker.js.map +1 -0
  91. package/lib/components/DatePicker/useDatePickerStyles.js +62 -0
  92. package/lib/components/DatePicker/useDatePickerStyles.js.map +1 -0
  93. package/lib/index.js +4 -0
  94. package/lib/index.js.map +1 -0
  95. package/lib/utils/animations.js +98 -0
  96. package/lib/utils/animations.js.map +1 -0
  97. package/lib/utils/constants.js +64 -0
  98. package/lib/utils/constants.js.map +1 -0
  99. package/lib/utils/dateFormatting/dateFormatting.defaults.js +58 -0
  100. package/lib/utils/dateFormatting/dateFormatting.defaults.js.map +1 -0
  101. package/lib/utils/dateFormatting/dateFormatting.types.js +2 -0
  102. package/lib/utils/dateFormatting/dateFormatting.types.js.map +1 -0
  103. package/lib/utils/dateFormatting/index.js +3 -0
  104. package/lib/utils/dateFormatting/index.js.map +1 -0
  105. package/lib/utils/dateGrid/dateGrid.types.js +2 -0
  106. package/lib/utils/dateGrid/dateGrid.types.js.map +1 -0
  107. package/lib/utils/dateGrid/findAvailableDate.js +29 -0
  108. package/lib/utils/dateGrid/findAvailableDate.js.map +1 -0
  109. package/lib/utils/dateGrid/getBoundedDateRange.js +18 -0
  110. package/lib/utils/dateGrid/getBoundedDateRange.js.map +1 -0
  111. package/lib/utils/dateGrid/getDateRangeTypeToUse.js +18 -0
  112. package/lib/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -0
  113. package/lib/utils/dateGrid/getDayGrid.js +85 -0
  114. package/lib/utils/dateGrid/getDayGrid.js.map +1 -0
  115. package/lib/utils/dateGrid/index.js +6 -0
  116. package/lib/utils/dateGrid/index.js.map +1 -0
  117. package/lib/utils/dateGrid/isAfterMaxDate.js +13 -0
  118. package/lib/utils/dateGrid/isAfterMaxDate.js.map +1 -0
  119. package/lib/utils/dateGrid/isBeforeMinDate.js +13 -0
  120. package/lib/utils/dateGrid/isBeforeMinDate.js.map +1 -0
  121. package/lib/utils/dateGrid/isContiguous.js +19 -0
  122. package/lib/utils/dateGrid/isContiguous.js.map +1 -0
  123. package/lib/utils/dateGrid/isRestrictedDate.js +21 -0
  124. package/lib/utils/dateGrid/isRestrictedDate.js.map +1 -0
  125. package/lib/utils/dateMath/dateMath.js +358 -0
  126. package/lib/utils/dateMath/dateMath.js.map +1 -0
  127. package/lib/utils/dateMath/index.js +2 -0
  128. package/lib/utils/dateMath/index.js.map +1 -0
  129. package/lib/utils/dom.js +9 -0
  130. package/lib/utils/dom.js.map +1 -0
  131. package/lib/utils/focus.js +28 -0
  132. package/lib/utils/focus.js.map +1 -0
  133. package/lib/utils/index.js +8 -0
  134. package/lib/utils/index.js.map +1 -0
  135. package/lib-commonjs/Calendar.js +9 -0
  136. package/lib-commonjs/Calendar.js.map +1 -0
  137. package/lib-commonjs/CalendarDay.js +9 -0
  138. package/lib-commonjs/CalendarDay.js.map +1 -0
  139. package/lib-commonjs/CalendarDayGrid.js +9 -0
  140. package/lib-commonjs/CalendarDayGrid.js.map +1 -0
  141. package/lib-commonjs/CalendarMonth.js +9 -0
  142. package/lib-commonjs/CalendarMonth.js.map +1 -0
  143. package/lib-commonjs/CalendarPicker.js +9 -0
  144. package/lib-commonjs/CalendarPicker.js.map +1 -0
  145. package/lib-commonjs/CalendarYear.js +9 -0
  146. package/lib-commonjs/CalendarYear.js.map +1 -0
  147. package/lib-commonjs/DatePicker.js +9 -0
  148. package/lib-commonjs/DatePicker.js.map +1 -0
  149. package/lib-commonjs/components/Calendar/Calendar.js +306 -0
  150. package/lib-commonjs/components/Calendar/Calendar.js.map +1 -0
  151. package/lib-commonjs/components/Calendar/Calendar.types.js +21 -0
  152. package/lib-commonjs/components/Calendar/Calendar.types.js.map +1 -0
  153. package/lib-commonjs/components/Calendar/defaults.js +12 -0
  154. package/lib-commonjs/components/Calendar/defaults.js.map +1 -0
  155. package/lib-commonjs/components/Calendar/index.js +16 -0
  156. package/lib-commonjs/components/Calendar/index.js.map +1 -0
  157. package/lib-commonjs/components/Calendar/useCalendarStyles.js +286 -0
  158. package/lib-commonjs/components/Calendar/useCalendarStyles.js.map +1 -0
  159. package/lib-commonjs/components/CalendarDay/CalendarDay.js +124 -0
  160. package/lib-commonjs/components/CalendarDay/CalendarDay.js.map +1 -0
  161. package/lib-commonjs/components/CalendarDay/CalendarDay.types.js +9 -0
  162. package/lib-commonjs/components/CalendarDay/CalendarDay.types.js.map +1 -0
  163. package/lib-commonjs/components/CalendarDay/index.js +11 -0
  164. package/lib-commonjs/components/CalendarDay/index.js.map +1 -0
  165. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.js +356 -0
  166. package/lib-commonjs/components/CalendarDay/useCalendarDayStyles.js.map +1 -0
  167. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js +181 -0
  168. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.js.map +1 -0
  169. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js +9 -0
  170. package/lib-commonjs/components/CalendarDayGrid/CalendarDayGrid.types.js.map +1 -0
  171. package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js +173 -0
  172. package/lib-commonjs/components/CalendarDayGrid/CalendarGridDayCell.js.map +1 -0
  173. package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js +35 -0
  174. package/lib-commonjs/components/CalendarDayGrid/CalendarGridRow.js.map +1 -0
  175. package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js +45 -0
  176. package/lib-commonjs/components/CalendarDayGrid/CalendarMonthHeaderRow.js.map +1 -0
  177. package/lib-commonjs/components/CalendarDayGrid/index.js +21 -0
  178. package/lib-commonjs/components/CalendarDayGrid/index.js.map +1 -0
  179. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.js +916 -0
  180. package/lib-commonjs/components/CalendarDayGrid/useCalendarDayGridStyles.js.map +1 -0
  181. package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.js +103 -0
  182. package/lib-commonjs/components/CalendarDayGrid/useWeekCornerStyles.js.map +1 -0
  183. package/lib-commonjs/components/CalendarDayGrid/useWeeks.js +54 -0
  184. package/lib-commonjs/components/CalendarDayGrid/useWeeks.js.map +1 -0
  185. package/lib-commonjs/components/CalendarMonth/CalendarMonth.js +271 -0
  186. package/lib-commonjs/components/CalendarMonth/CalendarMonth.js.map +1 -0
  187. package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js +9 -0
  188. package/lib-commonjs/components/CalendarMonth/CalendarMonth.types.js.map +1 -0
  189. package/lib-commonjs/components/CalendarMonth/index.js +11 -0
  190. package/lib-commonjs/components/CalendarMonth/index.js.map +1 -0
  191. package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js +14 -0
  192. package/lib-commonjs/components/CalendarMonth/useCalendarMonthStyles.js.map +1 -0
  193. package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js +7 -0
  194. package/lib-commonjs/components/CalendarPicker/CalendarPicker.types.js.map +1 -0
  195. package/lib-commonjs/components/CalendarPicker/index.js +10 -0
  196. package/lib-commonjs/components/CalendarPicker/index.js.map +1 -0
  197. package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.js +746 -0
  198. package/lib-commonjs/components/CalendarPicker/useCalendarPickerStyles.js.map +1 -0
  199. package/lib-commonjs/components/CalendarYear/CalendarYear.js +307 -0
  200. package/lib-commonjs/components/CalendarYear/CalendarYear.js.map +1 -0
  201. package/lib-commonjs/components/CalendarYear/CalendarYear.types.js +9 -0
  202. package/lib-commonjs/components/CalendarYear/CalendarYear.types.js.map +1 -0
  203. package/lib-commonjs/components/CalendarYear/index.js +11 -0
  204. package/lib-commonjs/components/CalendarYear/index.js.map +1 -0
  205. package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.js +14 -0
  206. package/lib-commonjs/components/CalendarYear/useCalendarYearStyles.js.map +1 -0
  207. package/lib-commonjs/components/DatePicker/DatePicker.js +21 -0
  208. package/lib-commonjs/components/DatePicker/DatePicker.js.map +1 -0
  209. package/lib-commonjs/components/DatePicker/DatePicker.types.js +9 -0
  210. package/lib-commonjs/components/DatePicker/DatePicker.types.js.map +1 -0
  211. package/lib-commonjs/components/DatePicker/defaults.js +22 -0
  212. package/lib-commonjs/components/DatePicker/defaults.js.map +1 -0
  213. package/lib-commonjs/components/DatePicker/index.js +14 -0
  214. package/lib-commonjs/components/DatePicker/index.js.map +1 -0
  215. package/lib-commonjs/components/DatePicker/renderDatePicker.js +33 -0
  216. package/lib-commonjs/components/DatePicker/renderDatePicker.js.map +1 -0
  217. package/lib-commonjs/components/DatePicker/useDatePicker.js +486 -0
  218. package/lib-commonjs/components/DatePicker/useDatePicker.js.map +1 -0
  219. package/lib-commonjs/components/DatePicker/useDatePickerStyles.js +100 -0
  220. package/lib-commonjs/components/DatePicker/useDatePickerStyles.js.map +1 -0
  221. package/lib-commonjs/index.js +50 -0
  222. package/lib-commonjs/index.js.map +1 -0
  223. package/lib-commonjs/utils/animations.js +126 -0
  224. package/lib-commonjs/utils/animations.js.map +1 -0
  225. package/lib-commonjs/utils/constants.js +82 -0
  226. package/lib-commonjs/utils/constants.js.map +1 -0
  227. package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js +102 -0
  228. package/lib-commonjs/utils/dateFormatting/dateFormatting.defaults.js.map +1 -0
  229. package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js +7 -0
  230. package/lib-commonjs/utils/dateFormatting/dateFormatting.types.js.map +1 -0
  231. package/lib-commonjs/utils/dateFormatting/index.js +10 -0
  232. package/lib-commonjs/utils/dateFormatting/index.js.map +1 -0
  233. package/lib-commonjs/utils/dateGrid/dateGrid.types.js +7 -0
  234. package/lib-commonjs/utils/dateGrid/dateGrid.types.js.map +1 -0
  235. package/lib-commonjs/utils/dateGrid/findAvailableDate.js +29 -0
  236. package/lib-commonjs/utils/dateGrid/findAvailableDate.js.map +1 -0
  237. package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js +23 -0
  238. package/lib-commonjs/utils/dateGrid/getBoundedDateRange.js.map +1 -0
  239. package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js +20 -0
  240. package/lib-commonjs/utils/dateGrid/getDateRangeTypeToUse.js.map +1 -0
  241. package/lib-commonjs/utils/dateGrid/getDayGrid.js +76 -0
  242. package/lib-commonjs/utils/dateGrid/getDayGrid.js.map +1 -0
  243. package/lib-commonjs/utils/dateGrid/index.js +13 -0
  244. package/lib-commonjs/utils/dateGrid/index.js.map +1 -0
  245. package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js +15 -0
  246. package/lib-commonjs/utils/dateGrid/isAfterMaxDate.js.map +1 -0
  247. package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js +15 -0
  248. package/lib-commonjs/utils/dateGrid/isBeforeMinDate.js.map +1 -0
  249. package/lib-commonjs/utils/dateGrid/isContiguous.js +28 -0
  250. package/lib-commonjs/utils/dateGrid/isContiguous.js.map +1 -0
  251. package/lib-commonjs/utils/dateGrid/isRestrictedDate.js +21 -0
  252. package/lib-commonjs/utils/dateGrid/isRestrictedDate.js.map +1 -0
  253. package/lib-commonjs/utils/dateMath/dateMath.js +274 -0
  254. package/lib-commonjs/utils/dateMath/dateMath.js.map +1 -0
  255. package/lib-commonjs/utils/dateMath/index.js +9 -0
  256. package/lib-commonjs/utils/dateMath/index.js.map +1 -0
  257. package/lib-commonjs/utils/dom.js +18 -0
  258. package/lib-commonjs/utils/dom.js.map +1 -0
  259. package/lib-commonjs/utils/focus.js +31 -0
  260. package/lib-commonjs/utils/focus.js.map +1 -0
  261. package/lib-commonjs/utils/index.js +15 -0
  262. package/lib-commonjs/utils/index.js.map +1 -0
  263. package/package.json +72 -0
@@ -0,0 +1,1156 @@
1
+ /// <reference types="react" />
2
+
3
+ import type { ComponentProps } from '@fluentui/react-utilities';
4
+ import type { ComponentState } from '@fluentui/react-utilities';
5
+ import { Field } from '@fluentui/react-field';
6
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
7
+ import { Input } from '@fluentui/react-input';
8
+ import type { PopoverProps } from '@fluentui/react-popover';
9
+ import { PopoverSurface } from '@fluentui/react-popover';
10
+ import * as React_2 from 'react';
11
+ import type { Slot } from '@fluentui/react-utilities';
12
+ import type { SlotClassNames } from '@fluentui/react-utilities';
13
+
14
+ /**
15
+ * Returns a date offset from the given date by the specified number of days.
16
+ * @param date - The origin date
17
+ * @param days - The number of days to offset. 'days' can be negative.
18
+ * @returns A new Date object offset from the origin date by the given number of days
19
+ */
20
+ export declare function addDays(date: Date, days: number): Date;
21
+
22
+ /**
23
+ * Returns a date offset from the given date by the specified number of months.
24
+ * The method tries to preserve the day-of-month; however, if the new month does not have enough days
25
+ * to contain the original day-of-month, we'll use the last day of the new month.
26
+ * @param date - The origin date
27
+ * @param months - The number of months to offset. 'months' can be negative.
28
+ * @returns A new Date object offset from the origin date by the given number of months
29
+ */
30
+ export declare function addMonths(date: Date, months: number): Date;
31
+
32
+ /**
33
+ * Returns a date offset from the given date by the specified number of weeks.
34
+ * @param date - The origin date
35
+ * @param weeks - The number of weeks to offset. 'weeks' can be negative.
36
+ * @returns A new Date object offset from the origin date by the given number of weeks
37
+ */
38
+ export declare function addWeeks(date: Date, weeks: number): Date;
39
+
40
+ /**
41
+ * Returns a date offset from the given date by the specified number of years.
42
+ * The method tries to preserve the day-of-month; however, if the new month does not have enough days
43
+ * to contain the original day-of-month, we'll use the last day of the new month.
44
+ * @param date - The origin date
45
+ * @param years - The number of years to offset. 'years' can be negative.
46
+ * @returns A new Date object offset from the origin date by the given number of years
47
+ */
48
+ export declare function addYears(date: Date, years: number): Date;
49
+
50
+ export declare enum AnimationDirection {
51
+ /**
52
+ * Grid will transition out and in horizontally
53
+ */
54
+ Horizontal = 0,
55
+ /**
56
+ * Grid will transition out and in vertically
57
+ */
58
+ Vertical = 1
59
+ }
60
+
61
+ /**
62
+ * @internal
63
+ */
64
+ declare interface CalendarDayGridProps extends DayGridOptions {
65
+ /**
66
+ * Optional callback to access the ICalendarDayGrid interface. Use this instead of ref for accessing
67
+ * the public methods and properties of the component.
68
+ */
69
+ componentRef?: React_2.RefObject<ICalendarDayGrid>;
70
+ /**
71
+ * Additional CSS class(es) to apply to the CalendarDayGrid.
72
+ */
73
+ className?: string;
74
+ /**
75
+ * Localized strings to use in the CalendarDayGrid
76
+ */
77
+ strings: CalendarStrings;
78
+ /**
79
+ * The currently selected date
80
+ */
81
+ selectedDate: Date;
82
+ /**
83
+ * The currently navigated date
84
+ */
85
+ navigatedDate: Date;
86
+ /**
87
+ * Callback issued when a date is selected
88
+ * @param date - The date the user selected
89
+ * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set
90
+ * for the component.
91
+ */
92
+ onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;
93
+ /**
94
+ * Callback issued when a date in the calendar is navigated
95
+ * @param date - The date that is navigated to
96
+ * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.
97
+ */
98
+ onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;
99
+ /**
100
+ * Callback issued when calendar day is closed
101
+ */
102
+ onDismiss?: () => void;
103
+ /**
104
+ * The first day of the week for your locale.
105
+ * @default DayOfWeek.Sunday
106
+ */
107
+ firstDayOfWeek: DayOfWeek;
108
+ /**
109
+ * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,
110
+ * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values
111
+ * @default FirstWeekOfYear.FirstDay
112
+ */
113
+ firstWeekOfYear: FirstWeekOfYear;
114
+ /**
115
+ * The date range type indicating how many days should be selected as the user
116
+ * selects days
117
+ * @default DateRangeType.Day
118
+ */
119
+ dateRangeType: DateRangeType;
120
+ /**
121
+ * The number of days to select while dateRangeType === DateRangeType.Day. Used in order to have multi-day
122
+ * views.
123
+ * @default 1
124
+ */
125
+ daysToSelectInDayView?: number;
126
+ /**
127
+ * Value of today. If unspecified, current time in client machine will be used.
128
+ */
129
+ today?: Date;
130
+ /**
131
+ * Whether the calendar should show the week number (weeks 1 to 53) before each week row
132
+ * @default false
133
+ */
134
+ showWeekNumbers?: boolean;
135
+ /**
136
+ * Apply additional formatting to dates, for example localized date formatting.
137
+ */
138
+ dateTimeFormatter: DateFormatting;
139
+ /**
140
+ * Ref callback for individual days. Allows for customization of the styling, properties, or listeners of the
141
+ * specific day.
142
+ */
143
+ customDayCellRef?: (element: HTMLElement, date: Date, classNames: CalendarDayGridStyles) => void;
144
+ /**
145
+ * How many weeks to show by default. If not provided, will show enough weeks to display the current
146
+ * month, between 4 and 6 depending
147
+ * @default undefined
148
+ */
149
+ weeksToShow?: number;
150
+ /**
151
+ * If set the Calendar will not allow navigation to or selection of a date earlier than this value.
152
+ */
153
+ minDate?: Date;
154
+ /**
155
+ * If set the Calendar will not allow navigation to or selection of a date later than this value.
156
+ */
157
+ maxDate?: Date;
158
+ /**
159
+ * If set the Calendar will not allow selection of dates in this array.
160
+ */
161
+ restrictedDates?: Date[];
162
+ /**
163
+ * The days that are selectable when `dateRangeType` is WorkWeek.
164
+ * If `dateRangeType` is not WorkWeek this property does nothing.
165
+ * @default [Monday,Tuesday,Wednesday,Thursday,Friday]
166
+ */
167
+ workWeekDays?: DayOfWeek[];
168
+ /**
169
+ * Whether the close button should be shown or not
170
+ * @default false
171
+ */
172
+ showCloseButton?: boolean;
173
+ /**
174
+ * Allows all dates and buttons to be focused, including disabled ones
175
+ * @default false
176
+ */
177
+ allFocusable?: boolean;
178
+ /**
179
+ * The ID of the control that labels this one
180
+ */
181
+ labelledBy?: string;
182
+ /**
183
+ * Whether to show days outside the selected month with lighter styles
184
+ * @default true
185
+ */
186
+ lightenDaysOutsideNavigatedMonth?: boolean;
187
+ /**
188
+ * The cardinal directions for animation to occur during transitions, either horizontal or veritcal
189
+ */
190
+ animationDirection?: AnimationDirection;
191
+ /**
192
+ * Optional callback function to mark specific days with a small symbol. Fires when the date range changes,
193
+ * gives the starting and ending displayed dates and expects the list of which days in between should be
194
+ * marked.
195
+ */
196
+ getMarkedDays?: (startingDate: Date, endingDate: Date) => Date[];
197
+ }
198
+
199
+ /**
200
+ * @internal
201
+ */
202
+ declare interface CalendarDayGridStyles {
203
+ /**
204
+ * The style for the root div
205
+ */
206
+ wrapper?: string;
207
+ /**
208
+ * The style for the table containing the grid
209
+ */
210
+ table?: string;
211
+ /**
212
+ * The style to apply to the grid cells for days
213
+ */
214
+ dayCell?: string;
215
+ /**
216
+ * The style to apply to grid cells for days in the selected range
217
+ */
218
+ daySelected?: string;
219
+ /**
220
+ * The style to apply to row around weeks
221
+ */
222
+ weekRow?: string;
223
+ /**
224
+ * The style to apply to the column headers above the weeks
225
+ */
226
+ weekDayLabelCell?: string;
227
+ /**
228
+ * The style to apply to grid cells for week numbers
229
+ */
230
+ weekNumberCell?: string;
231
+ /**
232
+ * The style to apply to individual days that are outside the min/max date range
233
+ */
234
+ dayOutsideBounds?: string;
235
+ /**
236
+ * The style to apply to individual days that are outside the current month
237
+ */
238
+ dayOutsideNavigatedMonth?: string;
239
+ /**
240
+ * The style to apply to the button element within the day cells
241
+ */
242
+ dayButton?: string;
243
+ /**
244
+ * The style to apply to the individual button element that matches the "today" parameter
245
+ */
246
+ dayIsToday?: string;
247
+ /**
248
+ * The style applied to the first placeholder week used during transitions
249
+ */
250
+ firstTransitionWeek?: string;
251
+ /**
252
+ * The style applied to the last placeholder week used during transitions
253
+ */
254
+ lastTransitionWeek?: string;
255
+ /**
256
+ * The style applied to the marker on days to mark as important
257
+ */
258
+ dayMarker?: string;
259
+ }
260
+
261
+ export declare interface CalendarDayProps extends CalendarDayGridProps {
262
+ /**
263
+ * Optional callback to access the ICalendarDay interface. Use this instead of ref for accessing
264
+ * the public methods and properties of the component.
265
+ */
266
+ componentRef?: React_2.RefObject<ICalendarDay>;
267
+ /**
268
+ * Additional CSS class(es) to apply to the CalendarDay.
269
+ */
270
+ className?: string;
271
+ /**
272
+ * Localized strings to use in the Calendar
273
+ */
274
+ strings: CalendarStrings;
275
+ /**
276
+ * The currently navigated date
277
+ */
278
+ navigatedDate: Date;
279
+ /**
280
+ * Callback issued when a date in the calendar is navigated
281
+ * @param date - The date that is navigated to
282
+ * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.
283
+ */
284
+ onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;
285
+ /**
286
+ * Callback issued when calendar day is closed
287
+ */
288
+ onDismiss?: () => void;
289
+ /**
290
+ * Callback function when the header is selected
291
+ */
292
+ onHeaderSelect?: () => void;
293
+ /**
294
+ * Whether the calendar should show the week number (weeks 1 to 53) before each week row
295
+ * @default false
296
+ */
297
+ showWeekNumbers?: boolean;
298
+ /**
299
+ * Apply additional formatting to dates, for example localized date formatting.
300
+ */
301
+ dateTimeFormatter: DateFormatting;
302
+ /**
303
+ * Whether the calendar should show 6 weeks by default.
304
+ * @default false
305
+ */
306
+ showSixWeeksByDefault?: boolean;
307
+ /**
308
+ * If set the Calendar will not allow navigation to or selection of a date earlier than this value.
309
+ */
310
+ minDate?: Date;
311
+ /**
312
+ * If set the Calendar will not allow navigation to or selection of a date later than this value.
313
+ */
314
+ maxDate?: Date;
315
+ /**
316
+ * If set the Calendar will not allow selection of dates in this array.
317
+ */
318
+ restrictedDates?: Date[];
319
+ /**
320
+ * Whether the close button should be shown or not
321
+ * @default false
322
+ */
323
+ showCloseButton?: boolean;
324
+ /**
325
+ * Allows all dates and buttons to be focused, including disabled ones
326
+ * @default false
327
+ */
328
+ allFocusable?: boolean;
329
+ }
330
+
331
+ export declare interface CalendarMonthProps {
332
+ /**
333
+ * Optional callback to access the ICalendarMonth interface. Use this instead of ref for accessing
334
+ * the public methods and properties of the component.
335
+ */
336
+ componentRef?: React_2.RefObject<ICalendarMonth>;
337
+ /**
338
+ * Localized strings to use in the Calendar
339
+ */
340
+ strings: CalendarStrings;
341
+ /**
342
+ * The currently selected date
343
+ */
344
+ selectedDate: Date;
345
+ /**
346
+ * The currently navigated date
347
+ */
348
+ navigatedDate: Date;
349
+ /**
350
+ * Callback issued when a month is selected
351
+ * @param date - The date the user selected
352
+ * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set
353
+ * for the component.
354
+ */
355
+ onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;
356
+ /**
357
+ * Callback issued when the year is navigated
358
+ * @param date - The date that is navigated to
359
+ * @param focusOnNavigatedDay - Whether to set the focus to the navigated date.
360
+ */
361
+ onNavigateDate: (date: Date, focusOnNavigatedDay: boolean) => void;
362
+ /**
363
+ * Value of today. If unspecified, current time in client machine will be used.
364
+ */
365
+ today?: Date;
366
+ /**
367
+ * Callback function when the header is selected
368
+ */
369
+ onHeaderSelect?: () => void;
370
+ /**
371
+ * Apply additional formatting to dates, for example localized date formatting.
372
+ */
373
+ dateTimeFormatter?: DateFormatting;
374
+ /**
375
+ * If set the Calendar will not allow navigation to or selection of a date earlier than this value.
376
+ */
377
+ minDate?: Date;
378
+ /**
379
+ * If set the Calendar will not allow navigation to or selection of a date later than this value.
380
+ */
381
+ maxDate?: Date;
382
+ /**
383
+ * Whether the month picker should highlight the current month
384
+ * @default false
385
+ */
386
+ highlightCurrentMonth?: boolean;
387
+ /**
388
+ * Whether the month picker should highlight the selected month
389
+ * @default false
390
+ */
391
+ highlightSelectedMonth?: boolean;
392
+ /**
393
+ * Allows all dates and buttons to be focused, including disabled ones
394
+ * @default false
395
+ */
396
+ allFocusable?: boolean;
397
+ /**
398
+ * Additional CSS class(es) to apply to the CalendarMonth.
399
+ */
400
+ className?: string;
401
+ /**
402
+ * Whether the year picker is hidden
403
+ * @default false
404
+ */
405
+ yearPickerHidden?: boolean;
406
+ /**
407
+ * The cardinal directions for animation to occur during transitions, either horizontal or veritcal
408
+ */
409
+ animationDirection?: AnimationDirection;
410
+ }
411
+
412
+ export declare interface CalendarProps extends React_2.RefAttributes<HTMLDivElement> {
413
+ /**
414
+ * Optional callback to access the ICalendar interface. Use this instead of ref for accessing
415
+ * the public methods and properties of the component.
416
+ */
417
+ componentRef?: React_2.RefObject<ICalendar>;
418
+ /**
419
+ * Customized props for the calendar day
420
+ */
421
+ calendarDayProps?: Partial<CalendarDayProps>;
422
+ /**
423
+ * Customized props for the calendar month
424
+ */
425
+ calendarMonthProps?: Partial<CalendarMonthProps>;
426
+ /**
427
+ * Optional class name to add to the root element.
428
+ */
429
+ className?: string;
430
+ /**
431
+ * Callback for when a date is selected
432
+ * @param date - The date the user selected
433
+ * @param selectedDateRangeArray - The resultant list of dates that are selected based on the date range type set
434
+ * for the component.
435
+ */
436
+ onSelectDate?: (date: Date, selectedDateRangeArray?: Date[]) => void;
437
+ /**
438
+ * Callback for when calendar is closed
439
+ */
440
+ onDismiss?: () => void;
441
+ /**
442
+ * ID for the calendar
443
+ */
444
+ id?: string;
445
+ /**
446
+ * Default value of the Calendar, if any
447
+ */
448
+ value?: Date;
449
+ /**
450
+ * Value of today. If unspecified, current time in client machine will be used.
451
+ */
452
+ today?: Date;
453
+ /**
454
+ * The date range type indicating how many days should be selected as the user
455
+ * selects days
456
+ * @default DateRangeType.Day
457
+ */
458
+ dateRangeType?: DateRangeType;
459
+ /**
460
+ * The first day of the week for your locale.
461
+ * @default DayOfWeek.Sunday
462
+ */
463
+ firstDayOfWeek?: DayOfWeek;
464
+ /**
465
+ * Defines when the first week of the year should start.
466
+ * @default FirstWeekOfYear.FirstDay
467
+ */
468
+ firstWeekOfYear?: FirstWeekOfYear;
469
+ /**
470
+ * Whether the month picker is shown beside the day picker or hidden.
471
+ * @default true
472
+ */
473
+ isMonthPickerVisible?: boolean;
474
+ /**
475
+ * Whether the day picker is shown beside the month picker or hidden.
476
+ * @default true
477
+ */
478
+ isDayPickerVisible?: boolean;
479
+ /**
480
+ * Show month picker on top of date picker when visible.
481
+ * @default false
482
+ */
483
+ showMonthPickerAsOverlay?: boolean;
484
+ /**
485
+ * Whether the "Go to today" link should be shown or not
486
+ */
487
+ showGoToToday?: boolean;
488
+ /**
489
+ * Whether the calendar should show the week number (weeks 1 to 53) before each week row
490
+ * @default false
491
+ */
492
+ showWeekNumbers?: boolean;
493
+ /**
494
+ * Localized strings to use in the Calendar
495
+ */
496
+ strings?: CalendarStrings;
497
+ /**
498
+ * Apply additional formatting to dates, for example localized date formatting.
499
+ */
500
+ dateTimeFormatter?: DateFormatting;
501
+ /**
502
+ * If set the Calendar will not allow navigation to or selection of a date earlier than this value.
503
+ */
504
+ minDate?: Date;
505
+ /**
506
+ * If set the Calendar will not allow navigation to or selection of a date later than this value.
507
+ */
508
+ maxDate?: Date;
509
+ /**
510
+ * If set the Calendar will not allow selection of dates in this array.
511
+ */
512
+ restrictedDates?: Date[];
513
+ /**
514
+ * Whether the calendar should show 6 weeks by default.
515
+ * @default false
516
+ */
517
+ showSixWeeksByDefault?: boolean;
518
+ /**
519
+ * The days that are selectable when `dateRangeType` is `WorkWeek`.
520
+ * If `dateRangeType` is not `WorkWeek` this property does nothing.
521
+ * @default [Monday,Tuesday,Wednesday,Thursday,Friday]
522
+ */
523
+ workWeekDays?: DayOfWeek[];
524
+ /**
525
+ * Whether the month picker should highlight the current month
526
+ * @default false
527
+ */
528
+ highlightCurrentMonth?: boolean;
529
+ /**
530
+ * Whether the month picker should highlight the selected month
531
+ * @default false
532
+ */
533
+ highlightSelectedMonth?: boolean;
534
+ /**
535
+ * Whether the close button should be shown or not
536
+ * @default false
537
+ */
538
+ showCloseButton?: boolean;
539
+ /**
540
+ * Allows all dates and buttons to be focused, including disabled ones
541
+ * @default false
542
+ */
543
+ allFocusable?: boolean;
544
+ }
545
+
546
+ export declare interface CalendarStrings extends DateGridStrings {
547
+ /**
548
+ * String to render for button to direct the user to today's date.
549
+ */
550
+ goToToday: string;
551
+ /**
552
+ * Aria-label for the "previous month" button in day picker.
553
+ */
554
+ prevMonthAriaLabel?: string;
555
+ /**
556
+ * Aria-label for the "next month" button in day picker.
557
+ */
558
+ nextMonthAriaLabel?: string;
559
+ /**
560
+ * Aria-label for the "previous year" button in month picker.
561
+ */
562
+ prevYearAriaLabel?: string;
563
+ /**
564
+ * Aria-label for the "next year" button in month picker.
565
+ */
566
+ nextYearAriaLabel?: string;
567
+ /**
568
+ * Aria-label for the "previous year range" button in year picker.
569
+ */
570
+ prevYearRangeAriaLabel?: string;
571
+ /**
572
+ * Aria-label for the "next year range" button in year picker.
573
+ */
574
+ nextYearRangeAriaLabel?: string;
575
+ /**
576
+ * Aria-label format string for the header button in the month picker. Should have 1 string param, e.g. "`{0}`,
577
+ * select to change the year". This aria-label will only be applied if the year picker is enabled; otherwise
578
+ * the label will default to the header string, e.g. "2019".
579
+ */
580
+ monthPickerHeaderAriaLabel?: string;
581
+ /**
582
+ * Aria-label format string for the header button in the year picker.
583
+ * Should have 1 string param, e.g. "`{0}`, select to change the month"
584
+ */
585
+ yearPickerHeaderAriaLabel?: string;
586
+ /**
587
+ * Aria-label for the "close" button.
588
+ */
589
+ closeButtonAriaLabel?: string;
590
+ /**
591
+ * Aria-label format string for the week number header. Should have 1 string param, e.g. "week number `{0}`"
592
+ */
593
+ weekNumberFormatString?: string;
594
+ /**
595
+ * Aria-label format string for the currently selected date. Should have 1 string param, e.g. "Selected date `{0}`"
596
+ */
597
+ selectedDateFormatString?: string;
598
+ /**
599
+ * Aria-label format string for today's date. Should have 1 string param, e.g. "Today's date `{0}`"
600
+ */
601
+ todayDateFormatString?: string;
602
+ /**
603
+ * Aria-label for when a date is marked
604
+ */
605
+ dayMarkedAriaLabel?: string;
606
+ }
607
+
608
+ /**
609
+ * Compare the date parts of two dates
610
+ * @param date1 - The first date to compare
611
+ * @param date2 - The second date to compare
612
+ * @returns A negative value if date1 is earlier than date2, 0 if the dates are equal, or a positive value
613
+ * if date1 is later than date2.
614
+ */
615
+ export declare function compareDatePart(date1: Date, date2: Date): Number;
616
+
617
+ /**
618
+ * Compares two dates, and returns true if the two dates (not accounting for time-of-day) are equal.
619
+ * @returns True if the two dates represent the same date (regardless of time-of-day), false otherwise.
620
+ */
621
+ export declare function compareDates(date1: Date, date2: Date): boolean;
622
+
623
+ export declare interface DateFormatting {
624
+ /**
625
+ * Get a localized string for a day.
626
+ */
627
+ formatDay: (date: Date) => string;
628
+ /**
629
+ * Get a localized string for a month.
630
+ */
631
+ formatMonth: (date: Date, strings: DateGridStrings) => string;
632
+ /**
633
+ * Get a localized string for a year.
634
+ */
635
+ formatYear: (date: Date) => string;
636
+ /**
637
+ * Get a localized string for a month, day, and year.
638
+ */
639
+ formatMonthDayYear: (date: Date, strings: DateGridStrings) => string;
640
+ /**
641
+ * Get a localized string for a month and year.
642
+ */
643
+ formatMonthYear: (date: Date, strings: DateGridStrings) => string;
644
+ }
645
+
646
+ export declare interface DateGridStrings {
647
+ /**
648
+ * An array of strings for the full names of months.
649
+ * The array is 0-based, so months[0] should be the full name of January.
650
+ */
651
+ months: string[];
652
+ /**
653
+ * An array of strings for the short names of months.
654
+ * The array is 0-based, so shortMonths[0] should be the short name of January.
655
+ */
656
+ shortMonths: string[];
657
+ /**
658
+ * An array of strings for the full names of days of the week.
659
+ * The array is 0-based, so days[0] should be the full name of Sunday.
660
+ */
661
+ days: string[];
662
+ /**
663
+ * An array of strings for the initials of the days of the week.
664
+ * The array is 0-based, so days[0] should be the initial of Sunday.
665
+ */
666
+ shortDays: string[];
667
+ }
668
+
669
+ export declare const DatePicker: ForwardRefComponent<DatePickerProps>;
670
+
671
+ export declare const datePickerClassNames: SlotClassNames<DatePickerSlots>;
672
+
673
+ export declare type DatePickerProps = ComponentProps<Partial<DatePickerSlots>> & {
674
+ /**
675
+ * Optional callback to access the IDatePicker interface. Use this instead of ref for accessing
676
+ * the public methods and properties of the component.
677
+ */
678
+ componentRef?: React_2.RefObject<IDatePicker>;
679
+ /**
680
+ * Callback issued when a date is selected
681
+ */
682
+ onSelectDate?: (date: Date | null | undefined) => void;
683
+ /**
684
+ * Label for the DatePicker
685
+ */
686
+ label?: string;
687
+ /**
688
+ * Whether the DatePicker is a required field or not
689
+ * @default false
690
+ */
691
+ isRequired?: boolean;
692
+ /**
693
+ * Disabled state of the DatePicker.
694
+ * @default false
695
+ */
696
+ disabled?: boolean;
697
+ /**
698
+ * Whether or not the Input of the DatePicker is underlined.
699
+ * @default false
700
+ */
701
+ underlined?: boolean;
702
+ /**
703
+ * Whether the month picker is shown beside the day picker or hidden.
704
+ * @default true
705
+ */
706
+ isMonthPickerVisible?: boolean;
707
+ /**
708
+ * Show month picker on top of date picker when visible.
709
+ * @default false
710
+ */
711
+ showMonthPickerAsOverlay?: boolean;
712
+ /**
713
+ * Whether the DatePicker allows input a date string directly or not
714
+ * @default false
715
+ */
716
+ allowTextInput?: boolean;
717
+ /**
718
+ * Whether the DatePicker should open automatically when the control is focused
719
+ * WARNING: setting this to false creates an accessibility violation and is not recommended
720
+ * @default true
721
+ */
722
+ disableAutoFocus?: boolean;
723
+ /**
724
+ * Whether the DatePicker should open when the input is clicked
725
+ * @default true
726
+ */
727
+ openOnClick?: boolean;
728
+ /**
729
+ * Placeholder text for the DatePicker
730
+ */
731
+ placeholder?: string;
732
+ /**
733
+ * Value of today. If unspecified, current time in client machine will be used.
734
+ */
735
+ today?: Date;
736
+ /**
737
+ * Default value of the DatePicker, if any
738
+ */
739
+ value?: Date;
740
+ /**
741
+ * Optional method to format the chosen date to a string to display in the DatePicker
742
+ * @default date.toString()
743
+ */
744
+ formatDate?: (date?: Date) => string;
745
+ /**
746
+ * Optional method to parse the text input value to date, it is only useful when allowTextInput is set to true
747
+ * @default new Date(Date.parse(dateStr))
748
+ */
749
+ parseDateFromString?: (dateStr: string) => Date | null;
750
+ /**
751
+ * The first day of the week for your locale.
752
+ * @default DayOfWeek.Sunday
753
+ */
754
+ firstDayOfWeek?: DayOfWeek;
755
+ /**
756
+ * Localized strings to use in the DatePicker
757
+ */
758
+ strings?: DatePickerStrings;
759
+ /**
760
+ * Whether the month picker should highlight the current month
761
+ * @default false
762
+ */
763
+ highlightCurrentMonth?: boolean;
764
+ /**
765
+ * Whether the month picker should highlight the selected month
766
+ * @default false
767
+ */
768
+ highlightSelectedMonth?: boolean;
769
+ /**
770
+ * Whether the calendar should show the week number (weeks 1 to 53) before each week row
771
+ * @default false
772
+ */
773
+ showWeekNumbers?: boolean;
774
+ /**
775
+ * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,
776
+ * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values
777
+ * @default FirstWeekOfYear.FirstFullWeek
778
+ */
779
+ firstWeekOfYear?: FirstWeekOfYear;
780
+ /**
781
+ * Whether the "Go to today" link should be shown or not
782
+ */
783
+ showGoToToday?: boolean;
784
+ /**
785
+ * Determines if the DatePicker has a border.
786
+ * @default false
787
+ */
788
+ borderless?: boolean;
789
+ /**
790
+ * Apply additional formatting to dates, for example localized date formatting.
791
+ */
792
+ dateTimeFormatter?: DateFormatting;
793
+ /**
794
+ * The minimum allowable date.
795
+ */
796
+ minDate?: Date;
797
+ /**
798
+ * The maximum allowable date.
799
+ */
800
+ maxDate?: Date;
801
+ /**
802
+ * The initially highlighted date.
803
+ */
804
+ initialPickerDate?: Date;
805
+ /**
806
+ * Allows all elements to be focused, including disabled ones
807
+ * @default false
808
+ */
809
+ allFocusable?: boolean;
810
+ /**
811
+ * Callback that runs after DatePicker's menu (Calendar) is closed
812
+ */
813
+ onAfterMenuDismiss?: () => void;
814
+ /**
815
+ * Whether the CalendarDay close button should be shown or not.
816
+ */
817
+ showCloseButton?: boolean;
818
+ /**
819
+ * The tabIndex of the Input
820
+ */
821
+ tabIndex?: number;
822
+ };
823
+
824
+ declare type DatePickerSlots = {
825
+ root: NonNullable<Slot<'div'>>;
826
+ field: NonNullable<Slot<typeof Field>>;
827
+ input: NonNullable<Slot<typeof Input>>;
828
+ wrapper: NonNullable<Slot<'div'>>;
829
+ popover: NonNullable<Slot<Partial<PopoverProps>>>;
830
+ popoverSurface: NonNullable<Slot<typeof PopoverSurface>>;
831
+ calendar: NonNullable<Slot<Partial<CalendarProps>>>;
832
+ };
833
+
834
+ declare type DatePickerState = ComponentState<DatePickerSlots> & {
835
+ disabled: boolean;
836
+ isDatePickerShown: boolean;
837
+ };
838
+
839
+ export declare interface DatePickerStrings extends CalendarStrings {
840
+ /**
841
+ * Error message to render for Input if isRequired validation fails.
842
+ */
843
+ isRequiredErrorMessage?: string;
844
+ /**
845
+ * Error message to render for Input if input date string parsing fails.
846
+ */
847
+ invalidInputErrorMessage?: string;
848
+ /**
849
+ * Error message to render for Input if date boundary (minDate, maxDate) validation fails.
850
+ */
851
+ isOutOfBoundsErrorMessage?: string;
852
+ /**
853
+ * Status message to render for Input the input date parsing fails,
854
+ * and the typed value is cleared and reset to the previous value.
855
+ * e.g. "Invalid entry `{0}`, date reset to `{1}`"
856
+ */
857
+ isResetStatusMessage?: string;
858
+ }
859
+
860
+ /**
861
+ * The supported date range types
862
+ */
863
+ export declare enum DateRangeType {
864
+ Day = 0,
865
+ Week = 1,
866
+ Month = 2,
867
+ WorkWeek = 3
868
+ }
869
+
870
+ declare interface DayGridOptions extends RestrictedDatesOptions {
871
+ /**
872
+ * The first day of the week for your locale.
873
+ */
874
+ firstDayOfWeek: DayOfWeek;
875
+ /**
876
+ * Defines when the first week of the year should start, FirstWeekOfYear.FirstDay,
877
+ * FirstWeekOfYear.FirstFullWeek or FirstWeekOfYear.FirstFourDayWeek are the possible values
878
+ */
879
+ firstWeekOfYear: FirstWeekOfYear;
880
+ /**
881
+ * The date range type indicating how many days should be selected as the user
882
+ * selects days
883
+ */
884
+ dateRangeType: DateRangeType;
885
+ /**
886
+ * The number of days to select while dateRangeType === DateRangeType.Day. Used in order to have multi-day
887
+ * views.
888
+ */
889
+ daysToSelectInDayView?: number;
890
+ /**
891
+ * Value of today. If unspecified, current time in client machine will be used.
892
+ */
893
+ today?: Date;
894
+ /**
895
+ * Whether the calendar should show the week number (weeks 1 to 53) before each week row
896
+ */
897
+ showWeekNumbers?: boolean;
898
+ /**
899
+ * The days that are selectable when `dateRangeType` is WorkWeek.
900
+ * If `dateRangeType` is not WorkWeek this property does nothing.
901
+ */
902
+ workWeekDays?: DayOfWeek[];
903
+ /**
904
+ * Which days in the generated grid should be marked.
905
+ */
906
+ markedDays?: Date[];
907
+ /**
908
+ * The currently selected date
909
+ */
910
+ selectedDate: Date;
911
+ /**
912
+ * The currently navigated date
913
+ */
914
+ navigatedDate: Date;
915
+ /**
916
+ * How many weeks to show by default. If not provided, will show enough weeks to display the current
917
+ * month, between 4 and 6 depending
918
+ */
919
+ weeksToShow?: number;
920
+ }
921
+
922
+ /**
923
+ * The days of the week
924
+ */
925
+ export declare enum DayOfWeek {
926
+ Sunday = 0,
927
+ Monday = 1,
928
+ Tuesday = 2,
929
+ Wednesday = 3,
930
+ Thursday = 4,
931
+ Friday = 5,
932
+ Saturday = 6
933
+ }
934
+
935
+ export declare const DAYS_IN_WEEK = 7;
936
+
937
+ export declare const defaultCalendarStrings: CalendarStrings;
938
+
939
+ export declare const defaultDatePickerStrings: DatePickerStrings;
940
+
941
+ /**
942
+ * First week of the year settings types
943
+ */
944
+ export declare enum FirstWeekOfYear {
945
+ FirstDay = 0,
946
+ FirstFullWeek = 1,
947
+ FirstFourDayWeek = 2
948
+ }
949
+
950
+ /**
951
+ * Helper function to assist in date comparisons
952
+ */
953
+ export declare function getDatePartHashValue(date: Date): number;
954
+
955
+ /**
956
+ * Gets the date range array including the specified date. The date range array is calculated as the list
957
+ * of dates accounting for the specified first day of the week and date range type.
958
+ * @param date - The input date
959
+ * @param dateRangeType - The desired date range type, i.e., day, week, month, etc.
960
+ * @param firstDayOfWeek - The first day of the week.
961
+ * @param workWeekDays - The allowed days in work week. If not provided, assumes all days are allowed.
962
+ * @param daysToSelectInDayView - The number of days to include when using dateRangeType === DateRangeType.Day
963
+ * for multiday view. Defaults to 1
964
+ * @returns An array of dates representing the date range containing the specified date.
965
+ */
966
+ export declare function getDateRangeArray(date: Date, dateRangeType: DateRangeType, firstDayOfWeek: DayOfWeek, workWeekDays?: DayOfWeek[], daysToSelectInDayView?: number): Date[];
967
+
968
+ /**
969
+ * Gets the date for the last day of the week based on the given date assuming
970
+ * the specified first day of the week.
971
+ * @param date - The date to find the beginning of the week date for.
972
+ * @returns A new date object representing the first day of the week containing the input date.
973
+ */
974
+ export declare function getEndDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date;
975
+
976
+ /**
977
+ * Returns a date that is the last day of the month of the provided date.
978
+ * @param date - The origin date
979
+ * @returns A new Date object with the day set to the last day of the month.
980
+ */
981
+ export declare function getMonthEnd(date: Date): Date;
982
+
983
+ /**
984
+ * Returns a date that is the first day of the month of the provided date.
985
+ * @param date - The origin date
986
+ * @returns A new Date object with the day set to the first day of the month.
987
+ */
988
+ export declare function getMonthStart(date: Date): Date;
989
+
990
+ /**
991
+ * Gets the date for the first day of the week based on the given date assuming
992
+ * the specified first day of the week.
993
+ * @param date - The date to find the beginning of the week date for.
994
+ * @returns A new date object representing the first day of the week containing the input date.
995
+ */
996
+ export declare function getStartDateOfWeek(date: Date, firstDayOfWeek: DayOfWeek): Date;
997
+
998
+ /**
999
+ * Returns the week number for a date.
1000
+ * Week numbers are 1 - 52 (53) in a year
1001
+ * @param date - A date to find the week number for.
1002
+ * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)
1003
+ * @param firstWeekOfYear - The first week of the year (1-2)
1004
+ * @returns The week's number in the year.
1005
+ */
1006
+ export declare function getWeekNumber(date: Date, firstDayOfWeek: DayOfWeek, firstWeekOfYear: FirstWeekOfYear): number;
1007
+
1008
+ /**
1009
+ * Returns the week number for a date.
1010
+ * Week numbers are 1 - 52 (53) in a year
1011
+ * @param navigatedDate - A date to find the week number for.
1012
+ * @param firstDayOfWeek - The first day of the week (0-6, Sunday = 0)
1013
+ * @param firstWeekOfYear - The first week of the year (1-2)
1014
+ * @returns The weeks number array for the current month.
1015
+ */
1016
+ export declare function getWeekNumbersInMonth(weeksInMonth: number, firstDayOfWeek: DayOfWeek, firstWeekOfYear: FirstWeekOfYear, navigatedDate: Date): number[];
1017
+
1018
+ /**
1019
+ * Returns a date that is the last day of the year of the provided date.
1020
+ * @param date - The origin date
1021
+ * @returns A new Date object with the day set to the last day of the year.
1022
+ */
1023
+ export declare function getYearEnd(date: Date): Date;
1024
+
1025
+ /**
1026
+ * Returns a date that is the first day of the year of the provided date.
1027
+ * @param date - The origin date
1028
+ * @returns A new Date object with the day set to the first day of the year.
1029
+ */
1030
+ export declare function getYearStart(date: Date): Date;
1031
+
1032
+ export declare interface ICalendar {
1033
+ /** Sets focus to the selected date. */
1034
+ focus: () => void;
1035
+ }
1036
+
1037
+ export declare interface ICalendarDay {
1038
+ focus(): void;
1039
+ }
1040
+
1041
+ /**
1042
+ * @internal
1043
+ */
1044
+ declare interface ICalendarDayGrid {
1045
+ focus(): void;
1046
+ }
1047
+
1048
+ export declare interface ICalendarMonth {
1049
+ focus(): void;
1050
+ }
1051
+
1052
+ export declare interface IDatePicker {
1053
+ /** Sets focus to the text field */
1054
+ focus(): void;
1055
+ /** Reset the state of the picker to the default */
1056
+ reset(): void;
1057
+ /** Open the datepicker callout */
1058
+ showDatePickerPopup(): void;
1059
+ }
1060
+
1061
+ /**
1062
+ * Checks whether the specified date is in the given date range.
1063
+ * @param date - The origin date
1064
+ * @param dateRange - An array of dates to do the lookup on
1065
+ * @returns True if the date matches one of the dates in the specified array, false otherwise.
1066
+ */
1067
+ export declare function isInDateRangeArray(date: Date, dateRange: Date[]): boolean;
1068
+
1069
+ /**
1070
+ * The months
1071
+ */
1072
+ export declare enum MonthOfYear {
1073
+ January = 0,
1074
+ February = 1,
1075
+ March = 2,
1076
+ April = 3,
1077
+ May = 4,
1078
+ June = 5,
1079
+ July = 6,
1080
+ August = 7,
1081
+ September = 8,
1082
+ October = 9,
1083
+ November = 10,
1084
+ December = 11
1085
+ }
1086
+
1087
+ /**
1088
+ * Render the final JSX of DatePicker
1089
+ */
1090
+ export declare const renderDatePicker_unstable: (state: DatePickerState) => JSX.Element;
1091
+
1092
+ declare interface RestrictedDatesOptions {
1093
+ /**
1094
+ * If set the Calendar will not allow navigation to or selection of a date earlier than this value.
1095
+ */
1096
+ minDate?: Date;
1097
+ /**
1098
+ * If set the Calendar will not allow navigation to or selection of a date later than this value.
1099
+ */
1100
+ maxDate?: Date;
1101
+ /**
1102
+ * If set the Calendar will not allow selection of dates in this array.
1103
+ */
1104
+ restrictedDates?: Date[];
1105
+ }
1106
+
1107
+ /**
1108
+ * Returns a date that is a copy of the given date, aside from the month changing to the given month.
1109
+ * The method tries to preserve the day-of-month; however, if the new month does not have enough days
1110
+ * to contain the original day-of-month, we'll use the last day of the new month.
1111
+ * @param date - The origin date
1112
+ * @param month - The 0-based index of the month to set on the date.
1113
+ * @returns A new Date object with the given month set.
1114
+ */
1115
+ export declare function setMonth(date: Date, month: number): Date;
1116
+
1117
+ export declare const TimeConstants: {
1118
+ MillisecondsInOneDay: number;
1119
+ MillisecondsIn1Sec: number;
1120
+ MillisecondsIn1Min: number;
1121
+ MillisecondsIn30Mins: number;
1122
+ MillisecondsIn1Hour: number;
1123
+ MinutesInOneDay: number;
1124
+ MinutesInOneHour: number;
1125
+ DaysInOneWeek: number;
1126
+ MonthInOneYear: number;
1127
+ HoursInOneDay: number;
1128
+ SecondsInOneMinute: number;
1129
+ OffsetTo24HourFormat: number;
1130
+ /**
1131
+ * Matches a time string. Groups:
1132
+ * 1. hours (with or without leading 0)
1133
+ * 2. minutes
1134
+ * 3. seconds (optional)
1135
+ * 4. meridiem (am/pm, case-insensitive, optional)
1136
+ */
1137
+ TimeFormatRegex: RegExp;
1138
+ };
1139
+
1140
+ /**
1141
+ * Create the state required to render DatePicker.
1142
+ *
1143
+ * The returned state can be modified with hooks such as useDatePickerStyles_unstable,
1144
+ * before being passed to renderDatePicker_unstable.
1145
+ *
1146
+ * @param props - props from this instance of DatePicker
1147
+ * @param ref - reference to root HTMLElement of DatePicker
1148
+ */
1149
+ export declare const useDatePicker_unstable: (props: DatePickerProps, ref: React_2.Ref<HTMLElement>) => DatePickerState;
1150
+
1151
+ /**
1152
+ * Apply styling to the DatePicker slots based on the state
1153
+ */
1154
+ export declare const useDatePickerStyles_unstable: (state: DatePickerState) => DatePickerState;
1155
+
1156
+ export { }