@mui/x-date-pickers 7.0.0-alpha.1 → 7.0.0-alpha.3

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 (323) hide show
  1. package/AdapterDateFns/AdapterDateFns.d.ts +2 -2
  2. package/AdapterDateFns/AdapterDateFns.js +11 -17
  3. package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +2 -2
  4. package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
  5. package/AdapterDayjs/AdapterDayjs.d.ts +2 -2
  6. package/AdapterDayjs/AdapterDayjs.js +13 -15
  7. package/AdapterLuxon/AdapterLuxon.d.ts +3 -3
  8. package/AdapterLuxon/AdapterLuxon.js +31 -39
  9. package/AdapterMoment/AdapterMoment.d.ts +3 -3
  10. package/AdapterMoment/AdapterMoment.js +16 -23
  11. package/AdapterMomentHijri/AdapterMomentHijri.d.ts +1 -3
  12. package/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
  13. package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +1 -4
  14. package/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
  15. package/CHANGELOG.md +607 -188
  16. package/DateCalendar/DateCalendar.js +4 -10
  17. package/DateCalendar/DateCalendar.types.d.ts +0 -4
  18. package/DateCalendar/DayCalendar.d.ts +3 -3
  19. package/DateCalendar/dayCalendarClasses.d.ts +1 -1
  20. package/DateCalendar/dayCalendarClasses.js +1 -1
  21. package/DateCalendar/index.d.ts +1 -1
  22. package/DateCalendar/index.js +1 -1
  23. package/DateCalendar/useCalendarState.d.ts +1 -1
  24. package/DateCalendar/useCalendarState.js +1 -9
  25. package/DateField/DateField.js +1 -1
  26. package/DatePicker/DatePicker.js +3 -7
  27. package/DateTimeField/DateTimeField.js +1 -9
  28. package/DateTimePicker/DateTimePicker.js +3 -15
  29. package/DesktopDatePicker/DesktopDatePicker.js +3 -7
  30. package/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
  31. package/DesktopTimePicker/DesktopTimePicker.js +1 -9
  32. package/DigitalClock/DigitalClock.js +3 -15
  33. package/MobileDatePicker/MobileDatePicker.js +3 -7
  34. package/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
  35. package/MobileTimePicker/MobileTimePicker.js +1 -9
  36. package/MonthCalendar/MonthCalendar.js +1 -1
  37. package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
  38. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +3 -2
  39. package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  40. package/PickersDay/PickersDay.js +1 -1
  41. package/PickersShortcuts/PickersShortcuts.d.ts +1 -1
  42. package/PickersShortcuts/PickersShortcuts.js +1 -1
  43. package/README.md +0 -1
  44. package/StaticDatePicker/StaticDatePicker.js +3 -7
  45. package/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
  46. package/StaticTimePicker/StaticTimePicker.js +1 -9
  47. package/TimeClock/Clock.js +1 -1
  48. package/TimeClock/TimeClock.js +3 -15
  49. package/TimeField/TimeField.js +1 -9
  50. package/TimePicker/TimePicker.js +1 -9
  51. package/YearCalendar/YearCalendar.js +1 -1
  52. package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +1 -1
  53. package/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  54. package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
  55. package/dateViewRenderers/dateViewRenderers.js +0 -2
  56. package/index.js +1 -1
  57. package/internals/components/PickersTextField/Outline.d.ts +2 -0
  58. package/internals/components/PickersTextField/Outline.js +99 -0
  59. package/internals/components/PickersTextField/PickersInput.d.ts +4 -0
  60. package/internals/components/PickersTextField/PickersInput.js +264 -0
  61. package/internals/components/PickersTextField/PickersInput.types.d.ts +30 -0
  62. package/internals/components/PickersTextField/PickersInput.types.js +1 -0
  63. package/internals/components/PickersTextField/PickersTextField.d.ts +3 -0
  64. package/internals/components/PickersTextField/PickersTextField.js +120 -0
  65. package/internals/components/PickersTextField/PickersTextField.types.d.ts +18 -0
  66. package/internals/components/PickersTextField/PickersTextField.types.js +1 -0
  67. package/internals/components/PickersTextField/index.d.ts +1 -0
  68. package/internals/components/PickersTextField/index.js +1 -0
  69. package/internals/components/PickersTextField/pickersTextFieldClasses.d.ts +42 -0
  70. package/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
  71. package/internals/hooks/date-helpers-hooks.js +2 -2
  72. package/internals/hooks/useField/useField.utils.js +30 -17
  73. package/internals/hooks/useField/useFieldState.js +1 -1
  74. package/internals/hooks/usePicker/usePickerValue.js +2 -6
  75. package/internals/hooks/usePicker/usePickerValue.types.d.ts +3 -3
  76. package/internals/hooks/useUtils.js +1 -1
  77. package/internals/hooks/useViews.js +2 -2
  78. package/internals/models/validation.d.ts +0 -8
  79. package/internals/utils/date-utils.js +2 -2
  80. package/internals/utils/validation/extractValidationProps.d.ts +1 -1
  81. package/internals/utils/validation/extractValidationProps.js +1 -1
  82. package/internals/utils/validation/validateDate.js +1 -1
  83. package/internals/utils/validation/validateTime.js +1 -8
  84. package/legacy/AdapterDateFns/AdapterDateFns.js +12 -16
  85. package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +14 -18
  86. package/legacy/AdapterDayjs/AdapterDayjs.js +15 -14
  87. package/legacy/AdapterLuxon/AdapterLuxon.js +34 -39
  88. package/legacy/AdapterMoment/AdapterMoment.js +326 -324
  89. package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +4 -28
  90. package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -33
  91. package/legacy/DateCalendar/DateCalendar.js +4 -10
  92. package/legacy/DateCalendar/PickersSlideTransition.js +8 -9
  93. package/legacy/DateCalendar/dayCalendarClasses.js +1 -1
  94. package/legacy/DateCalendar/index.js +1 -1
  95. package/legacy/DateCalendar/useCalendarState.js +1 -9
  96. package/legacy/DateField/DateField.js +1 -1
  97. package/legacy/DatePicker/DatePicker.js +3 -7
  98. package/legacy/DateTimeField/DateTimeField.js +1 -9
  99. package/legacy/DateTimePicker/DateTimePicker.js +3 -15
  100. package/legacy/DesktopDatePicker/DesktopDatePicker.js +3 -7
  101. package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
  102. package/legacy/DesktopTimePicker/DesktopTimePicker.js +1 -9
  103. package/legacy/DigitalClock/DigitalClock.js +3 -15
  104. package/legacy/MobileDatePicker/MobileDatePicker.js +3 -7
  105. package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
  106. package/legacy/MobileTimePicker/MobileTimePicker.js +1 -9
  107. package/legacy/MonthCalendar/MonthCalendar.js +1 -1
  108. package/legacy/MonthCalendar/PickersMonth.js +4 -5
  109. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
  110. package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  111. package/legacy/PickersDay/PickersDay.js +6 -7
  112. package/legacy/PickersLayout/PickersLayout.js +5 -6
  113. package/legacy/PickersShortcuts/PickersShortcuts.js +2 -1
  114. package/legacy/StaticDatePicker/StaticDatePicker.js +3 -7
  115. package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
  116. package/legacy/StaticTimePicker/StaticTimePicker.js +1 -9
  117. package/legacy/TimeClock/Clock.js +1 -1
  118. package/legacy/TimeClock/ClockNumber.js +4 -5
  119. package/legacy/TimeClock/TimeClock.js +3 -15
  120. package/legacy/TimeField/TimeField.js +1 -9
  121. package/legacy/TimePicker/TimePicker.js +1 -9
  122. package/legacy/TimePicker/TimePickerToolbar.js +1 -2
  123. package/legacy/YearCalendar/PickersYear.js +4 -5
  124. package/legacy/YearCalendar/YearCalendar.js +1 -1
  125. package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  126. package/legacy/dateViewRenderers/dateViewRenderers.js +0 -2
  127. package/legacy/index.js +1 -1
  128. package/legacy/internals/components/PickersModalDialog.js +3 -4
  129. package/legacy/internals/components/PickersTextField/Outline.js +100 -0
  130. package/legacy/internals/components/PickersTextField/PickersInput.js +273 -0
  131. package/legacy/internals/components/PickersTextField/PickersInput.types.js +1 -0
  132. package/legacy/internals/components/PickersTextField/PickersTextField.js +129 -0
  133. package/legacy/internals/components/PickersTextField/PickersTextField.types.js +1 -0
  134. package/legacy/internals/components/PickersTextField/index.js +1 -0
  135. package/legacy/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
  136. package/legacy/internals/hooks/date-helpers-hooks.js +2 -2
  137. package/legacy/internals/hooks/useField/useField.utils.js +30 -17
  138. package/legacy/internals/hooks/useField/useFieldState.js +1 -1
  139. package/legacy/internals/hooks/usePicker/usePickerValue.js +2 -6
  140. package/legacy/internals/hooks/useUtils.js +1 -1
  141. package/legacy/internals/hooks/useViews.js +2 -2
  142. package/legacy/internals/utils/date-utils.js +2 -2
  143. package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
  144. package/legacy/internals/utils/validation/validateDate.js +1 -1
  145. package/legacy/internals/utils/validation/validateTime.js +1 -8
  146. package/legacy/locales/deDE.js +4 -3
  147. package/legacy/locales/index.js +1 -0
  148. package/legacy/locales/mk.js +91 -0
  149. package/legacy/timeViewRenderers/timeViewRenderers.js +0 -6
  150. package/locales/beBY.d.ts +18 -5
  151. package/locales/caES.d.ts +18 -5
  152. package/locales/csCZ.d.ts +18 -5
  153. package/locales/daDK.d.ts +18 -5
  154. package/locales/deDE.d.ts +18 -5
  155. package/locales/deDE.js +2 -3
  156. package/locales/elGR.d.ts +18 -5
  157. package/locales/enUS.d.ts +18 -5
  158. package/locales/esES.d.ts +18 -5
  159. package/locales/eu.d.ts +18 -5
  160. package/locales/faIR.d.ts +18 -5
  161. package/locales/fiFI.d.ts +18 -5
  162. package/locales/frFR.d.ts +18 -5
  163. package/locales/heIL.d.ts +18 -5
  164. package/locales/huHU.d.ts +18 -5
  165. package/locales/index.d.ts +1 -0
  166. package/locales/index.js +1 -0
  167. package/locales/isIS.d.ts +18 -5
  168. package/locales/itIT.d.ts +18 -5
  169. package/locales/jaJP.d.ts +18 -5
  170. package/locales/koKR.d.ts +18 -5
  171. package/locales/kzKZ.d.ts +18 -5
  172. package/locales/mk.d.ts +66 -0
  173. package/locales/mk.js +55 -0
  174. package/locales/nbNO.d.ts +18 -5
  175. package/locales/nlNL.d.ts +18 -5
  176. package/locales/plPL.d.ts +18 -5
  177. package/locales/ptBR.d.ts +18 -5
  178. package/locales/roRO.d.ts +18 -5
  179. package/locales/ruRU.d.ts +18 -5
  180. package/locales/skSK.d.ts +18 -5
  181. package/locales/svSE.d.ts +18 -5
  182. package/locales/trTR.d.ts +18 -5
  183. package/locales/ukUA.d.ts +18 -5
  184. package/locales/urPK.d.ts +18 -5
  185. package/locales/utils/getPickersLocalization.d.ts +18 -5
  186. package/locales/utils/pickersLocaleTextApi.d.ts +18 -5
  187. package/locales/viVN.d.ts +18 -5
  188. package/locales/zhCN.d.ts +18 -5
  189. package/locales/zhHK.d.ts +18 -5
  190. package/models/adapters.d.ts +6 -10
  191. package/models/timezone.d.ts +1 -1
  192. package/models/validation.d.ts +1 -1
  193. package/modern/AdapterDateFns/AdapterDateFns.js +11 -17
  194. package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
  195. package/modern/AdapterDayjs/AdapterDayjs.js +13 -15
  196. package/modern/AdapterLuxon/AdapterLuxon.js +30 -39
  197. package/modern/AdapterMoment/AdapterMoment.js +16 -23
  198. package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
  199. package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
  200. package/modern/DateCalendar/DateCalendar.js +4 -10
  201. package/modern/DateCalendar/dayCalendarClasses.js +1 -1
  202. package/modern/DateCalendar/index.js +1 -1
  203. package/modern/DateCalendar/useCalendarState.js +1 -9
  204. package/modern/DateField/DateField.js +1 -1
  205. package/modern/DatePicker/DatePicker.js +3 -7
  206. package/modern/DateTimeField/DateTimeField.js +1 -9
  207. package/modern/DateTimePicker/DateTimePicker.js +3 -15
  208. package/modern/DesktopDatePicker/DesktopDatePicker.js +3 -7
  209. package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
  210. package/modern/DesktopTimePicker/DesktopTimePicker.js +1 -9
  211. package/modern/DigitalClock/DigitalClock.js +3 -15
  212. package/modern/MobileDatePicker/MobileDatePicker.js +3 -7
  213. package/modern/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
  214. package/modern/MobileTimePicker/MobileTimePicker.js +1 -9
  215. package/modern/MonthCalendar/MonthCalendar.js +1 -1
  216. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
  217. package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  218. package/modern/PickersDay/PickersDay.js +1 -1
  219. package/modern/PickersShortcuts/PickersShortcuts.js +1 -1
  220. package/modern/StaticDatePicker/StaticDatePicker.js +3 -7
  221. package/modern/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
  222. package/modern/StaticTimePicker/StaticTimePicker.js +1 -9
  223. package/modern/TimeClock/Clock.js +1 -1
  224. package/modern/TimeClock/TimeClock.js +3 -15
  225. package/modern/TimeField/TimeField.js +1 -9
  226. package/modern/TimePicker/TimePicker.js +1 -9
  227. package/modern/YearCalendar/YearCalendar.js +1 -1
  228. package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  229. package/modern/dateViewRenderers/dateViewRenderers.js +0 -2
  230. package/modern/index.js +1 -1
  231. package/modern/internals/components/PickersTextField/Outline.js +99 -0
  232. package/modern/internals/components/PickersTextField/PickersInput.js +264 -0
  233. package/modern/internals/components/PickersTextField/PickersInput.types.js +1 -0
  234. package/modern/internals/components/PickersTextField/PickersTextField.js +119 -0
  235. package/modern/internals/components/PickersTextField/PickersTextField.types.js +1 -0
  236. package/modern/internals/components/PickersTextField/index.js +1 -0
  237. package/modern/internals/components/PickersTextField/pickersTextFieldClasses.js +9 -0
  238. package/modern/internals/hooks/date-helpers-hooks.js +2 -2
  239. package/modern/internals/hooks/useField/useField.utils.js +30 -17
  240. package/modern/internals/hooks/useField/useFieldState.js +1 -1
  241. package/modern/internals/hooks/usePicker/usePickerValue.js +2 -6
  242. package/modern/internals/hooks/useUtils.js +1 -1
  243. package/modern/internals/hooks/useViews.js +2 -2
  244. package/modern/internals/utils/date-utils.js +2 -2
  245. package/modern/internals/utils/validation/extractValidationProps.js +1 -1
  246. package/modern/internals/utils/validation/validateDate.js +1 -1
  247. package/modern/internals/utils/validation/validateTime.js +1 -8
  248. package/modern/locales/deDE.js +2 -3
  249. package/modern/locales/index.js +1 -0
  250. package/modern/locales/mk.js +55 -0
  251. package/modern/timeViewRenderers/timeViewRenderers.js +0 -6
  252. package/node/AdapterDateFns/AdapterDateFns.js +11 -17
  253. package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +13 -19
  254. package/node/AdapterDayjs/AdapterDayjs.js +12 -14
  255. package/node/AdapterLuxon/AdapterLuxon.js +30 -39
  256. package/node/AdapterMoment/AdapterMoment.js +16 -23
  257. package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -27
  258. package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +0 -29
  259. package/node/DateCalendar/DateCalendar.js +4 -10
  260. package/node/DateCalendar/dayCalendarClasses.js +2 -2
  261. package/node/DateCalendar/index.js +2 -2
  262. package/node/DateCalendar/useCalendarState.js +1 -9
  263. package/node/DateField/DateField.js +1 -1
  264. package/node/DatePicker/DatePicker.js +3 -7
  265. package/node/DateTimeField/DateTimeField.js +1 -9
  266. package/node/DateTimePicker/DateTimePicker.js +3 -15
  267. package/node/DesktopDatePicker/DesktopDatePicker.js +3 -7
  268. package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +3 -15
  269. package/node/DesktopTimePicker/DesktopTimePicker.js +1 -9
  270. package/node/DigitalClock/DigitalClock.js +3 -15
  271. package/node/MobileDatePicker/MobileDatePicker.js +3 -7
  272. package/node/MobileDateTimePicker/MobileDateTimePicker.js +3 -15
  273. package/node/MobileTimePicker/MobileTimePicker.js +1 -9
  274. package/node/MonthCalendar/MonthCalendar.js +1 -1
  275. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +5 -15
  276. package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
  277. package/node/PickersDay/PickersDay.js +1 -1
  278. package/node/PickersShortcuts/PickersShortcuts.js +1 -1
  279. package/node/StaticDatePicker/StaticDatePicker.js +3 -7
  280. package/node/StaticDateTimePicker/StaticDateTimePicker.js +3 -15
  281. package/node/StaticTimePicker/StaticTimePicker.js +1 -9
  282. package/node/TimeClock/Clock.js +1 -1
  283. package/node/TimeClock/TimeClock.js +3 -15
  284. package/node/TimeField/TimeField.js +1 -9
  285. package/node/TimePicker/TimePicker.js +1 -9
  286. package/node/YearCalendar/YearCalendar.js +1 -1
  287. package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +0 -4
  288. package/node/dateViewRenderers/dateViewRenderers.js +0 -2
  289. package/node/index.js +1 -1
  290. package/node/internals/components/PickersTextField/Outline.js +108 -0
  291. package/node/internals/components/PickersTextField/PickersInput.js +272 -0
  292. package/node/internals/components/PickersTextField/PickersInput.types.js +5 -0
  293. package/node/internals/components/PickersTextField/PickersTextField.js +127 -0
  294. package/node/internals/components/PickersTextField/PickersTextField.types.js +5 -0
  295. package/node/internals/components/PickersTextField/index.js +12 -0
  296. package/node/internals/components/PickersTextField/pickersTextFieldClasses.js +17 -0
  297. package/node/internals/hooks/date-helpers-hooks.js +2 -2
  298. package/node/internals/hooks/useField/useField.utils.js +30 -17
  299. package/node/internals/hooks/useField/useFieldState.js +1 -1
  300. package/node/internals/hooks/usePicker/usePickerValue.js +2 -6
  301. package/node/internals/hooks/useUtils.js +1 -1
  302. package/node/internals/hooks/useViews.js +2 -2
  303. package/node/internals/utils/date-utils.js +2 -2
  304. package/node/internals/utils/validation/extractValidationProps.js +1 -1
  305. package/node/internals/utils/validation/validateDate.js +1 -1
  306. package/node/internals/utils/validation/validateTime.js +1 -8
  307. package/node/locales/deDE.js +2 -3
  308. package/node/locales/index.js +11 -0
  309. package/node/locales/mk.js +60 -0
  310. package/node/timeViewRenderers/timeViewRenderers.js +0 -6
  311. package/package.json +8 -7
  312. package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
  313. package/timeViewRenderers/timeViewRenderers.js +0 -6
  314. package/internals/components/FakeTextField/FakeTextField.d.ts +0 -22
  315. package/internals/components/FakeTextField/FakeTextField.js +0 -44
  316. package/internals/components/FakeTextField/index.d.ts +0 -1
  317. package/internals/components/FakeTextField/index.js +0 -1
  318. package/legacy/internals/components/FakeTextField/FakeTextField.js +0 -49
  319. package/legacy/internals/components/FakeTextField/index.js +0 -1
  320. package/modern/internals/components/FakeTextField/FakeTextField.js +0 -44
  321. package/modern/internals/components/FakeTextField/index.js +0 -1
  322. package/node/internals/components/FakeTextField/FakeTextField.js +0 -52
  323. package/node/internals/components/FakeTextField/index.js +0 -12
@@ -0,0 +1,264 @@
1
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
2
+ import _extends from "@babel/runtime/helpers/esm/extends";
3
+ const _excluded = ["elements", "defaultValue", "label", "onFocus", "onWrapperClick", "onBlur", "valueStr", "onValueStrChange", "id", "InputProps", "inputProps", "autoFocus", "ownerState", "endAdornment", "startAdornment"];
4
+ import * as React from 'react';
5
+ import clsx from 'clsx';
6
+ import Box from '@mui/material/Box';
7
+ import { useFormControl } from '@mui/material/FormControl';
8
+ import { styled } from '@mui/material/styles';
9
+ import useForkRef from '@mui/utils/useForkRef';
10
+ import { unstable_composeClasses as composeClasses, unstable_capitalize as capitalize, visuallyHidden } from '@mui/utils';
11
+ import { pickersInputClasses, getPickersInputUtilityClass } from './pickersTextFieldClasses';
12
+ import Outline from './Outline';
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { jsxs as _jsxs } from "react/jsx-runtime";
15
+ const SectionsWrapper = styled(Box, {
16
+ name: 'MuiPickersInput',
17
+ slot: 'Root',
18
+ overridesResolver: (props, styles) => styles.root
19
+ })(({
20
+ theme,
21
+ ownerState
22
+ }) => {
23
+ const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
24
+ return _extends({
25
+ cursor: 'text',
26
+ padding: '16.5px 14px',
27
+ display: 'flex',
28
+ justifyContent: 'flex-start',
29
+ alignItems: 'center',
30
+ width: ownerState.fullWidth ? '100%' : '25ch',
31
+ position: 'relative',
32
+ borderRadius: (theme.vars || theme).shape.borderRadius,
33
+ [`&:hover .${pickersInputClasses.notchedOutline}`]: {
34
+ borderColor: (theme.vars || theme).palette.text.primary
35
+ },
36
+ // Reset on touch devices, it doesn't add specificity
37
+ '@media (hover: none)': {
38
+ [`&:hover .${pickersInputClasses.notchedOutline}`]: {
39
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
40
+ }
41
+ },
42
+ [`&.${pickersInputClasses.focused} .${pickersInputClasses.notchedOutline}`]: {
43
+ borderStyle: 'solid',
44
+ borderColor: (theme.vars || theme).palette[ownerState.color].main,
45
+ borderWidth: 2
46
+ },
47
+ [`&.${pickersInputClasses.disabled}`]: {
48
+ [`& .${pickersInputClasses.notchedOutline}`]: {
49
+ borderColor: (theme.vars || theme).palette.action.disabled
50
+ },
51
+ '*': {
52
+ color: (theme.vars || theme).palette.action.disabled
53
+ }
54
+ },
55
+ [`&.${pickersInputClasses.error} .${pickersInputClasses.notchedOutline}`]: {
56
+ borderColor: (theme.vars || theme).palette.error.main
57
+ }
58
+ }, ownerState.size === 'small' && {
59
+ padding: '8.5px 14px'
60
+ });
61
+ });
62
+ const SectionsContainer = styled('div', {
63
+ name: 'MuiPickersInput',
64
+ slot: 'Input',
65
+ overridesResolver: (props, styles) => styles.input
66
+ })(({
67
+ theme,
68
+ ownerState
69
+ }) => ({
70
+ fontFamily: theme.typography.fontFamily,
71
+ fontSize: 'inherit',
72
+ lineHeight: '1.4375em',
73
+ // 23px
74
+ flexGrow: 1,
75
+ visibility: ownerState.adornedStart || ownerState.focused ? 'visible' : 'hidden'
76
+ }));
77
+ const SectionContainer = styled('span', {
78
+ name: 'MuiPickersInput',
79
+ slot: 'Section',
80
+ overridesResolver: (props, styles) => styles.section
81
+ })(({
82
+ theme
83
+ }) => ({
84
+ fontFamily: theme.typography.fontFamily,
85
+ fontSize: 'inherit',
86
+ lineHeight: '1.4375em',
87
+ // 23px
88
+ flexGrow: 1
89
+ }));
90
+ const SectionInput = styled('span', {
91
+ name: 'MuiPickersInput',
92
+ slot: 'Content',
93
+ overridesResolver: (props, styles) => styles.content
94
+ })(({
95
+ theme
96
+ }) => ({
97
+ fontFamily: theme.typography.fontFamily,
98
+ lineHeight: '1.4375em',
99
+ // 23px
100
+ letterSpacing: 'inherit',
101
+ width: 'fit-content'
102
+ }));
103
+ const SectionSeparator = styled('span', {
104
+ name: 'MuiPickersInput',
105
+ slot: 'Separator',
106
+ overridesResolver: (props, styles) => styles.separator
107
+ })(() => ({
108
+ whiteSpace: 'pre'
109
+ }));
110
+ const FakeHiddenInput = styled('input', {
111
+ name: 'MuiPickersInput',
112
+ slot: 'HiddenInput',
113
+ overridesResolver: (props, styles) => styles.hiddenInput
114
+ })(_extends({}, visuallyHidden));
115
+ const NotchedOutlineRoot = styled(Outline, {
116
+ name: 'MuiPickersInput',
117
+ slot: 'NotchedOutline',
118
+ overridesResolver: (props, styles) => styles.notchedOutline
119
+ })(({
120
+ theme
121
+ }) => {
122
+ const borderColor = theme.palette.mode === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)';
123
+ return {
124
+ borderColor: theme.vars ? `rgba(${theme.vars.palette.common.onBackgroundChannel} / 0.23)` : borderColor
125
+ };
126
+ });
127
+ function InputContent({
128
+ elements,
129
+ contentEditable,
130
+ ownerState
131
+ }) {
132
+ if (contentEditable) {
133
+ return elements.map(({
134
+ content,
135
+ before,
136
+ after
137
+ }) => `${before.children}${content.children}${after.children}`).join('');
138
+ }
139
+ return /*#__PURE__*/_jsx(React.Fragment, {
140
+ children: elements.map(({
141
+ container,
142
+ content,
143
+ before,
144
+ after
145
+ }, elementIndex) => /*#__PURE__*/_jsxs(SectionContainer, _extends({}, container, {
146
+ children: [/*#__PURE__*/_jsx(SectionSeparator, _extends({}, before, {
147
+ className: clsx(pickersInputClasses.before, before == null ? void 0 : before.className)
148
+ })), /*#__PURE__*/_jsx(SectionInput, _extends({}, content, {
149
+ className: clsx(pickersInputClasses.content, content == null ? void 0 : content.className),
150
+ ownerState
151
+ })), /*#__PURE__*/_jsx(SectionSeparator, _extends({}, after, {
152
+ className: clsx(pickersInputClasses.after, after == null ? void 0 : after.className)
153
+ }))]
154
+ }), elementIndex))
155
+ });
156
+ }
157
+ const useUtilityClasses = ownerState => {
158
+ const {
159
+ focused,
160
+ disabled,
161
+ error,
162
+ classes,
163
+ fullWidth,
164
+ color,
165
+ size,
166
+ endAdornment,
167
+ startAdornment
168
+ } = ownerState;
169
+ const slots = {
170
+ root: ['root', focused && !disabled && 'focused', disabled && 'disabled', error && 'error', fullWidth && 'fullWidth', `color${capitalize(color)}`, size === 'small' && 'inputSizeSmall', Boolean(startAdornment) && 'adornedStart', Boolean(endAdornment) && 'adornedEnd'],
171
+ notchedOutline: ['notchedOutline'],
172
+ before: ['before'],
173
+ after: ['after'],
174
+ content: ['content'],
175
+ input: ['input']
176
+ };
177
+ return composeClasses(slots, getPickersInputUtilityClass, classes);
178
+ };
179
+
180
+ // TODO: move to utils
181
+ // Separates the state props from the form control
182
+ function formControlState({
183
+ props,
184
+ states,
185
+ muiFormControl
186
+ }) {
187
+ return states.reduce((acc, state) => {
188
+ acc[state] = props[state];
189
+ if (muiFormControl) {
190
+ if (typeof props[state] === 'undefined') {
191
+ acc[state] = muiFormControl[state];
192
+ }
193
+ }
194
+ return acc;
195
+ }, {});
196
+ }
197
+ const PickersInput = /*#__PURE__*/React.forwardRef(function PickersInput(props, ref) {
198
+ const {
199
+ elements,
200
+ label,
201
+ onWrapperClick,
202
+ valueStr,
203
+ onValueStrChange,
204
+ id,
205
+ ownerState: ownerStateProp,
206
+ endAdornment,
207
+ startAdornment
208
+ } = props,
209
+ other = _objectWithoutPropertiesLoose(props, _excluded);
210
+ const inputRef = React.useRef(null);
211
+ const handleInputRef = useForkRef(ref, inputRef);
212
+ const muiFormControl = useFormControl();
213
+ const fcs = formControlState({
214
+ props,
215
+ muiFormControl,
216
+ states: ['color', 'disabled', 'error', 'focused', 'size', 'required', 'fullWidth', 'adornedStart']
217
+ });
218
+ React.useEffect(() => {
219
+ if (muiFormControl) {
220
+ muiFormControl.setAdornedStart(Boolean(startAdornment));
221
+ }
222
+ }, [muiFormControl, startAdornment]);
223
+ const ownerState = _extends({}, props, ownerStateProp, {
224
+ color: fcs.color || 'primary',
225
+ disabled: fcs.disabled,
226
+ error: fcs.error,
227
+ focused: fcs.focused,
228
+ fullWidth: fcs.fullWidth,
229
+ size: fcs.size
230
+ });
231
+ const classes = useUtilityClasses(ownerState);
232
+ return /*#__PURE__*/_jsxs(SectionsWrapper, _extends({
233
+ ref: handleInputRef
234
+ }, other, {
235
+ className: classes.root,
236
+ onClick: onWrapperClick,
237
+ ownerState: ownerState,
238
+ "aria-invalid": fcs.error,
239
+ children: [startAdornment, /*#__PURE__*/_jsxs(SectionsContainer, {
240
+ ownerState: ownerState,
241
+ className: classes.input,
242
+ children: [/*#__PURE__*/_jsx(InputContent, {
243
+ elements: elements,
244
+ contentEditable: other.contentEditable,
245
+ ownerState: ownerState
246
+ }), /*#__PURE__*/_jsx(FakeHiddenInput, {
247
+ value: valueStr,
248
+ onChange: onValueStrChange,
249
+ id: id,
250
+ "aria-hidden": "true",
251
+ tabIndex: -1
252
+ })]
253
+ }), endAdornment, /*#__PURE__*/_jsx(NotchedOutlineRoot, {
254
+ shrink: fcs.adornedStart || fcs.focused,
255
+ notched: fcs.adornedStart || fcs.focused,
256
+ className: classes.notchedOutline,
257
+ label: label != null && label !== '' && fcs.required ? /*#__PURE__*/_jsxs(React.Fragment, {
258
+ children: [label, "\u2009", '*']
259
+ }) : label,
260
+ ownerState: ownerState
261
+ })]
262
+ }));
263
+ });
264
+ export default PickersInput;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { OutlinedInputProps } from '@mui/material/OutlinedInput';
3
+ import { FieldsTextFieldProps } from '../../models';
4
+ export interface PickersInputElement {
5
+ container: React.HTMLAttributes<HTMLSpanElement>;
6
+ content: React.HTMLAttributes<HTMLSpanElement>;
7
+ before: React.HTMLAttributes<HTMLSpanElement>;
8
+ after: React.HTMLAttributes<HTMLSpanElement>;
9
+ }
10
+ export interface PickersInputProps extends FieldsTextFieldProps {
11
+ elements: PickersInputElement[];
12
+ areAllSectionsEmpty?: boolean;
13
+ valueStr: string;
14
+ onValueStrChange: React.ChangeEventHandler<HTMLInputElement>;
15
+ id?: string;
16
+ InputProps?: Partial<OutlinedInputProps>;
17
+ inputProps: any;
18
+ autoFocus?: boolean;
19
+ ownerState?: any;
20
+ onWrapperClick: () => void;
21
+ defaultValue: string;
22
+ label?: string;
23
+ endAdornment?: React.ReactNode;
24
+ startAdornment?: React.ReactNode;
25
+ onBlur?: React.FocusEventHandler;
26
+ onChange?: React.FormEventHandler;
27
+ onFocus?: React.FocusEventHandler;
28
+ onKeyDown?: React.KeyboardEventHandler;
29
+ onKeyUp?: React.KeyboardEventHandler;
30
+ }
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { PickersTextFieldProps } from './PickersTextField.types';
3
+ export declare const PickersTextField: React.ForwardRefExoticComponent<Omit<PickersTextFieldProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,120 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
3
+ const _excluded = ["elements", "className", "color", "disabled", "error", "label", "variant", "fullWidth", "valueStr", "helperText", "valueType", "id", "FormHelperTextProps", "InputLabelProps", "inputProps", "InputProps", "required", "focused", "ownerState"];
4
+ import * as React from 'react';
5
+ import clsx from 'clsx';
6
+ import { styled } from '@mui/material/styles';
7
+ import useForkRef from '@mui/utils/useForkRef';
8
+ import { unstable_composeClasses as composeClasses, unstable_useId as useId } from '@mui/utils';
9
+ import InputLabel from '@mui/material/InputLabel';
10
+ import FormHelperText from '@mui/material/FormHelperText';
11
+ import FormControl from '@mui/material/FormControl';
12
+ import { getPickersTextFieldUtilityClass } from './pickersTextFieldClasses';
13
+ import PickersInput from './PickersInput';
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { jsxs as _jsxs } from "react/jsx-runtime";
16
+ const PickersTextFieldRoot = styled(FormControl, {
17
+ name: 'MuiPickersTextField',
18
+ slot: 'Root',
19
+ overridesResolver: (props, styles) => styles.root
20
+ })({});
21
+ const useUtilityClasses = ownerState => {
22
+ const {
23
+ focused,
24
+ disabled,
25
+ classes,
26
+ required
27
+ } = ownerState;
28
+ const slots = {
29
+ root: ['root', focused && !disabled && 'focused', disabled && 'disabled', required && 'required']
30
+ };
31
+ return composeClasses(slots, getPickersTextFieldUtilityClass, classes);
32
+ };
33
+ export const PickersTextField = /*#__PURE__*/React.forwardRef(function PickersTextField(props, ref) {
34
+ const {
35
+ elements,
36
+ className,
37
+ color = 'primary',
38
+ disabled = false,
39
+ error = false,
40
+ label,
41
+ variant = 'outlined',
42
+ fullWidth = false,
43
+ valueStr,
44
+ helperText,
45
+ valueType,
46
+ id: idOverride,
47
+ FormHelperTextProps,
48
+ InputLabelProps,
49
+ inputProps,
50
+ InputProps,
51
+ required = false,
52
+ focused: focusedProp
53
+ } = props,
54
+ other = _objectWithoutPropertiesLoose(props, _excluded);
55
+ const [focused, setFocused] = React.useState(focusedProp);
56
+ const rootRef = React.useRef(null);
57
+ const handleRootRef = useForkRef(ref, rootRef);
58
+ const inputRef = React.useRef(null);
59
+ const handleInputRef = useForkRef(inputRef, InputProps == null ? void 0 : InputProps.ref);
60
+ const id = useId(idOverride);
61
+ const helperTextId = helperText && id ? `${id}-helper-text` : undefined;
62
+ const inputLabelId = label && id ? `${id}-label` : undefined;
63
+ const ownerState = _extends({}, props, {
64
+ color,
65
+ disabled,
66
+ error,
67
+ focused,
68
+ variant
69
+ });
70
+ const classes = useUtilityClasses(ownerState);
71
+
72
+ // TODO: delete after behavior implementation
73
+ const onWrapperClick = () => {
74
+ if (!focused) {
75
+ var _inputRef$current;
76
+ setFocused(true);
77
+ const container = rootRef.current;
78
+
79
+ // Find the first input element within the container
80
+ const firstInput = container == null ? void 0 : container.querySelector('.content');
81
+
82
+ // Check if the input element exists before focusing it
83
+ if (firstInput) {
84
+ firstInput.focus();
85
+ }
86
+ (_inputRef$current = inputRef.current) == null || _inputRef$current.focus();
87
+ }
88
+ };
89
+ return /*#__PURE__*/_jsxs(PickersTextFieldRoot, {
90
+ className: clsx(classes.root, className),
91
+ ref: handleRootRef,
92
+ focused: focused,
93
+ disabled: disabled,
94
+ variant: variant,
95
+ error: error,
96
+ color: color,
97
+ fullWidth: fullWidth,
98
+ required: required,
99
+ ownerState: ownerState,
100
+ children: [/*#__PURE__*/_jsx(InputLabel, _extends({
101
+ htmlFor: id,
102
+ id: inputLabelId
103
+ }, InputLabelProps, {
104
+ children: label
105
+ })), /*#__PURE__*/_jsx(PickersInput, _extends({
106
+ elements,
107
+ valueStr,
108
+ valueType,
109
+ onWrapperClick,
110
+ inputProps,
111
+ label
112
+ }, other, InputProps, {
113
+ ref: handleInputRef
114
+ })), helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({
115
+ id: helperTextId
116
+ }, FormHelperTextProps, {
117
+ children: helperText
118
+ }))]
119
+ });
120
+ });
@@ -0,0 +1,18 @@
1
+ /// <reference types="react" />
2
+ import { TextFieldClasses } from '@mui/material/TextField';
3
+ import { PickersInputProps } from './PickersInput.types';
4
+ export interface PickersTextFieldProps extends PickersInputProps {
5
+ classes?: Partial<TextFieldClasses>;
6
+ className?: string;
7
+ color?: 'primary' | 'secondary' | 'error' | 'info' | 'success' | 'warning';
8
+ disabled?: boolean;
9
+ error?: boolean;
10
+ fullWidth?: boolean;
11
+ helperText?: React.ReactNode;
12
+ size?: 'small' | 'medium';
13
+ variant?: 'filled' | 'outlined' | 'standard';
14
+ valueStr: string;
15
+ InputProps: any;
16
+ valueType: 'value' | 'placeholder';
17
+ required?: boolean;
18
+ }
@@ -0,0 +1 @@
1
+ export { PickersTextField } from './PickersTextField';
@@ -0,0 +1 @@
1
+ export { PickersTextField } from './PickersTextField';
@@ -0,0 +1,42 @@
1
+ export interface PickersTextFieldClasses {
2
+ /** Styles applied to the root element. */
3
+ root: string;
4
+ /** Styles applied to the root element if focused. */
5
+ focused: string;
6
+ /** State class applied to the root element if `disabled=true`. */
7
+ disabled: string;
8
+ /** State class applied to the root element if `error=true`. */
9
+ error: string;
10
+ /** State class applied to the root element id `required=true` */
11
+ required: string;
12
+ }
13
+ export type PickersTextFieldClassKey = keyof PickersTextFieldClasses;
14
+ export declare function getPickersTextFieldUtilityClass(slot: string): string;
15
+ export declare const pickersTextFieldClasses: Record<keyof PickersTextFieldClasses, string>;
16
+ export interface PickersInputClasses {
17
+ /** Styles applied to the root element. */
18
+ root: string;
19
+ /** Styles applied to the root element if focused. */
20
+ focused: string;
21
+ /** State class applied to the root element if `disabled=true`. */
22
+ disabled: string;
23
+ /** State class applied to the root element if `error=true`. */
24
+ error: string;
25
+ /** Styles applied to the NotchedOutline element. */
26
+ notchedOutline: string;
27
+ /** Styles applied to the fake input element. */
28
+ input: string;
29
+ /** Styles applied to the section of the picker. */
30
+ content: string;
31
+ /** Styles applied to the startSeparator */
32
+ before: string;
33
+ /** Styles applied to the endSeparator */
34
+ after: string;
35
+ /** Styles applied to the root if there is a startAdornment present */
36
+ adornedStart: string;
37
+ /** Styles applied to the root if there is an endAdornment present */
38
+ adornedEnd: string;
39
+ }
40
+ export type PickersInputClassKey = keyof PickersInputClasses;
41
+ export declare function getPickersInputUtilityClass(slot: string): string;
42
+ export declare const pickersInputClasses: Record<keyof PickersInputClasses, string>;
@@ -0,0 +1,9 @@
1
+ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generateUtilityClasses as generateUtilityClasses } from '@mui/utils';
2
+ export function getPickersTextFieldUtilityClass(slot) {
3
+ return generateUtilityClass('MuiPickersTextField', slot);
4
+ }
5
+ export const pickersTextFieldClasses = generateUtilityClasses('MuiPickersTextField', ['root', 'focused', 'disabled', 'error', 'required']);
6
+ export function getPickersInputUtilityClass(slot) {
7
+ return generateUtilityClass('MuiPickersInput', slot);
8
+ }
9
+ export const pickersInputClasses = generateUtilityClasses('MuiPickersInput', ['root', 'focused', 'disabled', 'error', 'notchedOutline', 'content', 'before', 'after', 'adornedStart', 'adornedEnd', 'input']);
@@ -8,7 +8,7 @@ export function useNextMonthDisabled(month, {
8
8
  }) {
9
9
  const utils = useUtils();
10
10
  return React.useMemo(() => {
11
- const now = utils.dateWithTimezone(undefined, timezone);
11
+ const now = utils.date(undefined, timezone);
12
12
  const lastEnabledMonth = utils.startOfMonth(disableFuture && utils.isBefore(now, maxDate) ? now : maxDate);
13
13
  return !utils.isAfter(lastEnabledMonth, month);
14
14
  }, [disableFuture, maxDate, month, utils, timezone]);
@@ -20,7 +20,7 @@ export function usePreviousMonthDisabled(month, {
20
20
  }) {
21
21
  const utils = useUtils();
22
22
  return React.useMemo(() => {
23
- const now = utils.dateWithTimezone(undefined, timezone);
23
+ const now = utils.date(undefined, timezone);
24
24
  const firstEnabledMonth = utils.startOfMonth(disablePast && utils.isAfter(now, minDate) ? now : minDate);
25
25
  return !utils.isBefore(firstEnabledMonth, month);
26
26
  }, [disablePast, minDate, month, utils, timezone]);
@@ -34,7 +34,7 @@ const getDeltaFromKeyCode = keyCode => {
34
34
  };
35
35
  export const getDaysInWeekStr = (utils, timezone, format) => {
36
36
  const elements = [];
37
- const now = utils.dateWithTimezone(undefined, timezone);
37
+ const now = utils.date(undefined, timezone);
38
38
  const startDate = utils.startOfWeek(now);
39
39
  const endDate = utils.endOfWeek(now);
40
40
  let current = startDate;
@@ -48,7 +48,7 @@ export const getLetterEditingOptions = (utils, timezone, sectionType, format) =>
48
48
  switch (sectionType) {
49
49
  case 'month':
50
50
  {
51
- return getMonthsInYear(utils, utils.dateWithTimezone(undefined, timezone)).map(month => utils.formatByString(month, format));
51
+ return getMonthsInYear(utils, utils.date(undefined, timezone)).map(month => utils.formatByString(month, format));
52
52
  }
53
53
  case 'weekDay':
54
54
  {
@@ -56,7 +56,7 @@ export const getLetterEditingOptions = (utils, timezone, sectionType, format) =>
56
56
  }
57
57
  case 'meridiem':
58
58
  {
59
- const now = utils.dateWithTimezone(undefined, timezone);
59
+ const now = utils.date(undefined, timezone);
60
60
  return [utils.startOfDay(now), utils.endOfDay(now)].map(date => utils.formatByString(date, format));
61
61
  }
62
62
  default:
@@ -113,7 +113,7 @@ export const adjustSectionValue = (utils, timezone, section, keyCode, sectionsVa
113
113
  let newSectionValueNumber = currentSectionValue + delta * step;
114
114
  if (shouldSetAbsolute) {
115
115
  if (section.type === 'year' && !isEnd && !isStart) {
116
- return utils.formatByString(utils.dateWithTimezone(undefined, timezone), section.format);
116
+ return utils.formatByString(utils.date(undefined, timezone), section.format);
117
117
  }
118
118
  if (delta > 0 || isStart) {
119
119
  newSectionValueNumber = sectionBoundaries.minimum;
@@ -207,49 +207,62 @@ export const addPositionPropertiesToSections = (sections, isRTL) => {
207
207
  }
208
208
  return newSections;
209
209
  };
210
- const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, currentTokenValue) => {
210
+ const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {
211
211
  switch (sectionConfig.type) {
212
212
  case 'year':
213
213
  {
214
214
  return localeText.fieldYearPlaceholder({
215
- digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), currentTokenValue).length
215
+ digitAmount: utils.formatByString(utils.date(undefined, timezone), sectionFormat).length,
216
+ format: sectionFormat
216
217
  });
217
218
  }
218
219
  case 'month':
219
220
  {
220
221
  return localeText.fieldMonthPlaceholder({
221
- contentType: sectionConfig.contentType
222
+ contentType: sectionConfig.contentType,
223
+ format: sectionFormat
222
224
  });
223
225
  }
224
226
  case 'day':
225
227
  {
226
- return localeText.fieldDayPlaceholder();
228
+ return localeText.fieldDayPlaceholder({
229
+ format: sectionFormat
230
+ });
227
231
  }
228
232
  case 'weekDay':
229
233
  {
230
234
  return localeText.fieldWeekDayPlaceholder({
231
- contentType: sectionConfig.contentType
235
+ contentType: sectionConfig.contentType,
236
+ format: sectionFormat
232
237
  });
233
238
  }
234
239
  case 'hours':
235
240
  {
236
- return localeText.fieldHoursPlaceholder();
241
+ return localeText.fieldHoursPlaceholder({
242
+ format: sectionFormat
243
+ });
237
244
  }
238
245
  case 'minutes':
239
246
  {
240
- return localeText.fieldMinutesPlaceholder();
247
+ return localeText.fieldMinutesPlaceholder({
248
+ format: sectionFormat
249
+ });
241
250
  }
242
251
  case 'seconds':
243
252
  {
244
- return localeText.fieldSecondsPlaceholder();
253
+ return localeText.fieldSecondsPlaceholder({
254
+ format: sectionFormat
255
+ });
245
256
  }
246
257
  case 'meridiem':
247
258
  {
248
- return localeText.fieldMeridiemPlaceholder();
259
+ return localeText.fieldMeridiemPlaceholder({
260
+ format: sectionFormat
261
+ });
249
262
  }
250
263
  default:
251
264
  {
252
- return currentTokenValue;
265
+ return sectionFormat;
253
266
  }
254
267
  }
255
268
  };
@@ -261,12 +274,12 @@ export const changeSectionValueFormat = (utils, valueStr, currentFormat, newForm
261
274
  }
262
275
  return utils.formatByString(utils.parse(valueStr, currentFormat), newFormat);
263
276
  };
264
- const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.dateWithTimezone(undefined, timezone), format).length === 4;
277
+ const isFourDigitYearFormat = (utils, timezone, format) => utils.formatByString(utils.date(undefined, timezone), format).length === 4;
265
278
  export const doesSectionFormatHaveLeadingZeros = (utils, timezone, contentType, sectionType, format) => {
266
279
  if (contentType !== 'digit') {
267
280
  return false;
268
281
  }
269
- const now = utils.dateWithTimezone(undefined, timezone);
282
+ const now = utils.date(undefined, timezone);
270
283
  switch (sectionType) {
271
284
  // We can't use `changeSectionValueFormat`, because `utils.parse('1', 'YYYY')` returns `1971` instead of `1`.
272
285
  case 'year':
@@ -472,7 +485,7 @@ export const createDateStrForInputFromSections = (sections, isRTL) => {
472
485
  return `\u2066${dateStr}\u2069`;
473
486
  };
474
487
  export const getSectionsBoundaries = (utils, timezone) => {
475
- const today = utils.dateWithTimezone(undefined, timezone);
488
+ const today = utils.date(undefined, timezone);
476
489
  const endOfYear = utils.endOfYear(today);
477
490
  const endOfDay = utils.endOfDay(today);
478
491
  const {
@@ -156,7 +156,7 @@ export const useFieldState = params => {
156
156
  const nonEmptySectionCountBefore = activeDateManager.getSections(state.sections).filter(section => section.value !== '').length;
157
157
  const hasNoOtherNonEmptySections = nonEmptySectionCountBefore === (activeSection.value === '' ? 0 : 1);
158
158
  const newSections = setSectionValue(selectedSectionIndexes.startIndex, '');
159
- const newActiveDate = hasNoOtherNonEmptySections ? null : utils.date(new Date(''));
159
+ const newActiveDate = hasNoOtherNonEmptySections ? null : utils.getInvalidDate();
160
160
  const newValues = activeDateManager.getNewValuesFromNewActiveDate(newActiveDate);
161
161
  if ((newActiveDate != null && !utils.isValid(newActiveDate)) !== (activeDateManager.date != null && !utils.isValid(activeDateManager.date))) {
162
162
  publishValue(_extends({}, newValues, {