@mui/x-date-pickers 6.18.1 → 7.0.0-alpha.1
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 +4 -15
- package/AdapterDateFns/AdapterDateFns.js +8 -90
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.d.ts +4 -15
- package/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
- package/AdapterDayjs/AdapterDayjs.d.ts +5 -17
- package/AdapterDayjs/AdapterDayjs.js +11 -60
- package/AdapterLuxon/AdapterLuxon.d.ts +4 -15
- package/AdapterLuxon/AdapterLuxon.js +16 -76
- package/AdapterMoment/AdapterMoment.d.ts +4 -20
- package/AdapterMoment/AdapterMoment.js +9 -66
- package/AdapterMomentHijri/AdapterMomentHijri.d.ts +1 -7
- package/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
- package/AdapterMomentJalaali/AdapterMomentJalaali.d.ts +1 -9
- package/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
- package/CHANGELOG.md +558 -1
- package/DateCalendar/DateCalendar.js +4 -21
- package/DateCalendar/DateCalendar.types.d.ts +12 -3
- package/DateCalendar/DayCalendar.d.ts +13 -5
- package/DateCalendar/DayCalendar.js +12 -21
- package/DateCalendar/index.d.ts +0 -1
- package/DateCalendar/index.js +1 -3
- package/DateCalendar/useCalendarState.js +2 -3
- package/DateField/DateField.js +5 -21
- package/DateField/DateField.types.d.ts +12 -3
- package/DatePicker/DatePicker.js +0 -13
- package/DatePicker/DatePicker.types.d.ts +1 -14
- package/DatePicker/shared.d.ts +4 -16
- package/DatePicker/shared.js +2 -5
- package/DateTimeField/DateTimeField.js +5 -21
- package/DateTimeField/DateTimeField.types.d.ts +2 -15
- package/DateTimePicker/DateTimePicker.js +0 -13
- package/DateTimePicker/DateTimePicker.types.d.ts +1 -14
- package/DateTimePicker/shared.d.ts +4 -17
- package/DateTimePicker/shared.js +4 -7
- package/DesktopDatePicker/DesktopDatePicker.js +0 -13
- package/DesktopDatePicker/DesktopDatePicker.types.d.ts +2 -15
- package/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
- package/DesktopDateTimePicker/DesktopDateTimePicker.types.d.ts +2 -15
- package/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/DesktopTimePicker/DesktopTimePicker.types.d.ts +2 -15
- package/DigitalClock/DigitalClock.js +18 -26
- package/DigitalClock/DigitalClock.types.d.ts +2 -15
- package/LocalizationProvider/LocalizationProvider.js +0 -6
- package/MobileDatePicker/MobileDatePicker.js +0 -13
- package/MobileDatePicker/MobileDatePicker.types.d.ts +2 -15
- package/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
- package/MobileDateTimePicker/MobileDateTimePicker.types.d.ts +2 -15
- package/MobileTimePicker/MobileTimePicker.js +0 -12
- package/MobileTimePicker/MobileTimePicker.types.d.ts +2 -15
- package/MonthCalendar/MonthCalendar.js +3 -7
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.types.d.ts +3 -15
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.d.ts +2 -1
- package/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.d.ts +1 -2
- package/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/PickersCalendarHeader/PickersCalendarHeader.js +14 -20
- package/PickersCalendarHeader/PickersCalendarHeader.types.d.ts +3 -16
- package/PickersLayout/PickersLayout.js +0 -12
- package/PickersLayout/PickersLayout.types.d.ts +6 -19
- package/PickersLayout/usePickerLayout.js +2 -7
- package/StaticDatePicker/StaticDatePicker.js +0 -13
- package/StaticDatePicker/StaticDatePicker.types.d.ts +2 -14
- package/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
- package/StaticDateTimePicker/StaticDateTimePicker.types.d.ts +2 -14
- package/StaticTimePicker/StaticTimePicker.js +0 -12
- package/StaticTimePicker/StaticTimePicker.types.d.ts +2 -14
- package/TimeClock/TimeClock.js +3 -20
- package/TimeClock/TimeClock.types.d.ts +1 -14
- package/TimeField/TimeField.js +5 -21
- package/TimeField/TimeField.types.d.ts +2 -15
- package/TimePicker/TimePicker.js +0 -12
- package/TimePicker/TimePicker.types.d.ts +1 -14
- package/TimePicker/shared.d.ts +3 -16
- package/TimePicker/shared.js +4 -7
- package/YearCalendar/YearCalendar.js +4 -8
- package/dateTimeViewRenderers/dateTimeViewRenderers.d.ts +2 -2
- package/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/dateViewRenderers/dateViewRenderers.d.ts +1 -1
- package/dateViewRenderers/dateViewRenderers.js +0 -4
- package/hooks/useClearableField.d.ts +1 -3
- package/hooks/useClearableField.js +6 -8
- package/index.d.ts +1 -0
- package/index.js +4 -1
- package/internals/components/PickersArrowSwitcher/PickersArrowSwitcher.types.d.ts +10 -6
- package/internals/components/PickersModalDialog.d.ts +4 -5
- package/internals/components/PickersPopper.d.ts +5 -6
- package/internals/hooks/useDesktopPicker/useDesktopPicker.types.d.ts +7 -8
- package/internals/hooks/useField/useField.types.d.ts +2 -2
- package/internals/hooks/useField/useField.utils.js +0 -1
- package/internals/hooks/useField/useFieldState.js +1 -1
- package/internals/hooks/useMobilePicker/useMobilePicker.types.d.ts +3 -4
- package/internals/hooks/useStaticPicker/useStaticPicker.types.d.ts +1 -14
- package/internals/index.d.ts +0 -2
- package/internals/index.js +0 -1
- package/internals/utils/getDefaultReferenceDate.d.ts +1 -2
- package/internals/utils/getDefaultReferenceDate.js +0 -4
- package/legacy/AdapterDateFns/AdapterDateFns.js +11 -92
- package/legacy/AdapterDateFnsJalali/AdapterDateFnsJalali.js +11 -92
- package/legacy/AdapterDayjs/AdapterDayjs.js +15 -63
- package/legacy/AdapterLuxon/AdapterLuxon.js +19 -78
- package/legacy/AdapterMoment/AdapterMoment.js +12 -70
- package/legacy/AdapterMomentHijri/AdapterMomentHijri.js +5 -30
- package/legacy/AdapterMomentJalaali/AdapterMomentJalaali.js +5 -40
- package/legacy/DateCalendar/DateCalendar.js +4 -21
- package/legacy/DateCalendar/DayCalendar.js +10 -16
- package/legacy/DateCalendar/index.js +1 -3
- package/legacy/DateCalendar/useCalendarState.js +2 -3
- package/legacy/DateField/DateField.js +6 -22
- package/legacy/DatePicker/DatePicker.js +0 -13
- package/legacy/DatePicker/shared.js +2 -5
- package/legacy/DateTimeField/DateTimeField.js +6 -22
- package/legacy/DateTimePicker/DateTimePicker.js +0 -13
- package/legacy/DateTimePicker/shared.js +4 -7
- package/legacy/DesktopDatePicker/DesktopDatePicker.js +0 -13
- package/legacy/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
- package/legacy/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/legacy/DigitalClock/DigitalClock.js +20 -26
- package/legacy/LocalizationProvider/LocalizationProvider.js +0 -6
- package/legacy/MobileDatePicker/MobileDatePicker.js +0 -13
- package/legacy/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
- package/legacy/MobileTimePicker/MobileTimePicker.js +0 -12
- package/legacy/MonthCalendar/MonthCalendar.js +3 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.js +11 -18
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/legacy/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +15 -10
- package/legacy/PickersCalendarHeader/PickersCalendarHeader.js +14 -20
- package/legacy/PickersLayout/PickersLayout.js +0 -12
- package/legacy/PickersLayout/usePickerLayout.js +2 -7
- package/legacy/StaticDatePicker/StaticDatePicker.js +0 -13
- package/legacy/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
- package/legacy/StaticTimePicker/StaticTimePicker.js +0 -12
- package/legacy/TimeClock/TimeClock.js +3 -20
- package/legacy/TimeField/TimeField.js +5 -21
- package/legacy/TimePicker/TimePicker.js +0 -12
- package/legacy/TimePicker/shared.js +4 -7
- package/legacy/YearCalendar/YearCalendar.js +4 -7
- package/legacy/dateTimeViewRenderers/dateTimeViewRenderers.js +2 -8
- package/legacy/dateViewRenderers/dateViewRenderers.js +0 -4
- package/legacy/hooks/useClearableField.js +6 -8
- package/legacy/index.js +4 -1
- package/legacy/internals/hooks/useField/useField.utils.js +0 -1
- package/legacy/internals/hooks/useField/useFieldState.js +1 -1
- package/legacy/internals/index.js +0 -1
- package/legacy/internals/utils/getDefaultReferenceDate.js +0 -6
- package/legacy/locales/esES.js +6 -7
- package/legacy/locales/eu.js +94 -0
- package/legacy/locales/index.js +1 -0
- package/legacy/timeViewRenderers/timeViewRenderers.js +0 -12
- package/locales/esES.js +6 -7
- package/locales/eu.d.ts +54 -0
- package/locales/eu.js +58 -0
- package/locales/index.d.ts +1 -0
- package/locales/index.js +1 -0
- package/models/adapters.d.ts +10 -135
- package/models/fields.d.ts +0 -6
- package/modern/AdapterDateFns/AdapterDateFns.js +8 -90
- package/modern/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
- package/modern/AdapterDayjs/AdapterDayjs.js +11 -59
- package/modern/AdapterLuxon/AdapterLuxon.js +16 -76
- package/modern/AdapterMoment/AdapterMoment.js +9 -65
- package/modern/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
- package/modern/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
- package/modern/DateCalendar/DateCalendar.js +3 -20
- package/modern/DateCalendar/DayCalendar.js +11 -19
- package/modern/DateCalendar/index.js +1 -3
- package/modern/DateCalendar/useCalendarState.js +2 -3
- package/modern/DateField/DateField.js +4 -20
- package/modern/DatePicker/DatePicker.js +0 -13
- package/modern/DatePicker/shared.js +1 -4
- package/modern/DateTimeField/DateTimeField.js +4 -20
- package/modern/DateTimePicker/DateTimePicker.js +0 -13
- package/modern/DateTimePicker/shared.js +3 -6
- package/modern/DesktopDatePicker/DesktopDatePicker.js +0 -13
- package/modern/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
- package/modern/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/modern/DigitalClock/DigitalClock.js +17 -25
- package/modern/LocalizationProvider/LocalizationProvider.js +0 -6
- package/modern/MobileDatePicker/MobileDatePicker.js +0 -13
- package/modern/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
- package/modern/MobileTimePicker/MobileTimePicker.js +0 -12
- package/modern/MonthCalendar/MonthCalendar.js +3 -7
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/modern/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/modern/PickersCalendarHeader/PickersCalendarHeader.js +13 -19
- package/modern/PickersLayout/PickersLayout.js +0 -12
- package/modern/PickersLayout/usePickerLayout.js +2 -7
- package/modern/StaticDatePicker/StaticDatePicker.js +0 -13
- package/modern/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
- package/modern/StaticTimePicker/StaticTimePicker.js +0 -12
- package/modern/TimeClock/TimeClock.js +3 -20
- package/modern/TimeField/TimeField.js +4 -20
- package/modern/TimePicker/TimePicker.js +0 -12
- package/modern/TimePicker/shared.js +3 -6
- package/modern/YearCalendar/YearCalendar.js +4 -8
- package/modern/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/modern/dateViewRenderers/dateViewRenderers.js +0 -4
- package/modern/hooks/useClearableField.js +5 -7
- package/modern/index.js +4 -1
- package/modern/internals/hooks/useField/useField.utils.js +0 -1
- package/modern/internals/hooks/useField/useFieldState.js +1 -1
- package/modern/internals/index.js +0 -1
- package/modern/internals/utils/getDefaultReferenceDate.js +0 -1
- package/modern/locales/esES.js +6 -7
- package/modern/locales/eu.js +58 -0
- package/modern/locales/index.js +1 -0
- package/modern/timeViewRenderers/timeViewRenderers.js +0 -12
- package/node/AdapterDateFns/AdapterDateFns.js +8 -90
- package/node/AdapterDateFnsJalali/AdapterDateFnsJalali.js +8 -90
- package/node/AdapterDayjs/AdapterDayjs.js +11 -59
- package/node/AdapterLuxon/AdapterLuxon.js +16 -76
- package/node/AdapterMoment/AdapterMoment.js +9 -65
- package/node/AdapterMomentHijri/AdapterMomentHijri.js +1 -30
- package/node/AdapterMomentJalaali/AdapterMomentJalaali.js +1 -40
- package/node/DateCalendar/DateCalendar.js +3 -20
- package/node/DateCalendar/DayCalendar.js +11 -19
- package/node/DateCalendar/index.js +1 -21
- package/node/DateCalendar/useCalendarState.js +1 -2
- package/node/DateField/DateField.js +4 -20
- package/node/DatePicker/DatePicker.js +0 -13
- package/node/DatePicker/shared.js +1 -4
- package/node/DateTimeField/DateTimeField.js +4 -20
- package/node/DateTimePicker/DateTimePicker.js +0 -13
- package/node/DateTimePicker/shared.js +3 -6
- package/node/DesktopDatePicker/DesktopDatePicker.js +0 -13
- package/node/DesktopDateTimePicker/DesktopDateTimePicker.js +0 -13
- package/node/DesktopTimePicker/DesktopTimePicker.js +0 -12
- package/node/DigitalClock/DigitalClock.js +17 -25
- package/node/LocalizationProvider/LocalizationProvider.js +0 -6
- package/node/MobileDatePicker/MobileDatePicker.js +0 -13
- package/node/MobileDateTimePicker/MobileDateTimePicker.js +0 -13
- package/node/MobileTimePicker/MobileTimePicker.js +0 -12
- package/node/MonthCalendar/MonthCalendar.js +3 -7
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.js +7 -18
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClock.utils.js +16 -6
- package/node/MultiSectionDigitalClock/MultiSectionDigitalClockSection.js +13 -10
- package/node/PickersCalendarHeader/PickersCalendarHeader.js +13 -19
- package/node/PickersLayout/PickersLayout.js +0 -12
- package/node/PickersLayout/usePickerLayout.js +2 -7
- package/node/StaticDatePicker/StaticDatePicker.js +0 -13
- package/node/StaticDateTimePicker/StaticDateTimePicker.js +0 -13
- package/node/StaticTimePicker/StaticTimePicker.js +0 -12
- package/node/TimeClock/TimeClock.js +3 -20
- package/node/TimeField/TimeField.js +4 -20
- package/node/TimePicker/TimePicker.js +0 -12
- package/node/TimePicker/shared.js +3 -6
- package/node/YearCalendar/YearCalendar.js +4 -8
- package/node/dateTimeViewRenderers/dateTimeViewRenderers.js +1 -7
- package/node/dateViewRenderers/dateViewRenderers.js +0 -4
- package/node/hooks/useClearableField.js +5 -7
- package/node/index.js +13 -1
- package/node/internals/hooks/useField/useField.utils.js +0 -1
- package/node/internals/hooks/useField/useFieldState.js +1 -1
- package/node/internals/index.js +0 -7
- package/node/internals/utils/getDefaultReferenceDate.js +1 -3
- package/node/locales/esES.js +6 -7
- package/node/locales/eu.js +64 -0
- package/node/locales/index.js +11 -0
- package/node/timeViewRenderers/timeViewRenderers.js +0 -12
- package/package.json +1 -1
- package/themeAugmentation/overrides.d.ts +1 -1
- package/timeViewRenderers/timeViewRenderers.d.ts +3 -3
- package/timeViewRenderers/timeViewRenderers.js +0 -12
- package/internals/utils/slots-migration.d.ts +0 -36
- package/internals/utils/slots-migration.js +0 -13
- package/legacy/internals/utils/slots-migration.js +0 -14
- package/modern/internals/utils/slots-migration.js +0 -13
- package/node/internals/utils/slots-migration.js +0 -21
|
@@ -23,16 +23,14 @@ const useClearableField = ({
|
|
|
23
23
|
InputProps: ForwardedInputProps,
|
|
24
24
|
onClear,
|
|
25
25
|
slots,
|
|
26
|
-
slotProps
|
|
27
|
-
components,
|
|
28
|
-
componentsProps
|
|
26
|
+
slotProps
|
|
29
27
|
}) => {
|
|
30
28
|
const localeText = (0, _internals.useLocaleText)();
|
|
31
|
-
const IconButton = slots?.clearButton ??
|
|
29
|
+
const IconButton = slots?.clearButton ?? _IconButton.default;
|
|
32
30
|
// The spread is here to avoid this bug mui/material-ui#34056
|
|
33
31
|
const _useSlotProps = (0, _utils.useSlotProps)({
|
|
34
32
|
elementType: IconButton,
|
|
35
|
-
externalSlotProps: slotProps?.clearButton
|
|
33
|
+
externalSlotProps: slotProps?.clearButton,
|
|
36
34
|
ownerState: {},
|
|
37
35
|
className: 'clearButton',
|
|
38
36
|
additionalProps: {
|
|
@@ -40,10 +38,10 @@ const useClearableField = ({
|
|
|
40
38
|
}
|
|
41
39
|
}),
|
|
42
40
|
iconButtonProps = (0, _objectWithoutPropertiesLoose2.default)(_useSlotProps, _excluded);
|
|
43
|
-
const EndClearIcon = slots?.clearIcon ??
|
|
41
|
+
const EndClearIcon = slots?.clearIcon ?? _icons.ClearIcon;
|
|
44
42
|
const endClearIconProps = (0, _utils.useSlotProps)({
|
|
45
43
|
elementType: EndClearIcon,
|
|
46
|
-
externalSlotProps: slotProps?.clearIcon
|
|
44
|
+
externalSlotProps: slotProps?.clearIcon,
|
|
47
45
|
ownerState: {}
|
|
48
46
|
});
|
|
49
47
|
const InputProps = (0, _extends2.default)({}, ForwardedInputProps, {
|
package/node/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @mui/x-date-pickers
|
|
2
|
+
* @mui/x-date-pickers v7.0.0-alpha.1
|
|
3
3
|
*
|
|
4
4
|
* @license MIT
|
|
5
5
|
* This source code is licensed under the MIT license found in the
|
|
@@ -379,6 +379,18 @@ Object.keys(_PickersShortcuts).forEach(function (key) {
|
|
|
379
379
|
}
|
|
380
380
|
});
|
|
381
381
|
});
|
|
382
|
+
var _PickersCalendarHeader = require("./PickersCalendarHeader");
|
|
383
|
+
Object.keys(_PickersCalendarHeader).forEach(function (key) {
|
|
384
|
+
if (key === "default" || key === "__esModule") return;
|
|
385
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
386
|
+
if (key in exports && exports[key] === _PickersCalendarHeader[key]) return;
|
|
387
|
+
Object.defineProperty(exports, key, {
|
|
388
|
+
enumerable: true,
|
|
389
|
+
get: function () {
|
|
390
|
+
return _PickersCalendarHeader[key];
|
|
391
|
+
}
|
|
392
|
+
});
|
|
393
|
+
});
|
|
382
394
|
var _utils = require("./internals/utils/utils");
|
|
383
395
|
var _models = require("./models");
|
|
384
396
|
Object.keys(_models).forEach(function (key) {
|
|
@@ -375,7 +375,6 @@ const splitFormatIntoSections = (utils, timezone, localeText, format, date, form
|
|
|
375
375
|
maxLength,
|
|
376
376
|
value: sectionValue,
|
|
377
377
|
placeholder: getSectionPlaceholder(utils, timezone, localeText, sectionConfig, token),
|
|
378
|
-
hasLeadingZeros: hasLeadingZerosInFormat,
|
|
379
378
|
hasLeadingZerosInFormat,
|
|
380
379
|
hasLeadingZerosInInput,
|
|
381
380
|
startSeparator: sections.length === 0 ? startSeparator : '',
|
|
@@ -258,7 +258,7 @@ const useFieldState = params => {
|
|
|
258
258
|
}, [format, utils.locale]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
259
259
|
|
|
260
260
|
React.useEffect(() => {
|
|
261
|
-
let shouldUpdate
|
|
261
|
+
let shouldUpdate;
|
|
262
262
|
if (!valueManager.areValuesEqual(utils, state.value, valueFromTheOutside)) {
|
|
263
263
|
shouldUpdate = true;
|
|
264
264
|
} else {
|
package/node/internals/index.js
CHANGED
|
@@ -171,12 +171,6 @@ Object.defineProperty(exports, "splitFieldInternalAndForwardedProps", {
|
|
|
171
171
|
return _fields.splitFieldInternalAndForwardedProps;
|
|
172
172
|
}
|
|
173
173
|
});
|
|
174
|
-
Object.defineProperty(exports, "uncapitalizeObjectKeys", {
|
|
175
|
-
enumerable: true,
|
|
176
|
-
get: function () {
|
|
177
|
-
return _slotsMigration.uncapitalizeObjectKeys;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
174
|
Object.defineProperty(exports, "useCalendarState", {
|
|
181
175
|
enumerable: true,
|
|
182
176
|
get: function () {
|
|
@@ -307,6 +301,5 @@ var _validateDate = require("./utils/validation/validateDate");
|
|
|
307
301
|
var _validateDateTime = require("./utils/validation/validateDateTime");
|
|
308
302
|
var _validateTime = require("./utils/validation/validateTime");
|
|
309
303
|
var _warning = require("./utils/warning");
|
|
310
|
-
var _slotsMigration = require("./utils/slots-migration");
|
|
311
304
|
var _DayCalendar = require("../DateCalendar/DayCalendar");
|
|
312
305
|
var _useCalendarState = require("../DateCalendar/useCalendarState");
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.getSectionTypeGranularity = exports.getDefaultReferenceDate = exports.SECTION_TYPE_GRANULARITY = void 0;
|
|
7
7
|
var _timeUtils = require("./time-utils");
|
|
8
8
|
var _dateUtils = require("./date-utils");
|
|
9
9
|
const SECTION_TYPE_GRANULARITY = exports.SECTION_TYPE_GRANULARITY = {
|
|
@@ -17,8 +17,6 @@ const SECTION_TYPE_GRANULARITY = exports.SECTION_TYPE_GRANULARITY = {
|
|
|
17
17
|
};
|
|
18
18
|
const getSectionTypeGranularity = sections => Math.max(...sections.map(section => SECTION_TYPE_GRANULARITY[section.type] ?? 1));
|
|
19
19
|
exports.getSectionTypeGranularity = getSectionTypeGranularity;
|
|
20
|
-
const getViewsGranularity = views => Math.max(...views.map(view => SECTION_TYPE_GRANULARITY[view] ?? 1));
|
|
21
|
-
exports.getViewsGranularity = getViewsGranularity;
|
|
22
20
|
const roundDate = (utils, granularity, date) => {
|
|
23
21
|
if (granularity === SECTION_TYPE_GRANULARITY.year) {
|
|
24
22
|
return utils.startOfYear(date);
|
package/node/locales/esES.js
CHANGED
|
@@ -33,7 +33,7 @@ const esESPickers = {
|
|
|
33
33
|
timePickerToolbarTitle: 'Seleccionar hora',
|
|
34
34
|
dateRangePickerToolbarTitle: 'Seleccionar rango de fecha',
|
|
35
35
|
// Clock labels
|
|
36
|
-
clockLabelText: (view, time, adapter) => `Seleccione ${views[view]}. ${time === null ? '
|
|
36
|
+
clockLabelText: (view, time, adapter) => `Seleccione ${views[view]}. ${time === null ? 'No hay hora seleccionada' : `La hora seleccionada es ${adapter.format(time, 'fullTime')}`}`,
|
|
37
37
|
hoursClockNumberText: hours => `${hours} horas`,
|
|
38
38
|
minutesClockNumberText: minutes => `${minutes} minutos`,
|
|
39
39
|
secondsClockNumberText: seconds => `${seconds} segundos`,
|
|
@@ -45,13 +45,12 @@ const esESPickers = {
|
|
|
45
45
|
calendarWeekNumberAriaLabelText: weekNumber => `Semana ${weekNumber}`,
|
|
46
46
|
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
47
47
|
// Open picker labels
|
|
48
|
-
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige
|
|
49
|
-
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige fecha, la fecha elegida es ${utils.format(value, 'fullDate')}` : 'Elige fecha',
|
|
49
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Elige hora, la hora elegida es ${utils.format(value, 'fullTime')}` : 'Elige hora',
|
|
50
|
+
fieldClearLabel: 'Limpiar valor',
|
|
52
51
|
// Table labels
|
|
53
|
-
timeTableLabel: 'elige
|
|
54
|
-
dateTableLabel: 'elige
|
|
52
|
+
timeTableLabel: 'elige hora',
|
|
53
|
+
dateTableLabel: 'elige fecha',
|
|
55
54
|
// Field section placeholders
|
|
56
55
|
fieldYearPlaceholder: params => 'A'.repeat(params.digitAmount),
|
|
57
56
|
fieldMonthPlaceholder: params => params.contentType === 'letter' ? 'MMMM' : 'MM',
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.eu = void 0;
|
|
7
|
+
var _getPickersLocalization = require("./utils/getPickersLocalization");
|
|
8
|
+
const views = {
|
|
9
|
+
hours: 'orduak',
|
|
10
|
+
minutes: 'minutuak',
|
|
11
|
+
seconds: 'segunduak',
|
|
12
|
+
meridiem: 'meridianoa'
|
|
13
|
+
};
|
|
14
|
+
const euPickers = {
|
|
15
|
+
// Calendar navigation
|
|
16
|
+
previousMonth: 'Azken hilabetea',
|
|
17
|
+
nextMonth: 'Hurrengo hilabetea',
|
|
18
|
+
// View navigation
|
|
19
|
+
openPreviousView: 'azken bista ireki',
|
|
20
|
+
openNextView: 'hurrengo bista ireki',
|
|
21
|
+
calendarViewSwitchingButtonAriaLabel: view => view === 'year' ? 'urteko bista irekita dago, aldatu egutegi bistara' : 'egutegi bista irekita dago, aldatu urteko bistara',
|
|
22
|
+
// DateRange placeholders
|
|
23
|
+
start: 'Hasi',
|
|
24
|
+
end: 'Bukatu',
|
|
25
|
+
// Action bar
|
|
26
|
+
cancelButtonLabel: 'Utxi',
|
|
27
|
+
clearButtonLabel: 'Garbitu',
|
|
28
|
+
okButtonLabel: 'OK',
|
|
29
|
+
todayButtonLabel: 'Gaur',
|
|
30
|
+
// Toolbar titles
|
|
31
|
+
datePickerToolbarTitle: 'Data aukeratu',
|
|
32
|
+
dateTimePickerToolbarTitle: 'Data eta ordua aukeratu',
|
|
33
|
+
timePickerToolbarTitle: 'Ordua aukeratu',
|
|
34
|
+
dateRangePickerToolbarTitle: 'Data tartea aukeratu',
|
|
35
|
+
// Clock labels
|
|
36
|
+
clockLabelText: (view, time, adapter) => `Aukeratu ${views[view]}. ${time === null ? 'Ez da ordurik aukertau' : `Aukeratutako ordua ${adapter.format(time, 'fullTime')} da`}`,
|
|
37
|
+
hoursClockNumberText: hours => `${hours} ordu`,
|
|
38
|
+
minutesClockNumberText: minutes => `${minutes} minutu`,
|
|
39
|
+
secondsClockNumberText: seconds => `${seconds} segundu`,
|
|
40
|
+
// Digital clock labels
|
|
41
|
+
selectViewText: view => `Aukeratu ${views[view]}`,
|
|
42
|
+
// Calendar labels
|
|
43
|
+
calendarWeekNumberHeaderLabel: 'Astea zenbakia',
|
|
44
|
+
calendarWeekNumberHeaderText: '#',
|
|
45
|
+
calendarWeekNumberAriaLabelText: weekNumber => `${weekNumber} astea`,
|
|
46
|
+
calendarWeekNumberText: weekNumber => `${weekNumber}`,
|
|
47
|
+
// Open picker labels
|
|
48
|
+
openDatePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Data aukeratu, aukeratutako data ${utils.format(value, 'fullDate')} da` : 'Data aukeratu',
|
|
49
|
+
openTimePickerDialogue: (value, utils) => value !== null && utils.isValid(value) ? `Ordua aukeratu, aukeratutako ordua ${utils.format(value, 'fullTime')} da` : 'Ordua aukeratu',
|
|
50
|
+
fieldClearLabel: 'Balioa garbitu',
|
|
51
|
+
// Table labels
|
|
52
|
+
timeTableLabel: 'ordua aukeratu',
|
|
53
|
+
dateTableLabel: 'data aukeratu',
|
|
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 eu = exports.eu = (0, _getPickersLocalization.getPickersLocalization)(euPickers);
|
package/node/locales/index.js
CHANGED
|
@@ -80,6 +80,17 @@ Object.keys(_esES).forEach(function (key) {
|
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
});
|
|
83
|
+
var _eu = require("./eu");
|
|
84
|
+
Object.keys(_eu).forEach(function (key) {
|
|
85
|
+
if (key === "default" || key === "__esModule") return;
|
|
86
|
+
if (key in exports && exports[key] === _eu[key]) return;
|
|
87
|
+
Object.defineProperty(exports, key, {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return _eu[key];
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
});
|
|
83
94
|
var _faIR = require("./faIR");
|
|
84
95
|
Object.keys(_faIR).forEach(function (key) {
|
|
85
96
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -33,8 +33,6 @@ const renderTimeViewClock = ({
|
|
|
33
33
|
minutesStep,
|
|
34
34
|
ampm,
|
|
35
35
|
ampmInClock,
|
|
36
|
-
components,
|
|
37
|
-
componentsProps,
|
|
38
36
|
slots,
|
|
39
37
|
slotProps,
|
|
40
38
|
readOnly,
|
|
@@ -65,8 +63,6 @@ const renderTimeViewClock = ({
|
|
|
65
63
|
minutesStep: minutesStep,
|
|
66
64
|
ampm: ampm,
|
|
67
65
|
ampmInClock: ampmInClock,
|
|
68
|
-
components: components,
|
|
69
|
-
componentsProps: componentsProps,
|
|
70
66
|
slots: slots,
|
|
71
67
|
slotProps: slotProps,
|
|
72
68
|
readOnly: readOnly,
|
|
@@ -98,8 +94,6 @@ const renderDigitalClockTimeView = ({
|
|
|
98
94
|
shouldDisableClock,
|
|
99
95
|
minutesStep,
|
|
100
96
|
ampm,
|
|
101
|
-
components,
|
|
102
|
-
componentsProps,
|
|
103
97
|
slots,
|
|
104
98
|
slotProps,
|
|
105
99
|
readOnly,
|
|
@@ -130,8 +124,6 @@ const renderDigitalClockTimeView = ({
|
|
|
130
124
|
shouldDisableClock: shouldDisableClock,
|
|
131
125
|
minutesStep: minutesStep,
|
|
132
126
|
ampm: ampm,
|
|
133
|
-
components: components,
|
|
134
|
-
componentsProps: componentsProps,
|
|
135
127
|
slots: slots,
|
|
136
128
|
slotProps: slotProps,
|
|
137
129
|
readOnly: readOnly,
|
|
@@ -164,8 +156,6 @@ const renderMultiSectionDigitalClockTimeView = ({
|
|
|
164
156
|
shouldDisableClock,
|
|
165
157
|
minutesStep,
|
|
166
158
|
ampm,
|
|
167
|
-
components,
|
|
168
|
-
componentsProps,
|
|
169
159
|
slots,
|
|
170
160
|
slotProps,
|
|
171
161
|
readOnly,
|
|
@@ -196,8 +186,6 @@ const renderMultiSectionDigitalClockTimeView = ({
|
|
|
196
186
|
shouldDisableClock: shouldDisableClock,
|
|
197
187
|
minutesStep: minutesStep,
|
|
198
188
|
ampm: ampm,
|
|
199
|
-
components: components,
|
|
200
|
-
componentsProps: componentsProps,
|
|
201
189
|
slots: slots,
|
|
202
190
|
slotProps: slotProps,
|
|
203
191
|
readOnly: readOnly,
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DateCalendarClassKey,
|
|
3
3
|
DayCalendarClassKey,
|
|
4
|
-
PickersCalendarHeaderClassKey,
|
|
5
4
|
PickersFadeTransitionGroupClassKey,
|
|
6
5
|
PickersSlideTransitionClassKey,
|
|
7
6
|
} from '../DateCalendar';
|
|
7
|
+
import { PickersCalendarHeaderClassKey } from '../PickersCalendarHeader';
|
|
8
8
|
import { DayCalendarSkeletonClassKey } from '../DayCalendarSkeleton';
|
|
9
9
|
import {
|
|
10
10
|
ClockClassKey,
|
|
@@ -11,6 +11,6 @@ export type TimeViewRendererProps<TView extends TimeViewWithMeridiem, TComponent
|
|
|
11
11
|
onViewChange?: (view: TView) => void;
|
|
12
12
|
views: readonly TView[];
|
|
13
13
|
};
|
|
14
|
-
export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, ampmInClock,
|
|
15
|
-
export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm,
|
|
16
|
-
export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm,
|
|
14
|
+
export declare const renderTimeViewClock: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, ampmInClock, slots, slotProps, readOnly, disabled, sx, autoFocus, showViewSwitcher, disableIgnoringDatePartForTimeValidation, timezone, }: TimeViewRendererProps<TimeView, TimeClockProps<TDate, TimeView>>) => React.JSX.Element;
|
|
15
|
+
export declare const renderDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<"hours", Omit<DigitalClockProps<TDate>, "timeStep"> & Pick<TimePickerProps<TDate>, "timeSteps">>) => React.JSX.Element;
|
|
16
|
+
export declare const renderMultiSectionDigitalClockTimeView: <TDate extends unknown>({ view, onViewChange, focusedView, onFocusedViewChange, views, value, defaultValue, referenceDate, onChange, className, classes, disableFuture, disablePast, minTime, maxTime, shouldDisableTime, shouldDisableClock, minutesStep, ampm, slots, slotProps, readOnly, disabled, sx, autoFocus, disableIgnoringDatePartForTimeValidation, timeSteps, skipDisabled, timezone, }: TimeViewRendererProps<TimeViewWithMeridiem, MultiSectionDigitalClockProps<TDate>>) => React.JSX.Element;
|
|
@@ -25,8 +25,6 @@ export const renderTimeViewClock = ({
|
|
|
25
25
|
minutesStep,
|
|
26
26
|
ampm,
|
|
27
27
|
ampmInClock,
|
|
28
|
-
components,
|
|
29
|
-
componentsProps,
|
|
30
28
|
slots,
|
|
31
29
|
slotProps,
|
|
32
30
|
readOnly,
|
|
@@ -57,8 +55,6 @@ export const renderTimeViewClock = ({
|
|
|
57
55
|
minutesStep: minutesStep,
|
|
58
56
|
ampm: ampm,
|
|
59
57
|
ampmInClock: ampmInClock,
|
|
60
|
-
components: components,
|
|
61
|
-
componentsProps: componentsProps,
|
|
62
58
|
slots: slots,
|
|
63
59
|
slotProps: slotProps,
|
|
64
60
|
readOnly: readOnly,
|
|
@@ -89,8 +85,6 @@ export const renderDigitalClockTimeView = ({
|
|
|
89
85
|
shouldDisableClock,
|
|
90
86
|
minutesStep,
|
|
91
87
|
ampm,
|
|
92
|
-
components,
|
|
93
|
-
componentsProps,
|
|
94
88
|
slots,
|
|
95
89
|
slotProps,
|
|
96
90
|
readOnly,
|
|
@@ -121,8 +115,6 @@ export const renderDigitalClockTimeView = ({
|
|
|
121
115
|
shouldDisableClock: shouldDisableClock,
|
|
122
116
|
minutesStep: minutesStep,
|
|
123
117
|
ampm: ampm,
|
|
124
|
-
components: components,
|
|
125
|
-
componentsProps: componentsProps,
|
|
126
118
|
slots: slots,
|
|
127
119
|
slotProps: slotProps,
|
|
128
120
|
readOnly: readOnly,
|
|
@@ -154,8 +146,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
|
|
|
154
146
|
shouldDisableClock,
|
|
155
147
|
minutesStep,
|
|
156
148
|
ampm,
|
|
157
|
-
components,
|
|
158
|
-
componentsProps,
|
|
159
149
|
slots,
|
|
160
150
|
slotProps,
|
|
161
151
|
readOnly,
|
|
@@ -186,8 +176,6 @@ export const renderMultiSectionDigitalClockTimeView = ({
|
|
|
186
176
|
shouldDisableClock: shouldDisableClock,
|
|
187
177
|
minutesStep: minutesStep,
|
|
188
178
|
ampm: ampm,
|
|
189
|
-
components: components,
|
|
190
|
-
componentsProps: componentsProps,
|
|
191
179
|
slots: slots,
|
|
192
180
|
slotProps: slotProps,
|
|
193
181
|
readOnly: readOnly,
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
type OptionalKeys<T extends object> = Exclude<{
|
|
2
|
-
[K in keyof T]: {} extends Pick<T, K> ? K : never;
|
|
3
|
-
}[keyof T], undefined>;
|
|
4
|
-
type UncapitalizeKeys<T extends object> = Uncapitalize<keyof T & string>;
|
|
5
|
-
export type UncapitalizeObjectKeys<T extends object> = {
|
|
6
|
-
[key in UncapitalizeKeys<Pick<T, OptionalKeys<T>>>]?: Capitalize<key> extends keyof T ? T[Capitalize<key>] : never;
|
|
7
|
-
} & {
|
|
8
|
-
[key in UncapitalizeKeys<Omit<T, OptionalKeys<T>>>]: Capitalize<key> extends keyof T ? T[Capitalize<key>] : never;
|
|
9
|
-
};
|
|
10
|
-
export interface SlotsAndSlotProps<TSlots extends object, TSlotProps> {
|
|
11
|
-
/**
|
|
12
|
-
* Overridable components.
|
|
13
|
-
* @default {}
|
|
14
|
-
* @deprecated Please use `slots`.
|
|
15
|
-
*/
|
|
16
|
-
components?: TSlots;
|
|
17
|
-
/**
|
|
18
|
-
* The props used for each component slot.
|
|
19
|
-
* @default {}
|
|
20
|
-
* @deprecated Please use `slotProps`.
|
|
21
|
-
*/
|
|
22
|
-
componentsProps?: TSlotProps;
|
|
23
|
-
/**
|
|
24
|
-
* Overridable component slots.
|
|
25
|
-
* @default {}
|
|
26
|
-
*/
|
|
27
|
-
slots?: UncapitalizeObjectKeys<TSlots>;
|
|
28
|
-
/**
|
|
29
|
-
* The props used for each component slot.
|
|
30
|
-
* @default {}
|
|
31
|
-
*/
|
|
32
|
-
slotProps?: TSlotProps;
|
|
33
|
-
}
|
|
34
|
-
type ObjectWithUnCapitalizedKeys<TInputType> = TInputType extends object ? UncapitalizeObjectKeys<TInputType> : undefined;
|
|
35
|
-
export declare const uncapitalizeObjectKeys: <TInputType extends object>(capitalizedObject: TInputType | undefined) => ObjectWithUnCapitalizedKeys<TInputType> | undefined;
|
|
36
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
// TODO v7: This file exist only to simplify typing between
|
|
3
|
-
// components/componentsProps and slots/slotProps
|
|
4
|
-
// Should be deleted when components/componentsProps are removed
|
|
5
|
-
|
|
6
|
-
export const uncapitalizeObjectKeys = capitalizedObject => {
|
|
7
|
-
if (capitalizedObject === undefined) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
|
|
11
|
-
[`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
|
|
12
|
-
}), {});
|
|
13
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
-
// TODO v7: This file exist only to simplify typing between
|
|
4
|
-
// components/componentsProps and slots/slotProps
|
|
5
|
-
// Should be deleted when components/componentsProps are removed
|
|
6
|
-
|
|
7
|
-
export var uncapitalizeObjectKeys = function uncapitalizeObjectKeys(capitalizedObject) {
|
|
8
|
-
if (capitalizedObject === undefined) {
|
|
9
|
-
return undefined;
|
|
10
|
-
}
|
|
11
|
-
return Object.keys(capitalizedObject).reduce(function (acc, key) {
|
|
12
|
-
return _extends({}, acc, _defineProperty({}, "".concat(key.slice(0, 1).toLowerCase()).concat(key.slice(1)), capitalizedObject[key]));
|
|
13
|
-
}, {});
|
|
14
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
-
// TODO v7: This file exist only to simplify typing between
|
|
3
|
-
// components/componentsProps and slots/slotProps
|
|
4
|
-
// Should be deleted when components/componentsProps are removed
|
|
5
|
-
|
|
6
|
-
export const uncapitalizeObjectKeys = capitalizedObject => {
|
|
7
|
-
if (capitalizedObject === undefined) {
|
|
8
|
-
return undefined;
|
|
9
|
-
}
|
|
10
|
-
return Object.keys(capitalizedObject).reduce((acc, key) => _extends({}, acc, {
|
|
11
|
-
[`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
|
|
12
|
-
}), {});
|
|
13
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.uncapitalizeObjectKeys = void 0;
|
|
8
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
-
// TODO v7: This file exist only to simplify typing between
|
|
10
|
-
// components/componentsProps and slots/slotProps
|
|
11
|
-
// Should be deleted when components/componentsProps are removed
|
|
12
|
-
|
|
13
|
-
const uncapitalizeObjectKeys = capitalizedObject => {
|
|
14
|
-
if (capitalizedObject === undefined) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
return Object.keys(capitalizedObject).reduce((acc, key) => (0, _extends2.default)({}, acc, {
|
|
18
|
-
[`${key.slice(0, 1).toLowerCase()}${key.slice(1)}`]: capitalizedObject[key]
|
|
19
|
-
}), {});
|
|
20
|
-
};
|
|
21
|
-
exports.uncapitalizeObjectKeys = uncapitalizeObjectKeys;
|