@mui/x-date-pickers 6.18.1 → 6.18.3
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 +112 -0
- package/DateCalendar/DateCalendar.js +1 -0
- package/DateCalendar/DateCalendar.types.d.ts +1 -0
- package/DateCalendar/useCalendarState.js +1 -1
- package/DatePicker/DatePicker.js +1 -0
- package/DateTimePicker/DateTimePicker.js +1 -0
- package/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -0
- package/MobileDatePicker/MobileDatePicker.js +1 -0
- package/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +3 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/StaticDatePicker/StaticDatePicker.js +1 -0
- package/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/index.js +1 -1
- package/internals/hooks/useField/useField.utils.js +23 -10
- package/legacy/DateCalendar/DateCalendar.js +1 -0
- package/legacy/DateCalendar/useCalendarState.js +1 -1
- package/legacy/DatePicker/DatePicker.js +1 -0
- package/legacy/DateTimePicker/DateTimePicker.js +1 -0
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -0
- package/legacy/MobileDatePicker/MobileDatePicker.js +1 -0
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/legacy/StaticDatePicker/StaticDatePicker.js +1 -0
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useField/useField.utils.js +23 -10
- package/legacy/locales/deDE.js +4 -3
- package/legacy/locales/esES.js +6 -7
- package/legacy/locales/eu.js +94 -0
- package/legacy/locales/index.js +2 -0
- package/legacy/locales/mk.js +91 -0
- package/locales/beBY.d.ts +18 -5
- package/locales/caES.d.ts +18 -5
- package/locales/csCZ.d.ts +18 -5
- package/locales/daDK.d.ts +18 -5
- package/locales/deDE.d.ts +18 -5
- package/locales/deDE.js +2 -3
- package/locales/elGR.d.ts +18 -5
- package/locales/enUS.d.ts +18 -5
- package/locales/esES.d.ts +18 -5
- package/locales/esES.js +6 -7
- package/locales/eu.d.ts +67 -0
- package/locales/eu.js +58 -0
- package/locales/faIR.d.ts +18 -5
- package/locales/fiFI.d.ts +18 -5
- package/locales/frFR.d.ts +18 -5
- package/locales/heIL.d.ts +18 -5
- package/locales/huHU.d.ts +18 -5
- package/locales/index.d.ts +2 -0
- package/locales/index.js +2 -0
- package/locales/isIS.d.ts +18 -5
- package/locales/itIT.d.ts +18 -5
- package/locales/jaJP.d.ts +18 -5
- package/locales/koKR.d.ts +18 -5
- package/locales/kzKZ.d.ts +18 -5
- package/locales/mk.d.ts +66 -0
- package/locales/mk.js +55 -0
- package/locales/nbNO.d.ts +18 -5
- package/locales/nlNL.d.ts +18 -5
- package/locales/plPL.d.ts +18 -5
- package/locales/ptBR.d.ts +18 -5
- package/locales/roRO.d.ts +18 -5
- package/locales/ruRU.d.ts +18 -5
- package/locales/skSK.d.ts +18 -5
- package/locales/svSE.d.ts +18 -5
- package/locales/trTR.d.ts +18 -5
- package/locales/ukUA.d.ts +18 -5
- package/locales/urPK.d.ts +18 -5
- package/locales/utils/getPickersLocalization.d.ts +18 -5
- package/locales/utils/pickersLocaleTextApi.d.ts +18 -5
- package/locales/viVN.d.ts +18 -5
- package/locales/zhCN.d.ts +18 -5
- package/locales/zhHK.d.ts +18 -5
- package/modern/DateCalendar/DateCalendar.js +1 -0
- package/modern/DateCalendar/useCalendarState.js +1 -1
- package/modern/DatePicker/DatePicker.js +1 -0
- package/modern/DateTimePicker/DateTimePicker.js +1 -0
- package/modern/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -0
- package/modern/MobileDatePicker/MobileDatePicker.js +1 -0
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/modern/StaticDatePicker/StaticDatePicker.js +1 -0
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useField/useField.utils.js +23 -10
- package/modern/locales/deDE.js +2 -3
- package/modern/locales/esES.js +6 -7
- package/modern/locales/eu.js +58 -0
- package/modern/locales/index.js +2 -0
- package/modern/locales/mk.js +55 -0
- package/node/DateCalendar/DateCalendar.js +1 -0
- package/node/DateCalendar/useCalendarState.js +1 -1
- package/node/DatePicker/DatePicker.js +1 -0
- package/node/DateTimePicker/DateTimePicker.js +1 -0
- package/node/DesktopDatePicker/DesktopDatePicker.js +1 -0
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +1 -0
- package/node/MobileDatePicker/MobileDatePicker.js +1 -0
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +1 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +2 -0
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +2 -1
- package/node/StaticDatePicker/StaticDatePicker.js +1 -0
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +1 -0
- package/node/index.js +1 -1
- package/node/internals/hooks/useField/useField.utils.js +23 -10
- package/node/locales/deDE.js +2 -3
- package/node/locales/esES.js +6 -7
- package/node/locales/eu.js +64 -0
- package/node/locales/index.js +22 -0
- package/node/locales/mk.js +60 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,118 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.18.3
|
|
7
|
+
|
|
8
|
+
_Dec 4, 2023_
|
|
9
|
+
|
|
10
|
+
We'd like to offer a big thanks to the 10 contributors who made this release possible. Here are some highlights ✨:
|
|
11
|
+
|
|
12
|
+
- 📈 Fix a lot of Charts package issues
|
|
13
|
+
- 🌍 Improve Bulgarian (bg-BG) locale on Data Grid
|
|
14
|
+
- 🐞 Bugfixes
|
|
15
|
+
- 📚 Documentation improvements
|
|
16
|
+
|
|
17
|
+
### Data Grid
|
|
18
|
+
|
|
19
|
+
#### `@mui/x-data-grid@6.18.3`
|
|
20
|
+
|
|
21
|
+
- [DataGrid] Fix cell editing adding a leading "v" on paste (#11166) @prasad5795
|
|
22
|
+
- [DataGrid] Fix handling of event target in portal (#11209) @cherniavskii
|
|
23
|
+
- [DataGrid] Fix `onFilterModelChange` being fired with stale field value (#11244) @gitstart
|
|
24
|
+
- [l10n] Improve Bulgarian (bg-BG) locale (#10856) (#11206) @Kristiqn95
|
|
25
|
+
|
|
26
|
+
#### `@mui/x-data-grid-pro@6.18.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
27
|
+
|
|
28
|
+
Same changes as in `@mui/x-data-grid@6.18.3`.
|
|
29
|
+
|
|
30
|
+
#### `@mui/x-data-grid-premium@6.18.3` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
31
|
+
|
|
32
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.3`, plus:
|
|
33
|
+
|
|
34
|
+
- [DataGridPremium] Fix aggregated column ignoring column definition changes (#11176) @cherniavskii
|
|
35
|
+
- [DataGridPremium] Fix custom filter operators not working on aggregated column (#11201) @cherniavskii
|
|
36
|
+
|
|
37
|
+
### Date Pickers
|
|
38
|
+
|
|
39
|
+
#### `@mui/x-date-pickers@6.18.3`
|
|
40
|
+
|
|
41
|
+
- [pickers] Correctly format `MultiSectionDigitalClock` number sections (#11297) @LukasTy
|
|
42
|
+
- [pickers] Expand field placeholder methods flexibility by providing `format` parameter (#11254) @LukasTy
|
|
43
|
+
|
|
44
|
+
#### `@mui/x-date-pickers-pro@6.18.3` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
45
|
+
|
|
46
|
+
Same changes as in `@mui/x-date-pickers@6.18.3`.
|
|
47
|
+
|
|
48
|
+
### Charts / `@mui/x-charts@6.18.3`
|
|
49
|
+
|
|
50
|
+
- [charts] Adjusted `defaultizeValueFormatter` util to accept an optional `series.valueFormatter` value (#11213) @michelengelen
|
|
51
|
+
- [charts] Apply `labelStyle` and `tickLabelStyle` props on `<ChartsYAxis />` (#11180) @akamfoad
|
|
52
|
+
- [charts] Fix TS config (#11259) @alexfauquette
|
|
53
|
+
- [charts] Fix error with empty dataset (#11063) @alexfauquette
|
|
54
|
+
- [charts] Fix export strategy (#11235) @alexfauquette
|
|
55
|
+
|
|
56
|
+
### Docs
|
|
57
|
+
|
|
58
|
+
- [docs] Add LTS section to support page (#11300) @joserodolfofreitas
|
|
59
|
+
- [docs] Add end v6 blogpost to whats new page (#11299) @joserodolfofreitas
|
|
60
|
+
- [docs] Document charts composition (#10710) @alexfauquette
|
|
61
|
+
- [docs] Fix version links (#11167) @LukasTy
|
|
62
|
+
- [docs] Improve Data Grid togglable columns example (#11241) @MBilalShafi
|
|
63
|
+
- [docs] Split charts overview and getting started in distinct pages (#10910) @alexfauquette
|
|
64
|
+
|
|
65
|
+
## 6.18.2
|
|
66
|
+
|
|
67
|
+
_Nov 23, 2023_
|
|
68
|
+
|
|
69
|
+
We'd like to offer a big thanks to the 11 contributors who made this release possible. Here are some highlights ✨:
|
|
70
|
+
|
|
71
|
+
- 🌍 Improve Arabic (ar-SD), Czech (cs-CZ), and Hebrew (he-IL) locales on Data Grid
|
|
72
|
+
- 🌍 Add Basque (eu) and Macedonian (mk) locales on Pickers
|
|
73
|
+
- 🌍 Improve German (de-DE) and Spanish (es-ES) locales on Pickers
|
|
74
|
+
- 🐞 Bugfixes
|
|
75
|
+
- 📚 Documentation improvements
|
|
76
|
+
|
|
77
|
+
### Data Grid
|
|
78
|
+
|
|
79
|
+
#### `@mui/x-data-grid@6.18.2`
|
|
80
|
+
|
|
81
|
+
- [l10n] Improve Arabic (ar-SD) locale (#11096) @OmarWebDev
|
|
82
|
+
- [l10n] Improve Czech (cs-CZ) locale (#10968) @luborepka
|
|
83
|
+
- [l10n] Improve Hebrew (he-IL) locale (#11056) @LironKiloma
|
|
84
|
+
|
|
85
|
+
#### `@mui/x-data-grid-pro@6.18.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
86
|
+
|
|
87
|
+
Same changes as in `@mui/x-data-grid@6.18.2`.
|
|
88
|
+
|
|
89
|
+
#### `@mui/x-data-grid-premium@6.18.2` [](https://mui.com/r/x-premium-svg-link 'Premium plan')
|
|
90
|
+
|
|
91
|
+
Same changes as in `@mui/x-data-grid-pro@6.18.2`.
|
|
92
|
+
|
|
93
|
+
### Date Pickers
|
|
94
|
+
|
|
95
|
+
#### `@mui/x-date-pickers@6.18.2`
|
|
96
|
+
|
|
97
|
+
- [l10n] Add Basque (eu) locale and improve Spanish (es-ES) locale (#10985) @lajtomekadimon
|
|
98
|
+
- [l10n] Add Macedonian (mk) locale (#11155) @brsnik
|
|
99
|
+
- [l10n] Improve German (de-DE) locale (#11104) @jho-vema
|
|
100
|
+
- [pickers] Deprecate `defaultCalendarMonth` prop (#11138) @flaviendelangle
|
|
101
|
+
- [pickers] Fix `DateCalendar` crashing when given an invalid value (#11101) @flaviendelangle
|
|
102
|
+
|
|
103
|
+
#### `@mui/x-date-pickers-pro@6.18.2` [](https://mui.com/r/x-pro-svg-link 'Pro plan')
|
|
104
|
+
|
|
105
|
+
Same changes as in `@mui/x-date-pickers@6.18.2`.
|
|
106
|
+
|
|
107
|
+
### Charts / `@mui/x-charts@6.18.2`
|
|
108
|
+
|
|
109
|
+
- [charts] Fix `ChartsTooltip` component setup (#11157) @LukasTy
|
|
110
|
+
- [charts] Remove outdated prop-types (#10998) @alexfauquette
|
|
111
|
+
|
|
112
|
+
### Docs
|
|
113
|
+
|
|
114
|
+
- [docs] Fix incoherent naming of a component in `Custom slots and subcomponents` page (#11003) @lhilgert9
|
|
115
|
+
- [test] Skip flaky e2e test in webkit (#11115) @cherniavskii
|
|
116
|
+
- [test] Wait for images to load (#11109) @cherniavskii
|
|
117
|
+
|
|
6
118
|
## 6.18.1
|
|
7
119
|
|
|
8
120
|
_Nov 9, 2023_
|
|
@@ -386,6 +386,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
386
386
|
dayOfWeekFormatter: PropTypes.func,
|
|
387
387
|
/**
|
|
388
388
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
389
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
389
390
|
*/
|
|
390
391
|
defaultCalendarMonth: PropTypes.any,
|
|
391
392
|
/**
|
|
@@ -27,6 +27,7 @@ export interface DateCalendarSlotsComponentsProps<TDate> extends PickersCalendar
|
|
|
27
27
|
export interface ExportedDateCalendarProps<TDate> extends ExportedDayCalendarProps<TDate>, ExportedMonthCalendarProps, ExportedYearCalendarProps, BaseDateValidationProps<TDate>, DayValidationProps<TDate>, YearValidationProps<TDate>, MonthValidationProps<TDate>, TimezoneProps {
|
|
28
28
|
/**
|
|
29
29
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
30
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
30
31
|
*/
|
|
31
32
|
defaultCalendarMonth?: TDate;
|
|
32
33
|
/**
|
|
@@ -73,7 +73,7 @@ export const useCalendarState = params => {
|
|
|
73
73
|
|
|
74
74
|
const [calendarState, dispatch] = React.useReducer(reducerFn, {
|
|
75
75
|
isMonthSwitchingAnimating: false,
|
|
76
|
-
focusedDay: value
|
|
76
|
+
focusedDay: utils.isValid(value) ? value : now,
|
|
77
77
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
78
78
|
slideDirection: 'left'
|
|
79
79
|
});
|
package/DatePicker/DatePicker.js
CHANGED
|
@@ -86,6 +86,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
86
86
|
dayOfWeekFormatter: PropTypes.func,
|
|
87
87
|
/**
|
|
88
88
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
89
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
89
90
|
*/
|
|
90
91
|
defaultCalendarMonth: PropTypes.any,
|
|
91
92
|
/**
|
|
@@ -96,6 +96,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
96
96
|
dayOfWeekFormatter: PropTypes.func,
|
|
97
97
|
/**
|
|
98
98
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
99
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
99
100
|
*/
|
|
100
101
|
defaultCalendarMonth: PropTypes.any,
|
|
101
102
|
/**
|
|
@@ -110,6 +110,7 @@ DesktopDatePicker.propTypes = {
|
|
|
110
110
|
dayOfWeekFormatter: PropTypes.func,
|
|
111
111
|
/**
|
|
112
112
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
113
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
113
114
|
*/
|
|
114
115
|
defaultCalendarMonth: PropTypes.any,
|
|
115
116
|
/**
|
|
@@ -159,6 +159,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
159
159
|
dayOfWeekFormatter: PropTypes.func,
|
|
160
160
|
/**
|
|
161
161
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
162
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
162
163
|
*/
|
|
163
164
|
defaultCalendarMonth: PropTypes.any,
|
|
164
165
|
/**
|
|
@@ -107,6 +107,7 @@ MobileDatePicker.propTypes = {
|
|
|
107
107
|
dayOfWeekFormatter: PropTypes.func,
|
|
108
108
|
/**
|
|
109
109
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
110
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
110
111
|
*/
|
|
111
112
|
defaultCalendarMonth: PropTypes.any,
|
|
112
113
|
/**
|
|
@@ -128,6 +128,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
128
128
|
dayOfWeekFormatter: PropTypes.func,
|
|
129
129
|
/**
|
|
130
130
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
131
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
131
132
|
*/
|
|
132
133
|
defaultCalendarMonth: PropTypes.any,
|
|
133
134
|
/**
|
|
@@ -254,6 +254,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
254
254
|
},
|
|
255
255
|
items: getTimeSectionOptions({
|
|
256
256
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
257
|
+
utils,
|
|
257
258
|
isDisabled: minutes => disabled || isTimeDisabled(minutes, 'minutes'),
|
|
258
259
|
resolveLabel: minutes => utils.format(utils.setMinutes(now, minutes), 'minutes'),
|
|
259
260
|
timeStep: timeSteps.minutes,
|
|
@@ -270,6 +271,7 @@ export const MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function M
|
|
|
270
271
|
},
|
|
271
272
|
items: getTimeSectionOptions({
|
|
272
273
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
274
|
+
utils,
|
|
273
275
|
isDisabled: seconds => disabled || isTimeDisabled(seconds, 'seconds'),
|
|
274
276
|
resolveLabel: seconds => utils.format(utils.setSeconds(now, seconds), 'seconds'),
|
|
275
277
|
timeStep: timeSteps.seconds,
|
|
@@ -10,13 +10,14 @@ interface IGetHoursSectionOptions<TDate> {
|
|
|
10
10
|
resolveAriaLabel: (value: string) => string;
|
|
11
11
|
}
|
|
12
12
|
export declare const getHourSectionOptions: <TDate>({ now, value, utils, ampm, isDisabled, resolveAriaLabel, timeStep, }: IGetHoursSectionOptions<TDate>) => MultiSectionDigitalClockOption<number>[];
|
|
13
|
-
interface IGetTimeSectionOptions {
|
|
13
|
+
interface IGetTimeSectionOptions<TDate> {
|
|
14
14
|
value: number | null;
|
|
15
|
+
utils: MuiPickersAdapter<TDate>;
|
|
15
16
|
isDisabled: (value: number) => boolean;
|
|
16
17
|
timeStep: number;
|
|
17
18
|
resolveLabel: (value: number) => string;
|
|
18
19
|
hasValue?: boolean;
|
|
19
20
|
resolveAriaLabel: (value: string) => string;
|
|
20
21
|
}
|
|
21
|
-
export declare const getTimeSectionOptions: ({ value, isDisabled, timeStep, resolveLabel, resolveAriaLabel, hasValue, }: IGetTimeSectionOptions) => MultiSectionDigitalClockOption<number>[];
|
|
22
|
+
export declare const getTimeSectionOptions: <TDate>({ value, utils, isDisabled, timeStep, resolveLabel, resolveAriaLabel, hasValue, }: IGetTimeSectionOptions<TDate>) => MultiSectionDigitalClockOption<number>[];
|
|
22
23
|
export {};
|
|
@@ -38,6 +38,7 @@ export const getHourSectionOptions = ({
|
|
|
38
38
|
};
|
|
39
39
|
export const getTimeSectionOptions = ({
|
|
40
40
|
value,
|
|
41
|
+
utils,
|
|
41
42
|
isDisabled,
|
|
42
43
|
timeStep,
|
|
43
44
|
resolveLabel,
|
|
@@ -56,7 +57,7 @@ export const getTimeSectionOptions = ({
|
|
|
56
57
|
const timeValue = timeStep * index;
|
|
57
58
|
return {
|
|
58
59
|
value: timeValue,
|
|
59
|
-
label: resolveLabel(timeValue),
|
|
60
|
+
label: utils.formatNumber(resolveLabel(timeValue)),
|
|
60
61
|
isDisabled,
|
|
61
62
|
isSelected,
|
|
62
63
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
@@ -86,6 +86,7 @@ StaticDatePicker.propTypes = {
|
|
|
86
86
|
dayOfWeekFormatter: PropTypes.func,
|
|
87
87
|
/**
|
|
88
88
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
89
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
89
90
|
*/
|
|
90
91
|
defaultCalendarMonth: PropTypes.any,
|
|
91
92
|
/**
|
|
@@ -106,6 +106,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
106
106
|
dayOfWeekFormatter: PropTypes.func,
|
|
107
107
|
/**
|
|
108
108
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
109
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
109
110
|
*/
|
|
110
111
|
defaultCalendarMonth: PropTypes.any,
|
|
111
112
|
/**
|
package/index.js
CHANGED
|
@@ -207,49 +207,62 @@ export const addPositionPropertiesToSections = (sections, isRTL) => {
|
|
|
207
207
|
}
|
|
208
208
|
return newSections;
|
|
209
209
|
};
|
|
210
|
-
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig,
|
|
210
|
+
const getSectionPlaceholder = (utils, timezone, localeText, sectionConfig, sectionFormat) => {
|
|
211
211
|
switch (sectionConfig.type) {
|
|
212
212
|
case 'year':
|
|
213
213
|
{
|
|
214
214
|
return localeText.fieldYearPlaceholder({
|
|
215
|
-
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone),
|
|
215
|
+
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), sectionFormat).length,
|
|
216
|
+
format: sectionFormat
|
|
216
217
|
});
|
|
217
218
|
}
|
|
218
219
|
case 'month':
|
|
219
220
|
{
|
|
220
221
|
return localeText.fieldMonthPlaceholder({
|
|
221
|
-
contentType: sectionConfig.contentType
|
|
222
|
+
contentType: sectionConfig.contentType,
|
|
223
|
+
format: sectionFormat
|
|
222
224
|
});
|
|
223
225
|
}
|
|
224
226
|
case 'day':
|
|
225
227
|
{
|
|
226
|
-
return localeText.fieldDayPlaceholder(
|
|
228
|
+
return localeText.fieldDayPlaceholder({
|
|
229
|
+
format: sectionFormat
|
|
230
|
+
});
|
|
227
231
|
}
|
|
228
232
|
case 'weekDay':
|
|
229
233
|
{
|
|
230
234
|
return localeText.fieldWeekDayPlaceholder({
|
|
231
|
-
contentType: sectionConfig.contentType
|
|
235
|
+
contentType: sectionConfig.contentType,
|
|
236
|
+
format: sectionFormat
|
|
232
237
|
});
|
|
233
238
|
}
|
|
234
239
|
case 'hours':
|
|
235
240
|
{
|
|
236
|
-
return localeText.fieldHoursPlaceholder(
|
|
241
|
+
return localeText.fieldHoursPlaceholder({
|
|
242
|
+
format: sectionFormat
|
|
243
|
+
});
|
|
237
244
|
}
|
|
238
245
|
case 'minutes':
|
|
239
246
|
{
|
|
240
|
-
return localeText.fieldMinutesPlaceholder(
|
|
247
|
+
return localeText.fieldMinutesPlaceholder({
|
|
248
|
+
format: sectionFormat
|
|
249
|
+
});
|
|
241
250
|
}
|
|
242
251
|
case 'seconds':
|
|
243
252
|
{
|
|
244
|
-
return localeText.fieldSecondsPlaceholder(
|
|
253
|
+
return localeText.fieldSecondsPlaceholder({
|
|
254
|
+
format: sectionFormat
|
|
255
|
+
});
|
|
245
256
|
}
|
|
246
257
|
case 'meridiem':
|
|
247
258
|
{
|
|
248
|
-
return localeText.fieldMeridiemPlaceholder(
|
|
259
|
+
return localeText.fieldMeridiemPlaceholder({
|
|
260
|
+
format: sectionFormat
|
|
261
|
+
});
|
|
249
262
|
}
|
|
250
263
|
default:
|
|
251
264
|
{
|
|
252
|
-
return
|
|
265
|
+
return sectionFormat;
|
|
253
266
|
}
|
|
254
267
|
}
|
|
255
268
|
};
|
|
@@ -395,6 +395,7 @@ process.env.NODE_ENV !== "production" ? DateCalendar.propTypes = {
|
|
|
395
395
|
dayOfWeekFormatter: PropTypes.func,
|
|
396
396
|
/**
|
|
397
397
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
398
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
398
399
|
*/
|
|
399
400
|
defaultCalendarMonth: PropTypes.any,
|
|
400
401
|
/**
|
|
@@ -75,7 +75,7 @@ export var useCalendarState = function useCalendarState(params) {
|
|
|
75
75
|
|
|
76
76
|
var _React$useReducer = React.useReducer(reducerFn, {
|
|
77
77
|
isMonthSwitchingAnimating: false,
|
|
78
|
-
focusedDay: value
|
|
78
|
+
focusedDay: utils.isValid(value) ? value : now,
|
|
79
79
|
currentMonth: utils.startOfMonth(referenceDate),
|
|
80
80
|
slideDirection: 'left'
|
|
81
81
|
}),
|
|
@@ -85,6 +85,7 @@ process.env.NODE_ENV !== "production" ? DatePicker.propTypes = {
|
|
|
85
85
|
dayOfWeekFormatter: PropTypes.func,
|
|
86
86
|
/**
|
|
87
87
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
88
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
88
89
|
*/
|
|
89
90
|
defaultCalendarMonth: PropTypes.any,
|
|
90
91
|
/**
|
|
@@ -95,6 +95,7 @@ process.env.NODE_ENV !== "production" ? DateTimePicker.propTypes = {
|
|
|
95
95
|
dayOfWeekFormatter: PropTypes.func,
|
|
96
96
|
/**
|
|
97
97
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
98
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
98
99
|
*/
|
|
99
100
|
defaultCalendarMonth: PropTypes.any,
|
|
100
101
|
/**
|
|
@@ -109,6 +109,7 @@ DesktopDatePicker.propTypes = {
|
|
|
109
109
|
dayOfWeekFormatter: PropTypes.func,
|
|
110
110
|
/**
|
|
111
111
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
112
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
112
113
|
*/
|
|
113
114
|
defaultCalendarMonth: PropTypes.any,
|
|
114
115
|
/**
|
|
@@ -157,6 +157,7 @@ DesktopDateTimePicker.propTypes = {
|
|
|
157
157
|
dayOfWeekFormatter: PropTypes.func,
|
|
158
158
|
/**
|
|
159
159
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
160
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
160
161
|
*/
|
|
161
162
|
defaultCalendarMonth: PropTypes.any,
|
|
162
163
|
/**
|
|
@@ -106,6 +106,7 @@ MobileDatePicker.propTypes = {
|
|
|
106
106
|
dayOfWeekFormatter: PropTypes.func,
|
|
107
107
|
/**
|
|
108
108
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
109
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
109
110
|
*/
|
|
110
111
|
defaultCalendarMonth: PropTypes.any,
|
|
111
112
|
/**
|
|
@@ -127,6 +127,7 @@ MobileDateTimePicker.propTypes = {
|
|
|
127
127
|
dayOfWeekFormatter: PropTypes.func,
|
|
128
128
|
/**
|
|
129
129
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
130
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
130
131
|
*/
|
|
131
132
|
defaultCalendarMonth: PropTypes.any,
|
|
132
133
|
/**
|
|
@@ -264,6 +264,7 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
264
264
|
},
|
|
265
265
|
items: getTimeSectionOptions({
|
|
266
266
|
value: utils.getMinutes(valueOrReferenceDate),
|
|
267
|
+
utils: utils,
|
|
267
268
|
isDisabled: function isDisabled(minutes) {
|
|
268
269
|
return disabled || isTimeDisabled(minutes, 'minutes');
|
|
269
270
|
},
|
|
@@ -284,6 +285,7 @@ export var MultiSectionDigitalClock = /*#__PURE__*/React.forwardRef(function Mul
|
|
|
284
285
|
},
|
|
285
286
|
items: getTimeSectionOptions({
|
|
286
287
|
value: utils.getSeconds(valueOrReferenceDate),
|
|
288
|
+
utils: utils,
|
|
287
289
|
isDisabled: function isDisabled(seconds) {
|
|
288
290
|
return disabled || isTimeDisabled(seconds, 'seconds');
|
|
289
291
|
},
|
|
@@ -38,6 +38,7 @@ export var getHourSectionOptions = function getHourSectionOptions(_ref) {
|
|
|
38
38
|
};
|
|
39
39
|
export var getTimeSectionOptions = function getTimeSectionOptions(_ref2) {
|
|
40
40
|
var value = _ref2.value,
|
|
41
|
+
utils = _ref2.utils,
|
|
41
42
|
isDisabled = _ref2.isDisabled,
|
|
42
43
|
timeStep = _ref2.timeStep,
|
|
43
44
|
resolveLabel = _ref2.resolveLabel,
|
|
@@ -56,7 +57,7 @@ export var getTimeSectionOptions = function getTimeSectionOptions(_ref2) {
|
|
|
56
57
|
var timeValue = timeStep * index;
|
|
57
58
|
return {
|
|
58
59
|
value: timeValue,
|
|
59
|
-
label: resolveLabel(timeValue),
|
|
60
|
+
label: utils.formatNumber(resolveLabel(timeValue)),
|
|
60
61
|
isDisabled: isDisabled,
|
|
61
62
|
isSelected: isSelected,
|
|
62
63
|
ariaLabel: resolveAriaLabel(timeValue.toString())
|
|
@@ -85,6 +85,7 @@ StaticDatePicker.propTypes = {
|
|
|
85
85
|
dayOfWeekFormatter: PropTypes.func,
|
|
86
86
|
/**
|
|
87
87
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
88
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
88
89
|
*/
|
|
89
90
|
defaultCalendarMonth: PropTypes.any,
|
|
90
91
|
/**
|
|
@@ -105,6 +105,7 @@ StaticDateTimePicker.propTypes = {
|
|
|
105
105
|
dayOfWeekFormatter: PropTypes.func,
|
|
106
106
|
/**
|
|
107
107
|
* Default calendar month displayed when `value` and `defaultValue` are empty.
|
|
108
|
+
* @deprecated Consider using `referenceDate` instead.
|
|
108
109
|
*/
|
|
109
110
|
defaultCalendarMonth: PropTypes.any,
|
|
110
111
|
/**
|
package/legacy/index.js
CHANGED
|
@@ -217,49 +217,62 @@ export var addPositionPropertiesToSections = function addPositionPropertiesToSec
|
|
|
217
217
|
}
|
|
218
218
|
return newSections;
|
|
219
219
|
};
|
|
220
|
-
var getSectionPlaceholder = function getSectionPlaceholder(utils, timezone, localeText, sectionConfig,
|
|
220
|
+
var getSectionPlaceholder = function getSectionPlaceholder(utils, timezone, localeText, sectionConfig, sectionFormat) {
|
|
221
221
|
switch (sectionConfig.type) {
|
|
222
222
|
case 'year':
|
|
223
223
|
{
|
|
224
224
|
return localeText.fieldYearPlaceholder({
|
|
225
|
-
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone),
|
|
225
|
+
digitAmount: utils.formatByString(utils.dateWithTimezone(undefined, timezone), sectionFormat).length,
|
|
226
|
+
format: sectionFormat
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
229
|
case 'month':
|
|
229
230
|
{
|
|
230
231
|
return localeText.fieldMonthPlaceholder({
|
|
231
|
-
contentType: sectionConfig.contentType
|
|
232
|
+
contentType: sectionConfig.contentType,
|
|
233
|
+
format: sectionFormat
|
|
232
234
|
});
|
|
233
235
|
}
|
|
234
236
|
case 'day':
|
|
235
237
|
{
|
|
236
|
-
return localeText.fieldDayPlaceholder(
|
|
238
|
+
return localeText.fieldDayPlaceholder({
|
|
239
|
+
format: sectionFormat
|
|
240
|
+
});
|
|
237
241
|
}
|
|
238
242
|
case 'weekDay':
|
|
239
243
|
{
|
|
240
244
|
return localeText.fieldWeekDayPlaceholder({
|
|
241
|
-
contentType: sectionConfig.contentType
|
|
245
|
+
contentType: sectionConfig.contentType,
|
|
246
|
+
format: sectionFormat
|
|
242
247
|
});
|
|
243
248
|
}
|
|
244
249
|
case 'hours':
|
|
245
250
|
{
|
|
246
|
-
return localeText.fieldHoursPlaceholder(
|
|
251
|
+
return localeText.fieldHoursPlaceholder({
|
|
252
|
+
format: sectionFormat
|
|
253
|
+
});
|
|
247
254
|
}
|
|
248
255
|
case 'minutes':
|
|
249
256
|
{
|
|
250
|
-
return localeText.fieldMinutesPlaceholder(
|
|
257
|
+
return localeText.fieldMinutesPlaceholder({
|
|
258
|
+
format: sectionFormat
|
|
259
|
+
});
|
|
251
260
|
}
|
|
252
261
|
case 'seconds':
|
|
253
262
|
{
|
|
254
|
-
return localeText.fieldSecondsPlaceholder(
|
|
263
|
+
return localeText.fieldSecondsPlaceholder({
|
|
264
|
+
format: sectionFormat
|
|
265
|
+
});
|
|
255
266
|
}
|
|
256
267
|
case 'meridiem':
|
|
257
268
|
{
|
|
258
|
-
return localeText.fieldMeridiemPlaceholder(
|
|
269
|
+
return localeText.fieldMeridiemPlaceholder({
|
|
270
|
+
format: sectionFormat
|
|
271
|
+
});
|
|
259
272
|
}
|
|
260
273
|
default:
|
|
261
274
|
{
|
|
262
|
-
return
|
|
275
|
+
return sectionFormat;
|
|
263
276
|
}
|
|
264
277
|
}
|
|
265
278
|
};
|
package/legacy/locales/deDE.js
CHANGED
|
@@ -63,8 +63,7 @@ var deDEPickers = {
|
|
|
63
63
|
openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
|
|
64
64
|
return value !== null && utils.isValid(value) ? "Uhrzeit ausw\xE4hlen, gew\xE4hlte Uhrzeit ist ".concat(utils.format(value, 'fullTime')) : 'Uhrzeit auswählen';
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
fieldClearLabel: 'Wert leeren',
|
|
68
67
|
// Table labels
|
|
69
68
|
timeTableLabel: 'Uhrzeit auswählen',
|
|
70
69
|
dateTableLabel: 'Datum auswählen',
|
|
@@ -78,7 +77,9 @@ var deDEPickers = {
|
|
|
78
77
|
fieldDayPlaceholder: function fieldDayPlaceholder() {
|
|
79
78
|
return 'TT';
|
|
80
79
|
},
|
|
81
|
-
|
|
80
|
+
fieldWeekDayPlaceholder: function fieldWeekDayPlaceholder(params) {
|
|
81
|
+
return params.contentType === 'letter' ? 'EEEE' : 'EE';
|
|
82
|
+
},
|
|
82
83
|
fieldHoursPlaceholder: function fieldHoursPlaceholder() {
|
|
83
84
|
return 'hh';
|
|
84
85
|
},
|
package/legacy/locales/esES.js
CHANGED
|
@@ -30,7 +30,7 @@ var esESPickers = {
|
|
|
30
30
|
dateRangePickerToolbarTitle: 'Seleccionar rango de fecha',
|
|
31
31
|
// Clock labels
|
|
32
32
|
clockLabelText: function clockLabelText(view, time, adapter) {
|
|
33
|
-
return "Seleccione ".concat(views[view], ". ").concat(time === null ? '
|
|
33
|
+
return "Seleccione ".concat(views[view], ". ").concat(time === null ? 'No hay hora seleccionada' : "La hora seleccionada es ".concat(adapter.format(time, 'fullTime')));
|
|
34
34
|
},
|
|
35
35
|
hoursClockNumberText: function hoursClockNumberText(hours) {
|
|
36
36
|
return "".concat(hours, " horas");
|
|
@@ -56,16 +56,15 @@ var esESPickers = {
|
|
|
56
56
|
},
|
|
57
57
|
// Open picker labels
|
|
58
58
|
openDatePickerDialogue: function openDatePickerDialogue(value, utils) {
|
|
59
|
-
return value !== null && utils.isValid(value) ? "Elige
|
|
59
|
+
return value !== null && utils.isValid(value) ? "Elige fecha, la fecha elegida es ".concat(utils.format(value, 'fullDate')) : 'Elige fecha';
|
|
60
60
|
},
|
|
61
61
|
openTimePickerDialogue: function openTimePickerDialogue(value, utils) {
|
|
62
|
-
return value !== null && utils.isValid(value) ? "Elige
|
|
62
|
+
return value !== null && utils.isValid(value) ? "Elige hora, la hora elegida es ".concat(utils.format(value, 'fullTime')) : 'Elige hora';
|
|
63
63
|
},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
fieldClearLabel: 'Limpiar valor',
|
|
66
65
|
// Table labels
|
|
67
|
-
timeTableLabel: 'elige
|
|
68
|
-
dateTableLabel: 'elige
|
|
66
|
+
timeTableLabel: 'elige hora',
|
|
67
|
+
dateTableLabel: 'elige fecha',
|
|
69
68
|
// Field section placeholders
|
|
70
69
|
fieldYearPlaceholder: function fieldYearPlaceholder(params) {
|
|
71
70
|
return 'A'.repeat(params.digitAmount);
|