@mui/x-date-pickers 7.0.0-alpha.9 → 7.0.0-beta.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 +139 -38
- package/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/DateTimePicker/DateTimePickerToolbar.d.ts +6 -1
- package/DateTimePicker/DateTimePickerToolbar.js +33 -17
- package/PickersLayout/PickersLayout.types.d.ts +6 -5
- package/PickersLayout/pickersLayoutClasses.js +3 -2
- package/PickersLayout/usePickerLayout.d.ts +2 -2
- package/PickersLayout/usePickerLayout.js +2 -1
- package/README.md +2 -2
- package/TimeClock/TimeClock.js +3 -3
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/index.js +1 -1
- package/internals/hooks/usePicker/usePicker.d.ts +1 -1
- package/internals/hooks/usePicker/usePicker.js +4 -2
- package/internals/hooks/usePicker/usePicker.types.d.ts +1 -1
- package/internals/hooks/usePicker/usePickerViews.d.ts +11 -2
- package/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/internals/index.d.ts +4 -4
- package/internals/index.js +2 -2
- package/internals/models/props/tabs.d.ts +2 -1
- package/legacy/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/legacy/DateTimePicker/DateTimePickerToolbar.js +43 -29
- package/legacy/PickersLayout/pickersLayoutClasses.js +3 -2
- package/legacy/PickersLayout/usePickerLayout.js +2 -1
- package/legacy/TimeClock/TimeClock.js +3 -3
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +5 -4
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/usePicker/usePicker.js +4 -2
- package/legacy/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/legacy/internals/index.js +2 -2
- package/legacy/locales/beBY.js +8 -3
- package/legacy/locales/caES.js +7 -2
- package/legacy/locales/csCZ.js +8 -3
- package/legacy/locales/daDK.js +8 -3
- package/legacy/locales/deDE.js +6 -1
- package/legacy/locales/elGR.js +8 -3
- package/legacy/locales/enUS.js +7 -3
- package/legacy/locales/esES.js +8 -3
- package/legacy/locales/eu.js +6 -1
- package/legacy/locales/faIR.js +6 -1
- package/legacy/locales/fiFI.js +8 -3
- package/legacy/locales/frFR.js +6 -1
- package/legacy/locales/heIL.js +6 -1
- package/legacy/locales/huHU.js +6 -1
- package/legacy/locales/isIS.js +8 -3
- package/legacy/locales/itIT.js +8 -3
- package/legacy/locales/jaJP.js +6 -1
- package/legacy/locales/koKR.js +6 -1
- package/legacy/locales/kzKZ.js +6 -1
- package/legacy/locales/mk.js +6 -1
- package/legacy/locales/nbNO.js +8 -3
- package/legacy/locales/nlNL.js +8 -3
- package/legacy/locales/plPL.js +8 -3
- package/legacy/locales/ptBR.js +6 -1
- package/legacy/locales/roRO.js +6 -1
- package/legacy/locales/ruRU.js +8 -3
- package/legacy/locales/skSK.js +8 -3
- package/legacy/locales/svSE.js +8 -3
- package/legacy/locales/trTR.js +8 -3
- package/legacy/locales/ukUA.js +8 -3
- package/legacy/locales/urPK.js +6 -1
- package/legacy/locales/viVN.js +8 -3
- package/legacy/locales/zhCN.js +6 -1
- package/legacy/locales/zhHK.js +6 -1
- package/locales/beBY.d.ts +4 -0
- package/locales/beBY.js +8 -3
- package/locales/caES.d.ts +4 -0
- package/locales/caES.js +7 -2
- package/locales/csCZ.d.ts +4 -0
- package/locales/csCZ.js +8 -3
- package/locales/daDK.d.ts +4 -0
- package/locales/daDK.js +8 -3
- package/locales/deDE.d.ts +4 -0
- package/locales/deDE.js +6 -1
- package/locales/elGR.d.ts +4 -0
- package/locales/elGR.js +8 -3
- package/locales/enUS.d.ts +4 -0
- package/locales/enUS.js +7 -3
- package/locales/esES.d.ts +4 -0
- package/locales/esES.js +8 -3
- package/locales/eu.d.ts +4 -0
- package/locales/eu.js +6 -1
- package/locales/faIR.d.ts +4 -0
- package/locales/faIR.js +6 -1
- package/locales/fiFI.d.ts +4 -0
- package/locales/fiFI.js +8 -3
- package/locales/frFR.d.ts +4 -0
- package/locales/frFR.js +6 -1
- package/locales/heIL.d.ts +4 -0
- package/locales/heIL.js +6 -1
- package/locales/huHU.d.ts +4 -0
- package/locales/huHU.js +6 -1
- package/locales/isIS.d.ts +4 -0
- package/locales/isIS.js +8 -3
- package/locales/itIT.d.ts +4 -0
- package/locales/itIT.js +8 -3
- package/locales/jaJP.d.ts +4 -0
- package/locales/jaJP.js +6 -1
- package/locales/koKR.d.ts +4 -0
- package/locales/koKR.js +6 -1
- package/locales/kzKZ.d.ts +4 -0
- package/locales/kzKZ.js +6 -1
- package/locales/mk.d.ts +4 -0
- package/locales/mk.js +6 -1
- package/locales/nbNO.d.ts +4 -0
- package/locales/nbNO.js +8 -3
- package/locales/nlNL.d.ts +4 -0
- package/locales/nlNL.js +8 -3
- package/locales/plPL.d.ts +4 -0
- package/locales/plPL.js +8 -3
- package/locales/ptBR.d.ts +4 -0
- package/locales/ptBR.js +6 -1
- package/locales/roRO.d.ts +4 -0
- package/locales/roRO.js +6 -1
- package/locales/ruRU.d.ts +4 -0
- package/locales/ruRU.js +8 -3
- package/locales/skSK.d.ts +4 -0
- package/locales/skSK.js +8 -3
- package/locales/svSE.d.ts +4 -0
- package/locales/svSE.js +8 -3
- package/locales/trTR.d.ts +4 -0
- package/locales/trTR.js +8 -3
- package/locales/ukUA.d.ts +4 -0
- package/locales/ukUA.js +8 -3
- package/locales/urPK.d.ts +4 -0
- package/locales/urPK.js +6 -1
- package/locales/utils/getPickersLocalization.d.ts +4 -0
- package/locales/utils/pickersLocaleTextApi.d.ts +4 -0
- package/locales/viVN.d.ts +4 -0
- package/locales/viVN.js +8 -3
- package/locales/zhCN.d.ts +4 -0
- package/locales/zhCN.js +6 -1
- package/locales/zhHK.d.ts +4 -0
- package/locales/zhHK.js +6 -1
- package/modern/DateTimePicker/DateTimePickerTabs.js +7 -4
- package/modern/DateTimePicker/DateTimePickerToolbar.js +33 -17
- package/modern/PickersLayout/pickersLayoutClasses.js +3 -2
- package/modern/PickersLayout/usePickerLayout.js +2 -1
- package/modern/TimeClock/TimeClock.js +3 -3
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/modern/index.js +1 -1
- package/modern/internals/hooks/usePicker/usePicker.js +4 -2
- package/modern/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/modern/internals/index.js +2 -2
- package/modern/locales/beBY.js +8 -3
- package/modern/locales/caES.js +7 -2
- package/modern/locales/csCZ.js +8 -3
- package/modern/locales/daDK.js +8 -3
- package/modern/locales/deDE.js +6 -1
- package/modern/locales/elGR.js +8 -3
- package/modern/locales/enUS.js +7 -3
- package/modern/locales/esES.js +8 -3
- package/modern/locales/eu.js +6 -1
- package/modern/locales/faIR.js +6 -1
- package/modern/locales/fiFI.js +8 -3
- package/modern/locales/frFR.js +6 -1
- package/modern/locales/heIL.js +6 -1
- package/modern/locales/huHU.js +6 -1
- package/modern/locales/isIS.js +8 -3
- package/modern/locales/itIT.js +8 -3
- package/modern/locales/jaJP.js +6 -1
- package/modern/locales/koKR.js +6 -1
- package/modern/locales/kzKZ.js +6 -1
- package/modern/locales/mk.js +6 -1
- package/modern/locales/nbNO.js +8 -3
- package/modern/locales/nlNL.js +8 -3
- package/modern/locales/plPL.js +8 -3
- package/modern/locales/ptBR.js +6 -1
- package/modern/locales/roRO.js +6 -1
- package/modern/locales/ruRU.js +8 -3
- package/modern/locales/skSK.js +8 -3
- package/modern/locales/svSE.js +8 -3
- package/modern/locales/trTR.js +8 -3
- package/modern/locales/ukUA.js +8 -3
- package/modern/locales/urPK.js +6 -1
- package/modern/locales/viVN.js +8 -3
- package/modern/locales/zhCN.js +6 -1
- package/modern/locales/zhHK.js +6 -1
- package/node/DateTimePicker/DateTimePickerTabs.js +8 -5
- package/node/DateTimePicker/DateTimePickerToolbar.js +34 -18
- package/node/PickersLayout/pickersLayoutClasses.js +5 -3
- package/node/PickersLayout/usePickerLayout.js +2 -1
- package/node/TimeClock/TimeClock.js +3 -3
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +4 -4
- package/node/index.js +1 -1
- package/node/internals/hooks/usePicker/usePicker.js +4 -2
- package/node/internals/hooks/usePicker/usePickerViews.js +8 -3
- package/node/internals/index.js +12 -0
- package/node/locales/beBY.js +8 -3
- package/node/locales/caES.js +7 -2
- package/node/locales/csCZ.js +8 -3
- package/node/locales/daDK.js +8 -3
- package/node/locales/deDE.js +6 -1
- package/node/locales/elGR.js +8 -3
- package/node/locales/enUS.js +7 -3
- package/node/locales/esES.js +8 -3
- package/node/locales/eu.js +6 -1
- package/node/locales/faIR.js +6 -1
- package/node/locales/fiFI.js +8 -3
- package/node/locales/frFR.js +6 -1
- package/node/locales/heIL.js +6 -1
- package/node/locales/huHU.js +6 -1
- package/node/locales/isIS.js +8 -3
- package/node/locales/itIT.js +8 -3
- package/node/locales/jaJP.js +6 -1
- package/node/locales/koKR.js +6 -1
- package/node/locales/kzKZ.js +6 -1
- package/node/locales/mk.js +6 -1
- package/node/locales/nbNO.js +8 -3
- package/node/locales/nlNL.js +8 -3
- package/node/locales/plPL.js +8 -3
- package/node/locales/ptBR.js +6 -1
- package/node/locales/roRO.js +6 -1
- package/node/locales/ruRU.js +8 -3
- package/node/locales/skSK.js +8 -3
- package/node/locales/svSE.js +8 -3
- package/node/locales/trTR.js +8 -3
- package/node/locales/ukUA.js +8 -3
- package/node/locales/urPK.js +6 -1
- package/node/locales/viVN.js +8 -3
- package/node/locales/zhCN.js +6 -1
- package/node/locales/zhHK.js +6 -1
- package/package.json +4 -4
- package/timeViewRenderers/timeViewRenderers.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,106 @@
|
|
|
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.0.0-beta.0
|
|
7
|
+
|
|
8
|
+
_Jan 26, 2024_
|
|
9
|
+
|
|
10
|
+
We are glad to announce MUI X v7 beta!
|
|
11
|
+
This version has several improvements, bug fixes, and exciting features 🎉.
|
|
12
|
+
We want to offer a big thanks to the 7 contributors who made this release possible ✨:
|
|
13
|
+
|
|
14
|
+
- 🚀 Release the [Date Time Range Picker](https://next.mui.com/x/react-date-pickers/date-time-range-picker/) component (#9528) @LukasTy
|
|
15
|
+
|
|
16
|
+
<img src="https://github.com/mui/mui-x/assets/4941090/122bb7bc-5e72-4e11-a8e5-96f3026de922" width="510" height="652" alt="Date Time Range Picker example" />
|
|
17
|
+
|
|
18
|
+
- 🎁 New column management panel design for the Data Grid (#11770) @MBilalShafi
|
|
19
|
+
|
|
20
|
+
<img width="310" alt="image" src="https://github.com/mui/mui-x/assets/12609561/a79dac8b-d54d-4e69-a63a-ef78f3993f37">
|
|
21
|
+
|
|
22
|
+
- 🐞 Bugfixes
|
|
23
|
+
- 📚 Documentation improvements
|
|
24
|
+
|
|
25
|
+
### Data Grid
|
|
26
|
+
|
|
27
|
+
#### Breaking changes
|
|
28
|
+
|
|
29
|
+
- The columns management component has been redesigned and the component was extracted from the `ColumnsPanel` which now only serves as a wrapper to display the component above the headers as a panel. As a result, a new slot `columnsManagement` and the related prop `slotProps.columnsManagement` have been introduced. The props corresponding to the columns management component which were previously passed to the prop `slotProps.columnsPanel` should now be passed to `slotProps.columnsManagement`. `slotProps.columnsPanel` could still be used to override props corresponding to the `Panel` component used in `ColumnsPanel` which uses [`Popper`](https://next.mui.com/material-ui/react-popper/) component under the hood.
|
|
30
|
+
|
|
31
|
+
```diff
|
|
32
|
+
<DataGrid
|
|
33
|
+
slotProps={{
|
|
34
|
+
- columnsPanel: {
|
|
35
|
+
+ columnsManagement: {
|
|
36
|
+
sort: 'asc',
|
|
37
|
+
autoFocusSearchField: false,
|
|
38
|
+
},
|
|
39
|
+
}}
|
|
40
|
+
/>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `Show all` and `Hide all` buttons in the `ColumnsPanel` have been combined into one `Show/Hide All` toggle in the new columns management component. The related props `disableShowAllButton` and `disableHideAllButton` have been replaced with a new prop `disableShowHideToggle`.
|
|
44
|
+
|
|
45
|
+
```diff
|
|
46
|
+
<DataGrid
|
|
47
|
+
- disableShowAllButton
|
|
48
|
+
- disableHideAllButton
|
|
49
|
+
+ disableShowHideToggle
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
#### `@mui/x-data-grid@7.0.0-beta.0`
|
|
54
|
+
|
|
55
|
+
- [DataGrid] Export `GridColumnTypes` interface for custom column types (#11742) @cherniavskii
|
|
56
|
+
- [DataGrid] Initialize `apiRef` early (#11792) @cherniavskii
|
|
57
|
+
- [DataGrid] New column management panel design (#11770) @MBilalShafi
|
|
58
|
+
- [DataGrid] Fix support for tree with more than 50,000 children (#11757) @zenazn
|
|
59
|
+
|
|
60
|
+
#### `@mui/x-data-grid-pro@7.0.0-beta.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
61
|
+
|
|
62
|
+
Same changes as in `@mui/x-data-grid@7.0.0-beta.0`.
|
|
63
|
+
|
|
64
|
+
#### `@mui/x-data-grid-premium@7.0.0-beta.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
65
|
+
|
|
66
|
+
Same changes as in `@mui/x-data-grid-pro@7.0.0-beta.0`.
|
|
67
|
+
|
|
68
|
+
### Date Pickers
|
|
69
|
+
|
|
70
|
+
#### `@mui/x-date-pickers@7.0.0-beta.0`
|
|
71
|
+
|
|
72
|
+
- [pickers] Apply the `layout.tabs` class to `Tabs` slot (#11781) @LukasTy
|
|
73
|
+
- [pickers] Avoid deep imports (#11794) @LukasTy
|
|
74
|
+
- [pickers] Fields typing optimization (#11779) @LukasTy
|
|
75
|
+
|
|
76
|
+
#### `@mui/x-date-pickers-pro@7.0.0-beta.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
77
|
+
|
|
78
|
+
Same changes as in `@mui/x-date-pickers@7.0.0-beta.0`, plus:
|
|
79
|
+
|
|
80
|
+
- [pickers] Add `DateTimeRangePicker` component (#9528) @LukasTy
|
|
81
|
+
- [pickers] Add `DateTimeRangePicker` theme augmentation (#11814) @LukasTy
|
|
82
|
+
- [DateRangePicker] Remove `calendars` prop on `Mobile` (#11752) @LukasTy
|
|
83
|
+
|
|
84
|
+
### Tree View / `@mui/x-tree-view@7.0.0-beta.0`
|
|
85
|
+
|
|
86
|
+
- [TreeView] Remove unused props from prop-types and typing (#11778) @flaviendelangle
|
|
87
|
+
- [TreeView] Throw an error when two items have the same id (#11715) @flaviendelangle
|
|
88
|
+
|
|
89
|
+
### Docs
|
|
90
|
+
|
|
91
|
+
- [docs] Add `contextValue` to the headless tree view doc (#11705) @flaviendelangle
|
|
92
|
+
- [docs] Add section for the `disableSelection` prop (#11821) @flaviendelangle
|
|
93
|
+
- [docs] Fix brand name non-breaking space (#11758) @oliviertassinari
|
|
94
|
+
- [docs] Fix typo in Data Grid components page (#11775) @flaviendelangle
|
|
95
|
+
- [docs] Fix use of quote, should use callout (#11759) @oliviertassinari
|
|
96
|
+
- [docs] Improve error message for MUI Vale rule @oliviertassinari
|
|
97
|
+
- [docs] Include `DateTimeRangePicker` in relevant demos (#11815) @LukasTy
|
|
98
|
+
- [docs] Add recipe for sorting row groups by the number of child rows (#11164) @cherniavskii
|
|
99
|
+
|
|
100
|
+
### Core
|
|
101
|
+
|
|
102
|
+
- [core] Cleanup script and alias setup (#11749) @LukasTy
|
|
103
|
+
- [core] Polish issue templates @oliviertassinari
|
|
104
|
+
- [code-infra] Update prettier and pretty-quick (#11735) @Janpot
|
|
105
|
+
|
|
6
106
|
## 7.0.0-alpha.9
|
|
7
107
|
|
|
8
108
|
_Jan 19, 2024_
|
|
@@ -138,14 +238,14 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.9`.
|
|
|
138
238
|
#### Breaking changes
|
|
139
239
|
|
|
140
240
|
- The `expandIcon` / `defaultExpandIcon` props, used to expand the children of a node (rendered when it is collapsed),
|
|
141
|
-
is now defined as a slot both on the Tree View and the Tree Item components.
|
|
241
|
+
is now defined as a slot both on the Tree View and the Tree Item components.
|
|
142
242
|
|
|
143
243
|
If you were using the `ChevronRight` icon from `@mui/icons-material`,
|
|
144
244
|
you can stop passing it to your component because it is now the default value:
|
|
145
245
|
|
|
146
246
|
```diff
|
|
147
247
|
-import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
148
|
-
|
|
248
|
+
|
|
149
249
|
<SimpleTreeView
|
|
150
250
|
- defaultExpandIcon={<ChevronRightIcon />}
|
|
151
251
|
>
|
|
@@ -180,14 +280,14 @@ is now defined as a slot both on the Tree View and the Tree Item components.
|
|
|
180
280
|
```
|
|
181
281
|
|
|
182
282
|
- The `collapseIcon` / `defaultCollapseIcon` props, used to collapse the children of a node (rendered when it is expanded),
|
|
183
|
-
is now defined as a slot both on the Tree View and the Tree Item components.
|
|
283
|
+
is now defined as a slot both on the Tree View and the Tree Item components.
|
|
184
284
|
|
|
185
285
|
If you were using the `ExpandMore` icon from `@mui/icons-material`,
|
|
186
286
|
you can stop passing it to your component because it is now the default value:
|
|
187
287
|
|
|
188
288
|
```diff
|
|
189
289
|
- import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
190
|
-
|
|
290
|
+
|
|
191
291
|
<SimpleTreeView
|
|
192
292
|
- defaultCollapseIcon={<ExpandMoreIcon />}
|
|
193
293
|
>
|
|
@@ -227,14 +327,14 @@ is now defined as a slot both on the Tree View and the Tree Item components.
|
|
|
227
327
|
```diff
|
|
228
328
|
-import { TreeItem, useTreeItem } from '@mui/x-tree-view/TreeItem';
|
|
229
329
|
+import { TreeItem, useTreeItemState } from '@mui/x-tree-view/TreeItem';
|
|
230
|
-
|
|
330
|
+
|
|
231
331
|
const CustomContent = React.forwardRef((props, ref) => {
|
|
232
332
|
- const { disabled } = useTreeItem(props.nodeId);
|
|
233
333
|
+ const { disabled } = useTreeItemState(props.nodeId);
|
|
234
|
-
|
|
334
|
+
|
|
235
335
|
// Render some UI
|
|
236
336
|
});
|
|
237
|
-
|
|
337
|
+
|
|
238
338
|
function App() {
|
|
239
339
|
return (
|
|
240
340
|
<SimpleTreeView>
|
|
@@ -412,7 +512,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
|
|
|
412
512
|
|
|
413
513
|
- [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11628) @LukasTy
|
|
414
514
|
- [docs] Improve `git diff` format @oliviertassinari
|
|
415
|
-
- [docs] Push up the MUI
|
|
515
|
+
- [docs] Push up the MUI X brand (#11533) @oliviertassinari
|
|
416
516
|
- [docs] Remove old data grid translation files (#11646) @cherniavskii
|
|
417
517
|
- [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
|
|
418
518
|
- [docs] Improve charts landing page (#11570) @oliviertassinari
|
|
@@ -422,8 +522,8 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.8`.
|
|
|
422
522
|
- [core] Lock `jsdom` version (#11652) @cherniavskii
|
|
423
523
|
- [core] Remove PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD (#11608) @oliviertassinari
|
|
424
524
|
- [core] Simplify isSsr logic (#11606) @oliviertassinari
|
|
425
|
-
- [core] Sync playwright cache between MUI
|
|
426
|
-
- [core] Use MUI
|
|
525
|
+
- [core] Sync playwright cache between MUI X and Material UI (#11607) @oliviertassinari
|
|
526
|
+
- [core] Use MUI X official name in errors (#11645) @oliviertassinari
|
|
427
527
|
|
|
428
528
|
## 7.0.0-alpha.7
|
|
429
529
|
|
|
@@ -455,7 +555,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
455
555
|
items={MUI_X_PRODUCTS}
|
|
456
556
|
defaultCollapseIcon={<ExpandMoreIcon />}
|
|
457
557
|
defaultExpandIcon={<ChevronRightIcon />}
|
|
458
|
-
|
|
558
|
+
/>;
|
|
459
559
|
```
|
|
460
560
|
|
|
461
561
|
- 🌍 Improve Czech (cs-CZ) locale on the Data Grid
|
|
@@ -559,10 +659,10 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.7`.
|
|
|
559
659
|
|
|
560
660
|
- [core] Fix release changelog (#11496) @romgrk
|
|
561
661
|
- [core] Fix use of ::before & ::after (#11515) @oliviertassinari
|
|
562
|
-
- [core] Localize the issue template to MUI
|
|
662
|
+
- [core] Localize the issue template to MUI X (#11511) @oliviertassinari
|
|
563
663
|
- [core] Regen api files (#11542) @flaviendelangle
|
|
564
664
|
- [core] Remove issue emoji @oliviertassinari
|
|
565
|
-
- [core] Sync the release instructions with MUI
|
|
665
|
+
- [core] Sync the release instructions with MUI Core @oliviertassinari
|
|
566
666
|
- [core] Yaml format match most common convention @oliviertassinari
|
|
567
667
|
|
|
568
668
|
## 7.0.0-alpha.6
|
|
@@ -600,6 +700,7 @@ We'd like to offer a big thanks to the 6 contributors who made this release poss
|
|
|
600
700
|
getOptionLabel: (value: any) => value.name,
|
|
601
701
|
};
|
|
602
702
|
```
|
|
703
|
+
|
|
603
704
|
- The `filterModel` now supports `Date` objects as values for `date` and `dateTime` column types.
|
|
604
705
|
The `filterModel` still accepts strings as values for `date` and `dateTime` column types,
|
|
605
706
|
but all updates to the `filterModel` coming from the UI (e.g. filter panel) will set the value as a `Date` object.
|
|
@@ -693,7 +794,7 @@ Same changes as in `@mui/x-data-grid-pro@7.0.0-alpha.5`.
|
|
|
693
794
|
#### Breaking changes
|
|
694
795
|
|
|
695
796
|
- The slot interfaces got renamed to match with `@mui/base` naming.
|
|
696
|
-
The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
|
|
797
|
+
The `SlotsComponent` suffix has been replaced with `Slots` and `SlotsComponentsProps` with `SlotProps`.
|
|
697
798
|
|
|
698
799
|
```diff
|
|
699
800
|
-DateCalendarSlotsComponent
|
|
@@ -1071,7 +1172,7 @@ Same changes as in `@mui/x-date-pickers@7.0.0-alpha.3`.
|
|
|
1071
1172
|
- [docs] Polish Next.js header description @oliviertassinari
|
|
1072
1173
|
- [docs] Remove the `newFeature` flag on v6 features (#11168) @flaviendelangle
|
|
1073
1174
|
- [docs] Simplify a bit chart demo (#11173) @oliviertassinari
|
|
1074
|
-
- [docs] Standardize the usage of callouts in the MUI
|
|
1175
|
+
- [docs] Standardize the usage of callouts in the MUI X docs (#7127) @samuelsycamore
|
|
1075
1176
|
- [docs] Adjust the Data Grid demo page design (#11231) @danilo-leal
|
|
1076
1177
|
|
|
1077
1178
|
### Core
|
|
@@ -1460,15 +1561,15 @@ And if you need the exact same output you can apply the following transformation
|
|
|
1460
1561
|
// For Day.js
|
|
1461
1562
|
-const isoString = adapter.toISO(value);
|
|
1462
1563
|
+const isoString = value.toISOString();
|
|
1463
|
-
|
|
1564
|
+
|
|
1464
1565
|
// For Luxon
|
|
1465
1566
|
-const isoString = adapter.toISO(value);
|
|
1466
1567
|
+const isoString = value.toUTC().toISO({ format: 'extended' });
|
|
1467
|
-
|
|
1568
|
+
|
|
1468
1569
|
// For DateFns
|
|
1469
1570
|
-const isoString = adapter.toISO(value);
|
|
1470
1571
|
+const isoString = dateFns.formatISO(value, { format: 'extended' });
|
|
1471
|
-
|
|
1572
|
+
|
|
1472
1573
|
// For Moment
|
|
1473
1574
|
-const isoString = adapter.toISO(value);
|
|
1474
1575
|
+const isoString = value.toISOString();
|
|
@@ -1836,7 +1937,7 @@ Same changes as in `@mui/x-date-pickers@6.19.0`.
|
|
|
1836
1937
|
|
|
1837
1938
|
- [docs] Add missing component @oliviertassinari
|
|
1838
1939
|
- [docs] Fix parsing of `x-date-pickers-pro` demo adapter imports (#11637) @LukasTy
|
|
1839
|
-
- [docs] Push up the MUI
|
|
1940
|
+
- [docs] Push up the MUI X brand (#11533) @oliviertassinari
|
|
1840
1941
|
- [docs] Improve Server-side data grid docs (#11589) @oliviertassinari
|
|
1841
1942
|
- [docs] Add demo to the charts overview page (#11586) @danilo-leal
|
|
1842
1943
|
- [docs] Fix 404 links in the docs @oliviertassinari
|
|
@@ -2196,7 +2297,7 @@ We'd like to offer a big thanks to the 7 contributors who made this release poss
|
|
|
2196
2297
|
- 🥧 Pie charts are now animated.
|
|
2197
2298
|
- 📈 Line charts now support partial data, and can interpolate missing data https://mui.com/x/react-charts/lines/#skip-missing-points.
|
|
2198
2299
|
|
|
2199
|
-
<img src="https://github.com/mui/mui-x/assets/3165635/d2d50b1b-ee29-4e4c-9ebe-629c06f3093e" width="683" height="436" />
|
|
2300
|
+
<img src="https://github.com/mui/mui-x/assets/3165635/d2d50b1b-ee29-4e4c-9ebe-629c06f3093e" width="683" height="436" alt="Charts partial data" />
|
|
2200
2301
|
|
|
2201
2302
|
- ✨ The data grid allows to ignore [diacritics](https://en.wikipedia.org/wiki/Diacritic) when filtering.
|
|
2202
2303
|
- 📚 Documentation improvements
|
|
@@ -2690,7 +2791,7 @@ Same changes as in `@mui/x-date-pickers@6.15.0`.
|
|
|
2690
2791
|
- [docs] Add missing MIT packages on the Licensing page (#10348) @flaviendelangle
|
|
2691
2792
|
- [docs] Clearer component pattern @oliviertassinari
|
|
2692
2793
|
- [docs] Easier to understand demo (#10370) @oliviertassinari
|
|
2693
|
-
- [docs] Fix `301` to Material
|
|
2794
|
+
- [docs] Fix `301` to Material UI @oliviertassinari
|
|
2694
2795
|
- [docs] Improve the column visibility section (#10327) @MBilalShafi
|
|
2695
2796
|
- [docs] Improve the documentation section `rowIdentifier` (#10326) @MBilalShafi
|
|
2696
2797
|
- [docs] Improve pickers localization documentation (#10202) @flaviendelangle
|
|
@@ -2768,12 +2869,12 @@ Same changes as in `@mui/x-date-pickers@6.14.0`.
|
|
|
2768
2869
|
- [docs] Add conditional range picker props example (#10227) @LukasTy
|
|
2769
2870
|
- [docs] Add toolbar to the multi-filters demo (#10223) @MBilalShafi
|
|
2770
2871
|
- [docs] Avoid the use of "We" @oliviertassinari
|
|
2771
|
-
- [docs] Clarify MUI vs. MUI
|
|
2872
|
+
- [docs] Clarify MUI vs. MUI Core difference @oliviertassinari
|
|
2772
2873
|
- [docs] Enable `ariaV7` flag for demos using `useDemoData` hook (#10204) @cherniavskii
|
|
2773
2874
|
- [docs] Fix Tree View link to API references (#10282) @oliviertassinari
|
|
2774
2875
|
- [docs] Fix image layout shift (#10313) @oliviertassinari
|
|
2775
|
-
- [docs] Fix link to MUI
|
|
2776
|
-
- [docs] Fix redirection to Base
|
|
2876
|
+
- [docs] Fix link to MUI X from readme logo @oliviertassinari
|
|
2877
|
+
- [docs] Fix redirection to Base UI URLs @oliviertassinari
|
|
2777
2878
|
- [docs] Improve Tree View demos (#10268) @oliviertassinari
|
|
2778
2879
|
- [docs] Improve docs for ref type props (#10273) @michelengelen
|
|
2779
2880
|
- [docs] Improve npm package README (#10269) @oliviertassinari
|
|
@@ -2857,7 +2958,7 @@ Same changes as in `@mui/x-date-pickers@6.13.0`, plus:
|
|
|
2857
2958
|
- [docs] Improve the week picker example (#8257) @flaviendelangle
|
|
2858
2959
|
- [docs] Include code links in the data grid demo (#10219) @cherniavskii
|
|
2859
2960
|
- [docs] Polish page for SEO (#10216) @oliviertassinari
|
|
2860
|
-
- [docs] Use `Base
|
|
2961
|
+
- [docs] Use `Base UI` `Portal` for the quick filter recipe (#10188) @DanailH
|
|
2861
2962
|
|
|
2862
2963
|
### Core
|
|
2863
2964
|
|
|
@@ -3118,7 +3219,7 @@ We'd like to offer a big thanks to the 12 contributors who made this release pos
|
|
|
3118
3219
|
|
|
3119
3220
|
- ⌚️ Move the tree view component from `@mui/lab` package
|
|
3120
3221
|
|
|
3121
|
-
The `<TreeView />` component has been moved to the MUI
|
|
3222
|
+
The `<TreeView />` component has been moved to the MUI X repository.
|
|
3122
3223
|
It is now accessible from its own package: `@mui/x-tree-view`.
|
|
3123
3224
|
|
|
3124
3225
|
- 🌍 Improve Hebrew (he-IL), Finnish (fi-FI), and Italian (it-IT) locales on the data grid
|
|
@@ -3180,7 +3281,7 @@ Same changes as in `@mui/x-date-pickers@6.11.0`.
|
|
|
3180
3281
|
|
|
3181
3282
|
- [docs] Add Tree View doc (#9825) @flaviendelangle
|
|
3182
3283
|
- [docs] Add charts nav item (#9821) @LukasTy
|
|
3183
|
-
- [docs] Add charts to MUI
|
|
3284
|
+
- [docs] Add charts to MUI X introduction pages (#9704) @joserodolfofreitas
|
|
3184
3285
|
- [docs] Add example for avoiding picker views layout shift (#9781) @noraleonte
|
|
3185
3286
|
- [docs] Consistency of Next.js App Router @oliviertassinari
|
|
3186
3287
|
- [docs] Fix API page regression: bring back slots section (#9866) @alexfauquette
|
|
@@ -3249,7 +3350,7 @@ Same changes as in `@mui/x-date-pickers@6.10.2`.
|
|
|
3249
3350
|
### Docs
|
|
3250
3351
|
|
|
3251
3352
|
- [docs] Add `pnpm` in more places @oliviertassinari
|
|
3252
|
-
- [docs] Add `pnpm` installation instructions for MUI
|
|
3353
|
+
- [docs] Add `pnpm` installation instructions for MUI X (#9707) @richbustos
|
|
3253
3354
|
- [docs] Align pickers "uncontrolled vs controlled" sections (#9772) @LukasTy
|
|
3254
3355
|
- [docs] Apply style guide to the data grid Layout page (#9673) @richbustos
|
|
3255
3356
|
- [docs] Differentiate between packages in `slotProps` docs (#9668) @cherniavskii
|
|
@@ -3558,7 +3659,7 @@ We'd like to offer a big thanks to the 11 contributors who made this release pos
|
|
|
3558
3659
|
|
|
3559
3660
|
- 🚀 Introducing UTC and timezone support for pickers.
|
|
3560
3661
|
|
|
3561
|
-
<img width="774" src="https://github.com/mui/mui-x/assets/3165635/ad95a404-ee67-4aff-b996-ad6cbb322348">
|
|
3662
|
+
<img width="774" src="https://github.com/mui/mui-x/assets/3165635/ad95a404-ee67-4aff-b996-ad6cbb322348" alt="Pickers time zone switching">
|
|
3562
3663
|
|
|
3563
3664
|
Visit the [documentation](https://mui.com/x/react-date-pickers/timezone/) to learn how to use it.
|
|
3564
3665
|
|
|
@@ -3610,7 +3711,7 @@ Same changes as in `@mui/x-date-pickers@6.9.0`.
|
|
|
3610
3711
|
|
|
3611
3712
|
- [docs] Add examples of using different time view renderers (#9360) @LukasTy
|
|
3612
3713
|
- [docs] Add recipe for single-click editing (#8365) @m4theushw
|
|
3613
|
-
- [docs] Fix Base
|
|
3714
|
+
- [docs] Fix Base UI references (#9349) @oliviertassinari
|
|
3614
3715
|
- [docs] Fix random screenshot generation (#9364) @cherniavskii
|
|
3615
3716
|
- [docs] Remove random generation from chart doc example (#9343) @flaviendelangle
|
|
3616
3717
|
- [docs] Sync h1 with sidenav link (#9252) @oliviertassinari
|
|
@@ -3794,7 +3895,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
3794
3895
|
|
|
3795
3896
|
- 🚀 New date time picking UI on [`DesktopDateTimePicker`](https://mui.com/x/react-date-pickers/date-time-picker/)
|
|
3796
3897
|
|
|
3797
|
-
<img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" />
|
|
3898
|
+
<img src="https://github.com/mui/mui-x/assets/3165635/4e1fe9f9-03eb-4f23-99dd-80212b21fb23" width="840" height="506" alt="Desktop Date Time Picker example" />
|
|
3798
3899
|
|
|
3799
3900
|
- 🚀 Performance improvements
|
|
3800
3901
|
- 🐞 Bugfixes
|
|
@@ -3870,7 +3971,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
3870
3971
|
|
|
3871
3972
|
- 💫 Introduce filtering on column headers for `DataGridPro` and `DataGridPremium`:
|
|
3872
3973
|
|
|
3873
|
-
<img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" />
|
|
3974
|
+
<img src="https://github.com/mui/mui-x/releases/download/v6.5.0/recording.gif" width="840" height="506" alt="Filtering on column headers example" />
|
|
3874
3975
|
|
|
3875
3976
|
See [the documentation](https://mui.com/x/react-data-grid/filtering/header-filters/) for more information
|
|
3876
3977
|
|
|
@@ -4029,7 +4130,7 @@ We'd like to offer a big thanks to the 15 contributors who made this release pos
|
|
|
4029
4130
|
|
|
4030
4131
|
- 🚀 New [time-picking UI](https://mui.com/x/react-date-pickers/digital-clock/) designed for desktops (#7958) @LukasTy
|
|
4031
4132
|
|
|
4032
|
-
<img src="https://user-images.githubusercontent.com/4941090/235072007-de39a397-e4a4-4c98-8e10-5ee4ad440108.gif" width="494" />
|
|
4133
|
+
<img src="https://user-images.githubusercontent.com/4941090/235072007-de39a397-e4a4-4c98-8e10-5ee4ad440108.gif" width="494" alt="New digital clock time picker" />
|
|
4033
4134
|
|
|
4034
4135
|
- ✨ Picker fields [now always include a leading zero](https://mui.com/x/react-date-pickers/adapters-locale/#respect-leading-zeros-in-fields) on digit sections (#8527) @flaviendelangle
|
|
4035
4136
|
- 🌍 Improve Chinese (zh-CN), French (fr-FR), and Turkish (tr-TR) locales
|
|
@@ -4405,7 +4506,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
4405
4506
|
- [docs] Add a warning for `luxon` macro tokens (#8245) @flaviendelangle
|
|
4406
4507
|
- [docs] Complete pickers customization pages (#8066) @alexfauquette
|
|
4407
4508
|
- [docs] Fix 301 redirection @oliviertassinari
|
|
4408
|
-
- [docs] Fix 404 links to customization Material
|
|
4509
|
+
- [docs] Fix 404 links to customization Material UI APIs (#8200) @oliviertassinari
|
|
4409
4510
|
- [docs] Fix `moment-hijri` demo (#8255) @LukasTy
|
|
4410
4511
|
- [docs] Improve migration diff (#8240) @oliviertassinari
|
|
4411
4512
|
- [docs] Change **What's new** page url to point to announcement blog post (#8186) @joserodolfofreitas
|
|
@@ -4836,7 +4937,7 @@ We'd like to offer a big thanks to the 17 contributors who made this release pos
|
|
|
4836
4937
|
|
|
4837
4938
|
_Jan 19, 2023_
|
|
4838
4939
|
|
|
4839
|
-
After a long period in alpha, we're glad to announce the first MUI
|
|
4940
|
+
After a long period in alpha, we're glad to announce the first MUI X v6 beta!
|
|
4840
4941
|
We encourage you to try out this version, packed with improvements, bug fixes, and a few highlighted features ✨:
|
|
4841
4942
|
|
|
4842
4943
|
**Data Grid**
|
|
@@ -6092,7 +6193,7 @@ We'd like to offer a big thanks to the 9 contributors who made this release poss
|
|
|
6092
6193
|
#### Breaking changes
|
|
6093
6194
|
|
|
6094
6195
|
- The `ToolbarComponent` has been replaced by a `Toolbar` component slot.
|
|
6095
|
-
You can find more information about this pattern in the [Base
|
|
6196
|
+
You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props):
|
|
6096
6197
|
|
|
6097
6198
|
```diff
|
|
6098
6199
|
// Same on all other pickers
|
|
@@ -6243,7 +6344,7 @@ We'd like to offer a big thanks to the 8 contributors who made this release poss
|
|
|
6243
6344
|
|
|
6244
6345
|
#### Breaking changes
|
|
6245
6346
|
|
|
6246
|
-
- All the props used by the mobile and desktop wrappers to override components or components' props have been replaced by component slots. You can find more information about this pattern in the [Base
|
|
6347
|
+
- All the props used by the mobile and desktop wrappers to override components or components' props have been replaced by component slots. You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
|
|
6247
6348
|
|
|
6248
6349
|
Some of the names have also been prefixed by `desktop` when it was unclear that the behavior was only applied on the desktop version of the pickers (or the responsive version when used on a desktop).
|
|
6249
6350
|
|
|
@@ -6432,7 +6533,7 @@ We'd like to offer a big thanks to the 10 contributors who made this release pos
|
|
|
6432
6533
|
#### Breaking changes
|
|
6433
6534
|
|
|
6434
6535
|
- The `renderDay` prop has been replaced by a `Day` component slot.
|
|
6435
|
-
You can find more information about this pattern in the [Base
|
|
6536
|
+
You can find more information about this pattern in the [Base UI documentation](https://mui.com/base-ui/getting-started/usage/#shared-props).
|
|
6436
6537
|
|
|
6437
6538
|
```diff
|
|
6438
6539
|
// Same for any other date, date time or date range picker.
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import clsx from 'clsx';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
import Tab from '@mui/material/Tab';
|
|
4
5
|
import Tabs, { tabsClasses } from '@mui/material/Tabs';
|
|
5
6
|
import { styled, useThemeProps } from '@mui/material/styles';
|
|
6
|
-
import
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
7
8
|
import { TimeIcon, DateRangeIcon } from '../icons';
|
|
8
9
|
import { useLocaleText } from '../internals/hooks/useUtils';
|
|
9
10
|
import { getDateTimePickerTabsUtilityClass } from './dateTimePickerTabsClasses';
|
|
@@ -68,7 +69,8 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
68
69
|
onViewChange,
|
|
69
70
|
timeIcon = /*#__PURE__*/_jsx(TimeIcon, {}),
|
|
70
71
|
view,
|
|
71
|
-
hidden = typeof window === 'undefined' || window.innerHeight < 667
|
|
72
|
+
hidden = typeof window === 'undefined' || window.innerHeight < 667,
|
|
73
|
+
className
|
|
72
74
|
} = props;
|
|
73
75
|
const localeText = useLocaleText();
|
|
74
76
|
const classes = useUtilityClasses(props);
|
|
@@ -83,7 +85,7 @@ const DateTimePickerTabs = function DateTimePickerTabs(inProps) {
|
|
|
83
85
|
variant: "fullWidth",
|
|
84
86
|
value: viewToTab(view),
|
|
85
87
|
onChange: handleChange,
|
|
86
|
-
className: classes.root,
|
|
88
|
+
className: clsx(className, classes.root),
|
|
87
89
|
children: [/*#__PURE__*/_jsx(Tab, {
|
|
88
90
|
value: "date",
|
|
89
91
|
"aria-label": localeText.dateTableLabel,
|
|
@@ -108,6 +110,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
108
110
|
* Override or extend the styles applied to the component.
|
|
109
111
|
*/
|
|
110
112
|
classes: PropTypes.object,
|
|
113
|
+
className: PropTypes.string,
|
|
111
114
|
/**
|
|
112
115
|
* Date tab icon.
|
|
113
116
|
* @default DateRange
|
|
@@ -119,7 +122,7 @@ process.env.NODE_ENV !== "production" ? DateTimePickerTabs.propTypes = {
|
|
|
119
122
|
*/
|
|
120
123
|
hidden: PropTypes.bool,
|
|
121
124
|
/**
|
|
122
|
-
* Callback called when a tab is clicked
|
|
125
|
+
* Callback called when a tab is clicked.
|
|
123
126
|
* @template TView
|
|
124
127
|
* @param {TView} view The view to open
|
|
125
128
|
*/
|
|
@@ -2,16 +2,21 @@ import * as React from 'react';
|
|
|
2
2
|
import { BaseToolbarProps, ExportedBaseToolbarProps } from '../internals/models/props/toolbar';
|
|
3
3
|
import { DateTimePickerToolbarClasses } from './dateTimePickerToolbarClasses';
|
|
4
4
|
import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models';
|
|
5
|
+
import { MakeOptional } from '../internals/models/helpers';
|
|
5
6
|
export interface ExportedDateTimePickerToolbarProps extends ExportedBaseToolbarProps {
|
|
6
7
|
ampm?: boolean;
|
|
7
8
|
ampmInClock?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem> {
|
|
10
|
+
export interface DateTimePickerToolbarProps<TDate> extends ExportedDateTimePickerToolbarProps, MakeOptional<BaseToolbarProps<TDate | null, DateOrTimeViewWithMeridiem>, 'view'> {
|
|
10
11
|
/**
|
|
11
12
|
* Override or extend the styles applied to the component.
|
|
12
13
|
*/
|
|
13
14
|
classes?: Partial<DateTimePickerToolbarClasses>;
|
|
14
15
|
toolbarVariant?: WrapperVariant;
|
|
16
|
+
/**
|
|
17
|
+
* If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
|
|
18
|
+
*/
|
|
19
|
+
toolbarTitle?: React.ReactNode;
|
|
15
20
|
}
|
|
16
21
|
/**
|
|
17
22
|
* Demos:
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant"];
|
|
3
|
+
const _excluded = ["ampm", "ampmInClock", "value", "onChange", "view", "isLandscape", "onViewChange", "toolbarFormat", "toolbarPlaceholder", "views", "disabled", "readOnly", "toolbarVariant", "toolbarTitle", "className"];
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
6
|
import { styled, useThemeProps, useTheme } from '@mui/material/styles';
|
|
7
|
-
import
|
|
7
|
+
import composeClasses from '@mui/utils/composeClasses';
|
|
8
|
+
import clsx from 'clsx';
|
|
8
9
|
import { PickersToolbarText } from '../internals/components/PickersToolbarText';
|
|
9
10
|
import { PickersToolbar } from '../internals/components/PickersToolbar';
|
|
10
11
|
import { PickersToolbarButton } from '../internals/components/PickersToolbarButton';
|
|
@@ -13,6 +14,8 @@ import { dateTimePickerToolbarClasses, getDateTimePickerToolbarUtilityClass } fr
|
|
|
13
14
|
import { useMeridiemMode } from '../internals/hooks/date-helpers-hooks';
|
|
14
15
|
import { MULTI_SECTION_CLOCK_SECTION_WIDTH } from '../internals/constants/dimensions';
|
|
15
16
|
import { formatMeridiem } from '../internals/utils/date-utils';
|
|
17
|
+
import { pickersToolbarTextClasses } from '../internals/components/pickersToolbarTextClasses';
|
|
18
|
+
import { pickersToolbarClasses } from '../internals';
|
|
16
19
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
17
20
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
21
|
const useUtilityClasses = ownerState => {
|
|
@@ -39,13 +42,18 @@ const DateTimePickerToolbarRoot = styled(PickersToolbar, {
|
|
|
39
42
|
})(({
|
|
40
43
|
theme,
|
|
41
44
|
ownerState
|
|
42
|
-
}) => ({
|
|
45
|
+
}) => _extends({
|
|
43
46
|
paddingLeft: ownerState.toolbarVariant === 'desktop' && !ownerState.isLandscape ? 24 : 16,
|
|
44
47
|
paddingRight: ownerState.toolbarVariant === 'desktop' && !ownerState.isLandscape ? 0 : 16,
|
|
45
48
|
borderBottom: ownerState.toolbarVariant === 'desktop' ? `1px solid ${(theme.vars || theme).palette.divider}` : undefined,
|
|
46
49
|
borderRight: ownerState.toolbarVariant === 'desktop' && ownerState.isLandscape ? `1px solid ${(theme.vars || theme).palette.divider}` : undefined,
|
|
47
50
|
justifyContent: 'space-around',
|
|
48
51
|
position: 'relative'
|
|
52
|
+
}, ownerState.toolbarVariant === 'desktop' && {
|
|
53
|
+
[`& .${pickersToolbarClasses.content} .${pickersToolbarTextClasses.selected}`]: {
|
|
54
|
+
color: (theme.vars || theme).palette.primary.main,
|
|
55
|
+
fontWeight: theme.typography.fontWeightBold
|
|
56
|
+
}
|
|
49
57
|
}));
|
|
50
58
|
DateTimePickerToolbarRoot.propTypes = {
|
|
51
59
|
// ----------------------------- Warning --------------------------------
|
|
@@ -182,7 +190,9 @@ function DateTimePickerToolbar(inProps) {
|
|
|
182
190
|
views,
|
|
183
191
|
disabled,
|
|
184
192
|
readOnly,
|
|
185
|
-
toolbarVariant = 'mobile'
|
|
193
|
+
toolbarVariant = 'mobile',
|
|
194
|
+
toolbarTitle: inToolbarTitle,
|
|
195
|
+
className
|
|
186
196
|
} = props,
|
|
187
197
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
188
198
|
const ownerState = props;
|
|
@@ -198,6 +208,7 @@ function DateTimePickerToolbar(inProps) {
|
|
|
198
208
|
const classes = useUtilityClasses(_extends({}, ownerState, {
|
|
199
209
|
theme
|
|
200
210
|
}));
|
|
211
|
+
const toolbarTitle = inToolbarTitle != null ? inToolbarTitle : localeText.dateTimePickerToolbarTitle;
|
|
201
212
|
const formatHours = time => ampm ? utils.format(time, 'hours12h') : utils.format(time, 'hours24h');
|
|
202
213
|
const dateText = React.useMemo(() => {
|
|
203
214
|
if (!value) {
|
|
@@ -209,9 +220,9 @@ function DateTimePickerToolbar(inProps) {
|
|
|
209
220
|
return utils.format(value, 'shortDate');
|
|
210
221
|
}, [value, toolbarFormat, toolbarPlaceholder, utils]);
|
|
211
222
|
return /*#__PURE__*/_jsxs(DateTimePickerToolbarRoot, _extends({
|
|
212
|
-
toolbarTitle: localeText.dateTimePickerToolbarTitle,
|
|
213
223
|
isLandscape: isLandscape,
|
|
214
|
-
className: classes.root
|
|
224
|
+
className: clsx(classes.root, className),
|
|
225
|
+
toolbarTitle: toolbarTitle
|
|
215
226
|
}, other, {
|
|
216
227
|
ownerState: ownerState,
|
|
217
228
|
children: [/*#__PURE__*/_jsxs(DateTimePickerToolbarDateContainer, {
|
|
@@ -236,14 +247,14 @@ function DateTimePickerToolbar(inProps) {
|
|
|
236
247
|
children: [/*#__PURE__*/_jsxs(DateTimePickerToolbarTimeDigitsContainer, {
|
|
237
248
|
className: classes.timeDigitsContainer,
|
|
238
249
|
ownerState: ownerState,
|
|
239
|
-
children: [views.includes('hours') && /*#__PURE__*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
children: [views.includes('hours') && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
251
|
+
children: [/*#__PURE__*/_jsx(PickersToolbarButton, {
|
|
252
|
+
variant: isDesktop ? 'h5' : 'h3',
|
|
253
|
+
width: isDesktop && !isLandscape ? MULTI_SECTION_CLOCK_SECTION_WIDTH : undefined,
|
|
254
|
+
onClick: () => onViewChange('hours'),
|
|
255
|
+
selected: view === 'hours',
|
|
256
|
+
value: value ? formatHours(value) : '--'
|
|
257
|
+
}), /*#__PURE__*/_jsx(DateTimePickerToolbarSeparator, {
|
|
247
258
|
variant: isDesktop ? 'h5' : 'h3',
|
|
248
259
|
value: ":",
|
|
249
260
|
className: classes.separator,
|
|
@@ -252,8 +263,9 @@ function DateTimePickerToolbar(inProps) {
|
|
|
252
263
|
variant: isDesktop ? 'h5' : 'h3',
|
|
253
264
|
width: isDesktop && !isLandscape ? MULTI_SECTION_CLOCK_SECTION_WIDTH : undefined,
|
|
254
265
|
onClick: () => onViewChange('minutes'),
|
|
255
|
-
selected: view === 'minutes',
|
|
256
|
-
value: value ? utils.format(value, 'minutes') : '--'
|
|
266
|
+
selected: view === 'minutes' || !views.includes('minutes') && view === 'hours',
|
|
267
|
+
value: value ? utils.format(value, 'minutes') : '--',
|
|
268
|
+
disabled: !views.includes('minutes')
|
|
257
269
|
})]
|
|
258
270
|
}), views.includes('seconds') && /*#__PURE__*/_jsxs(React.Fragment, {
|
|
259
271
|
children: [/*#__PURE__*/_jsx(DateTimePickerToolbarSeparator, {
|
|
@@ -335,12 +347,16 @@ process.env.NODE_ENV !== "production" ? DateTimePickerToolbar.propTypes = {
|
|
|
335
347
|
* @default "––"
|
|
336
348
|
*/
|
|
337
349
|
toolbarPlaceholder: PropTypes.node,
|
|
350
|
+
/**
|
|
351
|
+
* If provided, it will be used instead of `dateTimePickerToolbarTitle` from localization.
|
|
352
|
+
*/
|
|
353
|
+
toolbarTitle: PropTypes.node,
|
|
338
354
|
toolbarVariant: PropTypes.oneOf(['desktop', 'mobile']),
|
|
339
355
|
value: PropTypes.any,
|
|
340
356
|
/**
|
|
341
357
|
* Currently visible picker view.
|
|
342
358
|
*/
|
|
343
|
-
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year'])
|
|
359
|
+
view: PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']),
|
|
344
360
|
views: PropTypes.arrayOf(PropTypes.oneOf(['day', 'hours', 'meridiem', 'minutes', 'month', 'seconds', 'year']).isRequired).isRequired
|
|
345
361
|
} : void 0;
|
|
346
362
|
export { DateTimePickerToolbar };
|
|
@@ -8,6 +8,7 @@ import { UsePickerLayoutPropsResponseLayoutProps } from '../internals/hooks/useP
|
|
|
8
8
|
import { PickersLayoutClasses } from './pickersLayoutClasses';
|
|
9
9
|
import { DateOrTimeViewWithMeridiem, WrapperVariant } from '../internals/models/common';
|
|
10
10
|
import { PickersShortcutsProps } from '../PickersShortcuts';
|
|
11
|
+
import { ExportedPickersShortcutProps } from '../PickersShortcuts/PickersShortcuts';
|
|
11
12
|
export interface ExportedPickersLayoutSlots<TValue, TDate, TView extends DateOrTimeViewWithMeridiem> {
|
|
12
13
|
/**
|
|
13
14
|
* Custom component for the action bar, it is placed below the picker views.
|
|
@@ -87,11 +88,11 @@ export interface PickersLayoutProps<TValue, TDate, TView extends DateOrTimeViewW
|
|
|
87
88
|
*/
|
|
88
89
|
slotProps?: PickersLayoutSlotProps<TValue, TDate, TView>;
|
|
89
90
|
}
|
|
90
|
-
export interface SubComponents {
|
|
91
|
-
toolbar: React.
|
|
91
|
+
export interface SubComponents<TValue> {
|
|
92
|
+
toolbar: React.ReactElement<ExportedBaseToolbarProps> | null;
|
|
92
93
|
content: React.ReactNode;
|
|
93
|
-
tabs: React.
|
|
94
|
-
actionBar: React.
|
|
95
|
-
shortcuts: React.
|
|
94
|
+
tabs: React.ReactElement<ExportedBaseTabsProps> | null;
|
|
95
|
+
actionBar: React.ReactElement<PickersActionBarProps>;
|
|
96
|
+
shortcuts: React.ReactElement<ExportedPickersShortcutProps<TValue>> | null;
|
|
96
97
|
}
|
|
97
98
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
|
2
|
+
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
|
2
3
|
export function getPickersLayoutUtilityClass(slot) {
|
|
3
4
|
return generateUtilityClass('MuiPickersLayout', slot);
|
|
4
5
|
}
|
|
5
|
-
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'shortcuts']);
|
|
6
|
+
export const pickersLayoutClasses = generateUtilityClasses('MuiPickersLayout', ['root', 'landscape', 'contentWrapper', 'toolbar', 'actionBar', 'tabs', 'shortcuts']);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { PickersLayoutProps, SubComponents } from './PickersLayout.types';
|
|
2
2
|
import { DateOrTimeViewWithMeridiem } from '../internals/models';
|
|
3
|
-
interface UsePickerLayoutResponse extends SubComponents {
|
|
3
|
+
interface UsePickerLayoutResponse<TValue> extends SubComponents<TValue> {
|
|
4
4
|
}
|
|
5
|
-
declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse
|
|
5
|
+
declare const usePickerLayout: <TValue, TDate, TView extends DateOrTimeViewWithMeridiem>(props: PickersLayoutProps<TValue, TDate, TView>) => UsePickerLayoutResponse<TValue>;
|
|
6
6
|
export default usePickerLayout;
|