@mui/x-date-pickers 6.0.0-beta.0 → 6.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/AdapterDayjs/index.d.ts +2 -0
  2. package/AdapterDayjs/index.js +16 -5
  3. package/CHANGELOG.md +107 -3
  4. package/DatePicker/DatePickerToolbar.js +1 -0
  5. package/DateTimePicker/DateTimePickerToolbar.js +1 -0
  6. package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -2
  7. package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -2
  8. package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -2
  9. package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -2
  10. package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -2
  11. package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -2
  12. package/PickersLayout/PickersLayout.d.ts +1 -1
  13. package/PickersLayout/PickersLayout.js +15 -5
  14. package/PickersLayout/PickersLayout.types.d.ts +29 -15
  15. package/PickersLayout/pickersLayoutClasses.d.ts +2 -0
  16. package/PickersLayout/pickersLayoutClasses.js +1 -1
  17. package/PickersLayout/usePickerLayout.d.ts +1 -1
  18. package/PickersLayout/usePickerLayout.js +36 -14
  19. package/PickersShortcuts/PickersShortcuts.d.ts +25 -0
  20. package/PickersShortcuts/PickersShortcuts.js +88 -0
  21. package/PickersShortcuts/index.d.ts +2 -0
  22. package/PickersShortcuts/index.js +1 -0
  23. package/PickersShortcuts/package.json +6 -0
  24. package/StaticDatePicker/StaticDatePicker.types.d.ts +1 -1
  25. package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +1 -1
  26. package/StaticTimePicker/StaticTimePicker.types.d.ts +1 -1
  27. package/TimePicker/TimePickerToolbar.js +1 -0
  28. package/index.d.ts +1 -0
  29. package/index.js +2 -1
  30. package/internals/components/PickersPopper.js +3 -3
  31. package/internals/components/PickersToolbar.d.ts +1 -1
  32. package/internals/components/PickersToolbar.js +3 -1
  33. package/internals/demo/DemoContainer.d.ts +7 -5
  34. package/internals/demo/DemoContainer.js +34 -43
  35. package/internals/hooks/useDesktopPicker/index.d.ts +1 -1
  36. package/internals/hooks/useDesktopPicker/useDesktopPicker.js +29 -8
  37. package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +5 -3
  38. package/internals/hooks/useMobilePicker/index.d.ts +1 -1
  39. package/internals/hooks/useMobilePicker/useMobilePicker.js +26 -5
  40. package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +5 -3
  41. package/internals/hooks/usePicker/usePickerLayoutProps.d.ts +1 -0
  42. package/internals/hooks/usePicker/usePickerValue.d.ts +1 -0
  43. package/internals/hooks/usePicker/usePickerValue.js +12 -1
  44. package/internals/hooks/usePicker/usePickerViews.js +1 -0
  45. package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +3 -3
  46. package/internals/hooks/useViews.js +5 -1
  47. package/internals/models/props/toolbar.d.ts +1 -0
  48. package/legacy/AdapterDayjs/index.js +16 -5
  49. package/legacy/DatePicker/DatePickerToolbar.js +1 -0
  50. package/legacy/DateTimePicker/DateTimePickerToolbar.js +1 -0
  51. package/legacy/PickersLayout/PickersLayout.js +14 -5
  52. package/legacy/PickersLayout/pickersLayoutClasses.js +1 -1
  53. package/legacy/PickersLayout/usePickerLayout.js +50 -31
  54. package/legacy/PickersShortcuts/PickersShortcuts.js +88 -0
  55. package/legacy/PickersShortcuts/index.js +1 -0
  56. package/legacy/TimePicker/TimePickerToolbar.js +1 -0
  57. package/legacy/index.js +2 -1
  58. package/legacy/internals/components/PickersPopper.js +3 -3
  59. package/legacy/internals/components/PickersToolbar.js +3 -1
  60. package/legacy/internals/demo/DemoContainer.js +30 -39
  61. package/legacy/internals/hooks/useDesktopPicker/useDesktopPicker.js +29 -8
  62. package/legacy/internals/hooks/useMobilePicker/useMobilePicker.js +26 -5
  63. package/legacy/internals/hooks/usePicker/usePickerValue.js +14 -1
  64. package/legacy/internals/hooks/usePicker/usePickerViews.js +1 -0
  65. package/legacy/internals/hooks/useViews.js +5 -1
  66. package/legacy/locales/csCZ.js +90 -0
  67. package/legacy/locales/esES.js +5 -6
  68. package/legacy/locales/index.js +2 -0
  69. package/legacy/locales/jaJP.js +30 -15
  70. package/legacy/locales/ruRU.js +87 -0
  71. package/legacy/tests/describeValue/testControlledUnControlled.js +72 -0
  72. package/locales/csCZ.d.ts +48 -0
  73. package/locales/csCZ.js +60 -0
  74. package/locales/esES.js +5 -6
  75. package/locales/index.d.ts +2 -0
  76. package/locales/index.js +2 -0
  77. package/locales/jaJP.js +12 -15
  78. package/locales/ruRU.d.ts +48 -0
  79. package/locales/ruRU.js +55 -0
  80. package/modern/AdapterDayjs/index.js +15 -5
  81. package/modern/DatePicker/DatePickerToolbar.js +1 -0
  82. package/modern/DateTimePicker/DateTimePickerToolbar.js +1 -0
  83. package/modern/PickersLayout/PickersLayout.js +15 -5
  84. package/modern/PickersLayout/pickersLayoutClasses.js +1 -1
  85. package/modern/PickersLayout/usePickerLayout.js +35 -13
  86. package/modern/PickersShortcuts/PickersShortcuts.js +88 -0
  87. package/modern/PickersShortcuts/index.js +1 -0
  88. package/modern/TimePicker/TimePickerToolbar.js +1 -0
  89. package/modern/index.js +2 -1
  90. package/modern/internals/components/PickersPopper.js +3 -3
  91. package/modern/internals/components/PickersToolbar.js +3 -1
  92. package/modern/internals/demo/DemoContainer.js +34 -40
  93. package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +28 -7
  94. package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +25 -4
  95. package/modern/internals/hooks/usePicker/usePickerValue.js +12 -1
  96. package/modern/internals/hooks/usePicker/usePickerViews.js +1 -0
  97. package/modern/internals/hooks/useViews.js +5 -1
  98. package/modern/locales/csCZ.js +57 -0
  99. package/modern/locales/esES.js +5 -6
  100. package/modern/locales/index.js +2 -0
  101. package/modern/locales/jaJP.js +12 -15
  102. package/modern/locales/ruRU.js +55 -0
  103. package/modern/tests/describeValue/testControlledUnControlled.js +74 -0
  104. package/node/AdapterDayjs/index.js +17 -6
  105. package/node/DatePicker/DatePickerToolbar.js +1 -0
  106. package/node/DateTimePicker/DateTimePickerToolbar.js +1 -0
  107. package/node/PickersLayout/PickersLayout.js +15 -5
  108. package/node/PickersLayout/pickersLayoutClasses.js +1 -1
  109. package/node/PickersLayout/usePickerLayout.js +35 -13
  110. package/node/PickersShortcuts/PickersShortcuts.js +96 -0
  111. package/node/PickersShortcuts/index.js +12 -0
  112. package/node/TimePicker/TimePickerToolbar.js +1 -0
  113. package/node/index.js +13 -1
  114. package/node/internals/components/PickersPopper.js +3 -3
  115. package/node/internals/components/PickersToolbar.js +3 -1
  116. package/node/internals/demo/DemoContainer.js +34 -40
  117. package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +28 -7
  118. package/node/internals/hooks/useMobilePicker/useMobilePicker.js +25 -4
  119. package/node/internals/hooks/usePicker/usePickerValue.js +12 -1
  120. package/node/internals/hooks/usePicker/usePickerViews.js +1 -0
  121. package/node/internals/hooks/useViews.js +5 -1
  122. package/node/locales/csCZ.js +63 -0
  123. package/node/locales/esES.js +5 -6
  124. package/node/locales/index.js +22 -0
  125. package/node/locales/jaJP.js +12 -15
  126. package/node/locales/ruRU.js +61 -0
  127. package/node/tests/describeValue/testControlledUnControlled.js +73 -0
  128. package/package.json +1 -1
  129. package/tests/describeValue/testControlledUnControlled.js +74 -0
  130. package/themeAugmentation/props.d.ts +1 -1
@@ -16,6 +16,8 @@ export declare class AdapterDayjs extends BaseAdapterDayjs implements MuiPickers
16
16
  start: string;
17
17
  end: string;
18
18
  };
19
+ private getLocaleFormats;
20
+ is12HourCycleInCurrentLocale: () => boolean;
19
21
  /**
20
22
  * The current getFormatHelperText method uses an outdated format parsing logic.
21
23
  * We should use this one in the future to support all localized formats.
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable class-methods-use-this */
2
-
2
+ import defaultDayjs from 'dayjs';
3
3
  import weekOfYear from 'dayjs/plugin/weekOfYear';
4
4
  import BaseAdapterDayjs from '@date-io/dayjs';
5
5
  import { buildWarning } from '../internals/utils/warning';
@@ -39,12 +39,23 @@ export class AdapterDayjs extends BaseAdapterDayjs {
39
39
  start: '[',
40
40
  end: ']'
41
41
  };
42
- this.expandFormat = format => {
43
- const localeObject = this.rawDayJsInstance.Ls[this.locale || 'en'];
42
+ this.getLocaleFormats = () => {
43
+ var _this$rawDayJsInstanc;
44
+ const locales = (_this$rawDayJsInstanc = this.rawDayJsInstance.Ls) != null ? _this$rawDayJsInstanc : defaultDayjs.Ls;
45
+ const locale = this.locale || 'en';
46
+ let localeObject = locales[locale];
44
47
  if (localeObject === undefined) {
45
48
  localeNotFoundWarning();
49
+ localeObject = locales.en;
46
50
  }
47
- const localeFormats = localeObject === undefined ? this.rawDayJsInstance.Ls.en.formats : localeObject.formats;
51
+ return localeObject.formats;
52
+ };
53
+ this.is12HourCycleInCurrentLocale = () => {
54
+ /* istanbul ignore next */
55
+ return /A|a/.test(this.getLocaleFormats().LT || '');
56
+ };
57
+ this.expandFormat = format => {
58
+ const localeFormats = this.getLocaleFormats();
48
59
 
49
60
  // @see https://github.com/iamkun/dayjs/blob/dev/src/plugin/localizedFormat/index.js
50
61
  const t = formatBis => formatBis.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, (_, a, b) => a || b.slice(1));
@@ -59,6 +70,6 @@ export class AdapterDayjs extends BaseAdapterDayjs {
59
70
  this.getWeekNumber = date => {
60
71
  return date.week();
61
72
  };
62
- this.rawDayJsInstance.extend(weekOfYear);
73
+ defaultDayjs.extend(weekOfYear);
63
74
  }
64
75
  }
package/CHANGELOG.md CHANGED
@@ -3,6 +3,72 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 6.0.0-beta.1
7
+
8
+ _Jan 27, 2023_
9
+
10
+ We'd like to offer a big thanks to the 17 contributors who made this release possible. Here are some highlights ✨:
11
+
12
+ - 🚀 New shortcuts component for the date pickers (#7154) @alexfauquette
13
+ - 🌍 Add Belarusian (be-BY), Czech (cs-CZ) and Russian (ru-RU) locales
14
+ - 🌍 Improve Spanish (es-ES), Japanese (ja-JP), Slovak (sk-SK), and Vietnamese (vi-VN) locales
15
+ - ✨ New codemods for migrating to v6
16
+ - 📚 Documentation improvements
17
+ - 🐞 Bug fixes
18
+
19
+ ### `@mui/x-data-grid@v6.0.0-beta.1` / `@mui/x-data-grid-pro@v6.0.0-beta.1` / `@mui/x-data-grid-premium@v6.0.0-beta.1`
20
+
21
+ #### Changes
22
+
23
+ - [DataGrid] Add `title` attribute to cells (#7682) @thupi
24
+ - [DataGrid] Fix `autoHeight` not working properly inside of a flex container (#7701) @cherniavskii
25
+ - [DataGrid] Fix grid state not being updated after print preview is closed (#7642) @cherniavskii
26
+ - [DataGrid] Fix non-hideable columns visibility toggling (#7637) @cherniavskii
27
+ - [DataGrid] Fix scrolling on resize for data grids inside shadow root (#7298) @akiradev
28
+ - [l10n] Add Slovak (sk-SK) translation for aggregation functions (#7702) @msidlo
29
+ - [l10n] Add missing core locales for `MuiTablePagination` (#7717) @MBilalShafi
30
+ - [l10n] Improve Spanish (es-ES) and Vietnamese (vi-VN) locale (#7634) @WiXSL and @SpacerZ
31
+ - [l10n] Add Belarusian (be-BY) locale (#7646) @volhalink
32
+
33
+ ### `@mui/x-date-pickers@v6.0.0-beta.1` / `@mui/x-date-pickers-pro@v6.0.0-beta.1`
34
+
35
+ #### Changes
36
+
37
+ - [pickers] Fix `aria-labelledby` assignment to dialog (#7608) @LukasTy
38
+ - [pickers] Support `UTC` with `dayjs` (#7610) @flaviendelangle
39
+ - [pickers] Update focus when opening a UI view (#7620) @alexfauquette
40
+ - [DateRangePickers] Add shortcuts component (#7154) @alexfauquette
41
+ - [l10n] Add Czech (cs-CZ) locale (#7645) @OndrejHj04
42
+ - [l10n] Add Russian (ru-RU) locale (#7706) @rstmzh
43
+ - [l10n] Improve Japanese (ja-JP) locale (#7624) @makoto14
44
+
45
+ ### `@mui/x-codemod@v6.0.0-beta.1`
46
+
47
+ #### Changes
48
+
49
+ - [codemod] Add pickers `replace-toolbar-props-by-slot` codemod (#7687) @alexfauquette
50
+ - [codemod] Add `GridColumnMenuItemProps` to `column-menu-components-rename` codemod (#7710) @MBilalShafi
51
+ - [codemod] Add `headerHeight` prop update to `row-selection-props-rename` codemod (#7711) @MBilalShafi
52
+ - [codemod] Add pickers codemod for `components` to `slots` renaming (#7533) @alexfauquette
53
+ - [codemod] Add pickers `migrate-to-components-componentsProps` and `replace-arrows-button-slot` codemods (#7698) @alexfauquette
54
+ - [codemod] Add data grid codemod renaming `rowsPerPageOptions` prop to `pageSizeOptions` (#7603) @MBilalShafi
55
+ - [codemod] Add pickers `rename-should-disable-time` codemod (#7709) @alexfauquette
56
+ - [codemod] Add data grid `row-selection-props-rename` codemod (#7485) @MBilalShafi
57
+ - [codemod] Add data grid `rename-selectors-and-events` codemod (#7699) @MBilalShafi
58
+ - [codemod] Add pickers `replace-tabs-props` codemod (#7639) @alexfauquette
59
+
60
+ ### Docs
61
+
62
+ - [docs] Add info callout about available component `slots` (#7714) @Vivek-Prajapatii
63
+ - [docs] Add recipe for pinning grouped column (#7712) @MBilalShafi
64
+ - [docs] Fix 404 links to picker API page @oliviertassinari
65
+ - [docs] Update `DemoContainer` `components` prop using a codemod (#7574) @alexfauquette
66
+
67
+ ### Core
68
+
69
+ - [core] Fix `innerslotProps` typo (#7697) @LukasTy
70
+ - [core] Upgrade monorepo (#7676) @cherniavskii
71
+
6
72
  ## 6.0.0-beta.0
7
73
 
8
74
  _Jan 19, 2023_
@@ -342,7 +408,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
342
408
  ```diff
343
409
  <DateTimePicker
344
410
  - shouldDisableTime={(timeValue, view) => view === 'hours' && timeValue < 12}
345
- + shouldDisableTime={(time, view) => view === 'hours' && value.hour() < 12}
411
+ + shouldDisableTime={(value, view) => view === 'hours' && value.hour() < 12}
346
412
  />
347
413
  ```
348
414
 
@@ -1426,7 +1492,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
1426
1492
  // TimePicker, MobileTimePicker, DateRangePicker and MobileDateRangePicker.
1427
1493
  <DatePicker
1428
1494
  - DialogProps={{ backgroundColor: 'red' }}
1429
- + componentsProps={{ dialog: { backgroundColor: 'red }}}
1495
+ + componentsProps={{ dialog: { backgroundColor: 'red' }}}
1430
1496
  />
1431
1497
  ```
1432
1498
 
@@ -1437,7 +1503,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
1437
1503
  // TimePicker, DesktopTimePicker, DateRangePicker and DesktopDateRangePicker.
1438
1504
  <DatePicker
1439
1505
  - PaperProps={{ backgroundColor: 'red' }}
1440
- + componentsProps={{ desktopPaper: { backgroundColor: 'red }}}
1506
+ + componentsProps={{ desktopPaper: { backgroundColor: 'red' }}}
1441
1507
  />
1442
1508
  ```
1443
1509
 
@@ -1956,6 +2022,44 @@ You can find more information about the new api, including how to set those tran
1956
2022
  - [test] Skip tests for column pinning and dynamic row height (#5997) @m4theushw
1957
2023
  - [website] Improve security header @oliviertassinari
1958
2024
 
2025
+ ## v5.17.21
2026
+
2027
+ _Jan 27, 2023_
2028
+
2029
+ We'd like to offer a big thanks to the 13 contributors who made this release possible. Here are some highlights ✨:
2030
+
2031
+ - 🌍 Add Belarusian (be-BY), Czech (cs-CZ), and Russian (ru-RU) locales
2032
+ - 🌍 Improve Slovak (sk-SK), Japanese (ja-JP), Vietnamese (vi-VN), and Spanish (es-ES) locales
2033
+ - 🐞 Bugfixes
2034
+
2035
+ ### `@mui/x-data-grid@v5.17.21` / `@mui/x-data-grid-pro@v5.17.21` / `@mui/x-data-grid-premium@v5.17.21`
2036
+
2037
+ #### Changes
2038
+
2039
+ - [DataGrid] Add `title` attribute to cells (#7695) @thupi
2040
+ - [DataGrid] Fix grid state not being updated after print preview is closed (#7680) @cherniavskii
2041
+ - [DataGrid] Fix non-hideable columns visibility toggling (#7716) @cherniavskii
2042
+ - [DataGrid] Fix scrolling on resize for data grids inside shadow root (#7722) @cherniavskii
2043
+ - [DataGridPremium] Create aggregation footer row with `isAutoGenerated: true` (#7681) @m4theushw
2044
+ - [l10n] Add Belarusian (be-BY) locale (#7718) @volhalink
2045
+ - [l10n] Add Slovak (sk-SK) translation for aggregation functions (#7690) @msidlo
2046
+ - [l10n] Add missing core locales for `MuiTablePagination` (#7719) @MBilalShafi
2047
+ - [l10n] Improve Japanese (ja-JP) locale (#7627) @makoto14
2048
+ - [l10n] Improve Vietnamese (vi-VN) locale (#7601) @SpacerZ
2049
+
2050
+ ### `@mui/x-date-pickers@v5.0.16` / `@mui/x-date-pickers-pro@v5.0.16`
2051
+
2052
+ #### Changes
2053
+
2054
+ - [pickers] Add missing components to `themeAugmentation` (#7677) @LukasTy
2055
+ - [l10n] Add Czech (cs-CZ) locale (#7666) @OndrejHj04
2056
+ - [l10n] Add Russian (ru-RU) locale (#7708) @rstmzh
2057
+ - [l10n] Improve Spanish (es-ES) locale (#7614) @WiXSL
2058
+
2059
+ ### Docs
2060
+
2061
+ - [docs] Add info callout about available component `slots` (#7723) @Vivek-Prajapatii
2062
+
1959
2063
  ## 5.17.20
1960
2064
 
1961
2065
  _Jan 19, 2023_
@@ -116,6 +116,7 @@ process.env.NODE_ENV !== "production" ? DatePickerToolbar.propTypes = {
116
116
  onViewChange: PropTypes.func.isRequired,
117
117
  readOnly: PropTypes.bool,
118
118
  sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
119
+ titleId: PropTypes.string,
119
120
  /**
120
121
  * Toolbar date format.
121
122
  */
@@ -219,6 +219,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
219
219
  */
220
220
  onViewChange: PropTypes.func.isRequired,
221
221
  readOnly: PropTypes.bool,
222
+ titleId: PropTypes.string,
222
223
  /**
223
224
  * Toolbar date format.
224
225
  */
@@ -1,11 +1,11 @@
1
- import { UseDesktopPickerSlotsComponent, UseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
1
+ import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
2
2
  import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface DesktopDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateView>, 'Field' | 'OpenPickerIcon'> {
7
7
  }
8
- export interface DesktopDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, UseDesktopPickerSlotsComponentsProps<TDate, DateView> {
8
+ export interface DesktopDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, ExportedUseDesktopPickerSlotsComponentsProps<TDate, DateView> {
9
9
  }
10
10
  export interface DesktopDatePickerProps<TDate> extends BaseDatePickerProps<TDate>, DesktopOnlyPickerProps<TDate> {
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { UseDesktopPickerSlotsComponent, UseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
1
+ import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
2
2
  import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateOrTimeView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface DesktopDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, DateOrTimeView>, 'Field' | 'OpenPickerIcon'> {
7
7
  }
8
- export interface DesktopDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, UseDesktopPickerSlotsComponentsProps<TDate, DateOrTimeView> {
8
+ export interface DesktopDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseDesktopPickerSlotsComponentsProps<TDate, DateOrTimeView> {
9
9
  }
10
10
  export interface DesktopDateTimePickerProps<TDate> extends BaseDateTimePickerProps<TDate>, DesktopOnlyPickerProps<TDate> {
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { UseDesktopPickerSlotsComponent, UseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
1
+ import { UseDesktopPickerSlotsComponent, ExportedUseDesktopPickerSlotsComponentsProps, DesktopOnlyPickerProps } from '../internals/hooks/useDesktopPicker';
2
2
  import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { TimeView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface DesktopTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseDesktopPickerSlotsComponent<TDate, TimeView>, 'Field' | 'OpenPickerIcon'> {
7
7
  }
8
- export interface DesktopTimePickerSlotsComponentsProps<TDate> extends BaseTimePickerSlotsComponentsProps, UseDesktopPickerSlotsComponentsProps<TDate, TimeView> {
8
+ export interface DesktopTimePickerSlotsComponentsProps<TDate> extends BaseTimePickerSlotsComponentsProps, ExportedUseDesktopPickerSlotsComponentsProps<TDate, TimeView> {
9
9
  }
10
10
  export interface DesktopTimePickerProps<TDate> extends BaseTimePickerProps<TDate>, DesktopOnlyPickerProps<TDate> {
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { UseMobilePickerSlotsComponent, UseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
1
+ import { UseMobilePickerSlotsComponent, MobileOnlyPickerProps, ExportedUseMobilePickerSlotsComponentsProps } from '../internals/hooks/useMobilePicker';
2
2
  import { BaseDatePickerProps, BaseDatePickerSlotsComponent, BaseDatePickerSlotsComponentsProps } from '../DatePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface MobileDatePickerSlotsComponent<TDate> extends BaseDatePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateView>, 'Field'> {
7
7
  }
8
- export interface MobileDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, UseMobilePickerSlotsComponentsProps<TDate, DateView> {
8
+ export interface MobileDatePickerSlotsComponentsProps<TDate> extends BaseDatePickerSlotsComponentsProps<TDate>, ExportedUseMobilePickerSlotsComponentsProps<TDate, DateView> {
9
9
  }
10
10
  export interface MobileDatePickerProps<TDate> extends BaseDatePickerProps<TDate>, MobileOnlyPickerProps<TDate> {
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { UseMobilePickerSlotsComponent, UseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
1
+ import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
2
  import { BaseDateTimePickerProps, BaseDateTimePickerSlotsComponent, BaseDateTimePickerSlotsComponentsProps } from '../DateTimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { DateOrTimeView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface MobileDateTimePickerSlotsComponent<TDate> extends BaseDateTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, DateOrTimeView>, 'Field'> {
7
7
  }
8
- export interface MobileDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, UseMobilePickerSlotsComponentsProps<TDate, DateOrTimeView> {
8
+ export interface MobileDateTimePickerSlotsComponentsProps<TDate> extends BaseDateTimePickerSlotsComponentsProps<TDate>, ExportedUseMobilePickerSlotsComponentsProps<TDate, DateOrTimeView> {
9
9
  }
10
10
  export interface MobileDateTimePickerProps<TDate> extends BaseDateTimePickerProps<TDate>, MobileOnlyPickerProps<TDate> {
11
11
  /**
@@ -1,11 +1,11 @@
1
- import { UseMobilePickerSlotsComponent, UseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
1
+ import { UseMobilePickerSlotsComponent, ExportedUseMobilePickerSlotsComponentsProps, MobileOnlyPickerProps } from '../internals/hooks/useMobilePicker';
2
2
  import { BaseTimePickerProps, BaseTimePickerSlotsComponent, BaseTimePickerSlotsComponentsProps } from '../TimePicker/shared';
3
3
  import { MakeOptional } from '../internals/models/helpers';
4
4
  import { TimeView } from '../internals/models/views';
5
5
  import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
6
6
  export interface MobileTimePickerSlotsComponent<TDate> extends BaseTimePickerSlotsComponent<TDate>, MakeOptional<UseMobilePickerSlotsComponent<TDate, TimeView>, 'Field'> {
7
7
  }
8
- export interface MobileTimePickerSlotsComponentsProps<TDate> extends BaseTimePickerSlotsComponentsProps, UseMobilePickerSlotsComponentsProps<TDate, TimeView> {
8
+ export interface MobileTimePickerSlotsComponentsProps<TDate> extends BaseTimePickerSlotsComponentsProps, ExportedUseMobilePickerSlotsComponentsProps<TDate, TimeView> {
9
9
  }
10
10
  export interface MobileTimePickerProps<TDate> extends BaseTimePickerProps<TDate>, MobileOnlyPickerProps<TDate> {
11
11
  /**
@@ -9,7 +9,7 @@ declare const PickersLayoutRoot: import("@emotion/styled").StyledComponent<impor
9
9
  export { PickersLayoutRoot };
10
10
  export declare const PickersLayoutContentWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}>;
11
11
  declare const PickersLayout: {
12
- <TValue, TView extends DateOrTimeView>(inProps: PickersLayoutProps<TValue, TView>): JSX.Element;
12
+ <TValue, TDate, TView extends DateOrTimeView>(inProps: PickersLayoutProps<TValue, TDate, TView>): JSX.Element;
13
13
  propTypes: any;
14
14
  };
15
15
  export { PickersLayout };
@@ -31,10 +31,17 @@ const PickersLayoutRoot = styled('div', {
31
31
  gridAutoRows: 'max-content auto max-content',
32
32
  [`& .${pickersLayoutClasses.toolbar}`]: ownerState.isLandscape ? {
33
33
  gridColumn: theme.direction === 'rtl' ? 3 : 1,
34
- gridRow: '1 / 3'
34
+ gridRow: '2 / 3'
35
35
  } : {
36
- gridColumn: '1 / 4',
36
+ gridColumn: '2 / 4',
37
+ gridRow: 1
38
+ },
39
+ [`.${pickersLayoutClasses.shortcuts}`]: ownerState.isLandscape ? {
40
+ gridColumn: '2 / 4',
37
41
  gridRow: 1
42
+ } : {
43
+ gridColumn: theme.direction === 'rtl' ? 3 : 1,
44
+ gridRow: '2 / 3'
38
45
  },
39
46
  [`& .${pickersLayoutClasses.actionBar}`]: {
40
47
  gridColumn: '1 / 4',
@@ -72,22 +79,24 @@ const PickersLayout = function PickersLayout(inProps) {
72
79
  toolbar,
73
80
  content,
74
81
  tabs,
75
- actionBar
82
+ actionBar,
83
+ shortcuts
76
84
  } = usePickerLayout(props);
77
85
  const {
78
86
  sx,
79
87
  className,
88
+ isLandscape,
80
89
  ref,
81
90
  wrapperVariant
82
91
  } = props;
83
92
  const ownerState = props;
84
93
  const classes = useUtilityClasses(ownerState);
85
94
  return /*#__PURE__*/_jsxs(PickersLayoutRoot, {
95
+ ref: ref,
86
96
  sx: sx,
87
97
  className: clsx(className, classes.root),
88
98
  ownerState: ownerState,
89
- ref: ref,
90
- children: [toolbar, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
99
+ children: [isLandscape ? shortcuts : toolbar, isLandscape ? toolbar : shortcuts, /*#__PURE__*/_jsx(PickersLayoutContentWrapper, {
91
100
  className: classes.contentWrapper,
92
101
  children: wrapperVariant === 'desktop' ? /*#__PURE__*/_jsxs(React.Fragment, {
93
102
  children: [content, tabs]
@@ -119,6 +128,7 @@ process.env.NODE_ENV !== "production" ? PickersLayout.propTypes = {
119
128
  componentsProps: PropTypes.object,
120
129
  disabled: PropTypes.bool,
121
130
  isLandscape: PropTypes.bool.isRequired,
131
+ isValid: PropTypes.func.isRequired,
122
132
  onAccept: PropTypes.func.isRequired,
123
133
  onCancel: PropTypes.func.isRequired,
124
134
  onChange: PropTypes.func.isRequired,
@@ -6,35 +6,48 @@ import { DateOrTimeView } from '../internals/models/views';
6
6
  import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
7
7
  import { BaseTabsProps, ExportedBaseTabsProps } from '../internals/models/props/tabs';
8
8
  import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/usePicker/usePickerLayoutProps';
9
+ import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
9
10
  import { PickersLayoutClasses } from './pickersLayoutClasses';
10
11
  import { WrapperVariant } from '../internals/models/common';
11
- import { UncapitalizeObjectKeys } from '../internals/utils/slots-migration';
12
- export interface ExportedPickersLayoutSlotsComponent<TValue, TView extends DateOrTimeView> {
12
+ import { PickersShortcutsProps } from '../PickersShortcuts';
13
+ export interface ExportedPickersLayoutSlotsComponent<TValue, TDate, TView extends DateOrTimeView> {
13
14
  /**
14
15
  * Custom component for the action bar, it is placed bellow the picker views.
15
16
  * @default PickersActionBar
16
17
  */
17
18
  ActionBar?: React.ElementType<PickersActionBarProps>;
19
+ /**
20
+ * Custom component for the shortcuts.
21
+ * @default PickersShortcuts
22
+ */
23
+ Shortcuts?: React.JSXElementConstructor<PickersShortcutsProps<TValue>>;
18
24
  /**
19
25
  * Custom component for wrapping the layout.
20
- * It wraps the toolbar, views, and action bar.
26
+ * It wraps the toolbar, views, action bar, and shortcuts.
21
27
  */
22
- Layout?: React.JSXElementConstructor<PickersLayoutProps<TValue, TView>>;
28
+ Layout?: React.JSXElementConstructor<PickersLayoutProps<TValue, TDate, TView> & React.RefAttributes<HTMLDivElement>>;
23
29
  }
24
- interface PickersLayoutActionBarOwnerState<TValue, TView extends DateOrTimeView> extends PickersLayoutProps<TValue, TView> {
30
+ interface PickersLayoutActionBarOwnerState<TValue, TDate, TView extends DateOrTimeView> extends PickersLayoutProps<TValue, TDate, TView> {
25
31
  wrapperVariant: WrapperVariant;
26
32
  }
27
- export interface ExportedPickersLayoutSlotsComponentsProps<TValue, TView extends DateOrTimeView> {
33
+ interface PickersShortcutsOwnerState<TValue> extends PickersShortcutsProps<TValue> {
34
+ wrapperVariant: WrapperVariant;
35
+ }
36
+ export interface ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView extends DateOrTimeView> {
28
37
  /**
29
38
  * Props passed down to the action bar component.
30
39
  */
31
- actionBar?: SlotComponentProps<React.ComponentType<Omit<PickersActionBarProps, 'onAccept' | 'onClear' | 'onCancel' | 'onSetToday'>>, {}, PickersLayoutActionBarOwnerState<TValue, TView>>;
40
+ actionBar?: SlotComponentProps<React.ComponentType<Omit<PickersActionBarProps, 'onAccept' | 'onClear' | 'onCancel' | 'onSetToday'>>, {}, PickersLayoutActionBarOwnerState<TValue, TDate, TView>>;
41
+ /**
42
+ * Props passed down to the shortcuts component.
43
+ */
44
+ shortcuts?: SlotComponentProps<React.ComponentType<PickersShortcutsProps<TValue>>, {}, PickersShortcutsOwnerState<TValue>>;
32
45
  /**
33
46
  * Props passed down to the layoutRoot component.
34
47
  */
35
- layout?: Partial<PickersLayoutProps<TValue, TView>>;
48
+ layout?: Partial<PickersLayoutProps<TValue, TDate, TView>>;
36
49
  }
37
- export interface PickersLayoutSlotsComponent<TValue, TView extends DateOrTimeView> extends ExportedPickersLayoutSlotsComponent<TValue, TView> {
50
+ export interface PickersLayoutSlotsComponent<TValue, TDate, TView extends DateOrTimeView> extends ExportedPickersLayoutSlotsComponent<TValue, TDate, TView> {
38
51
  /**
39
52
  * Tabs enabling toggling between views.
40
53
  */
@@ -45,7 +58,7 @@ export interface PickersLayoutSlotsComponent<TValue, TView extends DateOrTimeVie
45
58
  */
46
59
  Toolbar?: React.JSXElementConstructor<BaseToolbarProps<TValue, TView>>;
47
60
  }
48
- export interface PickersLayoutSlotsComponentsProps<TValue, TView extends DateOrTimeView> extends ExportedPickersLayoutSlotsComponentsProps<TValue, TView> {
61
+ export interface PickersLayoutSlotsComponentsProps<TValue, TDate, TView extends DateOrTimeView> extends ExportedPickersLayoutSlotsComponentsProps<TValue, TDate, TView> {
49
62
  /**
50
63
  * Props passed down to the tabs component.
51
64
  */
@@ -55,7 +68,7 @@ export interface PickersLayoutSlotsComponentsProps<TValue, TView extends DateOrT
55
68
  */
56
69
  toolbar?: ExportedBaseToolbarProps;
57
70
  }
58
- export interface PickersLayoutProps<TValue, TView extends DateOrTimeView> extends Omit<UsePickerLayoutPropsResponseLayoutProps<TValue, TView>, 'value'> {
71
+ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeView> extends Omit<UsePickerLayoutPropsResponseLayoutProps<TValue, TView>, 'value'> {
59
72
  value?: TValue;
60
73
  className?: string;
61
74
  children?: React.ReactNode;
@@ -70,28 +83,29 @@ export interface PickersLayoutProps<TValue, TView extends DateOrTimeView> extend
70
83
  * @default {}
71
84
  * @deprecated Please use `slots`.
72
85
  */
73
- components?: PickersLayoutSlotsComponent<TValue, TView>;
86
+ components?: PickersLayoutSlotsComponent<TValue, TDate, TView>;
74
87
  /**
75
88
  * The props used for each component slot.
76
89
  * @default {}
77
90
  * @deprecated Please use `slotProps`.
78
91
  */
79
- componentsProps?: PickersLayoutSlotsComponentsProps<TValue, TView>;
92
+ componentsProps?: PickersLayoutSlotsComponentsProps<TValue, TDate, TView>;
80
93
  /**
81
94
  * Overrideable component slots.
82
95
  * @default {}
83
96
  */
84
- slots?: UncapitalizeObjectKeys<PickersLayoutSlotsComponent<TValue, TView>>;
97
+ slots?: UncapitalizeObjectKeys<PickersLayoutSlotsComponent<TValue, TDate, TView>>;
85
98
  /**
86
99
  * The props used for each component slot.
87
100
  * @default {}
88
101
  */
89
- slotProps?: PickersLayoutSlotsComponentsProps<TValue, TView>;
102
+ slotProps?: PickersLayoutSlotsComponentsProps<TValue, TDate, TView>;
90
103
  }
91
104
  export interface SubComponents {
92
105
  toolbar: React.ReactNode;
93
106
  content: React.ReactNode;
94
107
  tabs: React.ReactNode;
95
108
  actionBar: React.ReactNode;
109
+ shortcuts: React.ReactNode;
96
110
  }
97
111
  export {};
@@ -11,6 +11,8 @@ export interface PickersLayoutClasses {
11
11
  actionBar: string;
12
12
  /** Styles applied to the tabs. */
13
13
  tabs: string;
14
+ /** Styles applied to the shortcuts container. */
15
+ shortcuts: string;
14
16
  }
15
17
  export type PickersLayoutClassKey = keyof PickersLayoutClasses;
16
18
  export declare function getPickersLayoutUtilityClass(slot: string): string;
@@ -2,4 +2,4 @@ import { unstable_generateUtilityClass as generateUtilityClass, unstable_generat
2
2
  export function getPickersLayoutUtilityClass(slot) {
3
3
  return generateUtilityClass('MuiPickersLayout', slot);
4
4
  }
5
- export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar']);
5
+ export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'shortcuts']);
@@ -2,5 +2,5 @@ import { PickersLayoutProps, SubComponents } from './PickersLayout.types';
2
2
  import { DateOrTimeView } from '../internals/models';
3
3
  interface UsePickerLayoutResponse extends SubComponents {
4
4
  }
5
- declare const usePickerLayout: <TValue, TView extends DateOrTimeView>(props: PickersLayoutProps<TValue, TView>) => UsePickerLayoutResponse;
5
+ declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeView>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse;
6
6
  export default usePickerLayout;
@@ -4,19 +4,12 @@ import { useSlotProps } from '@mui/base/utils';
4
4
  import { unstable_composeClasses as composeClasses } from '@mui/utils';
5
5
  import { PickersActionBar } from '../PickersActionBar';
6
6
  import { getPickersLayoutUtilityClass } from './pickersLayoutClasses';
7
+ import { PickersShortcuts } from '../PickersShortcuts';
7
8
  import { uncapitalizeObjectKeys } from '../internals/utils/slots-migration';
8
9
  import { jsx as _jsx } from "react/jsx-runtime";
9
10
  function toolbarHasView(toolbarProps) {
10
11
  return toolbarProps.view !== null;
11
12
  }
12
-
13
- // TODO: Remove this functions. It get introduced to mark `value` prop in PickersLayoutProps as not required.
14
- // The true type should be
15
- // - For pickers value: TDate | null
16
- // - For rangepickers value: [TDate | null, TDate | null]
17
- function toolbarHasValue(toolbarProps) {
18
- return toolbarProps.value !== undefined;
19
- }
20
13
  const useUtilityClasses = ownerState => {
21
14
  const {
22
15
  classes,
@@ -28,12 +21,13 @@ const useUtilityClasses = ownerState => {
28
21
  toolbar: ['toolbar'],
29
22
  actionBar: ['actionBar'],
30
23
  tabs: ['tabs'],
31
- landscape: ['landscape']
24
+ landscape: ['landscape'],
25
+ shortcuts: ['shortcuts']
32
26
  };
33
27
  return composeClasses(slots, getPickersLayoutUtilityClass, classes);
34
28
  };
35
29
  const usePickerLayout = props => {
36
- var _slots$actionBar;
30
+ var _slots$actionBar, _slots$shortcuts;
37
31
  const {
38
32
  wrapperVariant,
39
33
  onAccept,
@@ -45,6 +39,7 @@ const usePickerLayout = props => {
45
39
  onViewChange,
46
40
  value,
47
41
  onChange,
42
+ isValid,
48
43
  isLandscape,
49
44
  disabled,
50
45
  readOnly,
@@ -52,10 +47,14 @@ const usePickerLayout = props => {
52
47
  components,
53
48
  componentsProps,
54
49
  slots: innerSlots,
55
- slotProps: innerslotProps
50
+ slotProps: innerSlotProps
51
+ // TODO: Remove this "as" hack. It get introduced to mark `value` prop in PickersLayoutProps as not required.
52
+ // The true type should be
53
+ // - For pickers value: TDate | null
54
+ // - For rangepickers value: [TDate | null, TDate | null]
56
55
  } = props;
57
56
  const slots = innerSlots != null ? innerSlots : uncapitalizeObjectKeys(components);
58
- const slotProps = innerslotProps != null ? innerslotProps : componentsProps;
57
+ const slotProps = innerSlotProps != null ? innerSlotProps : componentsProps;
59
58
  const classes = useUtilityClasses(props);
60
59
 
61
60
  // Action bar
@@ -99,7 +98,7 @@ const usePickerLayout = props => {
99
98
  wrapperVariant
100
99
  })
101
100
  });
102
- const toolbar = toolbarHasView(toolbarProps) && toolbarHasValue(toolbarProps) && !!Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, toolbarProps)) : null;
101
+ const toolbar = toolbarHasView(toolbarProps) && !!Toolbar ? /*#__PURE__*/_jsx(Toolbar, _extends({}, toolbarProps)) : null;
103
102
 
104
103
  // Content
105
104
 
@@ -112,11 +111,34 @@ const usePickerLayout = props => {
112
111
  view: view,
113
112
  onViewChange: onViewChange
114
113
  }, slotProps == null ? void 0 : slotProps.tabs)) : null;
114
+
115
+ // Shortcuts
116
+
117
+ const Shortcuts = (_slots$shortcuts = slots == null ? void 0 : slots.shortcuts) != null ? _slots$shortcuts : PickersShortcuts;
118
+ const shortcutsProps = useSlotProps({
119
+ elementType: Shortcuts,
120
+ externalSlotProps: slotProps == null ? void 0 : slotProps.shortcuts,
121
+ additionalProps: {
122
+ isValid,
123
+ isLandscape,
124
+ onChange,
125
+ className: classes.shortcuts
126
+ },
127
+ ownerState: {
128
+ isValid,
129
+ isLandscape,
130
+ onChange,
131
+ className: classes.shortcuts,
132
+ wrapperVariant
133
+ }
134
+ });
135
+ const shortcuts = view && !!Shortcuts ? /*#__PURE__*/_jsx(Shortcuts, _extends({}, shortcutsProps)) : null;
115
136
  return {
116
137
  toolbar,
117
138
  content,
118
139
  tabs,
119
- actionBar
140
+ actionBar,
141
+ shortcuts
120
142
  };
121
143
  };
122
144
  export default usePickerLayout;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { ListProps } from '@mui/material/List';
3
+ interface PickersShortcutsItemGetValueParams<TValue> {
4
+ isValid: (value: TValue) => boolean;
5
+ }
6
+ export interface PickersShortcutsItem<TValue> {
7
+ label: string;
8
+ getValue: (params: PickersShortcutsItemGetValueParams<TValue>) => TValue;
9
+ }
10
+ export interface PickersShortcutsProps<TValue> extends Omit<ListProps, 'onChange'> {
11
+ /**
12
+ * Ordered array of shortcuts to display.
13
+ * If empty, does not display the shortcuts.
14
+ * @default `[]`
15
+ */
16
+ items?: PickersShortcutsItem<TValue>[];
17
+ isLandscape: boolean;
18
+ onChange: (newValue: TValue) => void;
19
+ isValid: (value: TValue) => boolean;
20
+ }
21
+ declare function PickersShortcuts<TValue>(props: PickersShortcutsProps<TValue>): JSX.Element | null;
22
+ declare namespace PickersShortcuts {
23
+ var propTypes: any;
24
+ }
25
+ export { PickersShortcuts };