@mui/x-date-pickers 6.3.0 → 6.4.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/AdapterDateFns/AdapterDateFns.d.ts +3 -7
- package/AdapterDateFns/AdapterDateFns.js +2 -8
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +3 -7
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -8
- package/AdapterDayjs/AdapterDayjs.d.ts +3 -9
- package/AdapterDayjs/AdapterDayjs.js +2 -3
- package/AdapterLuxon/AdapterLuxon.d.ts +3 -8
- package/AdapterLuxon/AdapterLuxon.js +6 -5
- package/AdapterMoment/AdapterMoment.d.ts +3 -9
- package/AdapterMoment/AdapterMoment.js +2 -2
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +5 -14
- package/AdapterMomentHijri/AdapterMomentHijri.js +4 -10
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +6 -16
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +15 -12
- package/CHANGELOG.md +105 -2
- package/DateCalendar/DateCalendar.js +2 -2
- package/DateCalendar/DayCalendar.js +11 -10
- package/DateCalendar/PickersCalendarHeader.js +2 -2
- package/DateCalendar/useCalendarState.d.ts +1 -1
- package/DateField/DateField.js +4 -0
- package/DatePicker/shared.d.ts +1 -1
- package/DateTimeField/DateTimeField.js +4 -0
- package/DateTimeField/DateTimeField.types.d.ts +2 -10
- package/DateTimePicker/shared.d.ts +5 -12
- package/DesktopTimePicker/DesktopTimePicker.js +4 -2
- package/LocalizationProvider/LocalizationProvider.d.ts +10 -8
- package/LocalizationProvider/LocalizationProvider.js +3 -3
- package/MonthCalendar/MonthCalendar.js +2 -2
- package/TimeClock/TimeClock.types.d.ts +2 -1
- package/TimeField/TimeField.js +4 -0
- package/index.js +1 -1
- package/internals/hooks/useField/useField.utils.d.ts +13 -13
- package/internals/hooks/useField/useField.utils.js +5 -4
- package/internals/hooks/useField/useFieldState.js +2 -2
- package/internals/hooks/usePicker/usePickerViews.d.ts +2 -2
- package/internals/hooks/useUtils.d.ts +1 -1
- package/internals/index.d.ts +1 -1
- package/internals/models/props/clock.d.ts +1 -1
- package/internals/models/validation.d.ts +13 -0
- package/internals/utils/date-utils.d.ts +6 -4
- package/internals/utils/date-utils.js +16 -0
- package/internals/utils/time-utils.d.ts +4 -4
- package/internals/utils/validation/extractValidationProps.d.ts +1 -1
- package/internals/utils/validation/extractValidationProps.js +1 -1
- package/legacy/AdapterDateFns/AdapterDateFns.js +2 -8
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -8
- package/legacy/AdapterDayjs/AdapterDayjs.js +2 -3
- package/legacy/AdapterLuxon/AdapterLuxon.js +6 -5
- package/legacy/AdapterMoment/AdapterMoment.js +2 -2
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +4 -10
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +15 -12
- package/legacy/DateCalendar/DateCalendar.js +2 -2
- package/legacy/DateCalendar/DayCalendar.js +11 -10
- package/legacy/DateCalendar/PickersCalendarHeader.js +2 -2
- package/legacy/DateField/DateField.js +4 -0
- package/legacy/DateTimeField/DateTimeField.js +4 -0
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +4 -2
- package/legacy/LocalizationProvider/LocalizationProvider.js +3 -3
- package/legacy/MonthCalendar/MonthCalendar.js +2 -2
- package/legacy/TimeField/TimeField.js +4 -0
- package/legacy/index.js +1 -1
- package/legacy/internals/hooks/useField/useField.utils.js +7 -6
- package/legacy/internals/hooks/useField/useFieldState.js +2 -2
- package/legacy/internals/utils/date-utils.js +16 -0
- package/legacy/internals/utils/validation/extractValidationProps.js +1 -1
- package/legacy/locales/csCZ.js +3 -3
- package/legacy/locales/index.js +1 -0
- package/legacy/locales/skSK.js +93 -0
- package/legacy/locales/ukUA.js +3 -1
- package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.js +2 -7
- package/legacy/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +2 -0
- package/legacy/tests/describeGregorianAdapter/index.js +2 -1
- package/legacy/tests/describeGregorianAdapter/testCalculations.js +272 -200
- package/legacy/tests/describeGregorianAdapter/testLocalization.js +34 -0
- package/legacy/tests/describeHijriAdapter/describeHijriAdapter.js +1 -3
- package/legacy/tests/describeHijriAdapter/testCalculations.js +101 -28
- package/legacy/tests/describeHijriAdapter/testLocalization.js +8 -0
- package/legacy/tests/describeJalaliAdapter/describeJalaliAdapter.js +2 -6
- package/legacy/tests/describeJalaliAdapter/testCalculations.js +157 -24
- package/legacy/tests/describeJalaliAdapter/testLocalization.js +8 -0
- package/legacy/tests/describeValidation/testTextFieldValidation.js +26 -0
- package/locales/beBY.d.ts +3 -3
- package/locales/caES.d.ts +3 -3
- package/locales/csCZ.d.ts +3 -3
- package/locales/csCZ.js +3 -3
- package/locales/daDK.d.ts +3 -3
- package/locales/deDE.d.ts +3 -3
- package/locales/enUS.d.ts +3 -3
- package/locales/esES.d.ts +3 -3
- package/locales/faIR.d.ts +3 -3
- package/locales/fiFI.d.ts +3 -3
- package/locales/frFR.d.ts +3 -3
- package/locales/heIL.d.ts +3 -3
- package/locales/huHU.d.ts +3 -3
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/locales/isIS.d.ts +3 -3
- package/locales/itIT.d.ts +3 -3
- package/locales/jaJP.d.ts +3 -3
- package/locales/koKR.d.ts +3 -3
- package/locales/kzKZ.d.ts +3 -3
- package/locales/nbNO.d.ts +3 -3
- package/locales/nlNL.d.ts +3 -3
- package/locales/plPL.d.ts +3 -3
- package/locales/ptBR.d.ts +3 -3
- package/locales/ruRU.d.ts +3 -3
- package/locales/skSK.d.ts +53 -0
- package/locales/skSK.js +61 -0
- package/locales/svSE.d.ts +3 -3
- package/locales/trTR.d.ts +3 -3
- package/locales/ukUA.d.ts +3 -3
- package/locales/ukUA.js +1 -1
- package/locales/urPK.d.ts +3 -3
- package/locales/utils/getPickersLocalization.d.ts +3 -3
- package/locales/zhCN.d.ts +3 -3
- package/models/adapters.d.ts +43 -35
- package/modern/AdapterDateFns/AdapterDateFns.js +2 -8
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -8
- package/modern/AdapterDayjs/AdapterDayjs.js +2 -2
- package/modern/AdapterLuxon/AdapterLuxon.js +6 -5
- package/modern/AdapterMoment/AdapterMoment.js +2 -2
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +4 -10
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +15 -12
- package/modern/DateCalendar/DateCalendar.js +2 -2
- package/modern/DateCalendar/DayCalendar.js +11 -10
- package/modern/DateCalendar/PickersCalendarHeader.js +2 -2
- package/modern/DateField/DateField.js +4 -0
- package/modern/DateTimeField/DateTimeField.js +4 -0
- package/modern/DesktopTimePicker/DesktopTimePicker.js +3 -1
- package/modern/LocalizationProvider/LocalizationProvider.js +3 -3
- package/modern/MonthCalendar/MonthCalendar.js +2 -2
- package/modern/TimeField/TimeField.js +4 -0
- package/modern/index.js +1 -1
- package/modern/internals/hooks/useField/useField.utils.js +5 -4
- package/modern/internals/hooks/useField/useFieldState.js +2 -2
- package/modern/internals/utils/date-utils.js +16 -0
- package/modern/internals/utils/validation/extractValidationProps.js +1 -1
- package/modern/locales/csCZ.js +3 -3
- package/modern/locales/index.js +1 -0
- package/modern/locales/skSK.js +58 -0
- package/modern/locales/ukUA.js +1 -1
- package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.js +2 -7
- package/modern/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +2 -0
- package/modern/tests/describeGregorianAdapter/index.js +2 -1
- package/modern/tests/describeGregorianAdapter/testCalculations.js +272 -198
- package/modern/tests/describeGregorianAdapter/testLocalization.js +34 -0
- package/modern/tests/describeHijriAdapter/describeHijriAdapter.js +1 -3
- package/modern/tests/describeHijriAdapter/testCalculations.js +101 -28
- package/modern/tests/describeHijriAdapter/testLocalization.js +8 -0
- package/modern/tests/describeJalaliAdapter/describeJalaliAdapter.js +2 -6
- package/modern/tests/describeJalaliAdapter/testCalculations.js +157 -24
- package/modern/tests/describeJalaliAdapter/testLocalization.js +8 -0
- package/modern/tests/describeValidation/testTextFieldValidation.js +27 -0
- package/node/AdapterDateFns/AdapterDateFns.js +2 -8
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +2 -8
- package/node/AdapterDayjs/AdapterDayjs.js +2 -2
- package/node/AdapterLuxon/AdapterLuxon.js +6 -5
- package/node/AdapterMoment/AdapterMoment.js +2 -2
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +4 -10
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +15 -12
- package/node/DateCalendar/DateCalendar.js +1 -1
- package/node/DateCalendar/DayCalendar.js +11 -10
- package/node/DateCalendar/PickersCalendarHeader.js +2 -2
- package/node/DateField/DateField.js +4 -0
- package/node/DateTimeField/DateTimeField.js +4 -0
- package/node/DesktopTimePicker/DesktopTimePicker.js +3 -1
- package/node/LocalizationProvider/LocalizationProvider.js +5 -5
- package/node/MonthCalendar/MonthCalendar.js +1 -1
- package/node/TimeField/TimeField.js +4 -0
- package/node/index.js +1 -1
- package/node/internals/hooks/useField/useField.utils.js +5 -4
- package/node/internals/hooks/useField/useFieldState.js +2 -2
- package/node/internals/utils/date-utils.js +20 -2
- package/node/internals/utils/validation/extractValidationProps.js +1 -1
- package/node/locales/csCZ.js +3 -3
- package/node/locales/index.js +11 -0
- package/node/locales/skSK.js +65 -0
- package/node/locales/ukUA.js +1 -1
- package/node/tests/describeGregorianAdapter/describeGregorianAdapter.js +3 -9
- package/node/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +10 -0
- package/node/tests/describeGregorianAdapter/index.js +4 -3
- package/node/tests/describeGregorianAdapter/testCalculations.js +272 -198
- package/node/tests/describeGregorianAdapter/testLocalization.js +35 -0
- package/node/tests/describeHijriAdapter/describeHijriAdapter.js +1 -3
- package/node/tests/describeHijriAdapter/testCalculations.js +100 -27
- package/node/tests/describeHijriAdapter/testLocalization.js +8 -0
- package/node/tests/describeJalaliAdapter/describeJalaliAdapter.js +2 -6
- package/node/tests/describeJalaliAdapter/testCalculations.js +156 -23
- package/node/tests/describeJalaliAdapter/testLocalization.js +8 -0
- package/node/tests/describeValidation/testTextFieldValidation.js +27 -0
- package/package.json +2 -2
- package/tests/describeGregorianAdapter/describeGregorianAdapter.js +2 -7
- package/tests/describeGregorianAdapter/describeGregorianAdapter.utils.js +2 -0
- package/tests/describeGregorianAdapter/index.js +2 -1
- package/tests/describeGregorianAdapter/testCalculations.js +272 -198
- package/tests/describeGregorianAdapter/testLocalization.js +34 -0
- package/tests/describeHijriAdapter/describeHijriAdapter.js +1 -3
- package/tests/describeHijriAdapter/testCalculations.js +101 -28
- package/tests/describeHijriAdapter/testLocalization.js +8 -0
- package/tests/describeJalaliAdapter/describeJalaliAdapter.js +2 -6
- package/tests/describeJalaliAdapter/testCalculations.js +157 -24
- package/tests/describeJalaliAdapter/testLocalization.js +8 -0
- package/tests/describeValidation/testTextFieldValidation.js +27 -0
- package/themeAugmentation/props.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +2 -2
|
@@ -150,15 +150,9 @@ class AdapterMomentHijri extends _AdapterMoment.AdapterMoment {
|
|
|
150
150
|
locale: 'ar-SA',
|
|
151
151
|
instance
|
|
152
152
|
});
|
|
153
|
-
this.
|
|
153
|
+
this.lib = 'moment-hijri';
|
|
154
|
+
this.moment = void 0;
|
|
154
155
|
this.formatTokenMap = formatTokenMap;
|
|
155
|
-
this.escapedCharacters = {
|
|
156
|
-
start: '[',
|
|
157
|
-
end: ']'
|
|
158
|
-
};
|
|
159
|
-
this.toIMoment = value => {
|
|
160
|
-
return this.moment(value ? value.clone() : undefined).locale('ar-SA');
|
|
161
|
-
};
|
|
162
156
|
this.date = value => {
|
|
163
157
|
if (value === null) {
|
|
164
158
|
return null;
|
|
@@ -227,7 +221,7 @@ class AdapterMomentHijri extends _AdapterMoment.AdapterMoment {
|
|
|
227
221
|
};
|
|
228
222
|
this.getWeekdays = () => {
|
|
229
223
|
return [0, 1, 2, 3, 4, 5, 6].map(dayOfWeek => {
|
|
230
|
-
return this.
|
|
224
|
+
return this.date().weekday(dayOfWeek).format('dd');
|
|
231
225
|
});
|
|
232
226
|
};
|
|
233
227
|
this.getWeekArray = value => {
|
|
@@ -268,7 +262,7 @@ class AdapterMomentHijri extends _AdapterMoment.AdapterMoment {
|
|
|
268
262
|
return years;
|
|
269
263
|
};
|
|
270
264
|
this.getMeridiemText = ampm => {
|
|
271
|
-
return ampm === 'am' ? this.
|
|
265
|
+
return ampm === 'am' ? this.date().hours(2).format('A') : this.date().hours(14).format('A');
|
|
272
266
|
};
|
|
273
267
|
this.moment = instance || _momentHijri.default;
|
|
274
268
|
this.locale = 'ar-SA';
|
|
@@ -148,25 +148,18 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
|
|
|
148
148
|
locale: 'fa',
|
|
149
149
|
instance
|
|
150
150
|
});
|
|
151
|
-
this.isMUIAdapter = true;
|
|
152
151
|
this.lib = 'moment-jalaali';
|
|
153
152
|
this.moment = void 0;
|
|
154
|
-
this.locale = void 0;
|
|
155
|
-
this.formats = void 0;
|
|
156
153
|
this.formatTokenMap = formatTokenMap;
|
|
157
|
-
this.escapedCharacters = {
|
|
158
|
-
start: '[',
|
|
159
|
-
end: ']'
|
|
160
|
-
};
|
|
161
|
-
this.toJMoment = value => {
|
|
162
|
-
return this.moment(value ? value.clone() : undefined).locale('fa');
|
|
163
|
-
};
|
|
164
154
|
this.date = value => {
|
|
165
155
|
if (value === null) {
|
|
166
156
|
return null;
|
|
167
157
|
}
|
|
168
158
|
return this.moment(value).locale('fa');
|
|
169
159
|
};
|
|
160
|
+
this.parseISO = isoString => {
|
|
161
|
+
return this.moment(isoString).locale('fa');
|
|
162
|
+
};
|
|
170
163
|
this.parse = (value, format) => {
|
|
171
164
|
if (value === '') {
|
|
172
165
|
return null;
|
|
@@ -192,6 +185,16 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
|
|
|
192
185
|
}
|
|
193
186
|
return this.moment(value).isSame(comparing);
|
|
194
187
|
};
|
|
188
|
+
this.isSameYear = (value, comparing) => {
|
|
189
|
+
// `isSame` seems to mutate the date on `moment-jalaali`
|
|
190
|
+
// @ts-ignore
|
|
191
|
+
return value.clone().isSame(comparing, 'jYear');
|
|
192
|
+
};
|
|
193
|
+
this.isSameMonth = (value, comparing) => {
|
|
194
|
+
// `isSame` seems to mutate the date on `moment-jalaali`
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
return value.clone().isSame(comparing, 'jMonth');
|
|
197
|
+
};
|
|
195
198
|
this.isAfterYear = (value, comparing) => {
|
|
196
199
|
return value.jYear() > comparing.jYear();
|
|
197
200
|
};
|
|
@@ -242,7 +245,7 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
|
|
|
242
245
|
};
|
|
243
246
|
this.getWeekdays = () => {
|
|
244
247
|
return [0, 1, 2, 3, 4, 5, 6].map(dayOfWeek => {
|
|
245
|
-
return this.
|
|
248
|
+
return this.date().weekday(dayOfWeek).format('dd');
|
|
246
249
|
});
|
|
247
250
|
};
|
|
248
251
|
this.getWeekArray = value => {
|
|
@@ -275,7 +278,7 @@ class AdapterMomentJalaali extends _AdapterMoment.AdapterMoment {
|
|
|
275
278
|
return years;
|
|
276
279
|
};
|
|
277
280
|
this.getMeridiemText = ampm => {
|
|
278
|
-
return ampm === 'am' ? this.
|
|
281
|
+
return ampm === 'am' ? this.date().hours(2).format('A') : this.date().hours(14).format('A');
|
|
279
282
|
};
|
|
280
283
|
this.moment = instance || _momentJalaali.default;
|
|
281
284
|
this.locale = 'fa';
|
|
@@ -217,7 +217,7 @@ const DateCalendar = /*#__PURE__*/React.forwardRef(function DateCalendar(inProps
|
|
|
217
217
|
const handleSelectedDayChange = (0, _utils.unstable_useEventCallback)(day => {
|
|
218
218
|
if (value && day) {
|
|
219
219
|
// If there is a date already selected, then we want to keep its time
|
|
220
|
-
return setValueAndGoToNextView(
|
|
220
|
+
return setValueAndGoToNextView((0, _dateUtils.mergeDateAndTime)(utils, day, value), 'finish');
|
|
221
221
|
}
|
|
222
222
|
return setValueAndGoToNextView(day, 'finish');
|
|
223
223
|
});
|
|
@@ -223,6 +223,7 @@ function DayCalendar(inProps) {
|
|
|
223
223
|
});
|
|
224
224
|
const classes = useUtilityClasses(props);
|
|
225
225
|
const theme = (0, _styles.useTheme)();
|
|
226
|
+
const isRTL = theme.direction === 'rtl';
|
|
226
227
|
const {
|
|
227
228
|
onFocusedDayChange,
|
|
228
229
|
className,
|
|
@@ -297,13 +298,13 @@ function DayCalendar(inProps) {
|
|
|
297
298
|
break;
|
|
298
299
|
case 'ArrowLeft':
|
|
299
300
|
{
|
|
300
|
-
const newFocusedDayDefault = utils.addDays(day,
|
|
301
|
-
const nextAvailableMonth =
|
|
301
|
+
const newFocusedDayDefault = utils.addDays(day, isRTL ? 1 : -1);
|
|
302
|
+
const nextAvailableMonth = utils.addMonths(day, isRTL ? 1 : -1);
|
|
302
303
|
const closestDayToFocus = (0, _dateUtils.findClosestEnabledDate)({
|
|
303
304
|
utils,
|
|
304
305
|
date: newFocusedDayDefault,
|
|
305
|
-
minDate:
|
|
306
|
-
maxDate:
|
|
306
|
+
minDate: isRTL ? newFocusedDayDefault : utils.startOfMonth(nextAvailableMonth),
|
|
307
|
+
maxDate: isRTL ? utils.endOfMonth(nextAvailableMonth) : newFocusedDayDefault,
|
|
307
308
|
isDateDisabled
|
|
308
309
|
});
|
|
309
310
|
focusDay(closestDayToFocus || newFocusedDayDefault);
|
|
@@ -312,13 +313,13 @@ function DayCalendar(inProps) {
|
|
|
312
313
|
}
|
|
313
314
|
case 'ArrowRight':
|
|
314
315
|
{
|
|
315
|
-
const newFocusedDayDefault = utils.addDays(day,
|
|
316
|
-
const nextAvailableMonth =
|
|
316
|
+
const newFocusedDayDefault = utils.addDays(day, isRTL ? -1 : 1);
|
|
317
|
+
const nextAvailableMonth = utils.addMonths(day, isRTL ? -1 : 1);
|
|
317
318
|
const closestDayToFocus = (0, _dateUtils.findClosestEnabledDate)({
|
|
318
319
|
utils,
|
|
319
320
|
date: newFocusedDayDefault,
|
|
320
|
-
minDate:
|
|
321
|
-
maxDate:
|
|
321
|
+
minDate: isRTL ? utils.startOfMonth(nextAvailableMonth) : newFocusedDayDefault,
|
|
322
|
+
maxDate: isRTL ? newFocusedDayDefault : utils.endOfMonth(nextAvailableMonth),
|
|
322
323
|
isDateDisabled
|
|
323
324
|
});
|
|
324
325
|
focusDay(closestDayToFocus || newFocusedDayDefault);
|
|
@@ -334,11 +335,11 @@ function DayCalendar(inProps) {
|
|
|
334
335
|
event.preventDefault();
|
|
335
336
|
break;
|
|
336
337
|
case 'PageUp':
|
|
337
|
-
focusDay(utils.
|
|
338
|
+
focusDay(utils.addMonths(day, 1));
|
|
338
339
|
event.preventDefault();
|
|
339
340
|
break;
|
|
340
341
|
case 'PageDown':
|
|
341
|
-
focusDay(utils.
|
|
342
|
+
focusDay(utils.addMonths(day, -1));
|
|
342
343
|
event.preventDefault();
|
|
343
344
|
break;
|
|
344
345
|
default:
|
|
@@ -146,8 +146,8 @@ function PickersCalendarHeader(inProps) {
|
|
|
146
146
|
className: classes.switchViewIcon
|
|
147
147
|
}),
|
|
148
148
|
switchViewIconProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded);
|
|
149
|
-
const selectNextMonth = () => onMonthChange(utils.
|
|
150
|
-
const selectPreviousMonth = () => onMonthChange(utils.
|
|
149
|
+
const selectNextMonth = () => onMonthChange(utils.addMonths(month, 1), 'left');
|
|
150
|
+
const selectPreviousMonth = () => onMonthChange(utils.addMonths(month, -1), 'right');
|
|
151
151
|
const isNextMonthDisabled = (0, _dateHelpersHooks.useNextMonthDisabled)(month, {
|
|
152
152
|
disableFuture,
|
|
153
153
|
maxDate
|
|
@@ -214,6 +214,10 @@ process.env.NODE_ENV !== "production" ? DateField.propTypes = {
|
|
|
214
214
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
215
215
|
*/
|
|
216
216
|
onChange: _propTypes.default.func,
|
|
217
|
+
/**
|
|
218
|
+
* @ignore
|
|
219
|
+
*/
|
|
220
|
+
onClick: _propTypes.default.func,
|
|
217
221
|
/**
|
|
218
222
|
* Callback fired when the error associated to the current value changes.
|
|
219
223
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -247,6 +247,10 @@ process.env.NODE_ENV !== "production" ? DateTimeField.propTypes = {
|
|
|
247
247
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
248
248
|
*/
|
|
249
249
|
onChange: _propTypes.default.func,
|
|
250
|
+
/**
|
|
251
|
+
* @ignore
|
|
252
|
+
*/
|
|
253
|
+
onClick: _propTypes.default.func,
|
|
250
254
|
/**
|
|
251
255
|
* Callback fired when the error associated to the current value changes.
|
|
252
256
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
|
@@ -40,7 +40,9 @@ const DesktopTimePicker = /*#__PURE__*/React.forwardRef(function DesktopTimePick
|
|
|
40
40
|
}, defaultizedProps.viewRenderers);
|
|
41
41
|
const ampmInClock = defaultizedProps.ampmInClock ?? true;
|
|
42
42
|
const actionBarActions = shouldRenderTimeInASingleColumn ? [] : ['accept'];
|
|
43
|
-
|
|
43
|
+
// Need to avoid adding the `meridiem` view when unexpected renderer is specified
|
|
44
|
+
const shouldHoursRendererContainMeridiemView = viewRenderers.hours?.name === _timeViewRenderers.renderMultiSectionDigitalClockTimeView.name;
|
|
45
|
+
const views = defaultizedProps.ampm && shouldHoursRendererContainMeridiemView ? [...defaultizedProps.views, 'meridiem'] : defaultizedProps.views;
|
|
44
46
|
|
|
45
47
|
// Props with the default values specific to the desktop variant
|
|
46
48
|
const props = (0, _extends2.default)({}, defaultizedProps, {
|
|
@@ -4,8 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.LocalizationProvider =
|
|
8
|
-
exports.MuiPickersAdapterContext = void 0;
|
|
7
|
+
exports.MuiPickersAdapterContext = exports.LocalizationProvider = void 0;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
9
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
|
11
10
|
var React = _interopRequireWildcard(require("react"));
|
|
@@ -23,7 +22,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
23
22
|
/**
|
|
24
23
|
* @ignore - do not document.
|
|
25
24
|
*/
|
|
26
|
-
function LocalizationProvider(inProps) {
|
|
25
|
+
const LocalizationProvider = function LocalizationProvider(inProps) {
|
|
27
26
|
const {
|
|
28
27
|
localeText: inLocaleText
|
|
29
28
|
} = inProps,
|
|
@@ -87,7 +86,8 @@ function LocalizationProvider(inProps) {
|
|
|
87
86
|
value: contextValue,
|
|
88
87
|
children: children
|
|
89
88
|
});
|
|
90
|
-
}
|
|
89
|
+
};
|
|
90
|
+
exports.LocalizationProvider = LocalizationProvider;
|
|
91
91
|
process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
|
|
92
92
|
// ----------------------------- Warning --------------------------------
|
|
93
93
|
// | These PropTypes are generated from the TypeScript type definitions |
|
|
@@ -96,7 +96,7 @@ process.env.NODE_ENV !== "production" ? LocalizationProvider.propTypes = {
|
|
|
96
96
|
/**
|
|
97
97
|
* Locale for the date library you are using
|
|
98
98
|
*/
|
|
99
|
-
adapterLocale: _propTypes.default.
|
|
99
|
+
adapterLocale: _propTypes.default.any,
|
|
100
100
|
children: _propTypes.default.node,
|
|
101
101
|
/**
|
|
102
102
|
* Date library adapter class function.
|
|
@@ -185,7 +185,7 @@ const MonthCalendar = /*#__PURE__*/React.forwardRef(function MonthCalendar(inPro
|
|
|
185
185
|
className: (0, _clsx.default)(classes.root, className),
|
|
186
186
|
ownerState: ownerState
|
|
187
187
|
}, other, {
|
|
188
|
-
children:
|
|
188
|
+
children: (0, _dateUtils.getMonthsInYear)(utils, selectedDateOrStartOfMonth).map(month => {
|
|
189
189
|
const monthNumber = utils.getMonth(month);
|
|
190
190
|
const monthText = utils.format(month, 'monthShort');
|
|
191
191
|
const isSelected = monthNumber === selectedMonth;
|
|
@@ -231,6 +231,10 @@ process.env.NODE_ENV !== "production" ? TimeField.propTypes = {
|
|
|
231
231
|
* @param {FieldChangeHandlerContext<TError>} context The context containing the validation result of the current value.
|
|
232
232
|
*/
|
|
233
233
|
onChange: _propTypes.default.func,
|
|
234
|
+
/**
|
|
235
|
+
* @ignore
|
|
236
|
+
*/
|
|
237
|
+
onClick: _propTypes.default.func,
|
|
234
238
|
/**
|
|
235
239
|
* Callback fired when the error associated to the current value changes.
|
|
236
240
|
* @template TValue The value type. Will be either the same type as `value` or `null`. Can be in `[start, end]` format in case of range value.
|
package/node/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.validateSections = exports.splitFormatIntoSections = exports.mergeDateIntoReferenceDate = exports.isAndroid = exports.getSectionsBoundaries = exports.getSectionVisibleValue = exports.getSectionOrder = exports.getLetterEditingOptions = exports.getDaysInWeekStr = exports.getDateSectionConfigFromFormatToken = exports.getDateFromDateSections = exports.doesSectionFormatHaveLeadingZeros = exports.createDateStrForInputFromSections = exports.cleanString = exports.cleanLeadingZeros = exports.cleanDigitSectionValue = exports.clampDaySectionIfPossible = exports.changeSectionValueFormat = exports.adjustSectionValue = exports.addPositionPropertiesToSections = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _dateUtils = require("../../utils/date-utils");
|
|
9
10
|
const getDateSectionConfigFromFormatToken = (utils, formatToken) => {
|
|
10
11
|
const config = utils.formatTokenMap[formatToken];
|
|
11
12
|
if (config == null) {
|
|
@@ -56,7 +57,7 @@ const getLetterEditingOptions = (utils, sectionType, format) => {
|
|
|
56
57
|
switch (sectionType) {
|
|
57
58
|
case 'month':
|
|
58
59
|
{
|
|
59
|
-
return
|
|
60
|
+
return (0, _dateUtils.getMonthsInYear)(utils, utils.date()).map(month => utils.formatByString(month, format));
|
|
60
61
|
}
|
|
61
62
|
case 'weekDay':
|
|
62
63
|
{
|
|
@@ -330,7 +331,7 @@ const getEscapedPartsFromFormat = (utils, format) => {
|
|
|
330
331
|
}
|
|
331
332
|
return escapedParts;
|
|
332
333
|
};
|
|
333
|
-
const splitFormatIntoSections = (utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros) => {
|
|
334
|
+
const splitFormatIntoSections = (utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL) => {
|
|
334
335
|
let startSeparator = '';
|
|
335
336
|
const sections = [];
|
|
336
337
|
const now = utils.date();
|
|
@@ -418,7 +419,7 @@ const splitFormatIntoSections = (utils, localeText, format, date, formatDensity,
|
|
|
418
419
|
return sections.map(section => {
|
|
419
420
|
const cleanSeparator = separator => {
|
|
420
421
|
let cleanedSeparator = separator;
|
|
421
|
-
if (cleanedSeparator !== null && cleanedSeparator.includes(' ')) {
|
|
422
|
+
if (isRTL && cleanedSeparator !== null && cleanedSeparator.includes(' ')) {
|
|
422
423
|
cleanedSeparator = `\u2069${cleanedSeparator}\u2066`;
|
|
423
424
|
}
|
|
424
425
|
if (formatDensity === 'spacious' && ['/', '.', '-'].includes(cleanedSeparator)) {
|
|
@@ -481,7 +482,7 @@ const getSectionsBoundaries = utils => {
|
|
|
481
482
|
const {
|
|
482
483
|
maxDaysInMonth,
|
|
483
484
|
longestMonth
|
|
484
|
-
} =
|
|
485
|
+
} = (0, _dateUtils.getMonthsInYear)(utils, today).reduce((acc, month) => {
|
|
485
486
|
const daysInMonth = utils.getDaysInMonth(month);
|
|
486
487
|
if (daysInMonth > acc.maxDaysInMonth) {
|
|
487
488
|
return {
|
|
@@ -39,7 +39,7 @@ const useFieldState = params => {
|
|
|
39
39
|
const firstDefaultValue = React.useRef(defaultValue);
|
|
40
40
|
const valueFromTheOutside = valueProp ?? firstDefaultValue.current ?? valueManager.emptyValue;
|
|
41
41
|
const sectionsValueBoundaries = React.useMemo(() => (0, _useField.getSectionsBoundaries)(utils), [utils]);
|
|
42
|
-
const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, isRTL, date => (0, _useField.splitFormatIntoSections)(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros)), [fieldValueManager, format, localeText, isRTL, shouldRespectLeadingZeros, utils, formatDensity]);
|
|
42
|
+
const getSectionsFromValue = React.useCallback((value, fallbackSections = null) => fieldValueManager.getSectionsFromValue(utils, value, fallbackSections, isRTL, date => (0, _useField.splitFormatIntoSections)(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL)), [fieldValueManager, format, localeText, isRTL, shouldRespectLeadingZeros, utils, formatDensity]);
|
|
43
43
|
const placeholder = React.useMemo(() => fieldValueManager.getValueStrFromSections(getSectionsFromValue(valueManager.emptyValue), isRTL), [fieldValueManager, getSectionsFromValue, valueManager.emptyValue, isRTL]);
|
|
44
44
|
const [state, setState] = React.useState(() => {
|
|
45
45
|
const sections = getSectionsFromValue(valueFromTheOutside);
|
|
@@ -163,7 +163,7 @@ const useFieldState = params => {
|
|
|
163
163
|
if (date == null || !utils.isValid(date)) {
|
|
164
164
|
return null;
|
|
165
165
|
}
|
|
166
|
-
const sections = (0, _useField.splitFormatIntoSections)(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros);
|
|
166
|
+
const sections = (0, _useField.splitFormatIntoSections)(utils, localeText, format, date, formatDensity, shouldRespectLeadingZeros, isRTL);
|
|
167
167
|
return (0, _useField.mergeDateIntoReferenceDate)(utils, date, sections, referenceDate, false);
|
|
168
168
|
};
|
|
169
169
|
const newValue = fieldValueManager.parseValueStr(valueStr, state.referenceValue, parseDateStr);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.replaceInvalidDateByNull = exports.findClosestEnabledDate = exports.clamp = exports.areDatesEqual = exports.applyDefaultDate = void 0;
|
|
6
|
+
exports.replaceInvalidDateByNull = exports.mergeDateAndTime = exports.getMonthsInYear = exports.findClosestEnabledDate = exports.clamp = exports.areDatesEqual = exports.applyDefaultDate = void 0;
|
|
7
7
|
const findClosestEnabledDate = ({
|
|
8
8
|
date,
|
|
9
9
|
disableFuture,
|
|
@@ -80,4 +80,22 @@ const areDatesEqual = (utils, a, b) => {
|
|
|
80
80
|
}
|
|
81
81
|
return utils.isEqual(a, b);
|
|
82
82
|
};
|
|
83
|
-
exports.areDatesEqual = areDatesEqual;
|
|
83
|
+
exports.areDatesEqual = areDatesEqual;
|
|
84
|
+
const getMonthsInYear = (utils, year) => {
|
|
85
|
+
const firstMonth = utils.startOfYear(year);
|
|
86
|
+
const months = [firstMonth];
|
|
87
|
+
while (months.length < 12) {
|
|
88
|
+
const prevMonth = months[months.length - 1];
|
|
89
|
+
months.push(utils.addMonths(prevMonth, 1));
|
|
90
|
+
}
|
|
91
|
+
return months;
|
|
92
|
+
};
|
|
93
|
+
exports.getMonthsInYear = getMonthsInYear;
|
|
94
|
+
const mergeDateAndTime = (utils, dateParam, timeParam) => {
|
|
95
|
+
let mergedDate = dateParam;
|
|
96
|
+
mergedDate = utils.setHours(mergedDate, utils.getHours(timeParam));
|
|
97
|
+
mergedDate = utils.setMinutes(mergedDate, utils.getMinutes(timeParam));
|
|
98
|
+
mergedDate = utils.setSeconds(mergedDate, utils.getSeconds(timeParam));
|
|
99
|
+
return mergedDate;
|
|
100
|
+
};
|
|
101
|
+
exports.mergeDateAndTime = mergeDateAndTime;
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.extractValidationProps = void 0;
|
|
7
|
-
const VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minDate', 'maxDate', 'minTime', 'maxTime', 'minDateTime', 'maxDateTime', 'shouldDisableDate', 'shouldDisableMonth', 'shouldDisableYear', 'shouldDisableClock', 'shouldDisableTime', '
|
|
7
|
+
const VALIDATION_PROP_NAMES = ['disablePast', 'disableFuture', 'minDate', 'maxDate', 'minTime', 'maxTime', 'minDateTime', 'maxDateTime', 'shouldDisableDate', 'shouldDisableMonth', 'shouldDisableYear', 'shouldDisableClock', 'shouldDisableTime', 'minutesStep'];
|
|
8
8
|
/**
|
|
9
9
|
* Extract the validation props for the props received by a component.
|
|
10
10
|
* Limit the risk of forgetting some of them and reduce the bundle size.
|
package/node/locales/csCZ.js
CHANGED
|
@@ -15,7 +15,7 @@ const timeViews = {
|
|
|
15
15
|
const csCZPickers = {
|
|
16
16
|
// Calendar navigation
|
|
17
17
|
previousMonth: 'Další měsíc',
|
|
18
|
-
nextMonth: 'Předchozí
|
|
18
|
+
nextMonth: 'Předchozí měsíc',
|
|
19
19
|
// View navigation
|
|
20
20
|
openPreviousView: 'otevřít předchozí zobrazení',
|
|
21
21
|
openNextView: 'otevřít další zobrazení',
|
|
@@ -46,8 +46,8 @@ const csCZPickers = {
|
|
|
46
46
|
calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} týden v roce`,
|
|
47
47
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
48
48
|
// Open picker labels
|
|
49
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `
|
|
50
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `
|
|
49
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte datum, vybrané datum je ${utils.format(value, 'fullDate')}` : 'Vyberte datum',
|
|
50
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte čas, vybraný čas je ${utils.format(value, 'fullTime')}` : 'Vyberte čas',
|
|
51
51
|
// Table labels
|
|
52
52
|
timeTableLabel: 'vyberte čas',
|
|
53
53
|
dateTableLabel: 'vyberte datum',
|
package/node/locales/index.js
CHANGED
|
@@ -289,6 +289,17 @@ Object.keys(_heIL).forEach(function (key) {
|
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
291
|
});
|
|
292
|
+
var _skSK = require("./skSK");
|
|
293
|
+
Object.keys(_skSK).forEach(function (key) {
|
|
294
|
+
if (key === "default" || key === "__esModule") return;
|
|
295
|
+
if (key in exports && exports[key] === _skSK[key]) return;
|
|
296
|
+
Object.defineProperty(exports, key, {
|
|
297
|
+
enumerable: true,
|
|
298
|
+
get: function () {
|
|
299
|
+
return _skSK[key];
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
});
|
|
292
303
|
var _pickersLocaleTextApi = require("./utils/pickersLocaleTextApi");
|
|
293
304
|
Object.keys(_pickersLocaleTextApi).forEach(function (key) {
|
|
294
305
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.skSK = void 0;
|
|
7
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
8
|
+
// maps TimeView to its translation
|
|
9
|
+
const timeViews = {
|
|
10
|
+
hours: 'Hodiny',
|
|
11
|
+
minutes: 'Minúty',
|
|
12
|
+
seconds: 'Sekundy',
|
|
13
|
+
meridiem: 'Popoludnie'
|
|
14
|
+
};
|
|
15
|
+
const skSKPickers = {
|
|
16
|
+
// Calendar navigation
|
|
17
|
+
previousMonth: 'Ďalší mesiac',
|
|
18
|
+
nextMonth: 'Predchádzajúci mesiac',
|
|
19
|
+
// View navigation
|
|
20
|
+
openPreviousView: 'otvoriť predchádzajúce zobrazenie',
|
|
21
|
+
openNextView: 'otvoriť ďalšie zobrazenie',
|
|
22
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'ročné zobrazenie otvorené, prepnite do zobrazenia kalendára' : 'zobrazenie kalendára otvorené, prepnite do zobrazenia roka',
|
|
23
|
+
// DateRange placeholders
|
|
24
|
+
start: 'Začiatok',
|
|
25
|
+
end: 'Koniec',
|
|
26
|
+
// Action bar
|
|
27
|
+
cancelButtonLabel: 'Zrušiť',
|
|
28
|
+
clearButtonLabel: 'Vymazať',
|
|
29
|
+
okButtonLabel: 'Potvrdiť',
|
|
30
|
+
todayButtonLabel: 'Dnes',
|
|
31
|
+
// Toolbar titles
|
|
32
|
+
datePickerToolbarTitle: 'Vyberte dátum',
|
|
33
|
+
dateTimePickerToolbarTitle: 'Vyberte dátum a čas',
|
|
34
|
+
timePickerToolbarTitle: 'Vyberte čas',
|
|
35
|
+
dateRangePickerToolbarTitle: 'Vyberete rozmedzie dátumov',
|
|
36
|
+
// Clock labels
|
|
37
|
+
clockLabelText: (view, time, adapter) => `${timeViews[view] ?? view} vybraný. ${time === null ? 'Nie je vybraný čas' : `Vybraný čas je ${adapter.format(time, 'fullTime')}`}`,
|
|
38
|
+
hoursClockNumberText: hours => `${hours} hodín`,
|
|
39
|
+
minutesClockNumberText: minutes => `${minutes} minút`,
|
|
40
|
+
secondsClockNumberText: seconds => `${seconds} sekúnd`,
|
|
41
|
+
// Digital clock labels
|
|
42
|
+
selectViewText: view => `Vyberte ${timeViews[view]}`,
|
|
43
|
+
// Calendar labels
|
|
44
|
+
calendarWeekNumberHeaderLabel: 'Týždeň v roku',
|
|
45
|
+
calendarWeekNumberHeaderText: '#',
|
|
46
|
+
calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} týždeň v roku`,
|
|
47
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
48
|
+
// Open picker labels
|
|
49
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte dátum, vybraný dátum je ${utils.format(value, 'fullDate')}` : 'Vyberte dátum',
|
|
50
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Vyberte čas, vybraný čas je ${utils.format(value, 'fullTime')}` : 'Vyberte čas',
|
|
51
|
+
// Table labels
|
|
52
|
+
timeTableLabel: 'vyberte čas',
|
|
53
|
+
dateTableLabel: 'vyberte dátum',
|
|
54
|
+
// Field section placeholders
|
|
55
|
+
fieldYearPlaceholder: params => 'Y'.repeat(params.digitAmount),
|
|
56
|
+
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
57
|
+
fieldDayPlaceholder: () => 'DD',
|
|
58
|
+
// fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
59
|
+
fieldHoursPlaceholder: () => 'hh',
|
|
60
|
+
fieldMinutesPlaceholder: () => 'mm',
|
|
61
|
+
fieldSecondsPlaceholder: () => 'ss',
|
|
62
|
+
fieldMeridiemPlaceholder: () => 'aa'
|
|
63
|
+
};
|
|
64
|
+
const skSK = (0, _getPickersLocalization.getPickersLocalization)(skSKPickers);
|
|
65
|
+
exports.skSK = skSK;
|
package/node/locales/ukUA.js
CHANGED
|
@@ -54,7 +54,7 @@ const ukUAPickers = {
|
|
|
54
54
|
fieldYearPlaceholder: params => 'Y'.repeat(params.digitAmount),
|
|
55
55
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
56
56
|
fieldDayPlaceholder: () => 'DD',
|
|
57
|
-
|
|
57
|
+
fieldWeekDayPlaceholder: params => params.contentType === 'letter' ? 'EEEE' : 'EE',
|
|
58
58
|
fieldHoursPlaceholder: () => 'hh',
|
|
59
59
|
fieldMinutesPlaceholder: () => 'mm',
|
|
60
60
|
fieldSecondsPlaceholder: () => 'ss',
|
|
@@ -4,23 +4,17 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.describeGregorianAdapter =
|
|
7
|
+
exports.describeGregorianAdapter = void 0;
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
9
|
var _createDescribe = _interopRequireDefault(require("@mui/monorepo/test/utils/createDescribe"));
|
|
10
10
|
var _testCalculations = require("./testCalculations");
|
|
11
11
|
var _testLocalization = require("./testLocalization");
|
|
12
12
|
var _testFormat = require("./testFormat");
|
|
13
|
-
const TEST_DATE_ISO = '2018-10-30T11:44:00.000Z';
|
|
14
|
-
exports.TEST_DATE_ISO = TEST_DATE_ISO;
|
|
15
13
|
function innerGregorianDescribeAdapter(Adapter, params) {
|
|
16
|
-
const adapter = new Adapter(
|
|
17
|
-
locale: params.locale
|
|
18
|
-
});
|
|
14
|
+
const adapter = new Adapter();
|
|
19
15
|
describe(adapter.lib, () => {
|
|
20
16
|
const testSuitParams = (0, _extends2.default)({}, params, {
|
|
21
|
-
adapter
|
|
22
|
-
testDateISO: TEST_DATE_ISO,
|
|
23
|
-
testDate: adapter.date(TEST_DATE_ISO)
|
|
17
|
+
adapter
|
|
24
18
|
});
|
|
25
19
|
(0, _testCalculations.testCalculations)(testSuitParams);
|
|
26
20
|
(0, _testLocalization.testLocalization)(testSuitParams);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.TEST_DATE_LOCALE_STRING = exports.TEST_DATE_ISO_STRING = void 0;
|
|
7
|
+
const TEST_DATE_ISO_STRING = '2018-10-30T11:44:00.000Z';
|
|
8
|
+
exports.TEST_DATE_ISO_STRING = TEST_DATE_ISO_STRING;
|
|
9
|
+
const TEST_DATE_LOCALE_STRING = '2018-10-30';
|
|
10
|
+
exports.TEST_DATE_LOCALE_STRING = TEST_DATE_LOCALE_STRING;
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "TEST_DATE_ISO_STRING", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function () {
|
|
9
|
-
return
|
|
9
|
+
return _describeGregorianAdapter2.TEST_DATE_ISO_STRING;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "describeGregorianAdapter", {
|
|
@@ -15,4 +15,5 @@ Object.defineProperty(exports, "describeGregorianAdapter", {
|
|
|
15
15
|
return _describeGregorianAdapter.describeGregorianAdapter;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
var _describeGregorianAdapter = require("./describeGregorianAdapter");
|
|
18
|
+
var _describeGregorianAdapter = require("./describeGregorianAdapter");
|
|
19
|
+
var _describeGregorianAdapter2 = require("./describeGregorianAdapter.utils");
|