@mui/x-date-pickers-pro 8.11.2 → 8.12.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 +231 -0
- package/DateRangeCalendar/DateRangeCalendar.js +1 -1
- package/DateRangePickerDay/DateRangePickerDay.js +1 -1
- package/DateTimeRangePicker/shared.d.ts +1 -0
- package/DateTimeRangePicker/shared.js +4 -0
- package/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +3 -1
- package/DesktopTimeRangePicker/DesktopTimeRangePicker.js +3 -1
- package/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +3 -1
- package/MobileTimeRangePicker/MobileTimeRangePicker.js +3 -1
- package/SingleInputDateRangeField/SingleInputDateRangeField.js +6 -3
- package/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +6 -3
- package/SingleInputTimeRangeField/SingleInputTimeRangeField.js +6 -3
- package/TimeRangePicker/shared.d.ts +1 -0
- package/TimeRangePicker/shared.js +4 -0
- package/esm/DateRangeCalendar/DateRangeCalendar.js +1 -1
- package/esm/DateRangePickerDay/DateRangePickerDay.js +1 -1
- package/esm/DateTimeRangePicker/shared.d.ts +1 -0
- package/esm/DateTimeRangePicker/shared.js +4 -0
- package/esm/DesktopDateTimeRangePicker/DesktopDateTimeRangePicker.js +3 -1
- package/esm/DesktopTimeRangePicker/DesktopTimeRangePicker.js +3 -1
- package/esm/MobileDateTimeRangePicker/MobileDateTimeRangePicker.js +3 -1
- package/esm/MobileTimeRangePicker/MobileTimeRangePicker.js +3 -1
- package/esm/SingleInputDateRangeField/SingleInputDateRangeField.js +7 -4
- package/esm/SingleInputDateTimeRangeField/SingleInputDateTimeRangeField.js +7 -4
- package/esm/SingleInputTimeRangeField/SingleInputTimeRangeField.js +7 -4
- package/esm/TimeRangePicker/shared.d.ts +1 -0
- package/esm/TimeRangePicker/shared.js +4 -0
- package/esm/index.js +1 -1
- package/esm/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +18 -17
- package/esm/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +18 -17
- package/index.js +1 -1
- package/internals/hooks/useDesktopRangePicker/useDesktopRangePicker.js +17 -16
- package/internals/hooks/useMobileRangePicker/useMobileRangePicker.js +17 -16
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,237 @@
|
|
|
5
5
|
All notable changes to this project will be documented in this file.
|
|
6
6
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
7
7
|
|
|
8
|
+
## 8.12.0
|
|
9
|
+
|
|
10
|
+
_Sep 25, 2025_
|
|
11
|
+
|
|
12
|
+
We'd like to extend a big thank you to the 15 contributors who made this release possible. Here are some highlights ✨:
|
|
13
|
+
|
|
14
|
+
- 🤝 Grid-Charts integration
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
👉 [🎥 Watch the full video](https://github.com/user-attachments/assets/28f1848e-dc85-4077-8756-a3e88afd4e54)
|
|
19
|
+
|
|
20
|
+
- ⌨️ Charts keyboard navigation
|
|
21
|
+
- ⚡️ Charts: Add new `renderer="svg-batch"` prop to Scatter charts that provides improved performance for large datasets
|
|
22
|
+
- 🐞 Bugfixes
|
|
23
|
+
- 📚 Documentation improvements
|
|
24
|
+
- 🧰 Codemod requires Node >=20.19
|
|
25
|
+
|
|
26
|
+
`@mui/x-codemod` minimum supported Node version is `20.19`.
|
|
27
|
+
This was only the case due to using the v18 `yargs` package; this now explicitly aligns with it. (#18979)
|
|
28
|
+
|
|
29
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
30
|
+
@deade1e, @sai6855, @thomas-mcdonald
|
|
31
|
+
|
|
32
|
+
The following are all team members who have contributed to this release:
|
|
33
|
+
@alexfauquette, @bernardobelchior, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @michelengelen, @prakhargupta1, @rita-codes, @siriwatknp, @arminmeh, @romgrk
|
|
34
|
+
|
|
35
|
+
### Data Grid
|
|
36
|
+
|
|
37
|
+
#### `@mui/x-data-grid@8.12.0`
|
|
38
|
+
|
|
39
|
+
- [DataGrid] Fix flex column width diff calculation while resizing (#19667) @arminmeh
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-data-grid-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
42
|
+
|
|
43
|
+
Same changes as in `@mui/x-data-grid@8.12.0`.
|
|
44
|
+
|
|
45
|
+
#### `@mui/x-data-grid-premium@8.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
46
|
+
|
|
47
|
+
Same changes as in `@mui/x-data-grid-pro@8.12.0`, plus:
|
|
48
|
+
|
|
49
|
+
- [DataGridPremium] Grid-Charts integration (#18021) @arminmeh
|
|
50
|
+
- [DataGridPremium] Fix sorting and filtering of the tree group columns with aggregation (#19607) @arminmeh
|
|
51
|
+
- [DataGridPremium] Disable aggregation on the grouping column by default (#19692) @arminmeh
|
|
52
|
+
- [DataGridPremium] Do not rely on the group separation constant to retrieve the column name for the charts panel (#19677) @arminmeh
|
|
53
|
+
- [DataGridPremium] Fix stale aggregation state (#19690) @arminmeh
|
|
54
|
+
- [DataGridPremium] Fix pivot column being hidden on autosizing (#19699) @cherniavskii
|
|
55
|
+
|
|
56
|
+
### Date and Time Pickers
|
|
57
|
+
|
|
58
|
+
#### `@mui/x-date-pickers@8.12.0`
|
|
59
|
+
|
|
60
|
+
- [pickers] Ensure reference value is not updated for invalid values (#19635) @michelengelen
|
|
61
|
+
- [pickers] Fix `slotProps.textField.slotProps.htmlInput` resolution (#19713) @LukasTy
|
|
62
|
+
- [pickers] Preserve time format when using single column layout on Time Range Picker (#19626) @sai6855
|
|
63
|
+
- [pickers] Preserve time format when using single column layout on Date Time Picker and Date Time Range Picker (#19608) @sai6855
|
|
64
|
+
|
|
65
|
+
#### `@mui/x-date-pickers-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
66
|
+
|
|
67
|
+
Same changes as in `@mui/x-date-pickers@8.12.0`.
|
|
68
|
+
|
|
69
|
+
### Charts
|
|
70
|
+
|
|
71
|
+
#### `@mui/x-charts@8.12.0`
|
|
72
|
+
|
|
73
|
+
- [charts] Add batch renderer for scatter chart (#19075) @bernardobelchior
|
|
74
|
+
- [charts] Add renderer suffix to performance benchmarks (#19620) @bernardobelchior
|
|
75
|
+
- [charts] Document how plugins can be used (#19343) @alexfauquette
|
|
76
|
+
- [charts] Export chart plugins per series type (#19337) @alexfauquette
|
|
77
|
+
- [charts] Export plugins (#19335) @alexfauquette
|
|
78
|
+
- [charts] Fix horizontal layout and toolbar (#19655) @alexfauquette
|
|
79
|
+
- [charts] Fix performance issue with JS animations (#19606) @bernardobelchior
|
|
80
|
+
- [charts] Fix piecewise scale causing wrong colors in axis with min/max (#19610) @bernardobelchior
|
|
81
|
+
- [charts] Fix zoom discard inconsistency (#19535) @bernardobelchior
|
|
82
|
+
- [charts] Introduce keyboard navigation (#19155) @alexfauquette
|
|
83
|
+
- [charts] Refactor `getAxisExtremum` (#19627) @bernardobelchior
|
|
84
|
+
- [charts] Remove unused code path from `getAxisScale` (#19673) @bernardobelchior
|
|
85
|
+
- [charts] Make new hideLegend prop on ChartWrapper optional (#19694) @thomas-mcdonald
|
|
86
|
+
- [charts] Fix chart crash in test environment (#19711) @JCQuintas
|
|
87
|
+
|
|
88
|
+
#### `@mui/x-charts-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
89
|
+
|
|
90
|
+
Same changes as in `@mui/x-charts@8.12.0`, plus:
|
|
91
|
+
|
|
92
|
+
- [charts-pro] Add `valueFormatter` to sankey (#19636) @JCQuintas
|
|
93
|
+
- [charts-pro] Allow `source/target` keywords in sankey link color (#19634) @JCQuintas
|
|
94
|
+
- [charts-pro] Allow exporting `SankeyChart` (#19659) @JCQuintas
|
|
95
|
+
- [charts-pro] Fix axis inversion when using axis `max` and `filterMode: 'discard'` (#19200) @bernardobelchior
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-charts-premium@8.12.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-charts-pro@8.12.0`, plus:
|
|
100
|
+
|
|
101
|
+
- [charts-premium] Grid-Charts integration (#18021) @arminmeh
|
|
102
|
+
|
|
103
|
+
### Tree View
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-tree-view@8.12.0`
|
|
106
|
+
|
|
107
|
+
- [tree view] Allow to pass `null` to the icon slots (#19569) @flaviendelangle
|
|
108
|
+
- [tree view] Fix `apiRef.current.isItemExpanded()` method (#19619) @flaviendelangle
|
|
109
|
+
|
|
110
|
+
#### `@mui/x-tree-view-pro@8.12.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
111
|
+
|
|
112
|
+
Same changes as in `@mui/x-tree-view@8.12.0`.
|
|
113
|
+
|
|
114
|
+
### Codemod
|
|
115
|
+
|
|
116
|
+
#### `@mui/x-codemod@8.12.0`
|
|
117
|
+
|
|
118
|
+
- [codemod] Bump `engines.node` to `>=20.19` to align with `yargs` package (#18979) @LukasTy
|
|
119
|
+
|
|
120
|
+
### Docs
|
|
121
|
+
|
|
122
|
+
- [docs] Add missing label to Charts example (#19616) @prakhargupta1
|
|
123
|
+
- [docs] Replace axis type and axis data with a table (#19618) @prakhargupta1
|
|
124
|
+
- [docs] Add Charts example collection page (#18353) @prakhargupta1
|
|
125
|
+
- [docs] Add a Charts demo showcasing bar and scatter composition (#19605) @prakhargupta1
|
|
126
|
+
- [docs] Add composition Charts demo for legends and tooltip (#19602) @prakhargupta1
|
|
127
|
+
- [docs] Add recipe about server-side data export (#19617) @siriwatknp
|
|
128
|
+
- [docs] Clarify DataGrid layout requirements (#19413) @romgrk
|
|
129
|
+
- [docs] Fix `ExportServerSideData` demo layout shift (#19669) @siriwatknp
|
|
130
|
+
- [docs] Improve server-side `updateRow()` description (#19554) @deade1e
|
|
131
|
+
- [docs] Show how to customize drawing area background (#19682) @alexfauquette
|
|
132
|
+
- [docs] Add hook documentation pages (#19334) @Copilot
|
|
133
|
+
|
|
134
|
+
### Core
|
|
135
|
+
|
|
136
|
+
- [code-infra] Add copilot instructions specific to x repo (#19623) @JCQuintas
|
|
137
|
+
- [code-infra] Load `tsx` files in visual regression (#19595) @JCQuintas
|
|
138
|
+
- [code-infra] Remove renovate automerge (#19501) @Janpot
|
|
139
|
+
- [code-infra] Update `DEFAULT_TIMESTAMP` format to ISO 8601 (#19624) @Janpot
|
|
140
|
+
- [code-infra] Update `findLatestTaggedVersion` to filter tags based on major version (#19693) @michelengelen
|
|
141
|
+
- [code-infra] Fix changelog generation for charts premium (#19701) @JCQuintas
|
|
142
|
+
- [code-infra] Run prettier on `createReleasePR.mjs` (#19702) @bernardobelchior
|
|
143
|
+
- [code-infra] Make `x-charts-premium` releasable (#18959) @JCQuintas
|
|
144
|
+
- [docs-infra] Ensure `create-playground` script only runs if target file is absent (#19603) @michelengelen
|
|
145
|
+
- [docs-infra] Add @prakhargupta1 as a codeowner of the docs (#19679) @alexfauquette
|
|
146
|
+
|
|
147
|
+
### Miscellaneous
|
|
148
|
+
|
|
149
|
+
- [test] Reduce time for wheel zoom test (#19571) @alexfauquette
|
|
150
|
+
- Change `matchPackageNames` to `matchDepNames` for date-fns-v2 @Janpot
|
|
151
|
+
- Remove groupName for date-fns-v2 in renovate.json @Janpot
|
|
152
|
+
|
|
153
|
+
## 8.11.3
|
|
154
|
+
|
|
155
|
+
_Sep 16, 2025_
|
|
156
|
+
|
|
157
|
+
We'd like to extend a big thank you to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
158
|
+
|
|
159
|
+
- 🐞 Bugfixes
|
|
160
|
+
- 📚 Documentation improvements
|
|
161
|
+
|
|
162
|
+
Special thanks go out to the community members for their valuable contributions:
|
|
163
|
+
@sai6855
|
|
164
|
+
|
|
165
|
+
The following are all team members who have contributed to this release:
|
|
166
|
+
@alexfauquette, @bernardobelchior, @brijeshb42, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @LukasTy, @rita-codes, @siriwatknp
|
|
167
|
+
|
|
168
|
+
### Data Grid
|
|
169
|
+
|
|
170
|
+
#### `@mui/x-data-grid@8.11.3`
|
|
171
|
+
|
|
172
|
+
- [DataGrid] Fix numeric font size not being applied (#19552) @cherniavskii
|
|
173
|
+
- [DataGrid] Improve `operator` types to display literal values (#19529) @siriwatknp
|
|
174
|
+
|
|
175
|
+
#### `@mui/x-data-grid-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
176
|
+
|
|
177
|
+
Same changes as in `@mui/x-data-grid@8.11.3`.
|
|
178
|
+
|
|
179
|
+
#### `@mui/x-data-grid-premium@8.11.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
180
|
+
|
|
181
|
+
Same changes as in `@mui/x-data-grid-pro@8.11.3`.
|
|
182
|
+
|
|
183
|
+
### Date and Time Pickers
|
|
184
|
+
|
|
185
|
+
#### `@mui/x-date-pickers@8.11.3`
|
|
186
|
+
|
|
187
|
+
- [pickers] Refactor `slots` and `slotProps` propagation strategy (#18867) @LukasTy
|
|
188
|
+
|
|
189
|
+
#### `@mui/x-date-pickers-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
190
|
+
|
|
191
|
+
Same changes as in `@mui/x-date-pickers@8.11.3`.
|
|
192
|
+
|
|
193
|
+
### Charts
|
|
194
|
+
|
|
195
|
+
#### `@mui/x-charts@8.11.3`
|
|
196
|
+
|
|
197
|
+
- [charts] Add `inline-` piecewise legend options (#19382) @JCQuintas
|
|
198
|
+
- [charts] Add bar gradient example (#19174) @bernardobelchior
|
|
199
|
+
- [charts] Ignore empty tick labels in label overlap computation (#19547) @alexfauquette
|
|
200
|
+
- [charts] Rename `isBandScale` to `isDiscreteScale` (#19514) @bernardobelchior
|
|
201
|
+
- [charts] Fix legend position affecting toolbar's position (#19257) @sai6855
|
|
202
|
+
|
|
203
|
+
#### `@mui/x-charts-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
204
|
+
|
|
205
|
+
Same changes as in `@mui/x-charts@8.11.3`, plus:
|
|
206
|
+
|
|
207
|
+
- [charts-pro] Add chart title and caption to export demo (#19524) @bernardobelchior
|
|
208
|
+
|
|
209
|
+
### Tree View
|
|
210
|
+
|
|
211
|
+
#### `@mui/x-tree-view@8.11.3`
|
|
212
|
+
|
|
213
|
+
- [tree view] Stop looping through all items to publish the `removeItem` event (#19500) @flaviendelangle
|
|
214
|
+
- [tree view] Support flat DOM structure (#19350) @flaviendelangle
|
|
215
|
+
- [tree view] Update cursor styles for disabled TreeItem (#19548) @sai6855
|
|
216
|
+
|
|
217
|
+
#### `@mui/x-tree-view-pro@8.11.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
218
|
+
|
|
219
|
+
Same changes as in `@mui/x-tree-view@8.11.3`.
|
|
220
|
+
|
|
221
|
+
### Codemod
|
|
222
|
+
|
|
223
|
+
#### `@mui/x-codemod@8.11.3`
|
|
224
|
+
|
|
225
|
+
Internal changes.
|
|
226
|
+
|
|
227
|
+
### Docs
|
|
228
|
+
|
|
229
|
+
- [docs] Add styling row group recipe (#19349) @siriwatknp
|
|
230
|
+
- [docs] Group demos data into the dataset folder (#19549) @alexfauquette
|
|
231
|
+
- [docs] Add `shiny` bar chart example at the top (#19416) @JCQuintas
|
|
232
|
+
|
|
233
|
+
### Core
|
|
234
|
+
|
|
235
|
+
- [code-infra] Axios update (#19577) @Janpot
|
|
236
|
+
- [code-infra] Remove usage of copy-files command from code-infra (#19518) @brijeshb42
|
|
237
|
+
- [internal] Fix naming to match convention @oliviertassinari
|
|
238
|
+
|
|
8
239
|
## 8.11.2
|
|
9
240
|
|
|
10
241
|
_Sep 10, 2025_
|
|
@@ -37,7 +37,7 @@ var _DateRangePickerDay2 = require("../DateRangePickerDay2");
|
|
|
37
37
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
38
38
|
const _excluded = ["value", "defaultValue", "referenceDate", "onChange", "className", "classes", "disableFuture", "disablePast", "minDate", "maxDate", "shouldDisableDate", "reduceAnimations", "onMonthChange", "rangePosition", "defaultRangePosition", "onRangePositionChange", "calendars", "currentMonthCalendarPosition", "slots", "slotProps", "loading", "renderLoading", "disableHighlightToday", "focusedView", "onFocusedViewChange", "readOnly", "disabled", "showDaysOutsideCurrentMonth", "dayOfWeekFormatter", "disableAutoMonthSwitching", "autoFocus", "fixedWeekNumber", "disableDragEditing", "displayWeekNumber", "timezone", "availableRangePositions", "views", "view", "openTo", "onViewChange"],
|
|
39
39
|
_excluded2 = ["isDragging", "rangeDragDay", "draggingDatePosition"];
|
|
40
|
-
const releaseInfo = "
|
|
40
|
+
const releaseInfo = "MTc1ODc1MTIwMDAwMA==";
|
|
41
41
|
const DateRangeCalendarRoot = (0, _styles.styled)('div', {
|
|
42
42
|
name: 'MuiDateRangeCalendar',
|
|
43
43
|
slot: 'Root'
|
|
@@ -235,7 +235,7 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
|
|
|
235
235
|
showDaysOutsideCurrentMonth
|
|
236
236
|
} = props,
|
|
237
237
|
other = (0, _objectWithoutPropertiesLoose2.default)(props, _excluded);
|
|
238
|
-
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "
|
|
238
|
+
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
239
239
|
const adapter = (0, _hooks.usePickerAdapter)();
|
|
240
240
|
const shouldRenderHighlight = isHighlighting && !outsideCurrentMonth;
|
|
241
241
|
const shouldRenderPreview = isPreviewing && !outsideCurrentMonth;
|
|
@@ -58,6 +58,7 @@ export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<
|
|
|
58
58
|
type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' | ValidateDateTimeRangePropsToDefault>, 'views'>> & {
|
|
59
59
|
shouldRenderTimeInASingleColumn: boolean;
|
|
60
60
|
views: readonly DateTimeRangePickerView[];
|
|
61
|
+
viewsForFormatting: readonly DateOrTimeViewWithMeridiem[];
|
|
61
62
|
};
|
|
62
63
|
export declare function useDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps>(props: Props, name: string): UseDateTimeRangePickerDefaultizedProps<Props>;
|
|
63
64
|
export {};
|
|
@@ -39,12 +39,16 @@ function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
|
39
39
|
timeSteps: themeProps.timeSteps,
|
|
40
40
|
views: defaultViews
|
|
41
41
|
});
|
|
42
|
+
|
|
43
|
+
// Keep the original views for format calculation (before filtering)
|
|
44
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
42
45
|
return (0, _extends2.default)({}, themeProps, validationProps, {
|
|
43
46
|
timeSteps,
|
|
44
47
|
openTo,
|
|
45
48
|
shouldRenderTimeInASingleColumn,
|
|
46
49
|
thresholdToRenderTimeInASingleColumn,
|
|
47
50
|
views,
|
|
51
|
+
viewsForFormatting,
|
|
48
52
|
ampm,
|
|
49
53
|
slots: (0, _extends2.default)({
|
|
50
54
|
tabs: _DateTimeRangePickerTabs.DateTimeRangePickerTabs,
|
|
@@ -122,7 +122,9 @@ const DesktopDateTimeRangePicker = exports.DesktopDateTimeRangePicker = /*#__PUR
|
|
|
122
122
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
123
123
|
views,
|
|
124
124
|
viewRenderers,
|
|
125
|
-
format: (0, _internals.resolveDateTimeFormat)(adapter,
|
|
125
|
+
format: (0, _internals.resolveDateTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
126
|
+
views: defaultizedProps.viewsForFormatting
|
|
127
|
+
}), true),
|
|
126
128
|
// force true to correctly handle `renderTimeViewClock` as a renderer
|
|
127
129
|
ampmInClock: true,
|
|
128
130
|
calendars: defaultizedProps.calendars ?? 1,
|
|
@@ -87,7 +87,9 @@ const DesktopTimeRangePicker = exports.DesktopTimeRangePicker = /*#__PURE__*/Rea
|
|
|
87
87
|
views,
|
|
88
88
|
viewRenderers,
|
|
89
89
|
ampmInClock: true,
|
|
90
|
-
format: (0, _internals.resolveTimeFormat)(adapter,
|
|
90
|
+
format: (0, _internals.resolveTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
91
|
+
views: defaultizedProps.viewsForFormatting
|
|
92
|
+
})),
|
|
91
93
|
slots: (0, _extends2.default)({
|
|
92
94
|
field: _SingleInputTimeRangeField.SingleInputTimeRangeField
|
|
93
95
|
}, defaultizedProps.slots),
|
|
@@ -125,7 +125,9 @@ const MobileDateTimeRangePicker = exports.MobileDateTimeRangePicker = /*#__PURE_
|
|
|
125
125
|
}, defaultizedProps.viewRenderers);
|
|
126
126
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
127
127
|
viewRenderers,
|
|
128
|
-
format: (0, _internals.resolveDateTimeFormat)(adapter,
|
|
128
|
+
format: (0, _internals.resolveDateTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
129
|
+
views: defaultizedProps.viewsForFormatting
|
|
130
|
+
}), true),
|
|
129
131
|
// Force one calendar on mobile to avoid layout issues
|
|
130
132
|
calendars: 1,
|
|
131
133
|
// force true to correctly handle `renderTimeViewClock` as a renderer
|
|
@@ -85,7 +85,9 @@ const MobileTimeRangePicker = exports.MobileTimeRangePicker = /*#__PURE__*/React
|
|
|
85
85
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
86
86
|
ampmInClock: true,
|
|
87
87
|
viewRenderers,
|
|
88
|
-
format: (0, _internals.resolveTimeFormat)(adapter,
|
|
88
|
+
format: (0, _internals.resolveTimeFormat)(adapter, (0, _extends2.default)({}, defaultizedProps, {
|
|
89
|
+
views: defaultizedProps.viewsForFormatting
|
|
90
|
+
})),
|
|
89
91
|
slots: (0, _extends2.default)({
|
|
90
92
|
field: _SingleInputTimeRangeField.SingleInputTimeRangeField
|
|
91
93
|
}, defaultizedProps.slots),
|
|
@@ -43,11 +43,14 @@ const SingleInputDateRangeField = exports.SingleInputDateRangeField = /*#__PURE_
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useSingleInputDateRangeField.useSingleInputDateRangeField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.DateRangeIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") SingleInputDateRangeField.displayName = "SingleInputDateRangeField";
|
|
@@ -43,11 +43,14 @@ const SingleInputDateTimeRangeField = exports.SingleInputDateTimeRangeField = /*
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useSingleInputDateTimeRangeField.useSingleInputDateTimeRangeField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.DateRangeIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") SingleInputDateTimeRangeField.displayName = "SingleInputDateTimeRangeField";
|
|
@@ -43,11 +43,14 @@ const SingleInputTimeRangeField = exports.SingleInputTimeRangeField = /*#__PURE_
|
|
|
43
43
|
externalForwardedProps: other
|
|
44
44
|
});
|
|
45
45
|
const fieldResponse = (0, _useSingleInputTimeRangeField.useSingleInputTimeRangeField)(textFieldProps);
|
|
46
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.
|
|
46
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUIContextProvider, {
|
|
47
47
|
slots: slots,
|
|
48
48
|
slotProps: slotProps,
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
inputRef: other.inputRef,
|
|
50
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerFieldUI, {
|
|
51
|
+
fieldResponse: fieldResponse,
|
|
52
|
+
defaultOpenPickerIcon: _icons.ClockIcon
|
|
53
|
+
})
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
56
|
if (process.env.NODE_ENV !== "production") SingleInputTimeRangeField.displayName = "SingleInputTimeRangeField";
|
|
@@ -68,6 +68,7 @@ export interface BaseTimeRangePickerProps extends Omit<BasePickerInputProps<Pick
|
|
|
68
68
|
type UseTimeRangePickerDefaultizedProps<Props extends BaseTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'views' | 'openTo' | 'ampm' | keyof BaseTimeValidationProps>, 'views'>> & {
|
|
69
69
|
shouldRenderTimeInASingleColumn: boolean;
|
|
70
70
|
views: readonly TimeViewWithMeridiem[];
|
|
71
|
+
viewsForFormatting: readonly TimeViewWithMeridiem[];
|
|
71
72
|
};
|
|
72
73
|
export declare function useTimeRangePickerDefaultizedProps<Props extends BaseTimeRangePickerProps>(props: Props, name: string): UseTimeRangePickerDefaultizedProps<Props>;
|
|
73
74
|
export {};
|
|
@@ -49,6 +49,9 @@ function useTimeRangePickerDefaultizedProps(props, name) {
|
|
|
49
49
|
timeSteps: themeProps.timeSteps,
|
|
50
50
|
views: defaultViews
|
|
51
51
|
});
|
|
52
|
+
|
|
53
|
+
// Keep the original views for format calculation (before filtering)
|
|
54
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
52
55
|
return (0, _extends2.default)({}, themeProps, validationProps, {
|
|
53
56
|
localeText,
|
|
54
57
|
timeSteps,
|
|
@@ -56,6 +59,7 @@ function useTimeRangePickerDefaultizedProps(props, name) {
|
|
|
56
59
|
shouldRenderTimeInASingleColumn,
|
|
57
60
|
thresholdToRenderTimeInASingleColumn,
|
|
58
61
|
views,
|
|
62
|
+
viewsForFormatting,
|
|
59
63
|
ampm,
|
|
60
64
|
slots: (0, _extends2.default)({
|
|
61
65
|
tabs: _TimeRangePickerTabs.TimeRangePickerTabs,
|
|
@@ -30,7 +30,7 @@ import { PickersRangeCalendarHeader } from "../PickersRangeCalendarHeader/index.
|
|
|
30
30
|
import { useNullablePickerRangePositionContext } from "../internals/hooks/useNullablePickerRangePositionContext.js";
|
|
31
31
|
import { dateRangePickerDay2Classes } from "../DateRangePickerDay2/index.js";
|
|
32
32
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
-
const releaseInfo = "
|
|
33
|
+
const releaseInfo = "MTc1ODc1MTIwMDAwMA==";
|
|
34
34
|
const DateRangeCalendarRoot = styled('div', {
|
|
35
35
|
name: 'MuiDateRangeCalendar',
|
|
36
36
|
slot: 'Root'
|
|
@@ -228,7 +228,7 @@ const DateRangePickerDayRaw = /*#__PURE__*/React.forwardRef(function DateRangePi
|
|
|
228
228
|
showDaysOutsideCurrentMonth
|
|
229
229
|
} = props,
|
|
230
230
|
other = _objectWithoutPropertiesLoose(props, _excluded);
|
|
231
|
-
useLicenseVerifier('x-date-pickers-pro', "
|
|
231
|
+
useLicenseVerifier('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
232
232
|
const adapter = usePickerAdapter();
|
|
233
233
|
const shouldRenderHighlight = isHighlighting && !outsideCurrentMonth;
|
|
234
234
|
const shouldRenderPreview = isPreviewing && !outsideCurrentMonth;
|
|
@@ -58,6 +58,7 @@ export interface BaseDateTimeRangePickerProps extends Omit<BasePickerInputProps<
|
|
|
58
58
|
type UseDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'openTo' | 'ampm' | ValidateDateTimeRangePropsToDefault>, 'views'>> & {
|
|
59
59
|
shouldRenderTimeInASingleColumn: boolean;
|
|
60
60
|
views: readonly DateTimeRangePickerView[];
|
|
61
|
+
viewsForFormatting: readonly DateOrTimeViewWithMeridiem[];
|
|
61
62
|
};
|
|
62
63
|
export declare function useDateTimeRangePickerDefaultizedProps<Props extends BaseDateTimeRangePickerProps>(props: Props, name: string): UseDateTimeRangePickerDefaultizedProps<Props>;
|
|
63
64
|
export {};
|
|
@@ -32,12 +32,16 @@ export function useDateTimeRangePickerDefaultizedProps(props, name) {
|
|
|
32
32
|
timeSteps: themeProps.timeSteps,
|
|
33
33
|
views: defaultViews
|
|
34
34
|
});
|
|
35
|
+
|
|
36
|
+
// Keep the original views for format calculation (before filtering)
|
|
37
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
35
38
|
return _extends({}, themeProps, validationProps, {
|
|
36
39
|
timeSteps,
|
|
37
40
|
openTo,
|
|
38
41
|
shouldRenderTimeInASingleColumn,
|
|
39
42
|
thresholdToRenderTimeInASingleColumn,
|
|
40
43
|
views,
|
|
44
|
+
viewsForFormatting,
|
|
41
45
|
ampm,
|
|
42
46
|
slots: _extends({
|
|
43
47
|
tabs: DateTimeRangePickerTabs,
|
|
@@ -115,7 +115,9 @@ const DesktopDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function Deskto
|
|
|
115
115
|
const props = _extends({}, defaultizedProps, {
|
|
116
116
|
views,
|
|
117
117
|
viewRenderers,
|
|
118
|
-
format: resolveDateTimeFormat(adapter, defaultizedProps,
|
|
118
|
+
format: resolveDateTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
119
|
+
views: defaultizedProps.viewsForFormatting
|
|
120
|
+
}), true),
|
|
119
121
|
// force true to correctly handle `renderTimeViewClock` as a renderer
|
|
120
122
|
ampmInClock: true,
|
|
121
123
|
calendars: defaultizedProps.calendars ?? 1,
|
|
@@ -80,7 +80,9 @@ const DesktopTimeRangePicker = /*#__PURE__*/React.forwardRef(function DesktopTim
|
|
|
80
80
|
views,
|
|
81
81
|
viewRenderers,
|
|
82
82
|
ampmInClock: true,
|
|
83
|
-
format: resolveTimeFormat(adapter, defaultizedProps
|
|
83
|
+
format: resolveTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
84
|
+
views: defaultizedProps.viewsForFormatting
|
|
85
|
+
})),
|
|
84
86
|
slots: _extends({
|
|
85
87
|
field: SingleInputTimeRangeField
|
|
86
88
|
}, defaultizedProps.slots),
|
|
@@ -118,7 +118,9 @@ const MobileDateTimeRangePicker = /*#__PURE__*/React.forwardRef(function MobileD
|
|
|
118
118
|
}, defaultizedProps.viewRenderers);
|
|
119
119
|
const props = _extends({}, defaultizedProps, {
|
|
120
120
|
viewRenderers,
|
|
121
|
-
format: resolveDateTimeFormat(adapter, defaultizedProps,
|
|
121
|
+
format: resolveDateTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
122
|
+
views: defaultizedProps.viewsForFormatting
|
|
123
|
+
}), true),
|
|
122
124
|
// Force one calendar on mobile to avoid layout issues
|
|
123
125
|
calendars: 1,
|
|
124
126
|
// force true to correctly handle `renderTimeViewClock` as a renderer
|
|
@@ -78,7 +78,9 @@ const MobileTimeRangePicker = /*#__PURE__*/React.forwardRef(function MobileTimeR
|
|
|
78
78
|
const props = _extends({}, defaultizedProps, {
|
|
79
79
|
ampmInClock: true,
|
|
80
80
|
viewRenderers,
|
|
81
|
-
format: resolveTimeFormat(adapter, defaultizedProps
|
|
81
|
+
format: resolveTimeFormat(adapter, _extends({}, defaultizedProps, {
|
|
82
|
+
views: defaultizedProps.viewsForFormatting
|
|
83
|
+
})),
|
|
82
84
|
slots: _extends({
|
|
83
85
|
field: SingleInputTimeRangeField
|
|
84
86
|
}, defaultizedProps.slots),
|
|
@@ -7,7 +7,7 @@ import PropTypes from 'prop-types';
|
|
|
7
7
|
import { useThemeProps } from '@mui/material/styles';
|
|
8
8
|
import refType from '@mui/utils/refType';
|
|
9
9
|
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
|
|
10
|
-
import { PickerFieldUI, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
10
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
11
11
|
import { useSingleInputDateRangeField } from "./useSingleInputDateRangeField.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
@@ -36,11 +36,14 @@ const SingleInputDateRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useSingleInputDateRangeField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: DateRangeIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") SingleInputDateRangeField.displayName = "SingleInputDateRangeField";
|
|
@@ -5,7 +5,7 @@ const _excluded = ["slots", "slotProps"];
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { DateRangeIcon } from '@mui/x-date-pickers/icons';
|
|
8
|
-
import { PickerFieldUI, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
8
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import refType from '@mui/utils/refType';
|
|
11
11
|
import { useSingleInputDateTimeRangeField } from "./useSingleInputDateTimeRangeField.js";
|
|
@@ -36,11 +36,14 @@ const SingleInputDateTimeRangeField = /*#__PURE__*/React.forwardRef(function Sin
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useSingleInputDateTimeRangeField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: DateRangeIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") SingleInputDateTimeRangeField.displayName = "SingleInputDateTimeRangeField";
|
|
@@ -5,7 +5,7 @@ const _excluded = ["slots", "slotProps"];
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import PropTypes from 'prop-types';
|
|
7
7
|
import { ClockIcon } from '@mui/x-date-pickers/icons';
|
|
8
|
-
import { PickerFieldUI, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
8
|
+
import { PickerFieldUI, PickerFieldUIContextProvider, useFieldTextFieldProps } from '@mui/x-date-pickers/internals';
|
|
9
9
|
import { useThemeProps } from '@mui/material/styles';
|
|
10
10
|
import refType from '@mui/utils/refType';
|
|
11
11
|
import { useSingleInputTimeRangeField } from "./useSingleInputTimeRangeField.js";
|
|
@@ -36,11 +36,14 @@ const SingleInputTimeRangeField = /*#__PURE__*/React.forwardRef(function SingleI
|
|
|
36
36
|
externalForwardedProps: other
|
|
37
37
|
});
|
|
38
38
|
const fieldResponse = useSingleInputTimeRangeField(textFieldProps);
|
|
39
|
-
return /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(PickerFieldUIContextProvider, {
|
|
40
40
|
slots: slots,
|
|
41
41
|
slotProps: slotProps,
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
inputRef: other.inputRef,
|
|
43
|
+
children: /*#__PURE__*/_jsx(PickerFieldUI, {
|
|
44
|
+
fieldResponse: fieldResponse,
|
|
45
|
+
defaultOpenPickerIcon: ClockIcon
|
|
46
|
+
})
|
|
44
47
|
});
|
|
45
48
|
});
|
|
46
49
|
if (process.env.NODE_ENV !== "production") SingleInputTimeRangeField.displayName = "SingleInputTimeRangeField";
|
|
@@ -68,6 +68,7 @@ export interface BaseTimeRangePickerProps extends Omit<BasePickerInputProps<Pick
|
|
|
68
68
|
type UseTimeRangePickerDefaultizedProps<Props extends BaseTimeRangePickerProps> = LocalizedComponent<Omit<DefaultizedProps<Props, 'views' | 'openTo' | 'ampm' | keyof BaseTimeValidationProps>, 'views'>> & {
|
|
69
69
|
shouldRenderTimeInASingleColumn: boolean;
|
|
70
70
|
views: readonly TimeViewWithMeridiem[];
|
|
71
|
+
viewsForFormatting: readonly TimeViewWithMeridiem[];
|
|
71
72
|
};
|
|
72
73
|
export declare function useTimeRangePickerDefaultizedProps<Props extends BaseTimeRangePickerProps>(props: Props, name: string): UseTimeRangePickerDefaultizedProps<Props>;
|
|
73
74
|
export {};
|
|
@@ -41,6 +41,9 @@ export function useTimeRangePickerDefaultizedProps(props, name) {
|
|
|
41
41
|
timeSteps: themeProps.timeSteps,
|
|
42
42
|
views: defaultViews
|
|
43
43
|
});
|
|
44
|
+
|
|
45
|
+
// Keep the original views for format calculation (before filtering)
|
|
46
|
+
const viewsForFormatting = ampm ? [...defaultViews, 'meridiem'] : defaultViews;
|
|
44
47
|
return _extends({}, themeProps, validationProps, {
|
|
45
48
|
localeText,
|
|
46
49
|
timeSteps,
|
|
@@ -48,6 +51,7 @@ export function useTimeRangePickerDefaultizedProps(props, name) {
|
|
|
48
51
|
shouldRenderTimeInASingleColumn,
|
|
49
52
|
thresholdToRenderTimeInASingleColumn,
|
|
50
53
|
views,
|
|
54
|
+
viewsForFormatting,
|
|
51
55
|
ampm,
|
|
52
56
|
slots: _extends({
|
|
53
57
|
tabs: TimeRangePickerTabs,
|
package/esm/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import useSlotProps from '@mui/utils/useSlotProps';
|
|
|
7
7
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
8
8
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
9
9
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
10
|
-
import { usePicker, PickerPopper, PickerProvider
|
|
10
|
+
import { usePicker, PickerPopper, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
11
11
|
import { useRangePosition } from "../useRangePosition.js";
|
|
12
12
|
import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
|
|
13
13
|
import { getRangeFieldType } from "../../utils/date-fields-utils.js";
|
|
@@ -19,7 +19,7 @@ export const useDesktopRangePicker = _ref => {
|
|
|
19
19
|
steps
|
|
20
20
|
} = _ref,
|
|
21
21
|
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
-
useLicenseVerifier('x-date-pickers-pro', "
|
|
22
|
+
useLicenseVerifier('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
23
23
|
const {
|
|
24
24
|
slots,
|
|
25
25
|
slotProps,
|
|
@@ -27,7 +27,8 @@ export const useDesktopRangePicker = _ref => {
|
|
|
27
27
|
localeText
|
|
28
28
|
} = props;
|
|
29
29
|
const fieldType = getRangeFieldType(slots.field);
|
|
30
|
-
const
|
|
30
|
+
const isSingleInput = fieldType === 'single-input';
|
|
31
|
+
const viewContainerRole = isSingleInput ? 'dialog' : 'tooltip';
|
|
31
32
|
const rangePositionResponse = useRangePosition(props);
|
|
32
33
|
const getStepNavigation = createRangePickerStepNavigation({
|
|
33
34
|
steps,
|
|
@@ -58,22 +59,22 @@ export const useDesktopRangePicker = _ref => {
|
|
|
58
59
|
fieldProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
59
60
|
const Layout = slots?.layout ?? PickersLayout;
|
|
60
61
|
const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
|
|
61
|
-
children: /*#__PURE__*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
children: /*#__PURE__*/_jsxs(PickerRangePositionContext.Provider, {
|
|
63
|
+
value: rangePositionResponse,
|
|
64
|
+
children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
|
|
65
|
+
slots: slots,
|
|
66
|
+
slotProps: slotProps
|
|
67
|
+
}, isSingleInput && {
|
|
68
|
+
inputRef
|
|
69
|
+
})), /*#__PURE__*/_jsx(PickerPopper, {
|
|
70
|
+
slots: slots,
|
|
71
|
+
slotProps: slotProps,
|
|
72
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
|
|
68
73
|
slots: slots,
|
|
69
74
|
slotProps: slotProps,
|
|
70
|
-
children:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
children: renderCurrentView()
|
|
74
|
-
}))
|
|
75
|
-
})]
|
|
76
|
-
})
|
|
75
|
+
children: renderCurrentView()
|
|
76
|
+
}))
|
|
77
|
+
})]
|
|
77
78
|
})
|
|
78
79
|
}));
|
|
79
80
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
@@ -8,7 +8,7 @@ import useEventCallback from '@mui/utils/useEventCallback';
|
|
|
8
8
|
import resolveComponentProps from '@mui/utils/resolveComponentProps';
|
|
9
9
|
import { useLicenseVerifier } from '@mui/x-license';
|
|
10
10
|
import { PickersLayout } from '@mui/x-date-pickers/PickersLayout';
|
|
11
|
-
import { usePicker, PickersModalDialog, PickerProvider
|
|
11
|
+
import { usePicker, PickersModalDialog, PickerProvider } from '@mui/x-date-pickers/internals';
|
|
12
12
|
import { usePickerTranslations } from '@mui/x-date-pickers/hooks';
|
|
13
13
|
import { useRangePosition } from "../useRangePosition.js";
|
|
14
14
|
import { PickerRangePositionContext } from "../../../hooks/usePickerRangePositionContext.js";
|
|
@@ -21,7 +21,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
21
21
|
steps
|
|
22
22
|
} = _ref,
|
|
23
23
|
pickerParams = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
24
|
-
useLicenseVerifier('x-date-pickers-pro', "
|
|
24
|
+
useLicenseVerifier('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
25
25
|
const {
|
|
26
26
|
slots,
|
|
27
27
|
slotProps: innerSlotProps,
|
|
@@ -30,6 +30,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
30
30
|
localeText
|
|
31
31
|
} = props;
|
|
32
32
|
const fieldType = getRangeFieldType(slots.field);
|
|
33
|
+
const isSingleInput = fieldType === 'single-input';
|
|
33
34
|
const rangePositionResponse = useRangePosition(props);
|
|
34
35
|
const contextTranslations = usePickerTranslations();
|
|
35
36
|
const getStepNavigation = createRangePickerStepNavigation({
|
|
@@ -55,7 +56,7 @@ export const useMobileRangePicker = _ref => {
|
|
|
55
56
|
const _useSlotProps = useSlotProps({
|
|
56
57
|
elementType: Field,
|
|
57
58
|
externalSlotProps: innerSlotProps?.field,
|
|
58
|
-
additionalProps: _extends({},
|
|
59
|
+
additionalProps: _extends({}, isSingleInput && isToolbarHidden && {
|
|
59
60
|
id: labelId
|
|
60
61
|
}),
|
|
61
62
|
ownerState
|
|
@@ -93,22 +94,22 @@ export const useMobileRangePicker = _ref => {
|
|
|
93
94
|
}
|
|
94
95
|
});
|
|
95
96
|
const renderPicker = () => /*#__PURE__*/_jsx(PickerProvider, _extends({}, providerProps, {
|
|
96
|
-
children: /*#__PURE__*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
children: /*#__PURE__*/_jsxs(PickerRangePositionContext.Provider, {
|
|
98
|
+
value: rangePositionResponse,
|
|
99
|
+
children: [/*#__PURE__*/_jsx(Field, _extends({}, fieldProps, {
|
|
100
|
+
slots: slots,
|
|
101
|
+
slotProps: slotProps
|
|
102
|
+
}, isSingleInput && {
|
|
103
|
+
inputRef
|
|
104
|
+
})), /*#__PURE__*/_jsx(PickersModalDialog, {
|
|
105
|
+
slots: slots,
|
|
106
|
+
slotProps: slotProps,
|
|
107
|
+
children: /*#__PURE__*/_jsx(Layout, _extends({}, slotProps?.layout, {
|
|
103
108
|
slots: slots,
|
|
104
109
|
slotProps: slotProps,
|
|
105
|
-
children:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
children: renderCurrentView()
|
|
109
|
-
}))
|
|
110
|
-
})]
|
|
111
|
-
})
|
|
110
|
+
children: renderCurrentView()
|
|
111
|
+
}))
|
|
112
|
+
})]
|
|
112
113
|
})
|
|
113
114
|
}));
|
|
114
115
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
package/index.js
CHANGED
|
@@ -27,7 +27,7 @@ const useDesktopRangePicker = _ref => {
|
|
|
27
27
|
steps
|
|
28
28
|
} = _ref,
|
|
29
29
|
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
30
|
-
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "
|
|
30
|
+
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
31
31
|
const {
|
|
32
32
|
slots,
|
|
33
33
|
slotProps,
|
|
@@ -35,7 +35,8 @@ const useDesktopRangePicker = _ref => {
|
|
|
35
35
|
localeText
|
|
36
36
|
} = props;
|
|
37
37
|
const fieldType = (0, _dateFieldsUtils.getRangeFieldType)(slots.field);
|
|
38
|
-
const
|
|
38
|
+
const isSingleInput = fieldType === 'single-input';
|
|
39
|
+
const viewContainerRole = isSingleInput ? 'dialog' : 'tooltip';
|
|
39
40
|
const rangePositionResponse = (0, _useRangePosition.useRangePosition)(props);
|
|
40
41
|
const getStepNavigation = (0, _createRangePickerStepNavigation.createRangePickerStepNavigation)({
|
|
41
42
|
steps,
|
|
@@ -66,22 +67,22 @@ const useDesktopRangePicker = _ref => {
|
|
|
66
67
|
fieldProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
67
68
|
const Layout = slots?.layout ?? _PickersLayout.PickersLayout;
|
|
68
69
|
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerProvider, (0, _extends2.default)({}, providerProps, {
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
70
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_usePickerRangePositionContext.PickerRangePositionContext.Provider, {
|
|
71
|
+
value: rangePositionResponse,
|
|
72
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Field, (0, _extends2.default)({}, fieldProps, {
|
|
73
|
+
slots: slots,
|
|
74
|
+
slotProps: slotProps
|
|
75
|
+
}, isSingleInput && {
|
|
76
|
+
inputRef
|
|
77
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerPopper, {
|
|
78
|
+
slots: slots,
|
|
79
|
+
slotProps: slotProps,
|
|
80
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Layout, (0, _extends2.default)({}, slotProps?.layout, {
|
|
76
81
|
slots: slots,
|
|
77
82
|
slotProps: slotProps,
|
|
78
|
-
children:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
children: renderCurrentView()
|
|
82
|
-
}))
|
|
83
|
-
})]
|
|
84
|
-
})
|
|
83
|
+
children: renderCurrentView()
|
|
84
|
+
}))
|
|
85
|
+
})]
|
|
85
86
|
})
|
|
86
87
|
}));
|
|
87
88
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
|
@@ -29,7 +29,7 @@ const useMobileRangePicker = _ref => {
|
|
|
29
29
|
steps
|
|
30
30
|
} = _ref,
|
|
31
31
|
pickerParams = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
32
|
-
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "
|
|
32
|
+
(0, _xLicense.useLicenseVerifier)('x-date-pickers-pro', "MTc1ODc1MTIwMDAwMA==");
|
|
33
33
|
const {
|
|
34
34
|
slots,
|
|
35
35
|
slotProps: innerSlotProps,
|
|
@@ -38,6 +38,7 @@ const useMobileRangePicker = _ref => {
|
|
|
38
38
|
localeText
|
|
39
39
|
} = props;
|
|
40
40
|
const fieldType = (0, _dateFieldsUtils.getRangeFieldType)(slots.field);
|
|
41
|
+
const isSingleInput = fieldType === 'single-input';
|
|
41
42
|
const rangePositionResponse = (0, _useRangePosition.useRangePosition)(props);
|
|
42
43
|
const contextTranslations = (0, _hooks.usePickerTranslations)();
|
|
43
44
|
const getStepNavigation = (0, _createRangePickerStepNavigation.createRangePickerStepNavigation)({
|
|
@@ -63,7 +64,7 @@ const useMobileRangePicker = _ref => {
|
|
|
63
64
|
const _useSlotProps = (0, _useSlotProps2.default)({
|
|
64
65
|
elementType: Field,
|
|
65
66
|
externalSlotProps: innerSlotProps?.field,
|
|
66
|
-
additionalProps: (0, _extends2.default)({},
|
|
67
|
+
additionalProps: (0, _extends2.default)({}, isSingleInput && isToolbarHidden && {
|
|
67
68
|
id: labelId
|
|
68
69
|
}),
|
|
69
70
|
ownerState
|
|
@@ -101,22 +102,22 @@ const useMobileRangePicker = _ref => {
|
|
|
101
102
|
}
|
|
102
103
|
});
|
|
103
104
|
const renderPicker = () => /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickerProvider, (0, _extends2.default)({}, providerProps, {
|
|
104
|
-
children: /*#__PURE__*/(0, _jsxRuntime.
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_usePickerRangePositionContext.PickerRangePositionContext.Provider, {
|
|
106
|
+
value: rangePositionResponse,
|
|
107
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Field, (0, _extends2.default)({}, fieldProps, {
|
|
108
|
+
slots: slots,
|
|
109
|
+
slotProps: slotProps
|
|
110
|
+
}, isSingleInput && {
|
|
111
|
+
inputRef
|
|
112
|
+
})), /*#__PURE__*/(0, _jsxRuntime.jsx)(_internals.PickersModalDialog, {
|
|
113
|
+
slots: slots,
|
|
114
|
+
slotProps: slotProps,
|
|
115
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Layout, (0, _extends2.default)({}, slotProps?.layout, {
|
|
111
116
|
slots: slots,
|
|
112
117
|
slotProps: slotProps,
|
|
113
|
-
children:
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
children: renderCurrentView()
|
|
117
|
-
}))
|
|
118
|
-
})]
|
|
119
|
-
})
|
|
118
|
+
children: renderCurrentView()
|
|
119
|
+
}))
|
|
120
|
+
})]
|
|
120
121
|
})
|
|
121
122
|
}));
|
|
122
123
|
if (process.env.NODE_ENV !== "production") renderPicker.displayName = "renderPicker";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers-pro",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.12.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The Pro plan edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
"clsx": "^2.1.1",
|
|
36
36
|
"prop-types": "^15.8.1",
|
|
37
37
|
"react-transition-group": "^4.4.5",
|
|
38
|
-
"@mui/x-internals": "8.
|
|
39
|
-
"@mui/x-
|
|
40
|
-
"@mui/x-
|
|
38
|
+
"@mui/x-internals": "8.12.0",
|
|
39
|
+
"@mui/x-date-pickers": "8.12.0",
|
|
40
|
+
"@mui/x-license": "8.12.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"@emotion/react": "^11.9.0",
|