@mui/x-date-pickers 8.17.0 → 8.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/DatePicker/DatePicker.js +8 -2
  3. package/DateTimePicker/DateTimePicker.js +8 -2
  4. package/DateTimePicker/DateTimePickerToolbar.js +2 -1
  5. package/DesktopDatePicker/DesktopDatePicker.js +8 -2
  6. package/DesktopDateTimePicker/DesktopDateTimePicker.js +8 -2
  7. package/DesktopTimePicker/DesktopTimePicker.js +8 -2
  8. package/MobileDatePicker/MobileDatePicker.js +8 -2
  9. package/MobileDateTimePicker/MobileDateTimePicker.js +8 -2
  10. package/MobileTimePicker/MobileTimePicker.js +8 -2
  11. package/PickersShortcuts/PickersShortcuts.js +2 -1
  12. package/StaticDatePicker/StaticDatePicker.js +8 -2
  13. package/StaticDateTimePicker/StaticDateTimePicker.js +8 -2
  14. package/StaticTimePicker/StaticTimePicker.js +8 -2
  15. package/TimePicker/TimePicker.js +8 -2
  16. package/TimePicker/TimePickerToolbar.js +2 -1
  17. package/esm/DatePicker/DatePicker.js +8 -2
  18. package/esm/DateTimePicker/DateTimePicker.js +8 -2
  19. package/esm/DateTimePicker/DateTimePickerToolbar.js +2 -1
  20. package/esm/DesktopDatePicker/DesktopDatePicker.js +8 -2
  21. package/esm/DesktopDateTimePicker/DesktopDateTimePicker.js +8 -2
  22. package/esm/DesktopTimePicker/DesktopTimePicker.js +8 -2
  23. package/esm/MobileDatePicker/MobileDatePicker.js +8 -2
  24. package/esm/MobileDateTimePicker/MobileDateTimePicker.js +8 -2
  25. package/esm/MobileTimePicker/MobileTimePicker.js +8 -2
  26. package/esm/PickersShortcuts/PickersShortcuts.js +2 -1
  27. package/esm/StaticDatePicker/StaticDatePicker.js +8 -2
  28. package/esm/StaticDateTimePicker/StaticDateTimePicker.js +8 -2
  29. package/esm/StaticTimePicker/StaticTimePicker.js +8 -2
  30. package/esm/TimePicker/TimePicker.js +8 -2
  31. package/esm/TimePicker/TimePickerToolbar.js +2 -1
  32. package/esm/index.js +1 -1
  33. package/esm/internals/components/PickerProvider.d.ts +8 -0
  34. package/esm/internals/hooks/useField/useFieldState.js +19 -10
  35. package/esm/internals/hooks/useField/useFieldV6TextField.js +1 -0
  36. package/esm/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +14 -2
  37. package/esm/internals/hooks/usePicker/usePicker.js +13 -5
  38. package/esm/internals/hooks/usePicker/usePicker.types.d.ts +8 -2
  39. package/esm/models/pickers.d.ts +8 -0
  40. package/index.js +1 -1
  41. package/internals/components/PickerProvider.d.ts +8 -0
  42. package/internals/hooks/useField/useFieldState.js +19 -10
  43. package/internals/hooks/useField/useFieldV6TextField.js +1 -0
  44. package/internals/hooks/usePicker/hooks/useValueAndOpenStates.js +14 -2
  45. package/internals/hooks/usePicker/usePicker.js +13 -5
  46. package/internals/hooks/usePicker/usePicker.types.d.ts +8 -2
  47. package/models/pickers.d.ts +8 -0
  48. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -5,6 +5,106 @@
5
5
  All notable changes to this project will be documented in this file.
6
6
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
7
7
 
8
+ ## 8.18.0
9
+
10
+ <!-- generated comparing v8.17.0..master -->
11
+
12
+ _Nov 13, 2025_
13
+
14
+ We'd like to extend a big thank you to the 14 contributors who made this release possible. Here are some highlights ✨:
15
+
16
+ - Add `barLabelPlacement` property to customize the bar label position in bar charts, enabling labels to be placed above bars.
17
+
18
+ ![image](https://github.com/user-attachments/assets/4bc3a75b-74b8-4c6d-896b-5f5bf837bcda)
19
+
20
+ - Add `source` property to the date/time picker lifecycle and event handler context, enabling clearer differentiation between changes initiated by the picker UI and those from direct field input.
21
+ - 🐞 Bugfixes
22
+ - 📚 Documentation improvements
23
+
24
+ Special thanks go out to these community members for their valuable contributions:
25
+ @htollefsen, @sai6855, @Sigdriv
26
+
27
+ The following team members contributed to this release:
28
+ @arminmeh, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @JCQuintas, @michelengelen, @noraleonte, @prakhargupta1, @rita-codes, @siriwatknp
29
+
30
+ ### Data Grid
31
+
32
+ #### `@mui/x-data-grid@8.18.0`
33
+
34
+ - [DataGrid] Allow default event in the column action cell item click event handler (#20272) @arminmeh
35
+ - [DataGrid] Remove unnecessary generic from `useGridApiRef` (#20277) @cherniavskii
36
+
37
+ #### `@mui/x-data-grid-pro@8.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
38
+
39
+ Same changes as in `@mui/x-data-grid@8.18.0`.
40
+
41
+ #### `@mui/x-data-grid-premium@8.18.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
42
+
43
+ Same changes as in `@mui/x-data-grid-pro@8.18.0`, plus:
44
+
45
+ - [DataGridPremium] Return the correct `cellParams` value from the aggregation cells (#20224) @arminmeh
46
+
47
+ ### Date and Time Pickers
48
+
49
+ #### `@mui/x-date-pickers@8.18.0`
50
+
51
+ - [pickers] Keep invalid date state consistent (#20040) @michelengelen
52
+ - [pickers] Adds new `source` property to `onChange` and `onAccept` context object (#20234) @michelengelen
53
+
54
+ #### `@mui/x-date-pickers-pro@8.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
55
+
56
+ Same changes as in `@mui/x-date-pickers@8.18.0`.
57
+
58
+ ### Charts
59
+
60
+ #### `@mui/x-charts@8.18.0`
61
+
62
+ - [charts] Add prop for positioning a bar label (#20194) @Sigdriv
63
+ - [charts] Fix applying dark mode styles in `ChartAxisZoomSliderThumb` (#20232) @sai6855
64
+
65
+ #### `@mui/x-charts-pro@8.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
66
+
67
+ Same changes as in `@mui/x-charts@8.18.0`, plus:
68
+
69
+ - [charts-pro] Allow specifying Content Security Policy nonce on export (#20053) @bernardobelchior
70
+ - [charts-pro] Fix applying dark mode styles to slider (#20220) @sai6855
71
+ - [charts-pro] Sankey should respect node order (#20065) @JCQuintas
72
+
73
+ #### `@mui/x-charts-premium@8.18.0` [![premium](https://mui.com/r/x-premium-svg)](https://mui.com/r/x-premium-svg-link 'Premium plan')
74
+
75
+ Same changes as in `@mui/x-charts-pro@8.18.0`.
76
+
77
+ ### Tree View
78
+
79
+ #### `@mui/x-tree-view@8.18.0`
80
+
81
+ - [tree view] Prepare tests for the new store structure (#20225) @flaviendelangle
82
+ - [tree view] Prepare the item plugin files for the store migration (#20240) @flaviendelangle
83
+ - [tree view] Use `TreeItemId` type instead of raw string (#20233) @flaviendelangle
84
+
85
+ #### `@mui/x-tree-view-pro@8.18.0` [![pro](https://mui.com/r/x-pro-svg)](https://mui.com/r/x-pro-svg-link 'Pro plan')
86
+
87
+ Same changes as in `@mui/x-tree-view@8.18.0`.
88
+
89
+ ### Codemod
90
+
91
+ #### `@mui/x-codemod@8.18.0`
92
+
93
+ Internal changes.
94
+
95
+ ### Docs
96
+
97
+ - [charts] Add a demo for a custom tick label (#20073) @prakhargupta1
98
+ - [charts] Create `useAxes()` hook documentation page (#20229) @JCQuintas
99
+ - [charts] Fix logo alignment (#20228) @JCQuintas
100
+ - [charts] Fixes typo in import example (#20236) @htollefsen
101
+ - [Data Grid] Add recipe for cursor pagination with data source (#19700) @siriwatknp
102
+ - [Data Grid] Add a demo for pinned rows aggregation (#20198) @cherniavskii
103
+
104
+ ### Core
105
+
106
+ - [docs-infra] Use deployment config from docs-infra package (#20243) @brijeshb42
107
+
8
108
  ## 8.17.0
9
109
 
10
110
  _Nov 5, 2025_
@@ -183,7 +183,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
183
183
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
184
184
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
185
185
  * @param {TValue} value The value that was just accepted.
186
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
186
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
187
+ * - `validationError`: validation result of the current value
188
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
189
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
187
190
  */
188
191
  onAccept: _propTypes.default.func,
189
192
  /**
@@ -191,7 +194,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
191
194
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
192
195
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
193
196
  * @param {TValue} value The new value.
194
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
197
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
198
+ * - `validationError`: validation result of the current value
199
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
200
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
195
201
  */
196
202
  onChange: _propTypes.default.func,
197
203
  /**
@@ -221,7 +221,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
221
221
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
222
222
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
223
223
  * @param {TValue} value The value that was just accepted.
224
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
224
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
225
+ * - `validationError`: validation result of the current value
226
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
227
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
225
228
  */
226
229
  onAccept: _propTypes.default.func,
227
230
  /**
@@ -229,7 +232,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
229
232
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
230
233
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
231
234
  * @param {TValue} value The new value.
232
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
235
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
236
+ * - `validationError`: validation result of the current value
237
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
238
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
233
239
  */
234
240
  onChange: _propTypes.default.func,
235
241
  /**
@@ -264,7 +264,8 @@ function DateTimePickerToolbar(inProps) {
264
264
  meridiemMode,
265
265
  handleMeridiemChange
266
266
  } = (0, _dateHelpersHooks.useMeridiemMode)(value, ampm, newValue => setValue(newValue, {
267
- changeImportance: 'set'
267
+ changeImportance: 'set',
268
+ source: 'view'
268
269
  }));
269
270
  const toolbarVariant = overrides?.forceDesktopVariant ? 'desktop' : variant;
270
271
  const isDesktop = toolbarVariant === 'desktop';
@@ -194,7 +194,10 @@ DesktopDatePicker.propTypes = {
194
194
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
195
195
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
196
196
  * @param {TValue} value The value that was just accepted.
197
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
197
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
198
+ * - `validationError`: validation result of the current value
199
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
200
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
198
201
  */
199
202
  onAccept: _propTypes.default.func,
200
203
  /**
@@ -202,7 +205,10 @@ DesktopDatePicker.propTypes = {
202
205
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
203
206
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
204
207
  * @param {TValue} value The new value.
205
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
208
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
209
+ * - `validationError`: validation result of the current value
210
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
211
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
206
212
  */
207
213
  onChange: _propTypes.default.func,
208
214
  /**
@@ -316,7 +316,10 @@ DesktopDateTimePicker.propTypes = {
316
316
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
317
317
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
318
318
  * @param {TValue} value The value that was just accepted.
319
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
319
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
320
+ * - `validationError`: validation result of the current value
321
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
322
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
320
323
  */
321
324
  onAccept: _propTypes.default.func,
322
325
  /**
@@ -324,7 +327,10 @@ DesktopDateTimePicker.propTypes = {
324
327
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
325
328
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
326
329
  * @param {TValue} value The new value.
327
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
330
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
331
+ * - `validationError`: validation result of the current value
332
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
333
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
328
334
  */
329
335
  onChange: _propTypes.default.func,
330
336
  /**
@@ -198,7 +198,10 @@ DesktopTimePicker.propTypes = {
198
198
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
199
199
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
200
200
  * @param {TValue} value The value that was just accepted.
201
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
201
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
202
+ * - `validationError`: validation result of the current value
203
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
204
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
202
205
  */
203
206
  onAccept: _propTypes.default.func,
204
207
  /**
@@ -206,7 +209,10 @@ DesktopTimePicker.propTypes = {
206
209
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
207
210
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
208
211
  * @param {TValue} value The new value.
209
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
212
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
213
+ * - `validationError`: validation result of the current value
214
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
215
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
210
216
  */
211
217
  onChange: _propTypes.default.func,
212
218
  /**
@@ -192,7 +192,10 @@ MobileDatePicker.propTypes = {
192
192
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
193
193
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
194
194
  * @param {TValue} value The value that was just accepted.
195
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
195
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
196
+ * - `validationError`: validation result of the current value
197
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
198
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
196
199
  */
197
200
  onAccept: _propTypes.default.func,
198
201
  /**
@@ -200,7 +203,10 @@ MobileDatePicker.propTypes = {
200
203
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
201
204
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
202
205
  * @param {TValue} value The new value.
203
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
206
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
207
+ * - `validationError`: validation result of the current value
208
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
209
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
204
210
  */
205
211
  onChange: _propTypes.default.func,
206
212
  /**
@@ -282,7 +282,10 @@ MobileDateTimePicker.propTypes = {
282
282
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
283
283
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
284
284
  * @param {TValue} value The value that was just accepted.
285
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
285
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
286
+ * - `validationError`: validation result of the current value
287
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
288
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
286
289
  */
287
290
  onAccept: _propTypes.default.func,
288
291
  /**
@@ -290,7 +293,10 @@ MobileDateTimePicker.propTypes = {
290
293
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
291
294
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
292
295
  * @param {TValue} value The new value.
293
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
296
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
297
+ * - `validationError`: validation result of the current value
298
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
299
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
294
300
  */
295
301
  onChange: _propTypes.default.func,
296
302
  /**
@@ -183,7 +183,10 @@ MobileTimePicker.propTypes = {
183
183
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
184
184
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
185
185
  * @param {TValue} value The value that was just accepted.
186
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
186
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
187
+ * - `validationError`: validation result of the current value
188
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
189
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
187
190
  */
188
191
  onAccept: _propTypes.default.func,
189
192
  /**
@@ -191,7 +194,10 @@ MobileTimePicker.propTypes = {
191
194
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
192
195
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
193
196
  * @param {TValue} value The new value.
194
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
197
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
198
+ * - `validationError`: validation result of the current value
199
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
200
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
195
201
  */
196
202
  onChange: _propTypes.default.func,
197
203
  /**
@@ -58,7 +58,8 @@ function PickersShortcuts(props) {
58
58
  onClick: () => {
59
59
  setValue(newValue, {
60
60
  changeImportance,
61
- shortcut: item
61
+ shortcut: item,
62
+ source: 'view'
62
63
  });
63
64
  },
64
65
  disabled: !isValidValue(newValue)
@@ -149,7 +149,10 @@ StaticDatePicker.propTypes = {
149
149
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
150
150
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
151
151
  * @param {TValue} value The value that was just accepted.
152
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
152
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
153
+ * - `validationError`: validation result of the current value
154
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
155
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
153
156
  */
154
157
  onAccept: _propTypes.default.func,
155
158
  /**
@@ -157,7 +160,10 @@ StaticDatePicker.propTypes = {
157
160
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
158
161
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
159
162
  * @param {TValue} value The new value.
160
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
163
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
164
+ * - `validationError`: validation result of the current value
165
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
166
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
161
167
  */
162
168
  onChange: _propTypes.default.func,
163
169
  /**
@@ -236,7 +236,10 @@ StaticDateTimePicker.propTypes = {
236
236
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
237
237
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
238
238
  * @param {TValue} value The value that was just accepted.
239
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
239
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
240
+ * - `validationError`: validation result of the current value
241
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
242
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
240
243
  */
241
244
  onAccept: _propTypes.default.func,
242
245
  /**
@@ -244,7 +247,10 @@ StaticDateTimePicker.propTypes = {
244
247
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
245
248
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
246
249
  * @param {TValue} value The new value.
247
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
250
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
251
+ * - `validationError`: validation result of the current value
252
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
253
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
248
254
  */
249
255
  onChange: _propTypes.default.func,
250
256
  /**
@@ -139,7 +139,10 @@ StaticTimePicker.propTypes = {
139
139
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
140
140
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
141
141
  * @param {TValue} value The value that was just accepted.
142
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
142
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
143
+ * - `validationError`: validation result of the current value
144
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
145
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
143
146
  */
144
147
  onAccept: _propTypes.default.func,
145
148
  /**
@@ -147,7 +150,10 @@ StaticTimePicker.propTypes = {
147
150
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
148
151
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
149
152
  * @param {TValue} value The new value.
150
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
153
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
154
+ * - `validationError`: validation result of the current value
155
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
156
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
151
157
  */
152
158
  onChange: _propTypes.default.func,
153
159
  /**
@@ -171,7 +171,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
171
171
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
172
172
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
173
173
  * @param {TValue} value The value that was just accepted.
174
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
174
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
175
+ * - `validationError`: validation result of the current value
176
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
177
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
175
178
  */
176
179
  onAccept: _propTypes.default.func,
177
180
  /**
@@ -179,7 +182,10 @@ process.env.NODE_ENV !== "production" ? TimePicker.propTypes = {
179
182
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
180
183
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
181
184
  * @param {TValue} value The new value.
182
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
185
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
186
+ * - `validationError`: validation result of the current value
187
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
188
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
183
189
  */
184
190
  onChange: _propTypes.default.func,
185
191
  /**
@@ -145,7 +145,8 @@ function TimePickerToolbar(inProps) {
145
145
  meridiemMode,
146
146
  handleMeridiemChange
147
147
  } = (0, _dateHelpersHooks.useMeridiemMode)(value, ampm, newValue => setValue(newValue, {
148
- changeImportance: 'set'
148
+ changeImportance: 'set',
149
+ source: 'view'
149
150
  }));
150
151
  const formatSection = format => {
151
152
  if (!adapter.isValid(value)) {
@@ -176,7 +176,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
176
176
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
177
177
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
178
178
  * @param {TValue} value The value that was just accepted.
179
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
179
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
180
+ * - `validationError`: validation result of the current value
181
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
182
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
180
183
  */
181
184
  onAccept: PropTypes.func,
182
185
  /**
@@ -184,7 +187,10 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
184
187
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
185
188
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
186
189
  * @param {TValue} value The new value.
187
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
190
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
191
+ * - `validationError`: validation result of the current value
192
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
193
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
188
194
  */
189
195
  onChange: PropTypes.func,
190
196
  /**
@@ -214,7 +214,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
214
214
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
215
215
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
216
216
  * @param {TValue} value The value that was just accepted.
217
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
217
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
218
+ * - `validationError`: validation result of the current value
219
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
220
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
218
221
  */
219
222
  onAccept: PropTypes.func,
220
223
  /**
@@ -222,7 +225,10 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
222
225
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
223
226
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
224
227
  * @param {TValue} value The new value.
225
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
228
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
229
+ * - `validationError`: validation result of the current value
230
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
231
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
226
232
  */
227
233
  onChange: PropTypes.func,
228
234
  /**
@@ -256,7 +256,8 @@ function DateTimePickerToolbar(inProps) {
256
256
  meridiemMode,
257
257
  handleMeridiemChange
258
258
  } = useMeridiemMode(value, ampm, newValue => setValue(newValue, {
259
- changeImportance: 'set'
259
+ changeImportance: 'set',
260
+ source: 'view'
260
261
  }));
261
262
  const toolbarVariant = overrides?.forceDesktopVariant ? 'desktop' : variant;
262
263
  const isDesktop = toolbarVariant === 'desktop';
@@ -187,7 +187,10 @@ DesktopDatePicker.propTypes = {
187
187
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
188
188
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
189
189
  * @param {TValue} value The value that was just accepted.
190
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
190
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
191
+ * - `validationError`: validation result of the current value
192
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
193
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
191
194
  */
192
195
  onAccept: PropTypes.func,
193
196
  /**
@@ -195,7 +198,10 @@ DesktopDatePicker.propTypes = {
195
198
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
196
199
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
197
200
  * @param {TValue} value The new value.
198
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
201
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
202
+ * - `validationError`: validation result of the current value
203
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
204
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
199
205
  */
200
206
  onChange: PropTypes.func,
201
207
  /**
@@ -309,7 +309,10 @@ DesktopDateTimePicker.propTypes = {
309
309
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
310
310
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
311
311
  * @param {TValue} value The value that was just accepted.
312
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
312
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
313
+ * - `validationError`: validation result of the current value
314
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
315
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
313
316
  */
314
317
  onAccept: PropTypes.func,
315
318
  /**
@@ -317,7 +320,10 @@ DesktopDateTimePicker.propTypes = {
317
320
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
318
321
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
319
322
  * @param {TValue} value The new value.
320
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
323
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
324
+ * - `validationError`: validation result of the current value
325
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
326
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
321
327
  */
322
328
  onChange: PropTypes.func,
323
329
  /**
@@ -191,7 +191,10 @@ DesktopTimePicker.propTypes = {
191
191
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
192
192
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
193
193
  * @param {TValue} value The value that was just accepted.
194
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
194
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
195
+ * - `validationError`: validation result of the current value
196
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
197
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
195
198
  */
196
199
  onAccept: PropTypes.func,
197
200
  /**
@@ -199,7 +202,10 @@ DesktopTimePicker.propTypes = {
199
202
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
200
203
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
201
204
  * @param {TValue} value The new value.
202
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
205
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
206
+ * - `validationError`: validation result of the current value
207
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
208
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
203
209
  */
204
210
  onChange: PropTypes.func,
205
211
  /**
@@ -185,7 +185,10 @@ MobileDatePicker.propTypes = {
185
185
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
186
186
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
187
187
  * @param {TValue} value The value that was just accepted.
188
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
188
+ * @param {FieldChangeHandlerContext<TError>} context Context about this acceptance:
189
+ * - `validationError`: validation result of the current value
190
+ * - `source`: source of the acceptance. One of 'field' | 'picker' | 'unknown'
191
+ * - `shortcut` (optional): the shortcut metadata if the value was accepted via a shortcut selection
189
192
  */
190
193
  onAccept: PropTypes.func,
191
194
  /**
@@ -193,7 +196,10 @@ MobileDatePicker.propTypes = {
193
196
  * @template TValue The value type. It will be the same type as `value` or `null`. It can be in `[start, end]` format in case of range value.
194
197
  * @template TError The validation error type. It will be either `string` or a `null`. It can be in `[start, end]` format in case of range value.
195
198
  * @param {TValue} value The new value.
196
- * @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
199
+ * @param {FieldChangeHandlerContext<TError>} context Context about this change:
200
+ * - `validationError`: validation result of the current value
201
+ * - `source`: source of the change. One of 'field' | 'view' | 'unknown'
202
+ * - `shortcut` (optional): the shortcut metadata if the change was triggered by a shortcut selection
197
203
  */
198
204
  onChange: PropTypes.func,
199
205
  /**