@mui/x-date-pickers 7.19.0 → 7.20.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.
- package/CHANGELOG.md +105 -13
- package/DateCalendar/DateCalendar.js +1 -1
- package/DateCalendar/DateCalendar.types.d.ts +1 -1
- package/DateField/DateField.types.d.ts +2 -7
- package/DateField/index.d.ts +1 -1
- package/DatePicker/DatePicker.js +1 -1
- package/DatePicker/DatePicker.types.d.ts +8 -1
- package/DatePicker/index.d.ts +1 -1
- package/DateTimeField/DateTimeField.types.d.ts +2 -7
- package/DateTimeField/index.d.ts +1 -1
- package/DateTimePicker/DateTimePicker.js +1 -1
- package/DateTimePicker/DateTimePicker.types.d.ts +9 -1
- package/DateTimePicker/DateTimePickerTabs.js +1 -1
- package/DateTimePicker/index.d.ts +1 -1
- package/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/DigitalClock/DigitalClock.js +39 -0
- package/MobileDatePicker/MobileDatePicker.js +1 -1
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/StaticDatePicker/StaticDatePicker.js +1 -1
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/TimeClock/Clock.js +8 -0
- package/TimeField/TimeField.types.d.ts +2 -7
- package/TimeField/index.d.ts +1 -1
- package/TimePicker/TimePicker.types.d.ts +9 -1
- package/TimePicker/index.d.ts +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/index.js +3 -1
- package/hooks/useParsedFormat.d.ts +15 -0
- package/hooks/useParsedFormat.js +43 -0
- package/hooks/usePickersContext.d.ts +4 -0
- package/hooks/usePickersContext.js +15 -0
- package/index.js +1 -1
- package/internals/components/PickersProvider.d.ts +34 -0
- package/internals/components/PickersProvider.js +26 -0
- package/internals/hooks/useDesktopPicker/useDesktopPicker.js +7 -4
- package/internals/hooks/useField/buildSectionsFromFormat.d.ts +1 -2
- package/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/internals/hooks/useField/useField.utils.d.ts +3 -3
- package/internals/hooks/useField/useField.utils.js +13 -13
- package/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/internals/hooks/useField/useFieldState.js +3 -5
- package/internals/hooks/useMobilePicker/useMobilePicker.js +7 -4
- package/internals/hooks/usePicker/usePicker.js +3 -1
- package/internals/hooks/usePicker/usePickerValue.js +7 -2
- package/internals/hooks/usePicker/usePickerValue.types.d.ts +2 -0
- package/internals/index.d.ts +1 -0
- package/internals/index.js +1 -0
- package/internals/utils/utils.d.ts +7 -0
- package/internals/utils/utils.js +11 -0
- package/models/pickers.d.ts +1 -1
- package/modern/DateCalendar/DateCalendar.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -1
- package/modern/DateTimePicker/DateTimePicker.js +1 -1
- package/modern/DateTimePicker/DateTimePickerTabs.js +1 -1
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/modern/DigitalClock/DigitalClock.js +39 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -1
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -1
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/modern/TimeClock/Clock.js +8 -0
- package/modern/hooks/index.js +3 -1
- package/modern/hooks/useParsedFormat.js +43 -0
- package/modern/hooks/usePickersContext.js +15 -0
- package/modern/index.js +1 -1
- package/modern/internals/components/PickersProvider.js +26 -0
- package/modern/internals/hooks/useDesktopPicker/useDesktopPicker.js +7 -4
- package/modern/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/modern/internals/hooks/useField/useField.utils.js +13 -13
- package/modern/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/modern/internals/hooks/useField/useFieldState.js +3 -5
- package/modern/internals/hooks/useMobilePicker/useMobilePicker.js +7 -4
- package/modern/internals/hooks/usePicker/usePicker.js +3 -1
- package/modern/internals/hooks/usePicker/usePickerValue.js +7 -2
- package/modern/internals/index.js +1 -0
- package/modern/internals/utils/utils.js +11 -0
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -1
- package/node/DateTimePicker/DateTimePicker.js +1 -1
- package/node/DateTimePicker/DateTimePickerTabs.js +1 -1
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -1
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -1
- package/node/DigitalClock/DigitalClock.js +39 -0
- package/node/MobileDatePicker/MobileDatePicker.js +1 -1
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -1
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +38 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -1
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -1
- package/node/TimeClock/Clock.js +8 -0
- package/node/hooks/index.js +15 -1
- package/node/hooks/useParsedFormat.js +50 -0
- package/node/hooks/usePickersContext.js +21 -0
- package/node/index.js +1 -1
- package/node/internals/components/PickersProvider.js +34 -0
- package/node/internals/hooks/useDesktopPicker/useDesktopPicker.js +5 -3
- package/node/internals/hooks/useField/buildSectionsFromFormat.js +4 -5
- package/node/internals/hooks/useField/useField.utils.js +13 -13
- package/node/internals/hooks/useField/useFieldCharacterEditing.js +2 -2
- package/node/internals/hooks/useField/useFieldState.js +3 -5
- package/node/internals/hooks/useMobilePicker/useMobilePicker.js +5 -3
- package/node/internals/hooks/usePicker/usePicker.js +3 -1
- package/node/internals/hooks/usePicker/usePickerValue.js +7 -1
- package/node/internals/index.js +7 -0
- package/node/internals/utils/utils.js +13 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,96 @@
|
|
|
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
|
+
## 7.20.0
|
|
7
|
+
|
|
8
|
+
_Oct 11, 2024_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 14 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📚 Updated ["What's new"](https://mui.com/x/whats-new/) page giving more detailed overview of the latest new features and other highlights
|
|
13
|
+
- 📚 New [collapsible column groups demo](https://mui.com/x/react-data-grid/column-groups/#collapsible-column-groups) for the Data Grid component
|
|
14
|
+
- 📚 New [Tree Item Customization](https://mui.com/x/react-tree-view/tree-item-customization/) documentation to learn how to use the new APIs to create custom Tree Items. The old APIs (`props.ContentComponent` and `props.ContentProps`) have been deprecated and will be removed in the new major version of the Tree View component.
|
|
15
|
+
- 🌍 Improve Japanese (ja-JP) locale on the Data Grid component
|
|
16
|
+
- 🐞 Bugfixes
|
|
17
|
+
- 📚 Other documentation improvements
|
|
18
|
+
|
|
19
|
+
Special thanks go out to the community contributors who have helped make this release possible:
|
|
20
|
+
@k-rajat19, @kalyan90, @uma-neko, @vfbiby.
|
|
21
|
+
Following are all team members who have contributed to this release: @alelthomas, @arminmeh, @arthurbalduini,
|
|
22
|
+
@cherniavskii, @flaviendelangle, @JCQuintas, @MBilalShafi, @noraleonte, @oliviertassinari, @samuelsycamore, @siriwatknp.
|
|
23
|
+
|
|
24
|
+
<!--/ HIGHLIGHT_ABOVE_SEPARATOR /-->
|
|
25
|
+
|
|
26
|
+
### Data Grid
|
|
27
|
+
|
|
28
|
+
#### `@mui/x-data-grid@7.20.0`
|
|
29
|
+
|
|
30
|
+
- [DataGrid] Add `onColumnHeaderContextMenu` event (#14734) @vfbiby
|
|
31
|
+
- [DataGrid] Avoid row spanning computation of outdated rows (#14902) @MBilalShafi
|
|
32
|
+
- [DataGrid] Fix scrollbar position not being updated after `scrollToIndexes` (#14888) @arminmeh
|
|
33
|
+
- [DataGrid] Pass `rowId` param to `processRowUpdate` (#14821) @k-rajat19
|
|
34
|
+
- [l10n] Improve Japanese (ja-JP) locale (#14870) @uma-neko
|
|
35
|
+
|
|
36
|
+
#### `@mui/x-data-grid-pro@7.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
37
|
+
|
|
38
|
+
Same changes as in `@mui/x-data-grid@7.20.0`, plus:
|
|
39
|
+
|
|
40
|
+
- [DataGridPro] Fix wording on the `rowSelectionPropagation` JSDoc and doc section (#14907) @flaviendelangle
|
|
41
|
+
|
|
42
|
+
#### `@mui/x-data-grid-premium@7.20.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
43
|
+
|
|
44
|
+
Same changes as in `@mui/x-data-grid-pro@7.20.0`.
|
|
45
|
+
|
|
46
|
+
### Date and Time Pickers
|
|
47
|
+
|
|
48
|
+
#### `@mui/x-date-pickers@7.20.0`
|
|
49
|
+
|
|
50
|
+
- [pickers] Add `PageUp` and `PageDown` support for time components (#14812) @arthurbalduini
|
|
51
|
+
- [pickers] Fix regression on `PickerValidDate` (#14896) @flaviendelangle
|
|
52
|
+
- [pickers] Move the `DateFieldInPickerProps` interface to the `DatePicker` folder and rename it `DatePickerFieldProps` (same for time and date time) (#14828) @flaviendelangle
|
|
53
|
+
|
|
54
|
+
#### `@mui/x-date-pickers-pro@7.20.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
55
|
+
|
|
56
|
+
Same changes as in `@mui/x-date-pickers@7.20.0`.
|
|
57
|
+
|
|
58
|
+
### Charts
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-charts@7.20.0`
|
|
61
|
+
|
|
62
|
+
No changes since `@mui/x-charts@v7.19.0`.
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-charts-pro@7.0.0-beta.4` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-charts@7.20.0`.
|
|
67
|
+
|
|
68
|
+
### Tree View
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-tree-view@7.20.0`
|
|
71
|
+
|
|
72
|
+
- [TreeItem] Deprecate the `ContentComponent` and `ContentProps` props (#14908) @flaviendelangle
|
|
73
|
+
- [TreeView] Rework how items are being rendered in Rich Tree View components (#14749) @flaviendelangle
|
|
74
|
+
|
|
75
|
+
### Docs
|
|
76
|
+
|
|
77
|
+
- [docs] Update "What's new" page (#14858) @cherniavskii
|
|
78
|
+
- [docs] Add collapsible column groups demo (#14818) @cherniavskii
|
|
79
|
+
- [docs] Add custom columns panel demo (#14825) @cherniavskii
|
|
80
|
+
- [docs] Capitalize all instances of "Data Grid" (#14884) @samuelsycamore
|
|
81
|
+
- [docs] Divide charts `tooltip` and `highlighting` pages (#14824) @JCQuintas
|
|
82
|
+
- [docs] Document the `TreeItem2` component and the `useTreeItem2` hook (#14551) @noraleonte
|
|
83
|
+
- [docs] Fix column pinning for "Disable detail panel content scroll" section (#14854 and #14885) @kalyan90
|
|
84
|
+
- [docs] Fix detail panel demo not working well with pinned columns (#14883) @cherniavskii
|
|
85
|
+
- [docs] New recipe of a read-only field (#14606) @flaviendelangle
|
|
86
|
+
- [docs] Change demo name example (#14822) @alelthomas
|
|
87
|
+
|
|
88
|
+
### Core
|
|
89
|
+
|
|
90
|
+
- [core] Support `@mui/utils` v6 (#14867) @siriwatknp
|
|
91
|
+
- [code-infra] Remove deprecated `data-mui-test` in favour of `data-testid` (#14882) @JCQuintas
|
|
92
|
+
- [code-infra] Update renovate config and add a `vitest` group (#14856) @JCQuintas
|
|
93
|
+
- [test] Replace `waitFor()` with `act()` (#14851) @oliviertassinari
|
|
94
|
+
- [test] Restore "pnpm tc" CLI (#14852) @oliviertassinari
|
|
95
|
+
|
|
6
96
|
## 7.19.0
|
|
7
97
|
|
|
8
98
|
_Oct 4, 2024_
|
|
@@ -90,13 +180,13 @@ Same changes as in `@mui/x-charts@7.19.0`.
|
|
|
90
180
|
|
|
91
181
|
- [TreeView] Apply experimental features in `getDefaultizedParams` instead of in the plugin render (#14661) @flaviendelangle
|
|
92
182
|
- [TreeView] Export `publicAPI` form `useTreeItem2Utils` (#14729) @noraleonte
|
|
93
|
-
- [TreeView] Fix cursor navigation interfering with browser shortcut keys
|
|
183
|
+
- [TreeView] Fix cursor navigation interfering with browser shortcut keys (#14798) @sai6855
|
|
94
184
|
- [TreeView] Fix invalid test for items reordering (#14665) @flaviendelangle
|
|
95
185
|
- [TreeView] Remove `instance.getTreeItemIdAttribute` (#14667) @flaviendelangle
|
|
96
186
|
|
|
97
187
|
### Docs
|
|
98
188
|
|
|
99
|
-
- [docs] Added warning callout for Firefox reordering bug
|
|
189
|
+
- [docs] Added warning callout for Firefox reordering bug (#14516) @michelengelen
|
|
100
190
|
- [docs] Copyedit `pages.ts` navigation (#14782) @samuelsycamore
|
|
101
191
|
- [docs] Fix typo in row spanning doc (#14770) @flaviendelangle
|
|
102
192
|
- [docs] Fix typo in the Tree View migration guide to v7 (#14727) @Sanderand
|
|
@@ -121,7 +211,7 @@ We'd like to offer a big thanks to the 14 contributors who made this release pos
|
|
|
121
211
|
|
|
122
212
|
- 💫 Support [Row spanning](https://mui.com/x/react-data-grid/row-spanning/) on the Data Grid that automatically merges the consecutive cells in a column based on the cell value
|
|
123
213
|
|
|
124
|
-
<img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="
|
|
214
|
+
<img width="600" src="https://github.com/user-attachments/assets/d32ec936-d238-4c92-9e1a-af6788d74cdf" alt="Data Grid row spanning" />
|
|
125
215
|
|
|
126
216
|
- ⏰ Support `date-fns` v4 (#14673) @LukasTy
|
|
127
217
|
- 🎉 Add option for Pickers to change the order of displayed years (#11780) @thomasmoon
|
|
@@ -560,7 +650,7 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
560
650
|
#### `@mui/x-data-grid@7.13.0`
|
|
561
651
|
|
|
562
652
|
- [DataGrid] Fix CSV export for `null` and `undefined` values (#14166) @k-rajat19
|
|
563
|
-
- [DataGrid] Fix error logged during skeleton loading with nested
|
|
653
|
+
- [DataGrid] Fix error logged during skeleton loading with nested Data Grid (#14186) @KenanYusuf
|
|
564
654
|
- [DataGrid] Remove needless check in `useGridStateInitialization` (#14181) @k-rajat19
|
|
565
655
|
- [DataGrid] Add recipe for persisting filters in local storage (#14208) @cherniavskii
|
|
566
656
|
- [l10n] Improve Vietnamese (vi-VN) locale (#14216) @hungnd-casso
|
|
@@ -678,6 +768,8 @@ Same changes as in `@mui/x-charts@7.12.1`, plus:
|
|
|
678
768
|
|
|
679
769
|
#### `@mui/x-tree-view@7.12.1`
|
|
680
770
|
|
|
771
|
+
No changes since `@mui/x-tree-view@7.12.0`.
|
|
772
|
+
|
|
681
773
|
### Docs
|
|
682
774
|
|
|
683
775
|
- [docs] Add a warning to promote the usage of `updateRows` (#14027) @MBilalShafi
|
|
@@ -1528,7 +1620,7 @@ Same changes as in `@mui/x-date-pickers@7.6.0`.
|
|
|
1528
1620
|
- [docs] Fix a small typo in property comment (#13245) @Janpot
|
|
1529
1621
|
- [docs] Improve the Data Grid FAQ page (#13258) @MBilalShafi
|
|
1530
1622
|
- [docs] Removes unused lines in TreeItem2 styling (#13264) @arthurbalduini
|
|
1531
|
-
- [docs] Small improvements on accessibility
|
|
1623
|
+
- [docs] Small improvements on accessibility Data Grid doc (#13233) @arthurbalduini
|
|
1532
1624
|
- [docs] Update Pickers demo configurations (#13303) @LukasTy
|
|
1533
1625
|
|
|
1534
1626
|
### Core
|
|
@@ -1542,7 +1634,7 @@ Same changes as in `@mui/x-date-pickers@7.6.0`.
|
|
|
1542
1634
|
- [test] Use test-utils from npm (#12880) @michaldudak
|
|
1543
1635
|
- [typescript] Remove duplicate `DateRangePosition` type in favor of `RangePosition` (#13288) @LukasTy
|
|
1544
1636
|
|
|
1545
|
-
##
|
|
1637
|
+
## 7.5.1
|
|
1546
1638
|
|
|
1547
1639
|
_May 23, 2024_
|
|
1548
1640
|
|
|
@@ -1602,7 +1694,7 @@ Same changes as in `@mui/x-date-pickers@7.5.1`.
|
|
|
1602
1694
|
- [code-infra] Run corepack enable on all CI jobs (#13205) @Janpot
|
|
1603
1695
|
- [code-infra] Use `nx` for lerna tasks (#13166) @LukasTy
|
|
1604
1696
|
|
|
1605
|
-
##
|
|
1697
|
+
## 7.5.0
|
|
1606
1698
|
|
|
1607
1699
|
_May 17, 2024_
|
|
1608
1700
|
|
|
@@ -2127,7 +2219,7 @@ Same changes as in `@mui/x-date-pickers@7.1.1`, plus:
|
|
|
2127
2219
|
- [docs] Fix typo in `getItemId` prop description (#12637) @flaviendelangle
|
|
2128
2220
|
- [docs] Make the Charts `margin` usage more visible (#12591) @alexfauquette
|
|
2129
2221
|
- [docs] Match IE 11 spacing with Material UI @oliviertassinari
|
|
2130
|
-
- [docs] Move
|
|
2222
|
+
- [docs] Move Data Grid interfaces to standard API page layout (#12016) @alexfauquette
|
|
2131
2223
|
- [docs] Remove ` around @default values (#12158) @alexfauquette
|
|
2132
2224
|
- [docs] Remove `day` from the default `dayOfWeekFormatter` function params (#12644) @LukasTy
|
|
2133
2225
|
- [docs] Use `TreeItem2` for icon expansion example on `RichTreeView` (#12563) @flaviendelangle
|
|
@@ -3568,7 +3660,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
|
|
|
3568
3660
|
- [docs] Fix generated tree view API docs (#11737) @LukasTy
|
|
3569
3661
|
- [docs] Generate docs for Tree View slots (#11730) @flaviendelangle
|
|
3570
3662
|
- [docs] Improve codemod for v7 (#11650) @oliviertassinari
|
|
3571
|
-
- [docs] Improve
|
|
3663
|
+
- [docs] Improve Data Grid `pageSizeOptions` prop documentation (#11682) @oliviertassinari
|
|
3572
3664
|
- [docs] Parse markdown on API docs demo titles (#11728) @LukasTy
|
|
3573
3665
|
- [docs] Remove the description from the `className` prop (#11693) @oliviertassinari
|
|
3574
3666
|
- [docs] Uplift `SimpleTreeView` customization examples (#11424) @noraleonte
|
|
@@ -3656,8 +3748,8 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
|
|
|
3656
3748
|
- [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11628) @LukasTy
|
|
3657
3749
|
- [docs] Improve `git diff` format @oliviertassinari
|
|
3658
3750
|
- [docs] Push up the MUI X brand (#11533) @oliviertassinari
|
|
3659
|
-
- [docs] Remove old
|
|
3660
|
-
- [docs] Improve Server-side
|
|
3751
|
+
- [docs] Remove old Data Grid translation files (#11646) @cherniavskii
|
|
3752
|
+
- [docs] Improve Server-side Data Grid docs (#11589) @oliviertassinari
|
|
3661
3753
|
- [docs] Improve charts landing page (#11570) @oliviertassinari
|
|
3662
3754
|
|
|
3663
3755
|
### Core
|
|
@@ -4167,7 +4259,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4167
4259
|
|
|
4168
4260
|
- The clipboard related exports `ignoreValueFormatterDuringExport` and `splitClipboardPastedText` are no longer prefixed with `unstable_`.
|
|
4169
4261
|
|
|
4170
|
-
- The deprecated constants `SUBMIT_FILTER_STROKE_TIME` and `SUBMIT_FILTER_DATE_STROKE_TIME` have been removed from the
|
|
4262
|
+
- The deprecated constants `SUBMIT_FILTER_STROKE_TIME` and `SUBMIT_FILTER_DATE_STROKE_TIME` have been removed from the Data Grid exports. Use the [`filterDebounceMs`](https://next.mui.com/x/api/data-grid/data-grid/#data-grid-prop-filterDebounceMs) prop to customize filter debounce time.
|
|
4171
4263
|
|
|
4172
4264
|
- The `slots.preferencesPanel` slot and the `slotProps.preferencesPanel` prop were removed. Use `slots.panel` and `slotProps.panel` instead.
|
|
4173
4265
|
|
|
@@ -4879,7 +4971,7 @@ A special shoutout to thank the 12 contributors who made this release possible.
|
|
|
4879
4971
|
- 🚀 First v7 alpha release
|
|
4880
4972
|
- ✨ Fix aggregation label not showing when `renderHeader` is used (#10961) @cherniavskii
|
|
4881
4973
|
- 📘 Server side data source [early documentation](https://mui.com/x/react-data-grid/server-side-data/)
|
|
4882
|
-
- 💫 New recipes added for the
|
|
4974
|
+
- 💫 New recipes added for the Data Grid
|
|
4883
4975
|
- 📈 `<ChartsReferenceLine />` component is now available
|
|
4884
4976
|
- 🌍 Add Basque (eu) locale, improve Czech (cs-CZ) and Spanish (es-ES) locales
|
|
4885
4977
|
- 🐞 Bugfixes
|
|
@@ -487,7 +487,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
487
487
|
/**
|
|
488
488
|
* Component displaying when passed `loading` true.
|
|
489
489
|
* @returns {React.ReactNode} The node to render when loading.
|
|
490
|
-
* @default () => <span
|
|
490
|
+
* @default () => <span>...</span>
|
|
491
491
|
*/
|
|
492
492
|
renderLoading: PropTypes.func,
|
|
493
493
|
/**
|
|
@@ -41,7 +41,7 @@ export interface ExportedDateCalendarProps<TDate extends PickerValidDate> extend
|
|
|
41
41
|
/**
|
|
42
42
|
* Component displaying when passed `loading` true.
|
|
43
43
|
* @returns {React.ReactNode} The node to render when loading.
|
|
44
|
-
* @default () => <span
|
|
44
|
+
* @default () => <span>...</span>
|
|
45
45
|
*/
|
|
46
46
|
renderLoading?: () => React.ReactNode;
|
|
47
47
|
/**
|
|
@@ -2,17 +2,12 @@ import * as React from 'react';
|
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
4
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
5
|
-
import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps
|
|
5
|
+
import { DateValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
6
6
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
7
|
-
import { MakeOptional
|
|
7
|
+
import { MakeOptional } from '../internals/models/helpers';
|
|
8
8
|
import { BaseDateValidationProps, DayValidationProps, MonthValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
9
9
|
export interface UseDateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, ExportedUseClearableFieldProps {
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Props the field can receive when used inside a date picker.
|
|
13
|
-
* (`DatePicker`, `DesktopDatePicker` or `MobileDatePicker` component).
|
|
14
|
-
*/
|
|
15
|
-
export type DateFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | keyof BaseDateValidationProps<TDate>> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateValidationError>;
|
|
16
11
|
export type UseDateFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
17
12
|
export type DateFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
18
13
|
/**
|
package/DateField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DateField } from './DateField';
|
|
2
2
|
export { useDateField as unstable_useDateField } from './useDateField';
|
|
3
|
-
export type { UseDateFieldProps, UseDateFieldComponentProps, DateFieldProps,
|
|
3
|
+
export type { UseDateFieldProps, UseDateFieldComponentProps, DateFieldProps, } from './DateField.types';
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -256,7 +256,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Component displaying when passed `loading` true.
|
|
258
258
|
* @returns {React.ReactNode} The node to render when loading.
|
|
259
|
-
* @default () => <span
|
|
259
|
+
* @default () => <span>...</span>
|
|
260
260
|
*/
|
|
261
261
|
renderLoading: PropTypes.func,
|
|
262
262
|
/**
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { UseDateFieldProps } from '../DateField';
|
|
1
2
|
import { DesktopDatePickerProps, DesktopDatePickerSlots, DesktopDatePickerSlotProps } from '../DesktopDatePicker';
|
|
3
|
+
import { DefaultizedProps } from '../internals/models/helpers';
|
|
4
|
+
import { BaseDateValidationProps } from '../internals/models/validation';
|
|
2
5
|
import { MobileDatePickerProps, MobileDatePickerSlots, MobileDatePickerSlotProps } from '../MobileDatePicker';
|
|
3
|
-
import { PickerValidDate } from '../models';
|
|
6
|
+
import { BaseSingleInputFieldProps, DateValidationError, FieldSection, PickerValidDate } from '../models';
|
|
4
7
|
export interface DatePickerSlots<TDate extends PickerValidDate> extends DesktopDatePickerSlots<TDate>, MobileDatePickerSlots<TDate> {
|
|
5
8
|
}
|
|
6
9
|
export interface DatePickerSlotProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends DesktopDatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure>, MobileDatePickerSlotProps<TDate, TEnableAccessibleFieldDOMStructure> {
|
|
@@ -28,3 +31,7 @@ export interface DatePickerProps<TDate extends PickerValidDate, TEnableAccessibl
|
|
|
28
31
|
*/
|
|
29
32
|
yearsPerRow?: 3 | 4;
|
|
30
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Props the field can receive when used inside a `DatePicker`, `DesktopDatePicker` or `MobileDatePicker` component.
|
|
36
|
+
*/
|
|
37
|
+
export type DatePickerFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = DefaultizedProps<UseDateFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | keyof BaseDateValidationProps<TDate>> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateValidationError>;
|
package/DatePicker/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DatePicker } from './DatePicker';
|
|
2
|
-
export type { DatePickerProps, DatePickerSlots, DatePickerSlotProps } from './DatePicker.types';
|
|
2
|
+
export type { DatePickerProps, DatePickerSlots, DatePickerSlotProps, DatePickerFieldProps, } from './DatePicker.types';
|
|
3
3
|
export { DatePickerToolbar } from './DatePickerToolbar';
|
|
4
4
|
export type { DatePickerToolbarProps } from './DatePickerToolbar';
|
|
5
5
|
export { datePickerToolbarClasses } from './datePickerToolbarClasses';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
|
-
import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps
|
|
4
|
+
import { DateTimeValidationError, FieldSection, PickerValidDate, BuiltInFieldTextFieldProps } from '../models';
|
|
5
5
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
6
|
-
import {
|
|
6
|
+
import { MakeOptional } from '../internals/models/helpers';
|
|
7
7
|
import { BaseDateValidationProps, BaseTimeValidationProps, DateTimeValidationProps, DayValidationProps, MonthValidationProps, TimeValidationProps, YearValidationProps } from '../internals/models/validation';
|
|
8
8
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
9
9
|
export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, DateTimeValidationError>, 'format'>, DayValidationProps<TDate>, MonthValidationProps<TDate>, YearValidationProps<TDate>, BaseDateValidationProps<TDate>, TimeValidationProps<TDate>, BaseTimeValidationProps, DateTimeValidationProps<TDate>, ExportedUseClearableFieldProps {
|
|
@@ -13,11 +13,6 @@ export interface UseDateTimeFieldProps<TDate extends PickerValidDate, TEnableAcc
|
|
|
13
13
|
*/
|
|
14
14
|
ampm?: boolean;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Props the field can receive when used inside a date time picker.
|
|
18
|
-
* (`DateTimePicker`, `DesktopDateTimePicker` or `MobileDateTimePicker` component).
|
|
19
|
-
*/
|
|
20
|
-
export type DateTimeFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseDateValidationProps<TDate> | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateTimeValidationError>;
|
|
21
16
|
export type UseDateTimeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
22
17
|
export type DateTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseDateTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
23
18
|
/**
|
package/DateTimeField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { DateTimeField } from './DateTimeField';
|
|
2
2
|
export { useDateTimeField as unstable_useDateTimeField } from './useDateTimeField';
|
|
3
|
-
export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps,
|
|
3
|
+
export type { UseDateTimeFieldProps, UseDateTimeFieldComponentProps, DateTimeFieldProps, } from './DateTimeField.types';
|
|
@@ -294,7 +294,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
294
294
|
/**
|
|
295
295
|
* Component displaying when passed `loading` true.
|
|
296
296
|
* @returns {React.ReactNode} The node to render when loading.
|
|
297
|
-
* @default () => <span
|
|
297
|
+
* @default () => <span>...</span>
|
|
298
298
|
*/
|
|
299
299
|
renderLoading: PropTypes.func,
|
|
300
300
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { UseDateTimeFieldProps } from '../DateTimeField';
|
|
1
2
|
import { DesktopDateTimePickerProps, DesktopDateTimePickerSlots, DesktopDateTimePickerSlotProps } from '../DesktopDateTimePicker';
|
|
2
3
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
4
|
+
import { DefaultizedProps } from '../internals/models/helpers';
|
|
5
|
+
import { BaseDateValidationProps, BaseTimeValidationProps } from '../internals/models/validation';
|
|
3
6
|
import { MobileDateTimePickerProps, MobileDateTimePickerSlots, MobileDateTimePickerSlotProps } from '../MobileDateTimePicker';
|
|
4
|
-
import { PickerValidDate } from '../models';
|
|
7
|
+
import { BaseSingleInputFieldProps, DateTimeValidationError, FieldSection, PickerValidDate } from '../models';
|
|
5
8
|
import { ExportedYearCalendarProps } from '../YearCalendar/YearCalendar.types';
|
|
6
9
|
export interface DateTimePickerSlots<TDate extends PickerValidDate> extends DesktopDateTimePickerSlots<TDate>, MobileDateTimePickerSlots<TDate, DateOrTimeViewWithMeridiem> {
|
|
7
10
|
}
|
|
@@ -30,3 +33,8 @@ export interface DateTimePickerProps<TDate extends PickerValidDate, TEnableAcces
|
|
|
30
33
|
*/
|
|
31
34
|
yearsPerRow?: 3 | 4;
|
|
32
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Props the field can receive when used inside a date time picker.
|
|
38
|
+
* (`DateTimePicker`, `DesktopDateTimePicker` or `MobileDateTimePicker` component).
|
|
39
|
+
*/
|
|
40
|
+
export type DateTimePickerFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = DefaultizedProps<UseDateTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseDateValidationProps<TDate> | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, DateTimeValidationError>;
|
|
@@ -87,7 +87,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
87
87
|
variant: "fullWidth",
|
|
88
88
|
value: viewToTab(view),
|
|
89
89
|
onChange: handleChange,
|
|
90
|
-
className: clsx(classes.root
|
|
90
|
+
className: clsx(className, classes.root),
|
|
91
91
|
sx: sx,
|
|
92
92
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
93
93
|
value: "date",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DateTimePicker } from './DateTimePicker';
|
|
2
|
-
export type { DateTimePickerProps, DateTimePickerSlots, DateTimePickerSlotProps, } from './DateTimePicker.types';
|
|
2
|
+
export type { DateTimePickerProps, DateTimePickerSlots, DateTimePickerSlotProps, DateTimePickerFieldProps, } from './DateTimePicker.types';
|
|
3
3
|
export { DateTimePickerTabs } from './DateTimePickerTabs';
|
|
4
4
|
export type { DateTimePickerTabsProps } from './DateTimePickerTabs';
|
|
5
5
|
export { dateTimePickerTabsClasses } from './dateTimePickerTabsClasses';
|
|
@@ -277,7 +277,7 @@ DesktopDatePicker.propTypes = {
|
|
|
277
277
|
/**
|
|
278
278
|
* Component displaying when passed `loading` true.
|
|
279
279
|
* @returns {React.ReactNode} The node to render when loading.
|
|
280
|
-
* @default () => <span
|
|
280
|
+
* @default () => <span>...</span>
|
|
281
281
|
*/
|
|
282
282
|
renderLoading: PropTypes.func,
|
|
283
283
|
/**
|
|
@@ -402,7 +402,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
402
402
|
/**
|
|
403
403
|
* Component displaying when passed `loading` true.
|
|
404
404
|
* @returns {React.ReactNode} The node to render when loading.
|
|
405
|
-
* @default () => <span
|
|
405
|
+
* @default () => <span>...</span>
|
|
406
406
|
*/
|
|
407
407
|
renderLoading: PropTypes.func,
|
|
408
408
|
/**
|
|
@@ -23,6 +23,7 @@ import { DIGITAL_CLOCK_VIEW_HEIGHT } from "../internals/constants/dimensions.js"
|
|
|
23
23
|
import { useControlledValueWithTimezone } from "../internals/hooks/useValueWithTimezone.js";
|
|
24
24
|
import { singleItemValueManager } from "../internals/utils/valueManagers.js";
|
|
25
25
|
import { useClockReferenceDate } from "../internals/hooks/useClockReferenceDate.js";
|
|
26
|
+
import { getFocusedListItemIndex } from "../internals/utils/utils.js";
|
|
26
27
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
27
28
|
const useUtilityClasses = ownerState => {
|
|
28
29
|
const {
|
|
@@ -104,6 +105,7 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
104
105
|
const utils = useUtils();
|
|
105
106
|
const containerRef = React.useRef(null);
|
|
106
107
|
const handleRef = useForkRef(ref, containerRef);
|
|
108
|
+
const listRef = React.useRef(null);
|
|
107
109
|
const props = useThemeProps({
|
|
108
110
|
props: inProps,
|
|
109
111
|
name: 'MuiDigitalClock'
|
|
@@ -236,15 +238,52 @@ export const DigitalClock = /*#__PURE__*/React.forwardRef(function DigitalClock(
|
|
|
236
238
|
}, (_, index) => utils.addMinutes(startOfDay, timeStep * (index + 1)))];
|
|
237
239
|
}, [valueOrReferenceDate, timeStep, utils]);
|
|
238
240
|
const focusedOptionIndex = timeOptions.findIndex(option => utils.isEqual(option, valueOrReferenceDate));
|
|
241
|
+
const handleKeyDown = event => {
|
|
242
|
+
switch (event.key) {
|
|
243
|
+
case 'PageUp':
|
|
244
|
+
{
|
|
245
|
+
if (!listRef.current) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
const newIndex = getFocusedListItemIndex(listRef.current) - 5;
|
|
249
|
+
const children = listRef.current?.children;
|
|
250
|
+
const newFocusedIndex = Math.max(0, newIndex);
|
|
251
|
+
const childToFocus = children[newFocusedIndex];
|
|
252
|
+
if (childToFocus) {
|
|
253
|
+
childToFocus.focus();
|
|
254
|
+
}
|
|
255
|
+
event.preventDefault();
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
case 'PageDown':
|
|
259
|
+
{
|
|
260
|
+
if (!listRef.current) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
const newIndex = getFocusedListItemIndex(listRef.current) + 5;
|
|
264
|
+
const children = listRef.current?.children;
|
|
265
|
+
const newFocusedIndex = Math.min(children.length - 1, newIndex);
|
|
266
|
+
const childToFocus = children[newFocusedIndex];
|
|
267
|
+
if (childToFocus) {
|
|
268
|
+
childToFocus.focus();
|
|
269
|
+
}
|
|
270
|
+
event.preventDefault();
|
|
271
|
+
break;
|
|
272
|
+
}
|
|
273
|
+
default:
|
|
274
|
+
}
|
|
275
|
+
};
|
|
239
276
|
return /*#__PURE__*/_jsx(DigitalClockRoot, _extends({
|
|
240
277
|
ref: handleRef,
|
|
241
278
|
className: clsx(classes.root, className),
|
|
242
279
|
ownerState: ownerState
|
|
243
280
|
}, other, {
|
|
244
281
|
children: /*#__PURE__*/_jsx(DigitalClockList, {
|
|
282
|
+
ref: listRef,
|
|
245
283
|
role: "listbox",
|
|
246
284
|
"aria-label": translations.timePickerToolbarTitle,
|
|
247
285
|
className: classes.list,
|
|
286
|
+
onKeyDown: handleKeyDown,
|
|
248
287
|
children: timeOptions.map((option, index) => {
|
|
249
288
|
if (skipDisabled && isTimeDisabled(option)) {
|
|
250
289
|
return null;
|
|
@@ -274,7 +274,7 @@ MobileDatePicker.propTypes = {
|
|
|
274
274
|
/**
|
|
275
275
|
* Component displaying when passed `loading` true.
|
|
276
276
|
* @returns {React.ReactNode} The node to render when loading.
|
|
277
|
-
* @default () => <span
|
|
277
|
+
* @default () => <span>...</span>
|
|
278
278
|
*/
|
|
279
279
|
renderLoading: PropTypes.func,
|
|
280
280
|
/**
|
|
@@ -322,7 +322,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
322
322
|
/**
|
|
323
323
|
* Component displaying when passed `loading` true.
|
|
324
324
|
* @returns {React.ReactNode} The node to render when loading.
|
|
325
|
-
* @default () => <span
|
|
325
|
+
* @default () => <span>...</span>
|
|
326
326
|
*/
|
|
327
327
|
renderLoading: PropTypes.func,
|
|
328
328
|
/**
|
|
@@ -10,6 +10,7 @@ import MenuItem from '@mui/material/MenuItem';
|
|
|
10
10
|
import useForkRef from '@mui/utils/useForkRef';
|
|
11
11
|
import { getMultiSectionDigitalClockSectionUtilityClass } from "./multiSectionDigitalClockSectionClasses.js";
|
|
12
12
|
import { DIGITAL_CLOCK_VIEW_HEIGHT, MULTI_SECTION_CLOCK_SECTION_WIDTH } from "../internals/constants/dimensions.js";
|
|
13
|
+
import { getFocusedListItemIndex } from "../internals/utils/utils.js";
|
|
13
14
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
15
|
const useUtilityClasses = ownerState => {
|
|
15
16
|
const {
|
|
@@ -138,12 +139,48 @@ export const MultiSectionDigitalClockSection = /*#__PURE__*/React.forwardRef(fun
|
|
|
138
139
|
containerRef.current.scrollTop = offsetTop - 4;
|
|
139
140
|
});
|
|
140
141
|
const focusedOptionIndex = items.findIndex(item => item.isFocused(item.value));
|
|
142
|
+
const handleKeyDown = event => {
|
|
143
|
+
switch (event.key) {
|
|
144
|
+
case 'PageUp':
|
|
145
|
+
{
|
|
146
|
+
if (!containerRef.current) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const newIndex = getFocusedListItemIndex(containerRef.current) - 5;
|
|
150
|
+
const children = containerRef.current?.children;
|
|
151
|
+
const newFocusedIndex = Math.max(0, newIndex);
|
|
152
|
+
const childToFocus = children[newFocusedIndex];
|
|
153
|
+
if (childToFocus) {
|
|
154
|
+
childToFocus.focus();
|
|
155
|
+
}
|
|
156
|
+
event.preventDefault();
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
case 'PageDown':
|
|
160
|
+
{
|
|
161
|
+
if (!containerRef.current) {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
const newIndex = getFocusedListItemIndex(containerRef.current) + 5;
|
|
165
|
+
const children = containerRef.current?.children;
|
|
166
|
+
const newFocusedIndex = Math.min(children.length - 1, newIndex);
|
|
167
|
+
const childToFocus = children[newFocusedIndex];
|
|
168
|
+
if (childToFocus) {
|
|
169
|
+
childToFocus.focus();
|
|
170
|
+
}
|
|
171
|
+
event.preventDefault();
|
|
172
|
+
break;
|
|
173
|
+
}
|
|
174
|
+
default:
|
|
175
|
+
}
|
|
176
|
+
};
|
|
141
177
|
return /*#__PURE__*/_jsx(MultiSectionDigitalClockSectionRoot, _extends({
|
|
142
178
|
ref: handleRef,
|
|
143
179
|
className: clsx(classes.root, className),
|
|
144
180
|
ownerState: ownerState,
|
|
145
181
|
autoFocusItem: autoFocus && active,
|
|
146
|
-
role: "listbox"
|
|
182
|
+
role: "listbox",
|
|
183
|
+
onKeyDown: handleKeyDown
|
|
147
184
|
}, other, {
|
|
148
185
|
children: items.map((option, index) => {
|
|
149
186
|
const isItemDisabled = option.isDisabled?.(option.value);
|
|
@@ -208,7 +208,7 @@ StaticDatePicker.propTypes = {
|
|
|
208
208
|
/**
|
|
209
209
|
* Component displaying when passed `loading` true.
|
|
210
210
|
* @returns {React.ReactNode} The node to render when loading.
|
|
211
|
-
* @default () => <span
|
|
211
|
+
* @default () => <span>...</span>
|
|
212
212
|
*/
|
|
213
213
|
renderLoading: PropTypes.func,
|
|
214
214
|
/**
|
|
@@ -256,7 +256,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
256
256
|
/**
|
|
257
257
|
* Component displaying when passed `loading` true.
|
|
258
258
|
* @returns {React.ReactNode} The node to render when loading.
|
|
259
|
-
* @default () => <span
|
|
259
|
+
* @default () => <span>...</span>
|
|
260
260
|
*/
|
|
261
261
|
renderLoading: PropTypes.func,
|
|
262
262
|
/**
|
package/TimeClock/Clock.js
CHANGED
|
@@ -274,6 +274,14 @@ export function Clock(inProps) {
|
|
|
274
274
|
handleValueChange(viewValue - keyboardControlStep, 'partial');
|
|
275
275
|
event.preventDefault();
|
|
276
276
|
break;
|
|
277
|
+
case 'PageUp':
|
|
278
|
+
handleValueChange(viewValue + 5, 'partial');
|
|
279
|
+
event.preventDefault();
|
|
280
|
+
break;
|
|
281
|
+
case 'PageDown':
|
|
282
|
+
handleValueChange(viewValue - 5, 'partial');
|
|
283
|
+
event.preventDefault();
|
|
284
|
+
break;
|
|
277
285
|
case 'Enter':
|
|
278
286
|
case ' ':
|
|
279
287
|
handleValueChange(viewValue, 'finish');
|
|
@@ -2,9 +2,9 @@ import * as React from 'react';
|
|
|
2
2
|
import { SlotComponentProps } from '@mui/utils';
|
|
3
3
|
import TextField from '@mui/material/TextField';
|
|
4
4
|
import { UseFieldInternalProps } from '../internals/hooks/useField';
|
|
5
|
-
import {
|
|
5
|
+
import { MakeOptional } from '../internals/models/helpers';
|
|
6
6
|
import { BaseTimeValidationProps, TimeValidationProps } from '../internals/models/validation';
|
|
7
|
-
import { FieldSection, PickerValidDate, TimeValidationError, BuiltInFieldTextFieldProps
|
|
7
|
+
import { FieldSection, PickerValidDate, TimeValidationError, BuiltInFieldTextFieldProps } from '../models';
|
|
8
8
|
import { ExportedUseClearableFieldProps, UseClearableFieldSlots, UseClearableFieldSlotProps } from '../hooks/useClearableField';
|
|
9
9
|
export interface UseTimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> extends MakeOptional<UseFieldInternalProps<TDate | null, TDate, FieldSection, TEnableAccessibleFieldDOMStructure, TimeValidationError>, 'format'>, TimeValidationProps<TDate>, BaseTimeValidationProps, ExportedUseClearableFieldProps {
|
|
10
10
|
/**
|
|
@@ -13,11 +13,6 @@ export interface UseTimeFieldProps<TDate extends PickerValidDate, TEnableAccessi
|
|
|
13
13
|
*/
|
|
14
14
|
ampm?: boolean;
|
|
15
15
|
}
|
|
16
|
-
/**
|
|
17
|
-
* Props the field can receive when used inside a time picker.
|
|
18
|
-
* (`TimePicker`, `DesktopTimePicker` or `MobileTimePicker` component).
|
|
19
|
-
*/
|
|
20
|
-
export type TimeFieldInPickerProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean> = DefaultizedProps<UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>, 'format' | 'timezone' | 'ampm' | keyof BaseTimeValidationProps> & BaseSingleInputFieldProps<TDate | null, TDate, FieldSection, false, TimeValidationError>;
|
|
21
16
|
export type UseTimeFieldComponentProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean, TChildProps extends {}> = Omit<TChildProps, keyof UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>> & UseTimeFieldProps<TDate, TEnableAccessibleFieldDOMStructure>;
|
|
22
17
|
export type TimeFieldProps<TDate extends PickerValidDate, TEnableAccessibleFieldDOMStructure extends boolean = false> = UseTimeFieldComponentProps<TDate, TEnableAccessibleFieldDOMStructure, BuiltInFieldTextFieldProps<TEnableAccessibleFieldDOMStructure>> & {
|
|
23
18
|
/**
|
package/TimeField/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { TimeField } from './TimeField';
|
|
2
2
|
export { useTimeField as unstable_useTimeField } from './useTimeField';
|
|
3
|
-
export type { UseTimeFieldProps, UseTimeFieldComponentProps, TimeFieldProps,
|
|
3
|
+
export type { UseTimeFieldProps, UseTimeFieldComponentProps, TimeFieldProps, } from './TimeField.types';
|