@mui/x-date-pickers 9.7.0 → 9.8.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/AdapterMomentHijri/AdapterMomentHijri.js +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.mjs +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +2 -2
- package/AdapterMomentJalaali/AdapterMomentJalaali.mjs +2 -2
- package/CHANGELOG.md +130 -1
- package/DateCalendar/DayCalendar.js +5 -4
- package/DateCalendar/DayCalendar.mjs +5 -4
- package/index.js +1 -1
- package/index.mjs +1 -1
- package/internals/components/PickerPopper/PickerPopper.js +1 -1
- package/internals/components/PickerPopper/PickerPopper.mjs +1 -1
- package/internals/hooks/useField/useField.utils.d.mts +0 -1
- package/internals/hooks/useField/useField.utils.d.ts +0 -1
- package/internals/hooks/useField/useField.utils.js +2 -2
- package/internals/hooks/useField/useField.utils.mjs +1 -1
- package/internals/hooks/useField/useFieldSectionContentProps.js +14 -11
- package/internals/hooks/useField/useFieldSectionContentProps.mjs +14 -11
- package/locales/roRO.js +2 -3
- package/locales/roRO.mjs +2 -3
- package/package.json +2 -2
|
@@ -90,10 +90,10 @@ const defaultFormats = {
|
|
|
90
90
|
meridiem: 'A',
|
|
91
91
|
minutes: 'mm',
|
|
92
92
|
seconds: 'ss',
|
|
93
|
-
fullDate: 'iYYYY, iMMMM
|
|
93
|
+
fullDate: 'iYYYY, iMMMM iD',
|
|
94
94
|
shortDate: 'iD iMMM',
|
|
95
95
|
normalDate: 'dddd, iD iMMM',
|
|
96
|
-
normalDateWithWeekday: '
|
|
96
|
+
normalDateWithWeekday: 'ddd, iD iMMMM',
|
|
97
97
|
fullTime12h: 'hh:mm A',
|
|
98
98
|
fullTime24h: 'HH:mm',
|
|
99
99
|
keyboardDate: 'iYYYY/iMM/iDD',
|
|
@@ -83,10 +83,10 @@ const defaultFormats = {
|
|
|
83
83
|
meridiem: 'A',
|
|
84
84
|
minutes: 'mm',
|
|
85
85
|
seconds: 'ss',
|
|
86
|
-
fullDate: 'iYYYY, iMMMM
|
|
86
|
+
fullDate: 'iYYYY, iMMMM iD',
|
|
87
87
|
shortDate: 'iD iMMM',
|
|
88
88
|
normalDate: 'dddd, iD iMMM',
|
|
89
|
-
normalDateWithWeekday: '
|
|
89
|
+
normalDateWithWeekday: 'ddd, iD iMMMM',
|
|
90
90
|
fullTime12h: 'hh:mm A',
|
|
91
91
|
fullTime24h: 'HH:mm',
|
|
92
92
|
keyboardDate: 'iYYYY/iMM/iDD',
|
|
@@ -87,11 +87,11 @@ const defaultFormats = {
|
|
|
87
87
|
meridiem: 'A',
|
|
88
88
|
minutes: 'mm',
|
|
89
89
|
seconds: 'ss',
|
|
90
|
-
fullDate: 'jYYYY, jMMMM
|
|
90
|
+
fullDate: 'jYYYY, jMMMM jD',
|
|
91
91
|
keyboardDate: 'jYYYY/jMM/jDD',
|
|
92
92
|
shortDate: 'jD jMMM',
|
|
93
93
|
normalDate: 'dddd, jD jMMM',
|
|
94
|
-
normalDateWithWeekday: '
|
|
94
|
+
normalDateWithWeekday: 'ddd, jD jMMMM',
|
|
95
95
|
fullTime12h: 'hh:mm A',
|
|
96
96
|
fullTime24h: 'HH:mm',
|
|
97
97
|
keyboardDateTime12h: 'jYYYY/jMM/jDD hh:mm A',
|
|
@@ -80,11 +80,11 @@ const defaultFormats = {
|
|
|
80
80
|
meridiem: 'A',
|
|
81
81
|
minutes: 'mm',
|
|
82
82
|
seconds: 'ss',
|
|
83
|
-
fullDate: 'jYYYY, jMMMM
|
|
83
|
+
fullDate: 'jYYYY, jMMMM jD',
|
|
84
84
|
keyboardDate: 'jYYYY/jMM/jDD',
|
|
85
85
|
shortDate: 'jD jMMM',
|
|
86
86
|
normalDate: 'dddd, jD jMMM',
|
|
87
|
-
normalDateWithWeekday: '
|
|
87
|
+
normalDateWithWeekday: 'ddd, jD jMMMM',
|
|
88
88
|
fullTime12h: 'hh:mm A',
|
|
89
89
|
fullTime24h: 'HH:mm',
|
|
90
90
|
keyboardDateTime12h: 'jYYYY/jMM/jDD hh:mm A',
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,135 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.8.0
|
|
4
|
+
|
|
5
|
+
_Jul 2, 2026_
|
|
6
|
+
|
|
7
|
+
We'd like to extend a big thank you to the 18 contributors who made this release possible. Here are some highlights ✨:
|
|
8
|
+
|
|
9
|
+
- 🗺️ New [`MapImagePlot`](https://mui.com/x/react-charts/map/) for rendering raster base maps, with `onItemClick` support on map shapes (Premium)
|
|
10
|
+
- 📊 New [`usePolarGeometry`](https://mui.com/x/react-charts/hooks/use-polar-geometry/) hook to build custom radial overlays
|
|
11
|
+
- 🐞 Bugfixes
|
|
12
|
+
- 📚 Documentation improvements
|
|
13
|
+
|
|
14
|
+
Special thanks go out to these community members for their valuable contributions:
|
|
15
|
+
@Anexus5919, @aromanio, @greymoth-jp, @mustafajw07, @timbuckley, @voidmatcha
|
|
16
|
+
|
|
17
|
+
The following team members contributed to this release:
|
|
18
|
+
@alexfauquette, @arminmeh, @cherniavskii, @flaviendelangle, @Janpot, @JCQuintas, @joserodolfofreitas, @LukasTy, @mapache-salvaje, @michelengelen, @rita-codes, @sai6855
|
|
19
|
+
|
|
20
|
+
### Data Grid
|
|
21
|
+
|
|
22
|
+
#### `@mui/x-data-grid@9.8.0`
|
|
23
|
+
|
|
24
|
+
- [DataGrid] Prevent cell editing from resurrecting a deleted row (#22958) @Anexus5919
|
|
25
|
+
- [DataGrid] Avoid reading `type` of `undefined` in `gridRowUtils` (#21808) @timbuckley
|
|
26
|
+
- [DataGrid] Improved get started tutorial (#22911) @joserodolfofreitas
|
|
27
|
+
- [l10n] Improve Japanese (ja-JP) locale (#23001) @greymoth-jp
|
|
28
|
+
|
|
29
|
+
#### `@mui/x-data-grid-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
30
|
+
|
|
31
|
+
Same changes as in `@mui/x-data-grid@9.8.0`.
|
|
32
|
+
|
|
33
|
+
#### `@mui/x-data-grid-premium@9.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
34
|
+
|
|
35
|
+
Same changes as in `@mui/x-data-grid-pro@9.8.0`, plus:
|
|
36
|
+
|
|
37
|
+
- [DataGridPremium] Escape `singleSelect` values in Excel export with `escapeFormulas` enabled (#22851) @Anexus5919
|
|
38
|
+
|
|
39
|
+
### Date and Time Pickers
|
|
40
|
+
|
|
41
|
+
#### `@mui/x-date-pickers@9.8.0`
|
|
42
|
+
|
|
43
|
+
- [pickers] Fix localized digit crash (#22995) @alexfauquette
|
|
44
|
+
- [pickers] Flag the first and last visible day cell across year boundaries (#22981) @Anexus5919
|
|
45
|
+
- [pickers] Use calendar day tokens in `AdapterMomentHijri` and `AdapterMomentJalaali` formats (#22974) @Anexus5919
|
|
46
|
+
- [pickers] Use the Hijri day token in `AdapterMomentHijri` `normalDateWithWeekday` (#22972) @Anexus5919
|
|
47
|
+
- [l10n] Improve Romanian (ro-RO) locale (#22969) @aromanio
|
|
48
|
+
|
|
49
|
+
#### `@mui/x-date-pickers-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
50
|
+
|
|
51
|
+
Same changes as in `@mui/x-date-pickers@9.8.0`, plus:
|
|
52
|
+
|
|
53
|
+
- [DateRangeCalendar] Fix auto month-switch across the year boundary (#22987) @Anexus5919
|
|
54
|
+
|
|
55
|
+
### Charts
|
|
56
|
+
|
|
57
|
+
#### `@mui/x-charts@9.8.0`
|
|
58
|
+
|
|
59
|
+
- [charts] Decouple `d3-geo` from the universal tooltip (#23011) @sai6855
|
|
60
|
+
- [charts] Deduplicate `getGroupingConfig` (#22889) @sai6855
|
|
61
|
+
- [charts] Expose `usePolarGeometry` hook for radial overlays (#22892) @mustafajw07
|
|
62
|
+
|
|
63
|
+
#### `@mui/x-charts-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
64
|
+
|
|
65
|
+
Same changes as in `@mui/x-charts@9.8.0`.
|
|
66
|
+
|
|
67
|
+
#### `@mui/x-charts-premium@9.8.0` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
68
|
+
|
|
69
|
+
Same changes as in `@mui/x-charts-pro@9.8.0`, plus:
|
|
70
|
+
|
|
71
|
+
- [charts-premium] Add `onItemClick` support for the Map shapes (#22876) @sai6855
|
|
72
|
+
- [charts-premium] Replace `dataIndex` with `name` in map identifier (#22891) @sai6855
|
|
73
|
+
- [charts-premium] Share helper function (#23030) @alexfauquette
|
|
74
|
+
- [charts-premium] Extract shared WebGL utilities across bar/scatter/heatmap renderers (#22466) @sai6855
|
|
75
|
+
- [charts-premium] Add `MapImagePlot` for raster base maps (#22977) @JCQuintas
|
|
76
|
+
|
|
77
|
+
### Tree View
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-tree-view@9.8.0`
|
|
80
|
+
|
|
81
|
+
- [TreeView] Fix extra selection event when clicking a collapsed parent item (#22249) @michelengelen
|
|
82
|
+
- [TreeView] Enforce top-level type imports (#23034) @Janpot
|
|
83
|
+
|
|
84
|
+
#### `@mui/x-tree-view-pro@9.8.0` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
85
|
+
|
|
86
|
+
Same changes as in `@mui/x-tree-view@9.8.0`.
|
|
87
|
+
|
|
88
|
+
### Scheduler
|
|
89
|
+
|
|
90
|
+
#### `@mui/x-scheduler@9.0.0-beta.4`
|
|
91
|
+
|
|
92
|
+
- [scheduler] Enforce top-level type imports (#22931) @Janpot
|
|
93
|
+
- [scheduler] Keep the occurrence date when editing only one recurring event (#23007) @Anexus5919
|
|
94
|
+
- [scheduler] Track bundle size of scheduler packages (#22682) @flaviendelangle
|
|
95
|
+
- [scheduler] Add `viewConfig` prop to limit displayed hours in the day and week views (#22929) @flaviendelangle
|
|
96
|
+
|
|
97
|
+
#### `@mui/x-scheduler-premium@9.0.0-beta.4` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
98
|
+
|
|
99
|
+
Same changes as in `@mui/x-scheduler@9.0.0-beta.4`, plus:
|
|
100
|
+
|
|
101
|
+
- [scheduler] Collapsible resources in the timeline (#22920) @rita-codes
|
|
102
|
+
|
|
103
|
+
### Codemod
|
|
104
|
+
|
|
105
|
+
#### `@mui/x-codemod@9.8.0`
|
|
106
|
+
|
|
107
|
+
Internal changes.
|
|
108
|
+
|
|
109
|
+
### Docs
|
|
110
|
+
|
|
111
|
+
- [docs] Add recipe for conditional master-detail panels (#22971) @michelengelen
|
|
112
|
+
- [docs] Add recipe for describing active filters in the toolbar (#22970) @michelengelen
|
|
113
|
+
- [docs] Add recipe for triggering clipboard copy from a button (#22967) @michelengelen
|
|
114
|
+
- [docs] Clarify that `fieldRef.current.focusField()` is the canonical way to focus a field (#22937) @michelengelen
|
|
115
|
+
- [docs][scheduler] Another copyediting pass across the Scheduler docs (#22619) @mapache-salvaje
|
|
116
|
+
- [docs][charts] Add map example for arbitrary GeoJSON shapes (#22976) @JCQuintas
|
|
117
|
+
- [docs][charts] Double point count in `ScatterAsyncRenderer` demo (#22906) @JCQuintas
|
|
118
|
+
|
|
119
|
+
### Core
|
|
120
|
+
|
|
121
|
+
- [code-infra] Fix tracking branch bug in release script (#22956) @michelengelen
|
|
122
|
+
- [code-infra] Remove mark-duplicate workflow (#22994) @cherniavskii
|
|
123
|
+
- [code-infra] Revert `nanoid@3.3.15` `minimumReleaseAge` exemption (#22953) @LukasTy
|
|
124
|
+
|
|
125
|
+
### Miscellaneous
|
|
126
|
+
|
|
127
|
+
- [internals] Fix `ERR_UNSUPPORTED_DIR_IMPORT` for `core-js-pure` in Node ESM (#22985) @michelengelen
|
|
128
|
+
- [internals] Harden `useDisposable` React internals read with safeReact (#22986) @rita-codes
|
|
129
|
+
- [internals] Replace core-js `DisposableStack` ponyfill with a minimal fallback (#23002) @sai6855
|
|
130
|
+
- [test] Assert the edited `dateTime` cell value in the e2e edit test (#22982) @voidmatcha
|
|
131
|
+
- [virtualizer] Remeasure scrollbars when layout changes (#22914) @arminmeh
|
|
132
|
+
|
|
3
133
|
## 9.7.0
|
|
4
134
|
|
|
5
135
|
_Jun 25, 2026_
|
|
@@ -178,7 +308,6 @@ Same changes as in `@mui/x-charts-pro@9.6.0`, plus:
|
|
|
178
308
|
- [charts-premium] Support maps tooltip positioned on items (#22648) @alexfauquette
|
|
179
309
|
- [docs] Show how to export maps (#22837) @alexfauquette
|
|
180
310
|
|
|
181
|
-
|
|
182
311
|
### Tree View
|
|
183
312
|
|
|
184
313
|
#### `@mui/x-tree-view@9.6.0`
|
|
@@ -143,6 +143,7 @@ function WrappedDay(_ref) {
|
|
|
143
143
|
} = _ref,
|
|
144
144
|
other = (0, _objectWithoutPropertiesLoose2.default)(_ref, _excluded);
|
|
145
145
|
const {
|
|
146
|
+
currentMonth,
|
|
146
147
|
disabled,
|
|
147
148
|
disableHighlightToday,
|
|
148
149
|
isMonthSwitchingAnimating,
|
|
@@ -189,19 +190,19 @@ function WrappedDay(_ref) {
|
|
|
189
190
|
}),
|
|
190
191
|
dayProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded2);
|
|
191
192
|
const isFirstVisibleCell = React.useMemo(() => {
|
|
192
|
-
const startOfMonth = adapter.startOfMonth(
|
|
193
|
+
const startOfMonth = adapter.startOfMonth(currentMonth);
|
|
193
194
|
if (!showDaysOutsideCurrentMonth) {
|
|
194
195
|
return adapter.isSameDay(day, startOfMonth);
|
|
195
196
|
}
|
|
196
197
|
return adapter.isSameDay(day, adapter.startOfWeek(startOfMonth));
|
|
197
|
-
}, [
|
|
198
|
+
}, [currentMonth, day, showDaysOutsideCurrentMonth, adapter]);
|
|
198
199
|
const isLastVisibleCell = React.useMemo(() => {
|
|
199
|
-
const endOfMonth = adapter.endOfMonth(
|
|
200
|
+
const endOfMonth = adapter.endOfMonth(currentMonth);
|
|
200
201
|
if (!showDaysOutsideCurrentMonth) {
|
|
201
202
|
return adapter.isSameDay(day, endOfMonth);
|
|
202
203
|
}
|
|
203
204
|
return adapter.isSameDay(day, adapter.endOfWeek(endOfMonth));
|
|
204
|
-
}, [
|
|
205
|
+
}, [currentMonth, day, showDaysOutsideCurrentMonth, adapter]);
|
|
205
206
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Day, (0, _extends2.default)({}, dayProps, {
|
|
206
207
|
day: day,
|
|
207
208
|
disabled: isDisabled,
|
|
@@ -136,6 +136,7 @@ function WrappedDay(_ref) {
|
|
|
136
136
|
} = _ref,
|
|
137
137
|
other = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
138
138
|
const {
|
|
139
|
+
currentMonth,
|
|
139
140
|
disabled,
|
|
140
141
|
disableHighlightToday,
|
|
141
142
|
isMonthSwitchingAnimating,
|
|
@@ -182,19 +183,19 @@ function WrappedDay(_ref) {
|
|
|
182
183
|
}),
|
|
183
184
|
dayProps = _objectWithoutPropertiesLoose(_useSlotProps, _excluded2);
|
|
184
185
|
const isFirstVisibleCell = React.useMemo(() => {
|
|
185
|
-
const startOfMonth = adapter.startOfMonth(
|
|
186
|
+
const startOfMonth = adapter.startOfMonth(currentMonth);
|
|
186
187
|
if (!showDaysOutsideCurrentMonth) {
|
|
187
188
|
return adapter.isSameDay(day, startOfMonth);
|
|
188
189
|
}
|
|
189
190
|
return adapter.isSameDay(day, adapter.startOfWeek(startOfMonth));
|
|
190
|
-
}, [
|
|
191
|
+
}, [currentMonth, day, showDaysOutsideCurrentMonth, adapter]);
|
|
191
192
|
const isLastVisibleCell = React.useMemo(() => {
|
|
192
|
-
const endOfMonth = adapter.endOfMonth(
|
|
193
|
+
const endOfMonth = adapter.endOfMonth(currentMonth);
|
|
193
194
|
if (!showDaysOutsideCurrentMonth) {
|
|
194
195
|
return adapter.isSameDay(day, endOfMonth);
|
|
195
196
|
}
|
|
196
197
|
return adapter.isSameDay(day, adapter.endOfWeek(endOfMonth));
|
|
197
|
-
}, [
|
|
198
|
+
}, [currentMonth, day, showDaysOutsideCurrentMonth, adapter]);
|
|
198
199
|
return /*#__PURE__*/_jsx(Day, _extends({}, dayProps, {
|
|
199
200
|
day: day,
|
|
200
201
|
disabled: isDisabled,
|
package/index.js
CHANGED
package/index.mjs
CHANGED
|
@@ -79,7 +79,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
// Ensure that this hook is not "activated" synchronously.
|
|
82
|
-
// https://github.com/
|
|
82
|
+
// https://github.com/react/react/issues/20074
|
|
83
83
|
function armClickAwayListener() {
|
|
84
84
|
activatedRef.current = true;
|
|
85
85
|
}
|
|
@@ -72,7 +72,7 @@ function useClickAwayListener(active, onClickAway) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
// Ensure that this hook is not "activated" synchronously.
|
|
75
|
-
// https://github.com/
|
|
75
|
+
// https://github.com/react/react/issues/20074
|
|
76
76
|
function armClickAwayListener() {
|
|
77
77
|
activatedRef.current = true;
|
|
78
78
|
}
|
|
@@ -6,7 +6,6 @@ export declare const getDateSectionConfigFromFormatToken: (adapter: MuiPickersAd
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getDaysInWeekStr: (adapter: MuiPickersAdapter, format: string) => string[];
|
|
8
8
|
export declare const getLetterEditingOptions: (adapter: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
9
|
-
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
10
9
|
export declare const getLocalizedDigits: (adapter: MuiPickersAdapter) => string[];
|
|
11
10
|
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
11
|
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
@@ -6,7 +6,6 @@ export declare const getDateSectionConfigFromFormatToken: (adapter: MuiPickersAd
|
|
|
6
6
|
};
|
|
7
7
|
export declare const getDaysInWeekStr: (adapter: MuiPickersAdapter, format: string) => string[];
|
|
8
8
|
export declare const getLetterEditingOptions: (adapter: MuiPickersAdapter, timezone: PickersTimezone, sectionType: FieldSectionType, format: string) => string[];
|
|
9
|
-
export declare const FORMAT_SECONDS_NO_LEADING_ZEROS = "s";
|
|
10
9
|
export declare const getLocalizedDigits: (adapter: MuiPickersAdapter) => string[];
|
|
11
10
|
export declare const removeLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
12
11
|
export declare const applyLocalizedDigits: (valueStr: string, localizedDigits: string[]) => string;
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForHiddenInputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits =
|
|
7
|
+
exports.validateSections = exports.removeLocalizedDigits = exports.parseSelectedSections = exports.mergeDateIntoReferenceDate = exports.isStringNumber = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLocalizedDigits = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForHiddenInputFromSections = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.changeSectionValueFormat = exports.applyLocalizedDigits = void 0;
|
|
8
8
|
var _formatErrorMessage2 = _interopRequireDefault(require("@mui/x-internals/formatErrorMessage"));
|
|
9
9
|
var _dateUtils = require("../../utils/date-utils");
|
|
10
10
|
var _timeUtils = require("../../utils/time-utils");
|
|
@@ -66,7 +66,7 @@ const getLetterEditingOptions = (adapter, timezone, sectionType, format) => {
|
|
|
66
66
|
// This format should be the same on all the adapters
|
|
67
67
|
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
68
68
|
exports.getLetterEditingOptions = getLetterEditingOptions;
|
|
69
|
-
const FORMAT_SECONDS_NO_LEADING_ZEROS =
|
|
69
|
+
const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
70
70
|
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
71
71
|
const getLocalizedDigits = adapter => {
|
|
72
72
|
const today = adapter.date(undefined);
|
|
@@ -56,7 +56,7 @@ export const getLetterEditingOptions = (adapter, timezone, sectionType, format)
|
|
|
56
56
|
|
|
57
57
|
// This format should be the same on all the adapters
|
|
58
58
|
// If some adapter does not respect this convention, then we will need to hardcode the format on each adapter.
|
|
59
|
-
|
|
59
|
+
const FORMAT_SECONDS_NO_LEADING_ZEROS = 's';
|
|
60
60
|
const NON_LOCALIZED_DIGITS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
|
|
61
61
|
export const getLocalizedDigits = adapter => {
|
|
62
62
|
const today = adapter.date(undefined);
|
|
@@ -10,6 +10,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
10
10
|
var _useEventCallback = _interopRequireDefault(require("@mui/utils/useEventCallback"));
|
|
11
11
|
var _hooks = require("../../../hooks");
|
|
12
12
|
var _syncSelectionToDOM = require("./syncSelectionToDOM");
|
|
13
|
+
var _useField = require("./useField.utils");
|
|
13
14
|
/**
|
|
14
15
|
* Generate the props to pass to the content element of each section of the field.
|
|
15
16
|
* @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
|
|
@@ -32,6 +33,7 @@ function useFieldSectionContentProps(parameters) {
|
|
|
32
33
|
sectionsValueBoundaries,
|
|
33
34
|
state,
|
|
34
35
|
value,
|
|
36
|
+
localizedDigits,
|
|
35
37
|
// Methods to update the states
|
|
36
38
|
clearActiveSection,
|
|
37
39
|
setCharacterQuery,
|
|
@@ -152,10 +154,10 @@ function useFieldSectionContentProps(parameters) {
|
|
|
152
154
|
onFocus: createFocusHandler(sectionIndex),
|
|
153
155
|
// Aria attributes
|
|
154
156
|
'aria-readonly': readOnly,
|
|
155
|
-
'aria-valuenow': getSectionValueNow(section, adapter),
|
|
157
|
+
'aria-valuenow': getSectionValueNow(section, adapter, localizedDigits),
|
|
156
158
|
'aria-valuemin': sectionBoundaries.minimum,
|
|
157
159
|
'aria-valuemax': sectionBoundaries.maximum,
|
|
158
|
-
'aria-valuetext': section.value ? getSectionValueText(section, adapter) : translations.empty,
|
|
160
|
+
'aria-valuetext': section.value ? getSectionValueText(section, adapter, localizedDigits) : translations.empty,
|
|
159
161
|
'aria-label': translations[section.type],
|
|
160
162
|
'aria-disabled': disabled,
|
|
161
163
|
// Other
|
|
@@ -171,9 +173,9 @@ function useFieldSectionContentProps(parameters) {
|
|
|
171
173
|
children: section.value || section.placeholder,
|
|
172
174
|
inputMode: section.contentType === 'letter' ? 'text' : 'numeric'
|
|
173
175
|
};
|
|
174
|
-
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
176
|
+
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, localizedDigits, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
175
177
|
}
|
|
176
|
-
function getSectionValueText(section, adapter) {
|
|
178
|
+
function getSectionValueText(section, adapter, localizedDigits) {
|
|
177
179
|
if (!section.value) {
|
|
178
180
|
return undefined;
|
|
179
181
|
}
|
|
@@ -181,7 +183,7 @@ function getSectionValueText(section, adapter) {
|
|
|
181
183
|
case 'month':
|
|
182
184
|
{
|
|
183
185
|
if (section.contentType === 'digit') {
|
|
184
|
-
const dateWithMonth = adapter.setMonth(adapter.date(), Number(section.value) - 1);
|
|
186
|
+
const dateWithMonth = adapter.setMonth(adapter.date(), Number((0, _useField.removeLocalizedDigits)(section.value, localizedDigits)) - 1);
|
|
185
187
|
return adapter.isValid(dateWithMonth) ? adapter.format(dateWithMonth, 'month') : '';
|
|
186
188
|
}
|
|
187
189
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
@@ -189,7 +191,7 @@ function getSectionValueText(section, adapter) {
|
|
|
189
191
|
}
|
|
190
192
|
case 'day':
|
|
191
193
|
if (section.contentType === 'digit') {
|
|
192
|
-
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(section.value));
|
|
194
|
+
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number((0, _useField.removeLocalizedDigits)(section.value, localizedDigits)));
|
|
193
195
|
// Announce a cardinal day (e.g. "2"), not a locale ordinal (e.g. French "2ème").
|
|
194
196
|
// See https://github.com/mui/mui-x/issues/22915.
|
|
195
197
|
return adapter.isValid(dateWithDay) ? adapter.format(dateWithDay, 'dayOfMonth') : '';
|
|
@@ -202,10 +204,11 @@ function getSectionValueText(section, adapter) {
|
|
|
202
204
|
return undefined;
|
|
203
205
|
}
|
|
204
206
|
}
|
|
205
|
-
function getSectionValueNow(section, adapter) {
|
|
207
|
+
function getSectionValueNow(section, adapter, localizedDigits) {
|
|
206
208
|
if (!section.value) {
|
|
207
209
|
return undefined;
|
|
208
210
|
}
|
|
211
|
+
const nonLocalizedValue = (0, _useField.removeLocalizedDigits)(section.value, localizedDigits);
|
|
209
212
|
switch (section.type) {
|
|
210
213
|
case 'weekDay':
|
|
211
214
|
{
|
|
@@ -213,7 +216,7 @@ function getSectionValueNow(section, adapter) {
|
|
|
213
216
|
// TODO: improve by resolving the week day number from a letter week day
|
|
214
217
|
return undefined;
|
|
215
218
|
}
|
|
216
|
-
return Number(
|
|
219
|
+
return Number(nonLocalizedValue);
|
|
217
220
|
}
|
|
218
221
|
case 'meridiem':
|
|
219
222
|
{
|
|
@@ -224,16 +227,16 @@ function getSectionValueNow(section, adapter) {
|
|
|
224
227
|
return undefined;
|
|
225
228
|
}
|
|
226
229
|
case 'day':
|
|
227
|
-
return section.contentType === 'digit-with-letter' ? parseInt(
|
|
230
|
+
return section.contentType === 'digit-with-letter' ? parseInt(nonLocalizedValue, 10) : Number(nonLocalizedValue);
|
|
228
231
|
case 'month':
|
|
229
232
|
{
|
|
230
233
|
if (section.contentType === 'digit') {
|
|
231
|
-
return Number(
|
|
234
|
+
return Number(nonLocalizedValue);
|
|
232
235
|
}
|
|
233
236
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
234
237
|
return parsedDate ? adapter.getMonth(parsedDate) + 1 : undefined;
|
|
235
238
|
}
|
|
236
239
|
default:
|
|
237
|
-
return section.contentType !== 'letter' ? Number(
|
|
240
|
+
return section.contentType !== 'letter' ? Number(nonLocalizedValue) : undefined;
|
|
238
241
|
}
|
|
239
242
|
}
|
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import useEventCallback from '@mui/utils/useEventCallback';
|
|
3
3
|
import { usePickerAdapter, usePickerTranslations } from "../../../hooks/index.mjs";
|
|
4
4
|
import { syncSelectionToDOM } from "./syncSelectionToDOM.mjs";
|
|
5
|
+
import { removeLocalizedDigits } from "./useField.utils.mjs";
|
|
5
6
|
/**
|
|
6
7
|
* Generate the props to pass to the content element of each section of the field.
|
|
7
8
|
* @param {UseFieldSectionContentPropsParameters} parameters The parameters of the hook.
|
|
@@ -24,6 +25,7 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
24
25
|
sectionsValueBoundaries,
|
|
25
26
|
state,
|
|
26
27
|
value,
|
|
28
|
+
localizedDigits,
|
|
27
29
|
// Methods to update the states
|
|
28
30
|
clearActiveSection,
|
|
29
31
|
setCharacterQuery,
|
|
@@ -144,10 +146,10 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
144
146
|
onFocus: createFocusHandler(sectionIndex),
|
|
145
147
|
// Aria attributes
|
|
146
148
|
'aria-readonly': readOnly,
|
|
147
|
-
'aria-valuenow': getSectionValueNow(section, adapter),
|
|
149
|
+
'aria-valuenow': getSectionValueNow(section, adapter, localizedDigits),
|
|
148
150
|
'aria-valuemin': sectionBoundaries.minimum,
|
|
149
151
|
'aria-valuemax': sectionBoundaries.maximum,
|
|
150
|
-
'aria-valuetext': section.value ? getSectionValueText(section, adapter) : translations.empty,
|
|
152
|
+
'aria-valuetext': section.value ? getSectionValueText(section, adapter, localizedDigits) : translations.empty,
|
|
151
153
|
'aria-label': translations[section.type],
|
|
152
154
|
'aria-disabled': disabled,
|
|
153
155
|
// Other
|
|
@@ -163,9 +165,9 @@ export function useFieldSectionContentProps(parameters) {
|
|
|
163
165
|
children: section.value || section.placeholder,
|
|
164
166
|
inputMode: section.contentType === 'letter' ? 'text' : 'numeric'
|
|
165
167
|
};
|
|
166
|
-
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
168
|
+
}, [sectionsValueBoundaries, isContainerEditable, disabled, readOnly, isEditable, translations, adapter, localizedDigits, handleInput, handlePaste, handleMouseUp, handleDragOver, createFocusHandler, fieldValueManager, value]);
|
|
167
169
|
}
|
|
168
|
-
function getSectionValueText(section, adapter) {
|
|
170
|
+
function getSectionValueText(section, adapter, localizedDigits) {
|
|
169
171
|
if (!section.value) {
|
|
170
172
|
return undefined;
|
|
171
173
|
}
|
|
@@ -173,7 +175,7 @@ function getSectionValueText(section, adapter) {
|
|
|
173
175
|
case 'month':
|
|
174
176
|
{
|
|
175
177
|
if (section.contentType === 'digit') {
|
|
176
|
-
const dateWithMonth = adapter.setMonth(adapter.date(), Number(section.value) - 1);
|
|
178
|
+
const dateWithMonth = adapter.setMonth(adapter.date(), Number(removeLocalizedDigits(section.value, localizedDigits)) - 1);
|
|
177
179
|
return adapter.isValid(dateWithMonth) ? adapter.format(dateWithMonth, 'month') : '';
|
|
178
180
|
}
|
|
179
181
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
@@ -181,7 +183,7 @@ function getSectionValueText(section, adapter) {
|
|
|
181
183
|
}
|
|
182
184
|
case 'day':
|
|
183
185
|
if (section.contentType === 'digit') {
|
|
184
|
-
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(section.value));
|
|
186
|
+
const dateWithDay = adapter.setDate(adapter.startOfYear(adapter.date()), Number(removeLocalizedDigits(section.value, localizedDigits)));
|
|
185
187
|
// Announce a cardinal day (e.g. "2"), not a locale ordinal (e.g. French "2ème").
|
|
186
188
|
// See https://github.com/mui/mui-x/issues/22915.
|
|
187
189
|
return adapter.isValid(dateWithDay) ? adapter.format(dateWithDay, 'dayOfMonth') : '';
|
|
@@ -194,10 +196,11 @@ function getSectionValueText(section, adapter) {
|
|
|
194
196
|
return undefined;
|
|
195
197
|
}
|
|
196
198
|
}
|
|
197
|
-
function getSectionValueNow(section, adapter) {
|
|
199
|
+
function getSectionValueNow(section, adapter, localizedDigits) {
|
|
198
200
|
if (!section.value) {
|
|
199
201
|
return undefined;
|
|
200
202
|
}
|
|
203
|
+
const nonLocalizedValue = removeLocalizedDigits(section.value, localizedDigits);
|
|
201
204
|
switch (section.type) {
|
|
202
205
|
case 'weekDay':
|
|
203
206
|
{
|
|
@@ -205,7 +208,7 @@ function getSectionValueNow(section, adapter) {
|
|
|
205
208
|
// TODO: improve by resolving the week day number from a letter week day
|
|
206
209
|
return undefined;
|
|
207
210
|
}
|
|
208
|
-
return Number(
|
|
211
|
+
return Number(nonLocalizedValue);
|
|
209
212
|
}
|
|
210
213
|
case 'meridiem':
|
|
211
214
|
{
|
|
@@ -216,16 +219,16 @@ function getSectionValueNow(section, adapter) {
|
|
|
216
219
|
return undefined;
|
|
217
220
|
}
|
|
218
221
|
case 'day':
|
|
219
|
-
return section.contentType === 'digit-with-letter' ? parseInt(
|
|
222
|
+
return section.contentType === 'digit-with-letter' ? parseInt(nonLocalizedValue, 10) : Number(nonLocalizedValue);
|
|
220
223
|
case 'month':
|
|
221
224
|
{
|
|
222
225
|
if (section.contentType === 'digit') {
|
|
223
|
-
return Number(
|
|
226
|
+
return Number(nonLocalizedValue);
|
|
224
227
|
}
|
|
225
228
|
const parsedDate = adapter.parse(section.value, section.format);
|
|
226
229
|
return parsedDate ? adapter.getMonth(parsedDate) + 1 : undefined;
|
|
227
230
|
}
|
|
228
231
|
default:
|
|
229
|
-
return section.contentType !== 'letter' ? Number(
|
|
232
|
+
return section.contentType !== 'letter' ? Number(nonLocalizedValue) : undefined;
|
|
230
233
|
}
|
|
231
234
|
}
|
package/locales/roRO.js
CHANGED
|
@@ -38,8 +38,7 @@ const roROPickers = {
|
|
|
38
38
|
dateTimePickerToolbarTitle: 'Selectați data și ora',
|
|
39
39
|
timePickerToolbarTitle: 'Selectați ora',
|
|
40
40
|
dateRangePickerToolbarTitle: 'Selectați intervalul de date',
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
timeRangePickerToolbarTitle: 'Selectați intervalul de timp',
|
|
43
42
|
// Clock labels
|
|
44
43
|
clockLabelText: (view, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime}`}`,
|
|
45
44
|
hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
|
|
@@ -55,7 +54,7 @@ const roROPickers = {
|
|
|
55
54
|
// Open Picker labels
|
|
56
55
|
openDatePickerDialogue: formattedDate => formattedDate ? `Selectați data, data selectată este ${formattedDate}` : 'Selectați data',
|
|
57
56
|
openTimePickerDialogue: formattedTime => formattedTime ? `Selectați ora, ora selectată este ${formattedTime}` : 'Selectați ora',
|
|
58
|
-
|
|
57
|
+
openRangePickerDialogue: formattedRange => formattedRange ? `Selectați intervalul, intervalul selectat este ${formattedRange}` : 'Selectați intervalul',
|
|
59
58
|
fieldClearLabel: 'Golire conținut',
|
|
60
59
|
// Table labels
|
|
61
60
|
timeTableLabel: 'Selectați ora',
|
package/locales/roRO.mjs
CHANGED
|
@@ -32,8 +32,7 @@ const roROPickers = {
|
|
|
32
32
|
dateTimePickerToolbarTitle: 'Selectați data și ora',
|
|
33
33
|
timePickerToolbarTitle: 'Selectați ora',
|
|
34
34
|
dateRangePickerToolbarTitle: 'Selectați intervalul de date',
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
timeRangePickerToolbarTitle: 'Selectați intervalul de timp',
|
|
37
36
|
// Clock labels
|
|
38
37
|
clockLabelText: (view, formattedTime) => `Selectați ${timeViews[view] ?? view}. ${!formattedTime ? 'Nicio oră selectată' : `Ora selectată este ${formattedTime}`}`,
|
|
39
38
|
hoursClockNumberText: hours => `${hours} ${timeViews.hours}`,
|
|
@@ -49,7 +48,7 @@ const roROPickers = {
|
|
|
49
48
|
// Open Picker labels
|
|
50
49
|
openDatePickerDialogue: formattedDate => formattedDate ? `Selectați data, data selectată este ${formattedDate}` : 'Selectați data',
|
|
51
50
|
openTimePickerDialogue: formattedTime => formattedTime ? `Selectați ora, ora selectată este ${formattedTime}` : 'Selectați ora',
|
|
52
|
-
|
|
51
|
+
openRangePickerDialogue: formattedRange => formattedRange ? `Selectați intervalul, intervalul selectat este ${formattedRange}` : 'Selectați intervalul',
|
|
53
52
|
fieldClearLabel: 'Golire conținut',
|
|
54
53
|
// Table labels
|
|
55
54
|
timeTableLabel: 'Selectați ora',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mui/x-date-pickers",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.8.0",
|
|
4
4
|
"author": "MUI Team",
|
|
5
5
|
"description": "The community edition of the MUI X Date and Time Picker components.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"clsx": "^2.1.1",
|
|
40
40
|
"prop-types": "^15.8.1",
|
|
41
41
|
"react-transition-group": "^4.4.5",
|
|
42
|
-
"@mui/x-internals": "^9.
|
|
42
|
+
"@mui/x-internals": "^9.8.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.9.0",
|