@mui/lab 5.0.0-alpha.75 → 5.0.0-alpha.76

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 (612) hide show
  1. package/AdapterDateFns/index.d.ts +1 -1
  2. package/AdapterDateFns/index.js +1 -1
  3. package/AdapterDayjs/index.d.ts +1 -1
  4. package/AdapterDayjs/index.js +1 -1
  5. package/AdapterLuxon/index.d.ts +1 -1
  6. package/AdapterLuxon/index.js +1 -1
  7. package/AdapterMoment/index.d.ts +1 -1
  8. package/AdapterMoment/index.js +1 -1
  9. package/CHANGELOG.md +74 -0
  10. package/CalendarPicker/index.d.ts +2 -5
  11. package/CalendarPicker/index.js +1 -1
  12. package/CalendarPickerSkeleton/index.d.ts +2 -3
  13. package/CalendarPickerSkeleton/index.js +1 -1
  14. package/ClockPicker/index.d.ts +2 -5
  15. package/ClockPicker/index.js +1 -2
  16. package/DatePicker/index.d.ts +2 -2
  17. package/DatePicker/index.js +1 -2
  18. package/DateRangePicker/DateRangePicker.d.ts +11 -65
  19. package/DateRangePicker/DateRangePicker.js +14 -512
  20. package/DateRangePicker/index.d.ts +2 -3
  21. package/DateRangePicker/index.js +2 -2
  22. package/DateRangePickerDay/DateRangePickerDay.d.ts +13 -79
  23. package/DateRangePickerDay/DateRangePickerDay.js +17 -240
  24. package/DateRangePickerDay/index.d.ts +2 -2
  25. package/DateRangePickerDay/index.js +2 -2
  26. package/DateTimePicker/index.d.ts +2 -2
  27. package/DateTimePicker/index.js +1 -2
  28. package/DesktopDatePicker/index.d.ts +2 -2
  29. package/DesktopDatePicker/index.js +1 -2
  30. package/DesktopDateRangePicker/DesktopDateRangePicker.d.ts +10 -64
  31. package/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -477
  32. package/DesktopDateRangePicker/index.d.ts +2 -2
  33. package/DesktopDateRangePicker/index.js +2 -2
  34. package/DesktopDateTimePicker/index.d.ts +2 -2
  35. package/DesktopDateTimePicker/index.js +1 -2
  36. package/DesktopTimePicker/index.d.ts +2 -2
  37. package/DesktopTimePicker/index.js +1 -2
  38. package/LoadingButton/loadingButtonClasses.d.ts +22 -22
  39. package/LocalizationProvider/index.d.ts +2 -2
  40. package/LocalizationProvider/index.js +1 -2
  41. package/Masonry/masonryClasses.d.ts +8 -8
  42. package/MobileDatePicker/index.d.ts +2 -2
  43. package/MobileDatePicker/index.js +1 -2
  44. package/MobileDateRangePicker/MobileDateRangePicker.d.ts +10 -64
  45. package/MobileDateRangePicker/MobileDateRangePicker.js +13 -487
  46. package/MobileDateRangePicker/index.d.ts +2 -2
  47. package/MobileDateRangePicker/index.js +2 -2
  48. package/MobileDateTimePicker/index.d.ts +2 -2
  49. package/MobileDateTimePicker/index.js +1 -2
  50. package/MobileTimePicker/index.d.ts +2 -2
  51. package/MobileTimePicker/index.js +1 -2
  52. package/MonthPicker/index.d.ts +2 -3
  53. package/MonthPicker/index.js +1 -1
  54. package/PickersDay/index.d.ts +2 -4
  55. package/PickersDay/index.js +1 -2
  56. package/StaticDatePicker/index.d.ts +2 -2
  57. package/StaticDatePicker/index.js +1 -2
  58. package/StaticDateRangePicker/StaticDateRangePicker.d.ts +10 -67
  59. package/StaticDateRangePicker/StaticDateRangePicker.js +13 -443
  60. package/StaticDateRangePicker/index.d.ts +2 -2
  61. package/StaticDateRangePicker/index.js +2 -2
  62. package/StaticDateTimePicker/index.d.ts +2 -2
  63. package/StaticDateTimePicker/index.js +1 -2
  64. package/StaticTimePicker/index.d.ts +2 -2
  65. package/StaticTimePicker/index.js +1 -2
  66. package/TabPanel/tabPanelClasses.d.ts +8 -8
  67. package/TimePicker/index.d.ts +2 -2
  68. package/TimePicker/index.js +1 -2
  69. package/Timeline/Timeline.d.ts +59 -59
  70. package/Timeline/TimelineContext.d.ts +6 -6
  71. package/Timeline/index.d.ts +5 -5
  72. package/Timeline/timelineClasses.d.ts +3 -3
  73. package/TimelineConnector/timelineConnectorClasses.d.ts +8 -8
  74. package/TimelineContent/timelineContentClasses.d.ts +14 -14
  75. package/TimelineDot/timelineDotClasses.d.ts +24 -24
  76. package/TimelineItem/timelineItemClasses.d.ts +16 -16
  77. package/TimelineOppositeContent/timelineOppositeContentClasses.d.ts +14 -14
  78. package/TimelineSeparator/timelineSeparatorClasses.d.ts +8 -8
  79. package/TreeItem/treeItemClasses.d.ts +24 -24
  80. package/TreeView/treeViewClasses.d.ts +8 -8
  81. package/YearPicker/index.d.ts +2 -5
  82. package/YearPicker/index.js +1 -3
  83. package/index.js +1 -1
  84. package/internal/svg-icons/ArrowDropDown.d.ts +7 -7
  85. package/internal/svg-icons/ArrowLeft.d.ts +7 -7
  86. package/internal/svg-icons/ArrowRight.d.ts +7 -7
  87. package/internal/svg-icons/Calendar.d.ts +7 -7
  88. package/internal/svg-icons/Clock.d.ts +7 -7
  89. package/internal/svg-icons/DateRange.d.ts +7 -7
  90. package/internal/svg-icons/Pen.d.ts +7 -7
  91. package/internal/svg-icons/Time.d.ts +7 -7
  92. package/legacy/AdapterDateFns/index.js +1 -1
  93. package/legacy/AdapterDayjs/index.js +1 -1
  94. package/legacy/AdapterLuxon/index.js +1 -1
  95. package/legacy/AdapterMoment/index.js +1 -1
  96. package/legacy/CalendarPicker/index.js +1 -1
  97. package/legacy/CalendarPickerSkeleton/index.js +1 -1
  98. package/legacy/ClockPicker/index.js +1 -2
  99. package/legacy/DatePicker/index.js +1 -2
  100. package/legacy/DateRangePicker/DateRangePicker.js +13 -517
  101. package/legacy/DateRangePicker/index.js +2 -2
  102. package/legacy/DateRangePickerDay/DateRangePickerDay.js +17 -245
  103. package/legacy/DateRangePickerDay/index.js +2 -2
  104. package/legacy/DateTimePicker/index.js +1 -2
  105. package/legacy/DesktopDatePicker/index.js +1 -2
  106. package/legacy/DesktopDateRangePicker/DesktopDateRangePicker.js +12 -482
  107. package/legacy/DesktopDateRangePicker/index.js +2 -2
  108. package/legacy/DesktopDateTimePicker/index.js +1 -2
  109. package/legacy/DesktopTimePicker/index.js +1 -2
  110. package/legacy/LocalizationProvider/index.js +1 -2
  111. package/legacy/MobileDatePicker/index.js +1 -2
  112. package/legacy/MobileDateRangePicker/MobileDateRangePicker.js +12 -492
  113. package/legacy/MobileDateRangePicker/index.js +2 -2
  114. package/legacy/MobileDateTimePicker/index.js +1 -2
  115. package/legacy/MobileTimePicker/index.js +1 -2
  116. package/legacy/MonthPicker/index.js +1 -1
  117. package/legacy/PickersDay/index.js +1 -2
  118. package/legacy/StaticDatePicker/index.js +1 -2
  119. package/legacy/StaticDateRangePicker/StaticDateRangePicker.js +12 -449
  120. package/legacy/StaticDateRangePicker/index.js +2 -2
  121. package/legacy/StaticDateTimePicker/index.js +1 -2
  122. package/legacy/StaticTimePicker/index.js +1 -2
  123. package/legacy/TimePicker/index.js +1 -2
  124. package/legacy/YearPicker/index.js +1 -3
  125. package/legacy/index.js +1 -1
  126. package/modern/AdapterDateFns/index.js +1 -1
  127. package/modern/AdapterDayjs/index.js +1 -1
  128. package/modern/AdapterLuxon/index.js +1 -1
  129. package/modern/AdapterMoment/index.js +1 -1
  130. package/modern/CalendarPicker/index.js +1 -1
  131. package/modern/CalendarPickerSkeleton/index.js +1 -1
  132. package/modern/ClockPicker/index.js +1 -2
  133. package/modern/DatePicker/index.js +1 -2
  134. package/modern/DateRangePicker/DateRangePicker.js +14 -512
  135. package/modern/DateRangePicker/index.js +2 -2
  136. package/modern/DateRangePickerDay/DateRangePickerDay.js +17 -240
  137. package/modern/DateRangePickerDay/index.js +2 -2
  138. package/modern/DateTimePicker/index.js +1 -2
  139. package/modern/DesktopDatePicker/index.js +1 -2
  140. package/modern/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -477
  141. package/modern/DesktopDateRangePicker/index.js +2 -2
  142. package/modern/DesktopDateTimePicker/index.js +1 -2
  143. package/modern/DesktopTimePicker/index.js +1 -2
  144. package/modern/LocalizationProvider/index.js +1 -2
  145. package/modern/MobileDatePicker/index.js +1 -2
  146. package/modern/MobileDateRangePicker/MobileDateRangePicker.js +13 -487
  147. package/modern/MobileDateRangePicker/index.js +2 -2
  148. package/modern/MobileDateTimePicker/index.js +1 -2
  149. package/modern/MobileTimePicker/index.js +1 -2
  150. package/modern/MonthPicker/index.js +1 -1
  151. package/modern/PickersDay/index.js +1 -2
  152. package/modern/StaticDatePicker/index.js +1 -2
  153. package/modern/StaticDateRangePicker/StaticDateRangePicker.js +13 -443
  154. package/modern/StaticDateRangePicker/index.js +2 -2
  155. package/modern/StaticDateTimePicker/index.js +1 -2
  156. package/modern/StaticTimePicker/index.js +1 -2
  157. package/modern/TimePicker/index.js +1 -2
  158. package/modern/YearPicker/index.js +1 -3
  159. package/modern/index.js +1 -1
  160. package/node/AdapterDateFns/index.js +2 -4
  161. package/node/AdapterDayjs/index.js +2 -4
  162. package/node/AdapterLuxon/index.js +2 -4
  163. package/node/AdapterMoment/index.js +2 -4
  164. package/node/CalendarPicker/index.js +2 -6
  165. package/node/CalendarPickerSkeleton/index.js +2 -6
  166. package/node/ClockPicker/index.js +2 -6
  167. package/node/DatePicker/index.js +2 -19
  168. package/node/DateRangePicker/DateRangePicker.js +14 -517
  169. package/node/DateRangePickerDay/DateRangePickerDay.js +20 -254
  170. package/node/DateTimePicker/index.js +2 -19
  171. package/node/DesktopDatePicker/index.js +2 -19
  172. package/node/DesktopDateRangePicker/DesktopDateRangePicker.js +13 -482
  173. package/node/DesktopDateTimePicker/index.js +2 -19
  174. package/node/DesktopTimePicker/index.js +2 -19
  175. package/node/LocalizationProvider/index.js +2 -19
  176. package/node/MobileDatePicker/index.js +2 -19
  177. package/node/MobileDateRangePicker/MobileDateRangePicker.js +13 -492
  178. package/node/MobileDateTimePicker/index.js +2 -19
  179. package/node/MobileTimePicker/index.js +2 -19
  180. package/node/MonthPicker/index.js +2 -6
  181. package/node/PickersDay/index.js +2 -6
  182. package/node/StaticDatePicker/index.js +2 -19
  183. package/node/StaticDateRangePicker/StaticDateRangePicker.js +13 -447
  184. package/node/StaticDateTimePicker/index.js +2 -19
  185. package/node/StaticTimePicker/index.js +2 -19
  186. package/node/TimePicker/index.js +2 -19
  187. package/node/YearPicker/index.js +9 -26
  188. package/node/index.js +1 -1
  189. package/package.json +8 -11
  190. package/themeAugmentation/components.d.ts +0 -50
  191. package/themeAugmentation/index.d.ts +2 -0
  192. package/themeAugmentation/overrides.d.ts +0 -16
  193. package/themeAugmentation/props.d.ts +0 -36
  194. package/CalendarPicker/CalendarPicker.d.ts +0 -106
  195. package/CalendarPicker/CalendarPicker.js +0 -344
  196. package/CalendarPicker/PickersCalendar.d.ts +0 -47
  197. package/CalendarPicker/PickersCalendar.js +0 -145
  198. package/CalendarPicker/PickersCalendarHeader.d.ts +0 -43
  199. package/CalendarPicker/PickersCalendarHeader.js +0 -165
  200. package/CalendarPicker/PickersFadeTransitionGroup.d.ts +0 -12
  201. package/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
  202. package/CalendarPicker/PickersSlideTransition.d.ts +0 -16
  203. package/CalendarPicker/PickersSlideTransition.js +0 -103
  204. package/CalendarPicker/shared.d.ts +0 -1
  205. package/CalendarPicker/shared.js +0 -1
  206. package/CalendarPicker/useCalendarState.d.ts +0 -32
  207. package/CalendarPicker/useCalendarState.js +0 -110
  208. package/CalendarPickerSkeleton/CalendarPickerSkeleton.d.ts +0 -41
  209. package/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -149
  210. package/ClockPicker/Clock.d.ts +0 -28
  211. package/ClockPicker/Clock.js +0 -267
  212. package/ClockPicker/ClockNumber.d.ts +0 -19
  213. package/ClockPicker/ClockNumber.js +0 -72
  214. package/ClockPicker/ClockNumbers.d.ts +0 -24
  215. package/ClockPicker/ClockNumbers.js +0 -80
  216. package/ClockPicker/ClockPicker.d.ts +0 -121
  217. package/ClockPicker/ClockPicker.js +0 -398
  218. package/ClockPicker/ClockPickerStandalone.d.ts +0 -28
  219. package/ClockPicker/ClockPickerStandalone.js +0 -47
  220. package/ClockPicker/ClockPointer.d.ts +0 -23
  221. package/ClockPicker/ClockPointer.js +0 -103
  222. package/ClockPicker/shared.d.ts +0 -5
  223. package/ClockPicker/shared.js +0 -57
  224. package/DatePicker/DatePicker.d.ts +0 -27
  225. package/DatePicker/DatePicker.js +0 -469
  226. package/DatePicker/DatePickerToolbar.d.ts +0 -23
  227. package/DatePicker/DatePickerToolbar.js +0 -82
  228. package/DatePicker/shared.d.ts +0 -45
  229. package/DatePicker/shared.js +0 -54
  230. package/DateRangePicker/DateRangePickerInput.d.ts +0 -35
  231. package/DateRangePicker/DateRangePickerInput.js +0 -132
  232. package/DateRangePicker/DateRangePickerToolbar.d.ts +0 -15
  233. package/DateRangePicker/DateRangePickerToolbar.js +0 -65
  234. package/DateRangePicker/DateRangePickerView.d.ts +0 -44
  235. package/DateRangePicker/DateRangePickerView.js +0 -177
  236. package/DateRangePicker/DateRangePickerViewDesktop.d.ts +0 -29
  237. package/DateRangePicker/DateRangePickerViewDesktop.js +0 -159
  238. package/DateRangePicker/DateRangePickerViewMobile.d.ts +0 -17
  239. package/DateRangePicker/DateRangePickerViewMobile.js +0 -62
  240. package/DateRangePicker/RangeTypes.d.ts +0 -8
  241. package/DateRangePicker/RangeTypes.js +0 -1
  242. package/DateRangePicker/date-range-manager.d.ts +0 -14
  243. package/DateRangePicker/date-range-manager.js +0 -43
  244. package/DateTimePicker/DateTimePicker.d.ts +0 -27
  245. package/DateTimePicker/DateTimePicker.js +0 -547
  246. package/DateTimePicker/DateTimePickerTabs.d.ts +0 -13
  247. package/DateTimePicker/DateTimePickerTabs.js +0 -87
  248. package/DateTimePicker/DateTimePickerToolbar.d.ts +0 -7
  249. package/DateTimePicker/DateTimePickerToolbar.js +0 -139
  250. package/DateTimePicker/shared.d.ts +0 -67
  251. package/DateTimePicker/shared.js +0 -58
  252. package/DesktopDatePicker/DesktopDatePicker.d.ts +0 -20
  253. package/DesktopDatePicker/DesktopDatePicker.js +0 -444
  254. package/DesktopDateTimePicker/DesktopDateTimePicker.d.ts +0 -20
  255. package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -518
  256. package/DesktopTimePicker/DesktopTimePicker.d.ts +0 -20
  257. package/DesktopTimePicker/DesktopTimePicker.js +0 -366
  258. package/LocalizationProvider/LocalizationProvider.d.ts +0 -35
  259. package/LocalizationProvider/LocalizationProvider.js +0 -108
  260. package/MobileDatePicker/MobileDatePicker.d.ts +0 -20
  261. package/MobileDatePicker/MobileDatePicker.js +0 -449
  262. package/MobileDateTimePicker/MobileDateTimePicker.d.ts +0 -20
  263. package/MobileDateTimePicker/MobileDateTimePicker.js +0 -529
  264. package/MobileTimePicker/MobileTimePicker.d.ts +0 -20
  265. package/MobileTimePicker/MobileTimePicker.js +0 -377
  266. package/MonthPicker/MonthPicker.d.ts +0 -53
  267. package/MonthPicker/MonthPicker.js +0 -182
  268. package/MonthPicker/PickersMonth.d.ts +0 -15
  269. package/MonthPicker/PickersMonth.js +0 -72
  270. package/PickersDay/PickersDay.d.ts +0 -93
  271. package/PickersDay/PickersDay.js +0 -396
  272. package/StaticDatePicker/StaticDatePicker.d.ts +0 -25
  273. package/StaticDatePicker/StaticDatePicker.js +0 -406
  274. package/StaticDateTimePicker/StaticDateTimePicker.d.ts +0 -25
  275. package/StaticDateTimePicker/StaticDateTimePicker.js +0 -486
  276. package/StaticTimePicker/StaticTimePicker.d.ts +0 -25
  277. package/StaticTimePicker/StaticTimePicker.js +0 -333
  278. package/TimePicker/TimePicker.d.ts +0 -27
  279. package/TimePicker/TimePicker.js +0 -395
  280. package/TimePicker/TimePickerToolbar.d.ts +0 -23
  281. package/TimePicker/TimePickerToolbar.js +0 -172
  282. package/TimePicker/shared.d.ts +0 -36
  283. package/TimePicker/shared.js +0 -45
  284. package/YearPicker/PickersYear.d.ts +0 -27
  285. package/YearPicker/PickersYear.js +0 -112
  286. package/YearPicker/YearPicker.d.ts +0 -44
  287. package/YearPicker/YearPicker.js +0 -251
  288. package/YearPicker/yearPickerClasses.d.ts +0 -3
  289. package/YearPicker/yearPickerClasses.js +0 -6
  290. package/internal/pickers/KeyboardDateInput.d.ts +0 -4
  291. package/internal/pickers/KeyboardDateInput.js +0 -59
  292. package/internal/pickers/Picker/Picker.d.ts +0 -33
  293. package/internal/pickers/Picker/Picker.js +0 -130
  294. package/internal/pickers/Picker/PickerView.d.ts +0 -3
  295. package/internal/pickers/Picker/PickerView.js +0 -11
  296. package/internal/pickers/PickersArrowSwitcher.d.ts +0 -41
  297. package/internal/pickers/PickersArrowSwitcher.js +0 -91
  298. package/internal/pickers/PickersModalDialog.d.ts +0 -47
  299. package/internal/pickers/PickersModalDialog.js +0 -78
  300. package/internal/pickers/PickersPopper.d.ts +0 -44
  301. package/internal/pickers/PickersPopper.js +0 -267
  302. package/internal/pickers/PickersToolbar.d.ts +0 -14
  303. package/internal/pickers/PickersToolbar.js +0 -88
  304. package/internal/pickers/PickersToolbarButton.d.ts +0 -13
  305. package/internal/pickers/PickersToolbarButton.js +0 -39
  306. package/internal/pickers/PickersToolbarText.d.ts +0 -8
  307. package/internal/pickers/PickersToolbarText.js +0 -36
  308. package/internal/pickers/PureDateInput.d.ts +0 -80
  309. package/internal/pickers/PureDateInput.js +0 -51
  310. package/internal/pickers/constants/dimensions.d.ts +0 -4
  311. package/internal/pickers/constants/dimensions.js +0 -4
  312. package/internal/pickers/constants/prop-types.d.ts +0 -1
  313. package/internal/pickers/constants/prop-types.js +0 -1
  314. package/internal/pickers/date-time-utils.d.ts +0 -8
  315. package/internal/pickers/date-time-utils.js +0 -28
  316. package/internal/pickers/date-utils.d.ts +0 -52
  317. package/internal/pickers/date-utils.js +0 -138
  318. package/internal/pickers/hooks/date-helpers-hooks.d.ts +0 -16
  319. package/internal/pickers/hooks/date-helpers-hooks.js +0 -37
  320. package/internal/pickers/hooks/useIsLandscape.d.ts +0 -4
  321. package/internal/pickers/hooks/useIsLandscape.js +0 -43
  322. package/internal/pickers/hooks/useMaskedInput.d.ts +0 -7
  323. package/internal/pickers/hooks/useMaskedInput.js +0 -93
  324. package/internal/pickers/hooks/useOpenState.d.ts +0 -10
  325. package/internal/pickers/hooks/useOpenState.js +0 -38
  326. package/internal/pickers/hooks/usePickerState.d.ts +0 -38
  327. package/internal/pickers/hooks/usePickerState.js +0 -117
  328. package/internal/pickers/hooks/useUtils.d.ts +0 -7
  329. package/internal/pickers/hooks/useUtils.js +0 -25
  330. package/internal/pickers/hooks/useValidation.d.ts +0 -23
  331. package/internal/pickers/hooks/useValidation.js +0 -44
  332. package/internal/pickers/hooks/useViews.d.ts +0 -19
  333. package/internal/pickers/hooks/useViews.js +0 -50
  334. package/internal/pickers/test-utils.js +0 -91
  335. package/internal/pickers/text-field-helper.d.ts +0 -11
  336. package/internal/pickers/text-field-helper.js +0 -66
  337. package/internal/pickers/time-utils.d.ts +0 -33
  338. package/internal/pickers/time-utils.js +0 -68
  339. package/internal/pickers/typings/BasePicker.d.ts +0 -95
  340. package/internal/pickers/typings/BasePicker.js +0 -1
  341. package/internal/pickers/typings/Views.d.ts +0 -1
  342. package/internal/pickers/typings/Views.js +0 -1
  343. package/internal/pickers/typings/helpers.d.ts +0 -9
  344. package/internal/pickers/typings/helpers.js +0 -1
  345. package/internal/pickers/utils.d.ts +0 -7
  346. package/internal/pickers/utils.js +0 -36
  347. package/internal/pickers/wrappers/DesktopTooltipWrapper.d.ts +0 -4
  348. package/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -55
  349. package/internal/pickers/wrappers/DesktopWrapper.d.ts +0 -16
  350. package/internal/pickers/wrappers/DesktopWrapper.js +0 -45
  351. package/internal/pickers/wrappers/MobileWrapper.d.ts +0 -14
  352. package/internal/pickers/wrappers/MobileWrapper.js +0 -50
  353. package/internal/pickers/wrappers/PickerStaticWrapper.d.ts +0 -21
  354. package/internal/pickers/wrappers/PickerStaticWrapper.js +0 -63
  355. package/internal/pickers/wrappers/ResponsiveWrapper.d.ts +0 -23
  356. package/internal/pickers/wrappers/ResponsiveWrapper.js +0 -44
  357. package/internal/pickers/wrappers/WrapperProps.d.ts +0 -13
  358. package/internal/pickers/wrappers/WrapperProps.js +0 -1
  359. package/internal/pickers/wrappers/WrapperVariantContext.d.ts +0 -11
  360. package/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
  361. package/legacy/CalendarPicker/CalendarPicker.js +0 -355
  362. package/legacy/CalendarPicker/PickersCalendar.js +0 -159
  363. package/legacy/CalendarPicker/PickersCalendarHeader.js +0 -176
  364. package/legacy/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
  365. package/legacy/CalendarPicker/PickersSlideTransition.js +0 -98
  366. package/legacy/CalendarPicker/shared.js +0 -1
  367. package/legacy/CalendarPicker/useCalendarState.js +0 -118
  368. package/legacy/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -155
  369. package/legacy/ClockPicker/Clock.js +0 -273
  370. package/legacy/ClockPicker/ClockNumber.js +0 -71
  371. package/legacy/ClockPicker/ClockNumbers.js +0 -83
  372. package/legacy/ClockPicker/ClockPicker.js +0 -437
  373. package/legacy/ClockPicker/ClockPickerStandalone.js +0 -49
  374. package/legacy/ClockPicker/ClockPointer.js +0 -130
  375. package/legacy/ClockPicker/shared.js +0 -61
  376. package/legacy/DatePicker/DatePicker.js +0 -467
  377. package/legacy/DatePicker/DatePickerToolbar.js +0 -82
  378. package/legacy/DatePicker/shared.js +0 -57
  379. package/legacy/DateRangePicker/DateRangePickerInput.js +0 -144
  380. package/legacy/DateRangePicker/DateRangePickerToolbar.js +0 -73
  381. package/legacy/DateRangePicker/DateRangePickerView.js +0 -181
  382. package/legacy/DateRangePicker/DateRangePickerViewDesktop.js +0 -174
  383. package/legacy/DateRangePicker/DateRangePickerViewMobile.js +0 -64
  384. package/legacy/DateRangePicker/RangeTypes.js +0 -1
  385. package/legacy/DateRangePicker/date-range-manager.js +0 -51
  386. package/legacy/DateTimePicker/DateTimePicker.js +0 -545
  387. package/legacy/DateTimePicker/DateTimePickerTabs.js +0 -88
  388. package/legacy/DateTimePicker/DateTimePickerToolbar.js +0 -151
  389. package/legacy/DateTimePicker/shared.js +0 -58
  390. package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -446
  391. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -520
  392. package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -368
  393. package/legacy/LocalizationProvider/LocalizationProvider.js +0 -108
  394. package/legacy/MobileDatePicker/MobileDatePicker.js +0 -452
  395. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -532
  396. package/legacy/MobileTimePicker/MobileTimePicker.js +0 -380
  397. package/legacy/MonthPicker/MonthPicker.js +0 -179
  398. package/legacy/MonthPicker/PickersMonth.js +0 -70
  399. package/legacy/PickersDay/PickersDay.js +0 -399
  400. package/legacy/StaticDatePicker/StaticDatePicker.js +0 -410
  401. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -490
  402. package/legacy/StaticTimePicker/StaticTimePicker.js +0 -336
  403. package/legacy/TimePicker/TimePicker.js +0 -393
  404. package/legacy/TimePicker/TimePickerToolbar.js +0 -179
  405. package/legacy/TimePicker/shared.js +0 -44
  406. package/legacy/YearPicker/PickersYear.js +0 -115
  407. package/legacy/YearPicker/YearPicker.js +0 -254
  408. package/legacy/YearPicker/yearPickerClasses.js +0 -6
  409. package/legacy/internal/pickers/KeyboardDateInput.js +0 -57
  410. package/legacy/internal/pickers/Picker/Picker.js +0 -141
  411. package/legacy/internal/pickers/Picker/PickerView.js +0 -11
  412. package/legacy/internal/pickers/PickersArrowSwitcher.js +0 -92
  413. package/legacy/internal/pickers/PickersModalDialog.js +0 -85
  414. package/legacy/internal/pickers/PickersPopper.js +0 -280
  415. package/legacy/internal/pickers/PickersToolbar.js +0 -92
  416. package/legacy/internal/pickers/PickersToolbarButton.js +0 -36
  417. package/legacy/internal/pickers/PickersToolbarText.js +0 -34
  418. package/legacy/internal/pickers/PureDateInput.js +0 -53
  419. package/legacy/internal/pickers/constants/dimensions.js +0 -4
  420. package/legacy/internal/pickers/constants/prop-types.js +0 -1
  421. package/legacy/internal/pickers/date-time-utils.js +0 -25
  422. package/legacy/internal/pickers/date-utils.js +0 -143
  423. package/legacy/internal/pickers/hooks/date-helpers-hooks.js +0 -35
  424. package/legacy/internal/pickers/hooks/useIsLandscape.js +0 -46
  425. package/legacy/internal/pickers/hooks/useMaskedInput.js +0 -105
  426. package/legacy/internal/pickers/hooks/useOpenState.js +0 -41
  427. package/legacy/internal/pickers/hooks/usePickerState.js +0 -143
  428. package/legacy/internal/pickers/hooks/useUtils.js +0 -25
  429. package/legacy/internal/pickers/hooks/useValidation.js +0 -43
  430. package/legacy/internal/pickers/hooks/useViews.js +0 -55
  431. package/legacy/internal/pickers/test-utils.js +0 -112
  432. package/legacy/internal/pickers/text-field-helper.js +0 -68
  433. package/legacy/internal/pickers/time-utils.js +0 -69
  434. package/legacy/internal/pickers/typings/BasePicker.js +0 -1
  435. package/legacy/internal/pickers/typings/Views.js +0 -1
  436. package/legacy/internal/pickers/typings/helpers.js +0 -1
  437. package/legacy/internal/pickers/utils.js +0 -52
  438. package/legacy/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -53
  439. package/legacy/internal/pickers/wrappers/DesktopWrapper.js +0 -43
  440. package/legacy/internal/pickers/wrappers/MobileWrapper.js +0 -47
  441. package/legacy/internal/pickers/wrappers/PickerStaticWrapper.js +0 -61
  442. package/legacy/internal/pickers/wrappers/ResponsiveWrapper.js +0 -42
  443. package/legacy/internal/pickers/wrappers/WrapperProps.js +0 -1
  444. package/legacy/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
  445. package/modern/CalendarPicker/CalendarPicker.js +0 -344
  446. package/modern/CalendarPicker/PickersCalendar.js +0 -145
  447. package/modern/CalendarPicker/PickersCalendarHeader.js +0 -165
  448. package/modern/CalendarPicker/PickersFadeTransitionGroup.js +0 -44
  449. package/modern/CalendarPicker/PickersSlideTransition.js +0 -103
  450. package/modern/CalendarPicker/shared.js +0 -1
  451. package/modern/CalendarPicker/useCalendarState.js +0 -108
  452. package/modern/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -149
  453. package/modern/ClockPicker/Clock.js +0 -267
  454. package/modern/ClockPicker/ClockNumber.js +0 -72
  455. package/modern/ClockPicker/ClockNumbers.js +0 -80
  456. package/modern/ClockPicker/ClockPicker.js +0 -398
  457. package/modern/ClockPicker/ClockPickerStandalone.js +0 -47
  458. package/modern/ClockPicker/ClockPointer.js +0 -103
  459. package/modern/ClockPicker/shared.js +0 -57
  460. package/modern/DatePicker/DatePicker.js +0 -469
  461. package/modern/DatePicker/DatePickerToolbar.js +0 -82
  462. package/modern/DatePicker/shared.js +0 -54
  463. package/modern/DateRangePicker/DateRangePickerInput.js +0 -128
  464. package/modern/DateRangePicker/DateRangePickerToolbar.js +0 -65
  465. package/modern/DateRangePicker/DateRangePickerView.js +0 -177
  466. package/modern/DateRangePicker/DateRangePickerViewDesktop.js +0 -159
  467. package/modern/DateRangePicker/DateRangePickerViewMobile.js +0 -62
  468. package/modern/DateRangePicker/RangeTypes.js +0 -1
  469. package/modern/DateRangePicker/date-range-manager.js +0 -43
  470. package/modern/DateTimePicker/DateTimePicker.js +0 -547
  471. package/modern/DateTimePicker/DateTimePickerTabs.js +0 -87
  472. package/modern/DateTimePicker/DateTimePickerToolbar.js +0 -139
  473. package/modern/DateTimePicker/shared.js +0 -58
  474. package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -444
  475. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -518
  476. package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -366
  477. package/modern/LocalizationProvider/LocalizationProvider.js +0 -108
  478. package/modern/MobileDatePicker/MobileDatePicker.js +0 -449
  479. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -529
  480. package/modern/MobileTimePicker/MobileTimePicker.js +0 -377
  481. package/modern/MonthPicker/MonthPicker.js +0 -182
  482. package/modern/MonthPicker/PickersMonth.js +0 -72
  483. package/modern/PickersDay/PickersDay.js +0 -396
  484. package/modern/StaticDatePicker/StaticDatePicker.js +0 -406
  485. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -486
  486. package/modern/StaticTimePicker/StaticTimePicker.js +0 -333
  487. package/modern/TimePicker/TimePicker.js +0 -395
  488. package/modern/TimePicker/TimePickerToolbar.js +0 -172
  489. package/modern/TimePicker/shared.js +0 -45
  490. package/modern/YearPicker/PickersYear.js +0 -112
  491. package/modern/YearPicker/YearPicker.js +0 -251
  492. package/modern/YearPicker/yearPickerClasses.js +0 -6
  493. package/modern/internal/pickers/KeyboardDateInput.js +0 -59
  494. package/modern/internal/pickers/Picker/Picker.js +0 -130
  495. package/modern/internal/pickers/Picker/PickerView.js +0 -11
  496. package/modern/internal/pickers/PickersArrowSwitcher.js +0 -91
  497. package/modern/internal/pickers/PickersModalDialog.js +0 -78
  498. package/modern/internal/pickers/PickersPopper.js +0 -267
  499. package/modern/internal/pickers/PickersToolbar.js +0 -88
  500. package/modern/internal/pickers/PickersToolbarButton.js +0 -39
  501. package/modern/internal/pickers/PickersToolbarText.js +0 -36
  502. package/modern/internal/pickers/PureDateInput.js +0 -51
  503. package/modern/internal/pickers/constants/dimensions.js +0 -4
  504. package/modern/internal/pickers/constants/prop-types.js +0 -1
  505. package/modern/internal/pickers/date-time-utils.js +0 -28
  506. package/modern/internal/pickers/date-utils.js +0 -138
  507. package/modern/internal/pickers/hooks/date-helpers-hooks.js +0 -37
  508. package/modern/internal/pickers/hooks/useIsLandscape.js +0 -43
  509. package/modern/internal/pickers/hooks/useMaskedInput.js +0 -93
  510. package/modern/internal/pickers/hooks/useOpenState.js +0 -38
  511. package/modern/internal/pickers/hooks/usePickerState.js +0 -117
  512. package/modern/internal/pickers/hooks/useUtils.js +0 -25
  513. package/modern/internal/pickers/hooks/useValidation.js +0 -44
  514. package/modern/internal/pickers/hooks/useViews.js +0 -48
  515. package/modern/internal/pickers/test-utils.js +0 -91
  516. package/modern/internal/pickers/text-field-helper.js +0 -66
  517. package/modern/internal/pickers/time-utils.js +0 -68
  518. package/modern/internal/pickers/typings/BasePicker.js +0 -1
  519. package/modern/internal/pickers/typings/Views.js +0 -1
  520. package/modern/internal/pickers/typings/helpers.js +0 -1
  521. package/modern/internal/pickers/utils.js +0 -36
  522. package/modern/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -53
  523. package/modern/internal/pickers/wrappers/DesktopWrapper.js +0 -45
  524. package/modern/internal/pickers/wrappers/MobileWrapper.js +0 -50
  525. package/modern/internal/pickers/wrappers/PickerStaticWrapper.js +0 -63
  526. package/modern/internal/pickers/wrappers/ResponsiveWrapper.js +0 -44
  527. package/modern/internal/pickers/wrappers/WrapperProps.js +0 -1
  528. package/modern/internal/pickers/wrappers/WrapperVariantContext.js +0 -12
  529. package/node/CalendarPicker/CalendarPicker.js +0 -377
  530. package/node/CalendarPicker/PickersCalendar.js +0 -166
  531. package/node/CalendarPicker/PickersCalendarHeader.js +0 -189
  532. package/node/CalendarPicker/PickersFadeTransitionGroup.js +0 -65
  533. package/node/CalendarPicker/PickersSlideTransition.js +0 -127
  534. package/node/CalendarPicker/shared.js +0 -5
  535. package/node/CalendarPicker/useCalendarState.js +0 -131
  536. package/node/CalendarPickerSkeleton/CalendarPickerSkeleton.js +0 -177
  537. package/node/ClockPicker/Clock.js +0 -290
  538. package/node/ClockPicker/ClockNumber.js +0 -95
  539. package/node/ClockPicker/ClockNumbers.js +0 -100
  540. package/node/ClockPicker/ClockPicker.js +0 -428
  541. package/node/ClockPicker/ClockPickerStandalone.js +0 -68
  542. package/node/ClockPicker/ClockPointer.js +0 -123
  543. package/node/ClockPicker/shared.js +0 -70
  544. package/node/DatePicker/DatePicker.js +0 -490
  545. package/node/DatePicker/DatePickerToolbar.js +0 -106
  546. package/node/DatePicker/shared.js +0 -73
  547. package/node/DateRangePicker/DateRangePickerInput.js +0 -155
  548. package/node/DateRangePicker/DateRangePickerToolbar.js +0 -86
  549. package/node/DateRangePicker/DateRangePickerView.js +0 -205
  550. package/node/DateRangePicker/DateRangePickerViewDesktop.js +0 -184
  551. package/node/DateRangePicker/DateRangePickerViewMobile.js +0 -84
  552. package/node/DateRangePicker/RangeTypes.js +0 -5
  553. package/node/DateRangePicker/date-range-manager.js +0 -52
  554. package/node/DateTimePicker/DateTimePicker.js +0 -568
  555. package/node/DateTimePicker/DateTimePickerTabs.js +0 -106
  556. package/node/DateTimePicker/DateTimePickerToolbar.js +0 -163
  557. package/node/DateTimePicker/shared.js +0 -72
  558. package/node/DesktopDatePicker/DesktopDatePicker.js +0 -469
  559. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -543
  560. package/node/DesktopTimePicker/DesktopTimePicker.js +0 -391
  561. package/node/LocalizationProvider/LocalizationProvider.js +0 -126
  562. package/node/MobileDatePicker/MobileDatePicker.js +0 -475
  563. package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -555
  564. package/node/MobileTimePicker/MobileTimePicker.js +0 -403
  565. package/node/MonthPicker/MonthPicker.js +0 -209
  566. package/node/MonthPicker/PickersMonth.js +0 -96
  567. package/node/PickersDay/PickersDay.js +0 -429
  568. package/node/StaticDatePicker/StaticDatePicker.js +0 -431
  569. package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -511
  570. package/node/StaticTimePicker/StaticTimePicker.js +0 -357
  571. package/node/TimePicker/TimePicker.js +0 -416
  572. package/node/TimePicker/TimePickerToolbar.js +0 -200
  573. package/node/TimePicker/shared.js +0 -59
  574. package/node/YearPicker/PickersYear.js +0 -136
  575. package/node/YearPicker/YearPicker.js +0 -275
  576. package/node/YearPicker/yearPickerClasses.js +0 -17
  577. package/node/internal/pickers/KeyboardDateInput.js +0 -85
  578. package/node/internal/pickers/Picker/Picker.js +0 -156
  579. package/node/internal/pickers/Picker/PickerView.js +0 -21
  580. package/node/internal/pickers/PickersArrowSwitcher.js +0 -113
  581. package/node/internal/pickers/PickersModalDialog.js +0 -100
  582. package/node/internal/pickers/PickersPopper.js +0 -291
  583. package/node/internal/pickers/PickersToolbar.js +0 -112
  584. package/node/internal/pickers/PickersToolbarButton.js +0 -60
  585. package/node/internal/pickers/PickersToolbarText.js +0 -58
  586. package/node/internal/pickers/PureDateInput.js +0 -70
  587. package/node/internal/pickers/constants/dimensions.js +0 -14
  588. package/node/internal/pickers/constants/prop-types.js +0 -5
  589. package/node/internal/pickers/date-time-utils.js +0 -40
  590. package/node/internal/pickers/date-utils.js +0 -170
  591. package/node/internal/pickers/hooks/date-helpers-hooks.js +0 -55
  592. package/node/internal/pickers/hooks/useIsLandscape.js +0 -59
  593. package/node/internal/pickers/hooks/useMaskedInput.js +0 -115
  594. package/node/internal/pickers/hooks/useOpenState.js +0 -53
  595. package/node/internal/pickers/hooks/usePickerState.js +0 -134
  596. package/node/internal/pickers/hooks/useUtils.js +0 -42
  597. package/node/internal/pickers/hooks/useValidation.js +0 -65
  598. package/node/internal/pickers/hooks/useViews.js +0 -64
  599. package/node/internal/pickers/test-utils.js +0 -122
  600. package/node/internal/pickers/text-field-helper.js +0 -86
  601. package/node/internal/pickers/time-utils.js +0 -92
  602. package/node/internal/pickers/typings/BasePicker.js +0 -5
  603. package/node/internal/pickers/typings/Views.js +0 -5
  604. package/node/internal/pickers/typings/helpers.js +0 -5
  605. package/node/internal/pickers/utils.js +0 -58
  606. package/node/internal/pickers/wrappers/DesktopTooltipWrapper.js +0 -74
  607. package/node/internal/pickers/wrappers/DesktopWrapper.js +0 -63
  608. package/node/internal/pickers/wrappers/MobileWrapper.js +0 -68
  609. package/node/internal/pickers/wrappers/PickerStaticWrapper.js +0 -88
  610. package/node/internal/pickers/wrappers/ResponsiveWrapper.js +0 -64
  611. package/node/internal/pickers/wrappers/WrapperProps.js +0 -5
  612. package/node/internal/pickers/wrappers/WrapperVariantContext.js +0 -25
@@ -1,93 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { useRifm } from 'rifm';
4
- import { useUtils } from './useUtils';
5
- import { createDelegatedEventHandler } from '../utils';
6
- import { maskedDateFormatter, getDisplayDate, checkMaskIsValidForCurrentFormat } from '../text-field-helper';
7
- export function useMaskedInput({
8
- acceptRegex = /[\d]/gi,
9
- disabled,
10
- disableMaskedInput,
11
- ignoreInvalidInputs,
12
- inputFormat,
13
- inputProps,
14
- label,
15
- mask,
16
- onChange,
17
- rawValue,
18
- readOnly,
19
- rifmFormatter,
20
- TextFieldProps,
21
- validationError
22
- }) {
23
- const utils = useUtils();
24
- const [isFocused, setIsFocused] = React.useState(false);
25
- const formatHelperText = utils.getFormatHelperText(inputFormat);
26
- const shouldUseMaskedInput = React.useMemo(() => {
27
- // formatting of dates is a quite slow thing, so do not make useless .format calls
28
- if (!mask || disableMaskedInput) {
29
- return false;
30
- }
31
-
32
- return checkMaskIsValidForCurrentFormat(mask, inputFormat, acceptRegex, utils);
33
- }, [acceptRegex, disableMaskedInput, inputFormat, mask, utils]);
34
- const formatter = React.useMemo(() => shouldUseMaskedInput && mask ? maskedDateFormatter(mask, acceptRegex) : st => st, [acceptRegex, mask, shouldUseMaskedInput]); // TODO: Implement with controlled vs unctrolled `rawValue`
35
-
36
- const currentInputValue = getDisplayDate(utils, rawValue, inputFormat);
37
- const [innerInputValue, setInnerInputValue] = React.useState(currentInputValue);
38
- const previousInputValueRef = React.useRef(currentInputValue);
39
- React.useEffect(() => {
40
- previousInputValueRef.current = currentInputValue;
41
- }, [currentInputValue]);
42
- const notTyping = !isFocused;
43
- const valueChanged = previousInputValueRef.current !== currentInputValue; // Update the input value only if the value changed outside of typing
44
-
45
- if (notTyping && valueChanged && (rawValue === null || utils.isValid(rawValue))) {
46
- if (currentInputValue !== innerInputValue) {
47
- setInnerInputValue(currentInputValue);
48
- }
49
- }
50
-
51
- const handleChange = text => {
52
- const finalString = text === '' || text === mask ? '' : text;
53
- setInnerInputValue(finalString);
54
- const date = finalString === null ? null : utils.parse(finalString, inputFormat);
55
-
56
- if (ignoreInvalidInputs && !utils.isValid(date)) {
57
- return;
58
- }
59
-
60
- onChange(date, finalString || undefined);
61
- };
62
-
63
- const rifmProps = useRifm({
64
- value: innerInputValue,
65
- onChange: handleChange,
66
- format: rifmFormatter || formatter
67
- });
68
- const inputStateArgs = shouldUseMaskedInput ? rifmProps : {
69
- value: innerInputValue,
70
- onChange: event => {
71
- handleChange(event.currentTarget.value);
72
- }
73
- };
74
- return _extends({
75
- label,
76
- disabled,
77
- error: validationError,
78
- inputProps: _extends({}, inputStateArgs, {
79
- disabled,
80
- placeholder: formatHelperText,
81
- readOnly,
82
- type: shouldUseMaskedInput ? 'tel' : 'text'
83
- }, inputProps, {
84
- onFocus: createDelegatedEventHandler(() => {
85
- setIsFocused(true);
86
- }, inputProps == null ? void 0 : inputProps.onFocus),
87
- onBlur: createDelegatedEventHandler(() => {
88
- setIsFocused(false);
89
- }, inputProps == null ? void 0 : inputProps.onBlur)
90
- })
91
- }, TextFieldProps);
92
- }
93
- export default useMaskedInput;
@@ -1,10 +0,0 @@
1
- export interface OpenStateProps {
2
- open?: boolean;
3
- onOpen?: () => void;
4
- onClose?: () => void;
5
- }
6
- export declare function useOpenState({ open, onOpen, onClose }: OpenStateProps): {
7
- isOpen: boolean;
8
- setIsOpen: (newIsOpen: boolean) => void;
9
- };
10
- export default useOpenState;
@@ -1,38 +0,0 @@
1
- import * as React from 'react';
2
- export function useOpenState({
3
- open,
4
- onOpen,
5
- onClose
6
- }) {
7
- const isControllingOpenProp = React.useRef(typeof open === 'boolean').current;
8
- const [openState, setIsOpenState] = React.useState(false); // It is required to update inner state in useEffect in order to avoid situation when
9
- // Our component is not mounted yet, but `open` state is set to `true` (e.g. initially opened)
10
-
11
- React.useEffect(() => {
12
- if (isControllingOpenProp) {
13
- if (typeof open !== 'boolean') {
14
- throw new Error('You must not mix controlling and uncontrolled mode for `open` prop');
15
- }
16
-
17
- setIsOpenState(open);
18
- }
19
- }, [isControllingOpenProp, open]);
20
- const setIsOpen = React.useCallback(newIsOpen => {
21
- if (!isControllingOpenProp) {
22
- setIsOpenState(newIsOpen);
23
- }
24
-
25
- if (newIsOpen && onOpen) {
26
- onOpen();
27
- }
28
-
29
- if (!newIsOpen && onClose) {
30
- onClose();
31
- }
32
- }, [isControllingOpenProp, onOpen, onClose]);
33
- return {
34
- isOpen: openState,
35
- setIsOpen
36
- };
37
- }
38
- export default useOpenState;
@@ -1,38 +0,0 @@
1
- import { WrapperVariant } from '../wrappers/WrapperVariantContext';
2
- import { MuiPickersAdapter } from './useUtils';
3
- export interface PickerStateValueManager<TInputValue, TDateValue> {
4
- areValuesEqual: (utils: MuiPickersAdapter, valueLeft: TDateValue, valueRight: TDateValue) => boolean;
5
- emptyValue: TDateValue;
6
- parseInput: (utils: MuiPickersAdapter, value: TInputValue) => TDateValue;
7
- }
8
- export declare type PickerSelectionState = 'partial' | 'shallow' | 'finish';
9
- export interface PickerStateProps<TInput, TDateValue> {
10
- disableCloseOnSelect?: boolean;
11
- open?: boolean;
12
- onAccept?: (date: TDateValue) => void;
13
- onChange: (date: TDateValue, keyboardInputValue?: string) => void;
14
- onClose?: () => void;
15
- onOpen?: () => void;
16
- value: TInput;
17
- }
18
- export declare function usePickerState<TInput, TDateValue>(props: PickerStateProps<TInput, TDateValue>, valueManager: PickerStateValueManager<TInput, TDateValue>): {
19
- pickerProps: {
20
- date: TDateValue;
21
- isMobileKeyboardViewOpen: boolean;
22
- toggleMobileKeyboardView: () => void;
23
- onDateChange: (newDate: TDateValue, wrapperVariant: WrapperVariant, selectionState?: PickerSelectionState) => void;
24
- };
25
- inputProps: {
26
- onChange: (date: TDateValue, keyboardInputValue?: string | undefined) => void;
27
- open: boolean;
28
- rawValue: TInput;
29
- openPicker: () => void;
30
- };
31
- wrapperProps: {
32
- open: boolean;
33
- onClear: () => void;
34
- onAccept: () => void;
35
- onDismiss: () => void;
36
- onSetToday: () => void;
37
- };
38
- };
@@ -1,117 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import * as React from 'react';
3
- import { useOpenState } from './useOpenState';
4
- import { useUtils } from './useUtils';
5
- export function usePickerState(props, valueManager) {
6
- const {
7
- disableCloseOnSelect,
8
- onAccept,
9
- onChange,
10
- value
11
- } = props;
12
- const utils = useUtils();
13
- const {
14
- isOpen,
15
- setIsOpen
16
- } = useOpenState(props);
17
-
18
- function initDraftableDate(date) {
19
- return {
20
- committed: date,
21
- draft: date
22
- };
23
- }
24
-
25
- const parsedDateValue = valueManager.parseInput(utils, value);
26
- const [draftState, dispatch] = React.useReducer((state, action) => {
27
- switch (action.type) {
28
- case 'reset':
29
- return initDraftableDate(action.payload);
30
-
31
- case 'update':
32
- return _extends({}, state, {
33
- draft: action.payload
34
- });
35
-
36
- default:
37
- return state;
38
- }
39
- }, parsedDateValue, initDraftableDate);
40
-
41
- if (!valueManager.areValuesEqual(utils, draftState.committed, parsedDateValue)) {
42
- dispatch({
43
- type: 'reset',
44
- payload: parsedDateValue
45
- });
46
- }
47
-
48
- const [initialDate, setInitialDate] = React.useState(draftState.committed); // Mobile keyboard view is a special case.
49
- // When it's open picker should work like closed, cause we are just showing text field
50
-
51
- const [isMobileKeyboardViewOpen, setMobileKeyboardViewOpen] = React.useState(false);
52
- const acceptDate = React.useCallback((acceptedDate, needClosePicker) => {
53
- onChange(acceptedDate);
54
-
55
- if (needClosePicker) {
56
- setIsOpen(false);
57
- setInitialDate(acceptedDate);
58
-
59
- if (onAccept) {
60
- onAccept(acceptedDate);
61
- }
62
- }
63
- }, [onAccept, onChange, setIsOpen]);
64
- const wrapperProps = React.useMemo(() => ({
65
- open: isOpen,
66
- onClear: () => acceptDate(valueManager.emptyValue, true),
67
- onAccept: () => acceptDate(draftState.draft, true),
68
- onDismiss: () => acceptDate(initialDate, true),
69
- onSetToday: () => {
70
- const now = utils.date();
71
- dispatch({
72
- type: 'update',
73
- payload: now
74
- });
75
- acceptDate(now, !disableCloseOnSelect);
76
- }
77
- }), [acceptDate, disableCloseOnSelect, isOpen, utils, draftState.draft, valueManager.emptyValue, initialDate]);
78
- const pickerProps = React.useMemo(() => ({
79
- date: draftState.draft,
80
- isMobileKeyboardViewOpen,
81
- toggleMobileKeyboardView: () => setMobileKeyboardViewOpen(!isMobileKeyboardViewOpen),
82
- onDateChange: (newDate, wrapperVariant, selectionState = 'partial') => {
83
- dispatch({
84
- type: 'update',
85
- payload: newDate
86
- });
87
-
88
- if (selectionState === 'partial') {
89
- acceptDate(newDate, false);
90
- }
91
-
92
- if (selectionState === 'finish') {
93
- const shouldCloseOnSelect = !(disableCloseOnSelect != null ? disableCloseOnSelect : wrapperVariant === 'mobile');
94
- acceptDate(newDate, shouldCloseOnSelect);
95
- } // if selectionState === "shallow" do nothing (we already update the draft state)
96
-
97
- }
98
- }), [acceptDate, disableCloseOnSelect, isMobileKeyboardViewOpen, draftState.draft]);
99
- const inputProps = React.useMemo(() => ({
100
- onChange,
101
- open: isOpen,
102
- rawValue: value,
103
- openPicker: () => setIsOpen(true)
104
- }), [onChange, isOpen, value, setIsOpen]);
105
- const pickerState = {
106
- pickerProps,
107
- inputProps,
108
- wrapperProps
109
- };
110
- React.useDebugValue(pickerState, () => ({
111
- MuiPickerState: {
112
- pickerDraft: draftState,
113
- other: pickerState
114
- }
115
- }));
116
- return pickerState;
117
- }
@@ -1,7 +0,0 @@
1
- export declare type MuiPickersAdapter<TDate = unknown> = import('../../../LocalizationProvider').MuiPickersAdapter<TDate>;
2
- export declare function useUtils<T = unknown>(): import("../../../LocalizationProvider").MuiPickersAdapter<T>;
3
- export declare function useDefaultDates<T>(): {
4
- minDate: T;
5
- maxDate: T;
6
- };
7
- export declare function useNow<TDate = unknown>(): TDate;
@@ -1,25 +0,0 @@
1
- import { formatMuiErrorMessage as _formatMuiErrorMessage } from "@mui/utils";
2
- import * as React from 'react';
3
- import { MuiPickersAdapterContext } from '../../../LocalizationProvider'; // Required for babel https://github.com/vercel/next.js/issues/7882. Replace with `export type` in future
4
-
5
- function useLocalizationContext() {
6
- const localization = React.useContext(MuiPickersAdapterContext);
7
-
8
- if (localization === null) {
9
- throw new Error(process.env.NODE_ENV !== "production" ? `Can not find utils in context. It looks like you forgot to wrap your component in LocalizationProvider, or pass dateAdapter prop directly.` : _formatMuiErrorMessage(13));
10
- }
11
-
12
- return localization;
13
- }
14
-
15
- export function useUtils() {
16
- return useLocalizationContext().utils;
17
- }
18
- export function useDefaultDates() {
19
- return useLocalizationContext().defaultDates;
20
- }
21
- export function useNow() {
22
- const utils = useUtils();
23
- const now = React.useRef(utils.date());
24
- return now.current;
25
- }
@@ -1,23 +0,0 @@
1
- import { DateValidationProps, RangeInput } from '../date-utils';
2
- import { DateTimeValidationProps } from '../date-time-utils';
3
- import { TimeValidationProps } from '../time-utils';
4
- export interface ValidationProps<TError, TDateValue> {
5
- /**
6
- * Callback that fired when input value or new `value` prop validation returns **new** validation error (or value is valid after error).
7
- * In case of validation error detected `reason` prop return non-null value and `TextField` must be displayed in `error` state.
8
- * This can be used to render appropriate form error.
9
- *
10
- * [Read the guide](https://next.material-ui-pickers.dev/guides/forms) about form integration and error displaying.
11
- * @DateIOType
12
- */
13
- onError?: (reason: TError, value: TDateValue) => void;
14
- value: TDateValue;
15
- }
16
- export declare type TimeValidationError = import('../time-utils').TimeValidationError;
17
- export declare function useTimeValidation<TDate>(props: TimeValidationProps<TDate> & ValidationProps<TimeValidationError, TDate>): TimeValidationError;
18
- export declare type DateValidationError = import('../date-utils').DateValidationError;
19
- export declare function useDateValidation<TDate>(props: DateValidationProps<TDate> & ValidationProps<DateValidationError, TDate>): DateValidationError;
20
- export declare type DateTimeValidationError = import('../date-time-utils').DateTimeValidationError;
21
- export declare function useDateTimeValidation<TDate>(props: DateTimeValidationProps<TDate> & ValidationProps<DateTimeValidationError, TDate>): DateTimeValidationError;
22
- export declare type DateRangeValidationError = import('../date-utils').DateRangeValidationError;
23
- export declare function useDateRangeValidation<TDate>(props: DateValidationProps<TDate> & ValidationProps<DateRangeValidationError, RangeInput<TDate>>): DateRangeValidationError;
@@ -1,44 +0,0 @@
1
- import * as React from 'react';
2
- import { useUtils } from './useUtils';
3
- import { validateDate, validateDateRange } from '../date-utils';
4
- import { validateDateTime } from '../date-time-utils';
5
- import { validateTime } from '../time-utils';
6
-
7
- function isSameDateOrTimeError(a, b) {
8
- return a === b;
9
- }
10
-
11
- function isSameDateRangeError(a, b) {
12
- return b !== null && a[1] === b[1] && a[0] === b[0];
13
- }
14
-
15
- function useValidation(props, validate, isSameError = isSameDateOrTimeError) {
16
- const {
17
- value,
18
- onError
19
- } = props;
20
- const utils = useUtils();
21
- const previousValidationErrorRef = React.useRef(null);
22
- const validationError = validate(utils, value, props);
23
- React.useEffect(() => {
24
- if (onError && !isSameError(validationError, previousValidationErrorRef.current)) {
25
- onError(validationError, value);
26
- }
27
-
28
- previousValidationErrorRef.current = validationError;
29
- }, [isSameError, onError, previousValidationErrorRef, validationError, value]);
30
- return validationError;
31
- }
32
-
33
- export function useTimeValidation(props) {
34
- return useValidation(props, validateTime, isSameDateOrTimeError);
35
- }
36
- export function useDateValidation(props) {
37
- return useValidation(props, validateDate, isSameDateOrTimeError);
38
- }
39
- export function useDateTimeValidation(props) {
40
- return useValidation(props, validateDateTime, isSameDateOrTimeError);
41
- }
42
- export function useDateRangeValidation(props) {
43
- return useValidation(props, validateDateRange, isSameDateRangeError);
44
- }
@@ -1,19 +0,0 @@
1
- import { PickerSelectionState } from './usePickerState';
2
- import { AllAvailableViews } from '../typings/Views';
3
- export declare type PickerOnChangeFn<TDate> = (date: TDate | null, selectionState?: PickerSelectionState) => void;
4
- interface UseViewsOptions<TDate, View extends AllAvailableViews> {
5
- onChange: PickerOnChangeFn<TDate>;
6
- onViewChange?: (newView: View) => void;
7
- openTo?: View;
8
- view: View | undefined;
9
- views: readonly View[];
10
- }
11
- export declare function useViews<TDate, View extends AllAvailableViews>({ onChange, onViewChange, openTo, view, views, }: UseViewsOptions<TDate, View>): {
12
- handleChangeAndOpenNext: (date: TDate, currentViewSelectionState?: PickerSelectionState | undefined) => void;
13
- nextView: View;
14
- previousView: View;
15
- openNext: () => void;
16
- openView: View;
17
- setOpenView: (newView: View) => void;
18
- };
19
- export {};
@@ -1,50 +0,0 @@
1
- import * as React from 'react';
2
- import { useControlled } from '@mui/material/utils';
3
- import { arrayIncludes } from '../utils';
4
- export function useViews({
5
- onChange,
6
- onViewChange,
7
- openTo,
8
- view,
9
- views
10
- }) {
11
- var _views, _views2;
12
-
13
- const [openView, setOpenView] = useControlled({
14
- name: 'Picker',
15
- state: 'view',
16
- controlled: view,
17
- default: openTo && arrayIncludes(views, openTo) ? openTo : views[0]
18
- });
19
- const previousView = (_views = views[views.indexOf(openView) - 1]) != null ? _views : null;
20
- const nextView = (_views2 = views[views.indexOf(openView) + 1]) != null ? _views2 : null;
21
- const changeView = React.useCallback(newView => {
22
- setOpenView(newView);
23
-
24
- if (onViewChange) {
25
- onViewChange(newView);
26
- }
27
- }, [setOpenView, onViewChange]);
28
- const openNext = React.useCallback(() => {
29
- if (nextView) {
30
- changeView(nextView);
31
- }
32
- }, [nextView, changeView]);
33
- const handleChangeAndOpenNext = React.useCallback((date, currentViewSelectionState) => {
34
- const isSelectionFinishedOnCurrentView = currentViewSelectionState === 'finish';
35
- const globalSelectionState = isSelectionFinishedOnCurrentView && Boolean(nextView) ? 'partial' : currentViewSelectionState;
36
- onChange(date, globalSelectionState);
37
-
38
- if (isSelectionFinishedOnCurrentView) {
39
- openNext();
40
- }
41
- }, [nextView, onChange, openNext]);
42
- return {
43
- handleChangeAndOpenNext,
44
- nextView,
45
- previousView,
46
- openNext,
47
- openView,
48
- setOpenView: changeView
49
- };
50
- }
@@ -1,91 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
- const _excluded = ["locale"];
4
- import * as React from 'react';
5
- import { parseISO } from 'date-fns';
6
- import { createRenderer, fireEvent, screen } from 'test/utils';
7
- import AdapterDateFns from '@mui/lab/AdapterDateFns';
8
- import LocalizationProvider from '@mui/lab/LocalizationProvider'; // TODO make possible to pass here any utils using cli
9
-
10
- /**
11
- * Wrapper around `@date-io/date-fns` that resolves https://github.com/dmtrKovalenko/date-io/issues/479.
12
- * We're not using `adapter.date` in the implementation which means the implementation is safe.
13
- * But we do use it in tests where usage of ISO dates without timezone is problematic
14
- */
15
-
16
- import { jsx as _jsx } from "react/jsx-runtime";
17
- export class AdapterClassToUse extends AdapterDateFns {
18
- constructor(...args) {
19
- super(...args);
20
-
21
- this.date = value => {
22
- if (typeof value === 'string') {
23
- return parseISO(value);
24
- }
25
-
26
- if (typeof value === 'undefined') {
27
- return new Date();
28
- }
29
-
30
- if (value === null) {
31
- // @ts-expect-error AdapterDateFns#date says it returns NotNullable but that's not true
32
- return null;
33
- }
34
-
35
- return new Date(value);
36
- };
37
- }
38
-
39
- }
40
- export const adapterToUse = new AdapterClassToUse();
41
- export const FakeTransitionComponent = /*#__PURE__*/React.forwardRef(function FakeTransitionComponent({
42
- children
43
- }, ref) {
44
- // set tabIndex in case it is used as a child of <TrapFocus />
45
- return /*#__PURE__*/_jsx("div", {
46
- ref: ref,
47
- tabIndex: -1,
48
- children: children
49
- });
50
- });
51
- export function wrapPickerMount(mount) {
52
- return node => mount( /*#__PURE__*/_jsx(LocalizationProvider, {
53
- dateAdapter: AdapterClassToUse,
54
- children: node
55
- }));
56
- }
57
- export function createPickerRenderer(_ref = {}) {
58
- let {
59
- locale
60
- } = _ref,
61
- createRendererOptions = _objectWithoutPropertiesLoose(_ref, _excluded);
62
-
63
- const {
64
- clock,
65
- render: clientRender
66
- } = createRenderer(createRendererOptions);
67
-
68
- function Wrapper({
69
- children
70
- }) {
71
- return /*#__PURE__*/_jsx(LocalizationProvider, {
72
- locale: locale,
73
- dateAdapter: AdapterClassToUse,
74
- children: children
75
- });
76
- }
77
-
78
- return {
79
- clock,
80
-
81
- render(node, options) {
82
- return clientRender(node, _extends({}, options, {
83
- wrapper: Wrapper
84
- }));
85
- }
86
-
87
- };
88
- }
89
- export function openMobilePicker() {
90
- fireEvent.click(screen.getByRole('textbox'));
91
- }
@@ -1,11 +0,0 @@
1
- import { ParseableDate } from './constants/prop-types';
2
- import { MuiPickersAdapter } from './hooks/useUtils';
3
- export declare function getTextFieldAriaText<TDate>(rawValue: ParseableDate<TDate>, utils: MuiPickersAdapter<TDate>): string;
4
- export declare const getDisplayDate: <TDate>(utils: MuiPickersAdapter<TDate>, value: ParseableDate<TDate>, inputFormat: string) => string;
5
- export declare function pick12hOr24hFormat(userFormat: string | undefined, ampm: boolean | undefined, formats: {
6
- localized: string;
7
- '12h': string;
8
- '24h': string;
9
- }): string;
10
- export declare function checkMaskIsValidForCurrentFormat(mask: string, format: string, acceptRegex: RegExp, utils: MuiPickersAdapter): boolean;
11
- export declare const maskedDateFormatter: (mask: string, acceptRegexp: RegExp) => (value: string) => string;
@@ -1,66 +0,0 @@
1
- export function getTextFieldAriaText(rawValue, utils) {
2
- // TODO: should `isValid` narrow `TDate | null` to `NonNullable<TDate>`?
3
- // Either we allow `TDate | null` to be valid and guard against calling `formatByString` with `null`.
4
- // Or we ensure `formatByString` is callable with `null`.
5
- return rawValue && utils.isValid(utils.date(rawValue)) ? `Choose date, selected date is ${utils.format(utils.date(rawValue), 'fullDate')}` : 'Choose date';
6
- }
7
- export const getDisplayDate = (utils, value, inputFormat) => {
8
- const date = utils.date(value);
9
- const isEmpty = value === null;
10
-
11
- if (isEmpty) {
12
- return '';
13
- }
14
-
15
- return utils.isValid(date) ? utils.formatByString( // TODO: should `isValid` narrow `TDate | null` to `NonNullable<TDate>`?
16
- // Either we allow `TDate | null` to be valid and guard against calling `formatByString` with `null`.
17
- // Or we ensure `formatByString` is callable with `null`.
18
- date, inputFormat) : '';
19
- };
20
- export function pick12hOr24hFormat(userFormat, ampm, formats) {
21
- if (userFormat) {
22
- return userFormat;
23
- }
24
-
25
- if (typeof ampm === 'undefined') {
26
- return formats.localized;
27
- }
28
-
29
- return ampm ? formats['12h'] : formats['24h'];
30
- }
31
- const MASK_USER_INPUT_SYMBOL = '_';
32
- const staticDateWith2DigitTokens = '2019-11-21T22:30:00.000';
33
- const staticDateWith1DigitTokens = '2019-01-01T09:00:00.000';
34
- export function checkMaskIsValidForCurrentFormat(mask, format, acceptRegex, utils) {
35
- const formattedDateWith1Digit = utils.formatByString(utils.date(staticDateWith1DigitTokens), format);
36
- const inferredFormatPatternWith1Digits = formattedDateWith1Digit.replace(acceptRegex, MASK_USER_INPUT_SYMBOL);
37
- const inferredFormatPatternWith2Digits = utils.formatByString(utils.date(staticDateWith2DigitTokens), format).replace(acceptRegex, '_');
38
- const isMaskValid = inferredFormatPatternWith2Digits === mask && inferredFormatPatternWith1Digits === mask;
39
-
40
- if (!isMaskValid && utils.lib !== 'luxon' && process.env.NODE_ENV !== 'production') {
41
- console.warn(`The mask "${mask}" you passed is not valid for the format used ${format}. Falling down to uncontrolled not-masked input.`);
42
- }
43
-
44
- return isMaskValid;
45
- }
46
- export const maskedDateFormatter = (mask, acceptRegexp) => value => {
47
- return value.split('').map((char, i) => {
48
- acceptRegexp.lastIndex = 0;
49
-
50
- if (i > mask.length - 1) {
51
- return '';
52
- }
53
-
54
- const maskChar = mask[i];
55
- const nextMaskChar = mask[i + 1];
56
- const acceptedChar = acceptRegexp.test(char) ? char : '';
57
- const formattedChar = maskChar === MASK_USER_INPUT_SYMBOL ? acceptedChar : maskChar + acceptedChar;
58
-
59
- if (i === value.length - 1 && nextMaskChar && nextMaskChar !== MASK_USER_INPUT_SYMBOL) {
60
- // when cursor at the end of mask part (e.g. month) prerender next symbol "21" -> "21/"
61
- return formattedChar ? formattedChar + nextMaskChar : '';
62
- }
63
-
64
- return formattedChar;
65
- }).join('');
66
- };
@@ -1,33 +0,0 @@
1
- import { ParseableDate } from './constants/prop-types';
2
- import { MuiPickersAdapter } from './hooks/useUtils';
3
- declare type Meridiem = 'am' | 'pm' | null;
4
- export declare const getMeridiem: (date: unknown, utils: MuiPickersAdapter<unknown>) => Meridiem;
5
- export declare const convertValueToMeridiem: (value: number, meridiem: Meridiem, ampm: boolean) => number;
6
- export declare const convertToMeridiem: <TDate>(time: TDate, meridiem: 'am' | 'pm', ampm: boolean, utils: MuiPickersAdapter<TDate>) => TDate;
7
- export declare function getSecondsInDay(date: unknown, utils: MuiPickersAdapter): number;
8
- export declare const createIsAfterIgnoreDatePart: (disableIgnoringDatePartForTimeValidation: boolean, utils: MuiPickersAdapter<unknown>) => (dateLeft: unknown, dateRight: unknown) => boolean;
9
- export interface TimeValidationProps<TDate> {
10
- /**
11
- * Min time acceptable time.
12
- * For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
13
- */
14
- minTime?: TDate;
15
- /**
16
- * Max time acceptable time.
17
- * For input validation date part of passed object will be ignored if `disableIgnoringDatePartForTimeValidation` not specified.
18
- */
19
- maxTime?: TDate;
20
- /**
21
- * Dynamically check if time is disabled or not.
22
- * If returns `false` appropriate time point will ot be acceptable.
23
- */
24
- shouldDisableTime?: (timeValue: number, clockType: 'hours' | 'minutes' | 'seconds') => boolean;
25
- /**
26
- * Do not ignore date part when validating min/max time.
27
- * @default false
28
- */
29
- disableIgnoringDatePartForTimeValidation?: boolean;
30
- }
31
- export declare const validateTime: <TDate>(utils: MuiPickersAdapter<unknown>, value: ParseableDate<TDate>, { minTime, maxTime, shouldDisableTime, disableIgnoringDatePartForTimeValidation, }: TimeValidationProps<TDate>) => "invalidDate" | "minTime" | "maxTime" | "shouldDisableTime-hours" | "shouldDisableTime-minutes" | "shouldDisableTime-seconds" | null;
32
- export declare type TimeValidationError = ReturnType<typeof validateTime>;
33
- export {};