@elliemae/ds-form-date-time-picker 3.15.0 → 3.16.0-next.10
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/dist/cjs/ControlledDateTimePicker.js +7 -7
- package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/ControlledDateTimePickerCTX.js.map +1 -1
- package/dist/cjs/config/useChangeHandlers.js +4 -4
- package/dist/cjs/config/useChangeHandlers.js.map +2 -2
- package/dist/cjs/config/useControlledDateTimePicker.js +13 -13
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useFocusTracker.js.map +1 -1
- package/dist/cjs/config/useGetDestructuredValues.js +3 -3
- package/dist/cjs/config/useGetDestructuredValues.js.map +1 -1
- package/dist/cjs/config/useGetFlags.js +8 -8
- package/dist/cjs/config/useGetFlags.js.map +2 -2
- package/dist/cjs/config/useGetPropsBasedOnType.js +1 -1
- package/dist/cjs/config/useGetPropsBasedOnType.js.map +1 -1
- package/dist/cjs/config/useGetPropsWithDefault.js +3 -3
- package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/cjs/config/useGetReferences.js.map +1 -1
- package/dist/cjs/config/useGlobalKeyHandlers.js +3 -3
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +1 -1
- package/dist/cjs/config/useRelevantValueFromProps.js +2 -2
- package/dist/cjs/config/useRelevantValueFromProps.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js +3 -3
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/index.js +9 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/ClearButton/ClearButton.js +12 -6
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/cjs/parts/ClearButton/useClearButton.js +1 -1
- package/dist/cjs/parts/ClearButton/useClearButton.js.map +1 -1
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +15 -8
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/cjs/parts/DateInputs/DDInput.js +6 -4
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +30 -12
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/cjs/parts/DateInputs/MMInput.js +6 -4
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +6 -4
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/useDateInputs.js +5 -5
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Calendar.js +5 -5
- package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +15 -7
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +19 -5
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +40 -7
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +20 -6
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +12 -6
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Day.js +11 -7
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js +5 -5
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +1 -1
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +6 -6
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +13 -7
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +11 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +13 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +12 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +4 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
- package/dist/cjs/parts/Pickers/PickersIcons.js +5 -5
- package/dist/cjs/parts/Pickers/PickersIcons.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +28 -7
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +28 -6
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +28 -7
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js +5 -5
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +26 -9
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +19 -5
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +20 -6
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +12 -6
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +4 -4
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
- package/dist/cjs/parts/Styleds.js +1 -1
- package/dist/cjs/parts/Styleds.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/HHInput.js +6 -4
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +6 -4
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +6 -4
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +30 -12
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js +2 -2
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +1 -1
- package/dist/cjs/propTypes.js +28 -26
- package/dist/cjs/propTypes.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/tests/custom-props/customProps.js +233 -0
- package/dist/cjs/tests/custom-props/customProps.js.map +7 -0
- package/dist/cjs/utils/dateHelpers.js +3 -3
- package/dist/cjs/utils/dateHelpers.js.map +1 -1
- package/dist/cjs/utils/dateTimeHelpers.js +2 -2
- package/dist/cjs/utils/dateTimeHelpers.js.map +1 -1
- package/dist/cjs/utils/hooks/useGetDayFromDateString.js +2 -2
- package/dist/cjs/utils/hooks/useGetDayFromDateString.js.map +1 -1
- package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +2 -2
- package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +1 -1
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js +5 -5
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js.map +1 -1
- package/dist/cjs/utils/stringHelpers.js +2 -2
- package/dist/cjs/utils/stringHelpers.js.map +1 -1
- package/dist/cjs/utils/timeHelpers.js +1 -1
- package/dist/cjs/utils/timeHelpers.js.map +1 -1
- package/dist/cjs/utils/typeGuards.js.map +1 -1
- package/dist/esm/ControlledDateTimePicker.js +6 -6
- package/dist/esm/ControlledDateTimePicker.js.map +1 -1
- package/dist/esm/ControlledDateTimePickerCTX.js.map +1 -1
- package/dist/esm/config/useChangeHandlers.js +4 -4
- package/dist/esm/config/useChangeHandlers.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +11 -11
- package/dist/esm/config/useControlledDateTimePicker.js.map +1 -1
- package/dist/esm/config/useFocusTracker.js.map +1 -1
- package/dist/esm/config/useGetDestructuredValues.js +3 -3
- package/dist/esm/config/useGetDestructuredValues.js.map +1 -1
- package/dist/esm/config/useGetFlags.js +8 -8
- package/dist/esm/config/useGetFlags.js.map +2 -2
- package/dist/esm/config/useGetPropsBasedOnType.js +1 -1
- package/dist/esm/config/useGetPropsBasedOnType.js.map +1 -1
- package/dist/esm/config/useGetPropsWithDefault.js +2 -2
- package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
- package/dist/esm/config/useGetReferences.js.map +1 -1
- package/dist/esm/config/useGlobalKeyHandlers.js +3 -3
- package/dist/esm/config/useGlobalKeyHandlers.js.map +1 -1
- package/dist/esm/config/useRelevantValueFromProps.js +2 -2
- package/dist/esm/config/useRelevantValueFromProps.js.map +1 -1
- package/dist/esm/config/useValidateProps.js +3 -3
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/index.js +9 -9
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +7 -0
- package/dist/esm/parts/ClearButton/ClearButton.js +12 -6
- package/dist/esm/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/esm/parts/ClearButton/useClearButton.js +1 -1
- package/dist/esm/parts/ClearButton/useClearButton.js.map +1 -1
- package/dist/esm/parts/ControlledDateTimePickerContent.js +15 -8
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/esm/parts/DateInputs/DDInput.js +6 -4
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +30 -12
- package/dist/esm/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/esm/parts/DateInputs/MMInput.js +6 -4
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +6 -4
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/useDateInputs.js +5 -5
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Calendar.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarBody.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +15 -7
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarContext.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +19 -5
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +40 -7
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +20 -6
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarWeekDays.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +12 -6
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/Day.js +11 -7
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Styleds.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +2 -2
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +1 -1
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +6 -6
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +13 -7
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +11 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +13 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +12 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +4 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
- package/dist/esm/parts/Pickers/PickersIcons.js +5 -5
- package/dist/esm/parts/Pickers/PickersIcons.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +28 -7
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +28 -6
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +28 -7
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js +5 -5
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheel.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +26 -9
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContext.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +19 -5
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +20 -6
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +12 -6
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +4 -4
- package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
- package/dist/esm/parts/Styleds.js +1 -1
- package/dist/esm/parts/Styleds.js.map +1 -1
- package/dist/esm/parts/TimeInputs/HHInput.js +6 -4
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +6 -4
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +6 -4
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +30 -12
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/esm/parts/TimeInputs/useTimeInputs.js +2 -2
- package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +1 -1
- package/dist/esm/propTypes.js +9 -2
- package/dist/esm/propTypes.js.map +2 -2
- package/dist/esm/tests/custom-props/customProps.js +207 -0
- package/dist/esm/tests/custom-props/customProps.js.map +7 -0
- package/dist/esm/utils/dateHelpers.js +3 -3
- package/dist/esm/utils/dateHelpers.js.map +1 -1
- package/dist/esm/utils/dateTimeHelpers.js +2 -2
- package/dist/esm/utils/dateTimeHelpers.js.map +1 -1
- package/dist/esm/utils/hooks/useGetDayFromDateString.js +2 -2
- package/dist/esm/utils/hooks/useGetDayFromDateString.js.map +1 -1
- package/dist/esm/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +2 -2
- package/dist/esm/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +1 -1
- package/dist/esm/utils/hooks/useGetStartingFocusedDay.js +5 -5
- package/dist/esm/utils/hooks/useGetStartingFocusedDay.js.map +1 -1
- package/dist/esm/utils/stringHelpers.js +2 -2
- package/dist/esm/utils/stringHelpers.js.map +1 -1
- package/dist/esm/utils/timeHelpers.js +1 -1
- package/dist/esm/utils/timeHelpers.js.map +1 -1
- package/dist/esm/utils/typeGuards.js.map +1 -1
- package/package.json +10 -9
- package/dist/types/ControlledDateTimePicker.d.ts +0 -7
- package/dist/types/ControlledDateTimePickerCTX.d.ts +0 -5
- package/dist/types/ControlledDateTimePickerDatatestid.d.ts +0 -63
- package/dist/types/ControlledDateTimePickerTypes.d.ts +0 -20
- package/dist/types/config/useChangeHandlers.d.ts +0 -27
- package/dist/types/config/useControlledDateTimePicker.d.ts +0 -16
- package/dist/types/config/useFocusTracker.d.ts +0 -38
- package/dist/types/config/useGetDestructuredValues.d.ts +0 -30
- package/dist/types/config/useGetFlags.d.ts +0 -30
- package/dist/types/config/useGetPropsBasedOnType.d.ts +0 -28
- package/dist/types/config/useGetPropsWithDefault.d.ts +0 -2
- package/dist/types/config/useGetReferences.d.ts +0 -33
- package/dist/types/config/useGlobalKeyHandlers.d.ts +0 -18
- package/dist/types/config/useRelevantValueFromProps.d.ts +0 -10
- package/dist/types/config/useValidateProps.d.ts +0 -2
- package/dist/types/exported-related/theming.d.ts +0 -37
- package/dist/types/index.d.ts +0 -9
- package/dist/types/parts/ClearButton/ClearButton.d.ts +0 -1
- package/dist/types/parts/ClearButton/useClearButton.d.ts +0 -11
- package/dist/types/parts/ControlledDateTimePickerContent.d.ts +0 -1
- package/dist/types/parts/DateInputs/DDInput.d.ts +0 -16
- package/dist/types/parts/DateInputs/DateInputs.d.ts +0 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +0 -18
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +0 -16
- package/dist/types/parts/DateInputs/useDateInputs.d.ts +0 -2
- package/dist/types/parts/Pickers/Calendar/Calendar.d.ts +0 -4
- package/dist/types/parts/Pickers/Calendar/CalendarBody.d.ts +0 -6
- package/dist/types/parts/Pickers/Calendar/CalendarContent.d.ts +0 -3
- package/dist/types/parts/Pickers/Calendar/CalendarContext.d.ts +0 -6
- package/dist/types/parts/Pickers/Calendar/CalendarDaysList.d.ts +0 -9
- package/dist/types/parts/Pickers/Calendar/CalendarFooter.d.ts +0 -2
- package/dist/types/parts/Pickers/Calendar/CalendarHead.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarMonthDays.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/CalendarWeekDays.d.ts +0 -2
- package/dist/types/parts/Pickers/Calendar/CalendarWrapper.d.ts +0 -1
- package/dist/types/parts/Pickers/Calendar/Day.d.ts +0 -8
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +0 -21
- package/dist/types/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +0 -14
- package/dist/types/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.d.ts +0 -15
- package/dist/types/parts/Pickers/Calendar/useFocusLogic.d.ts +0 -14
- package/dist/types/parts/Pickers/Calendar/useKeyboardHandlers.d.ts +0 -19
- package/dist/types/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +0 -16
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.d.ts +0 -6
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.d.ts +0 -2
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.d.ts +0 -1
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/Styleds.d.ts +0 -7
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.d.ts +0 -14
- package/dist/types/parts/Pickers/PickersIcons.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/HoursList.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/MeridiemList.d.ts +0 -2
- package/dist/types/parts/Pickers/TimeWheel/MinutesList.d.ts +0 -2
- package/dist/types/parts/Pickers/TimeWheel/TimeWheel.d.ts +0 -4
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelContent.d.ts +0 -2
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelContext.d.ts +0 -6
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelFooter.d.ts +0 -2
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelIconTrigger.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/TimeWheelWrapper.d.ts +0 -1
- package/dist/types/parts/Pickers/TimeWheel/useConfigTimePickerCTX.d.ts +0 -5
- package/dist/types/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.d.ts +0 -17
- package/dist/types/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +0 -13
- package/dist/types/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +0 -12
- package/dist/types/parts/Styleds.d.ts +0 -13
- package/dist/types/parts/TimeInputs/HHInput.d.ts +0 -17
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +0 -16
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +0 -16
- package/dist/types/parts/TimeInputs/TimeInputs.d.ts +0 -1
- package/dist/types/parts/TimeInputs/useTimeInputs.d.ts +0 -22
- package/dist/types/parts/config.d.ts +0 -5
- package/dist/types/propTypes.d.ts +0 -97
- package/dist/types/sharedTypes.d.ts +0 -95
- package/dist/types/tests/date-time-picker.auto-advance.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.clear-button.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.keyboard-focus.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.keyboard.data-entry-typing.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.keyboard.fill-with-now.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.keyboard.regressive-backspace.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.keyboard.shortcut-clear.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.manual-delete-values.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.onChange-meta-info.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.types-button.test.d.ts +0 -1
- package/dist/types/tests/date-time-picker.types-dom.test.d.ts +0 -1
- package/dist/types/utils/constants.d.ts +0 -38
- package/dist/types/utils/dateHelpers.d.ts +0 -40
- package/dist/types/utils/dateTimeHelpers.d.ts +0 -8
- package/dist/types/utils/hooks/useGetDayFromDateString.d.ts +0 -1
- package/dist/types/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.d.ts +0 -5
- package/dist/types/utils/hooks/useGetStartingFocusedDay.d.ts +0 -8
- package/dist/types/utils/hooks/useOnClickOutside.d.ts +0 -1
- package/dist/types/utils/numberHelpers.d.ts +0 -1
- package/dist/types/utils/stringHelpers.d.ts +0 -36
- package/dist/types/utils/timeHelpers.d.ts +0 -2
- package/dist/types/utils/typeGuards.d.ts +0 -4
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/tests/custom-props/customProps.js"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable import/extensions */\nimport { ControlledDateTimePickerDatatestid } from '../../index';\nconst customPropsShareds = {\n [ControlledDateTimePickerDatatestid.CONTAINER]: {\n 'data-foo': 'foo-picker-container',\n 'aria-label': 'custom label for picker-container',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\nconst customPropsDateInputs = {\n [ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH]: {\n 'data-foo': 'foo-month-input',\n 'aria-label': 'custom label for month-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY]: {\n 'data-foo': 'foo-day-input',\n 'aria-label': 'custom label for day-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR]: {\n 'data-foo': 'foo-year-input',\n 'aria-label': 'custom label for year-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\nconst customPropsTimeInputs = {\n [ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR]: {\n 'data-foo': 'foo-hour-input',\n 'aria-label': 'custom label for hour-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE]: {\n 'data-foo': 'foo-minute-input',\n 'aria-label': 'custom label for minute-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM]: {\n 'data-foo': 'foo-meridiem-input',\n 'aria-label': 'custom label for meridiem-input',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\n\nconst customPropsCalendarDatePart = {\n [ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL]: {\n 'data-foo': 'foo-calendar-header-label',\n 'aria-label': 'custom label for calendar-header-label',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR]: {\n 'data-foo': 'foo-calendar-prev-year',\n 'aria-label': 'custom label for calendar-prev-year',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH]: {\n 'data-foo': 'foo-calendar-prev-month',\n 'aria-label': 'custom label for calendar-prev-month',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.CALENDAR.DAY]: {\n 'data-foo': 'foo-calendar-day',\n 'aria-label': 'custom label for calendar-day',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH]: {\n 'data-foo': 'foo-calendar-next-month',\n 'aria-label': 'custom label for calendar-next-month',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR]: {\n 'data-foo': 'foo-calendar-next-year',\n 'aria-label': 'custom label for calendar-next-year',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\n\nconst customPropsCalendarTimePart = {\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.HEADER_LABEL]: {\n 'data-foo': 'foo-timewheel-header-label',\n 'aria-label': 'custom label for timewheel-header-label',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_HOUR]: {\n 'data-foo': 'foo-timewheel-prev-hour',\n 'aria-label': 'custom label for timewheel-prev-hour',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.HOUR]: {\n 'data-foo': 'foo-timewheel-hour',\n 'aria-label': 'custom label for timewheel-hour',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.CURRENT_HOUR]: {\n 'data-foo': 'foo-timewheel-current-hour',\n 'aria-label': 'custom label for timewheel-current-hour',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_HOUR]: {\n 'data-foo': 'foo-timewheel-next-hour',\n 'aria-label': 'custom label for timewheel-next-hour',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MINUTE]: {\n 'data-foo': 'foo-timewheel-prev-minute',\n 'aria-label': 'custom label for timewheel-prev-minute',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.MINUTE]: {\n 'data-foo': 'foo-timewheel-minute',\n 'aria-label': 'custom label for timewheel-minute',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.CURRENT_MINUTE]: {\n 'data-foo': 'foo-timewheel-current-minute',\n 'aria-label': 'custom label for timewheel-current-minute',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MINUTE]: {\n 'data-foo': 'foo-timewheel-next-minute',\n 'aria-label': 'custom label for timewheel-next-minute',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MERIDIEM]: {\n 'data-foo': 'foo-timewheel-prev-meridiem',\n 'aria-label': 'custom label for timewheel-prev-meridiem',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.MERIDIEM]: {\n 'data-foo': 'foo-timewheel-meridiem',\n 'aria-label': 'custom label for timewheel-meridiem',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.CURRENT_MERIDIEM]: {\n 'data-foo': 'foo-timewheel-current-meridiem',\n 'aria-label': 'custom label for timewheel-current-meridiem',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n [ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MERIDIEM]: {\n 'data-foo': 'foo-timewheel-next-meridiem',\n 'aria-label': 'custom label for timewheel-next-meridiem',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\n// const customPropsCalendarDatePartSelections = {\n// [ControlledDateTimePickerDatatestid.CALENDAR.FOCUSED_DAY]: {\n// 'data-foo': 'foo-calendar-focused-day',\n// 'aria-label': 'custom label for calendar-focused-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_DAY]: {\n// 'data-foo': 'foo-calendar-selected-day',\n// 'aria-label': 'custom label for calendar-selected-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CALENDAR.SELECTED_FOCUSED_DAY]: {\n// 'data-foo': 'foo-calendar-selected-focused-day',\n// 'aria-label': 'custom label for calendar-selected-focused-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n// const customPropsCalendarDatePartRanges = {\n// [ControlledDateTimePickerDatatestid.CALENDAR.START_RANGE_DAY]: {\n// 'data-foo': 'foo-calendar-start-range-day',\n// 'aria-label': 'custom label for calendar-start-range-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CALENDAR.IN_RANGE_DAY]: {\n// 'data-foo': 'foo-calendar-in-range-day',\n// 'aria-label': 'custom label for calendar-in-range-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CALENDAR.END_RANGE_DAY]: {\n// 'data-foo': 'foo-calendar-end-range-day',\n// 'aria-label': 'custom label for calendar-end-range-day',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n// const customPropsPickersIcons = {\n// [ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR]: {\n// 'data-foo': 'foo-calendar-icon',\n// 'aria-label': 'custom label for calendar-icon',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]: {\n// 'data-foo': 'foo-timewheel-icon',\n// 'aria-label': 'custom label for timewheel-icon',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n// const customPropsContextualMenu = {\n// [ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.CALENDAR]: {\n// 'data-foo': 'foo-contextual-menu-calendar',\n// 'aria-label': 'custom label for contextual-menu-calendar',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]: {\n// 'data-foo': 'foo-contextual-menu-timewheel',\n// 'aria-label': 'custom label for contextual-menu-timewheel',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n// const customPropsControllers = {\n// [ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR]: {\n// 'data-foo': 'foo-controller-component-calendar',\n// 'aria-label': 'custom label for controller-component-calendar',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL]: {\n// 'data-foo': 'foo-controller-component-timewheel',\n// 'aria-label': 'custom label for controller-component-timewheel',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR_TIMEWHEEL]: {\n// 'data-foo': 'foo-controller-component-calendar-timewheel',\n// 'aria-label': 'custom label for controller-component-calendar-timewheel',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n// const customPropsFooters = {\n// [ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR]: {\n// 'data-foo': 'foo-footers-calendar',\n// 'aria-label': 'custom label for footers-calendar',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL]: {\n// 'data-foo': 'foo-footers-timewheel',\n// 'aria-label': 'custom label for footers-timewheel',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// [ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR_TIMEWHEEL]: {\n// 'data-foo': 'foo-footers-calendar-timewheel',\n// 'aria-label': 'custom label for footers-calendar-timewheel',\n// ignoredProp: 'props not starting with data- or aria- are not exposed',\n// },\n// };\n\nexport const customPropsForFullDateTimePickerWhenClosed = {\n ...customPropsShareds,\n ...customPropsDateInputs,\n ...customPropsTimeInputs,\n [ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR_TIMEWHEEL]: {\n 'data-foo': 'foo-calendar-timewheel-icon',\n 'aria-label': 'custom label for calendar-timewheel-icon',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\nexport const customPropsForFullDateTimePickerWhenOpen = {\n ...customPropsForFullDateTimePickerWhenClosed,\n [ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.CALENDAR_TIMEWHEEL]: {\n 'data-foo': 'foo-contextual-menu-calendar-timewheel',\n 'aria-label': 'custom label for contextual-menu-calendar-timewheel',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n ...customPropsCalendarDatePart,\n ...customPropsCalendarTimePart,\n};\nexport const customPropsForFullDatePickerWhenClosed = {\n ...customPropsShareds,\n ...customPropsDateInputs,\n [ControlledDateTimePickerDatatestid.PICKER_ICONS.CALENDAR]: {\n 'data-foo': 'foo-calendar-icon',\n 'aria-label': 'custom label for calendar-icon',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\nexport const customPropsForFullDatePickerWhenOpen = {\n ...customPropsForFullDatePickerWhenClosed,\n [ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.CALENDAR]: {\n 'data-foo': 'foo-contextual-menu-calendar',\n 'aria-label': 'custom label for contextual-menu-calendar',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n ...customPropsCalendarDatePart,\n};\nexport const customPropsForFullTimePickerWhenClosed = {\n ...customPropsShareds,\n ...customPropsTimeInputs,\n [ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]: {\n 'data-foo': 'foo-timewheel-icon',\n 'aria-label': 'custom label for timewheel-icon',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n};\nexport const customPropsForFullTimePickerWhenOpen = {\n ...customPropsForFullTimePickerWhenClosed,\n [ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]: {\n 'data-foo': 'foo-contextual-menu-timewheel',\n 'aria-label': 'custom label for contextual-menu-timewheel',\n ignoredProp: 'props not starting with data- or aria- are not exposed',\n },\n ...customPropsCalendarTimePart,\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,0CAA0C;AACnD,MAAM,qBAAqB;AAAA,EACzB,CAAC,mCAAmC,YAAY;AAAA,IAC9C,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;AACA,MAAM,wBAAwB;AAAA,EAC5B,CAAC,mCAAmC,YAAY,QAAQ;AAAA,IACtD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,CAAC,mCAAmC,YAAY,MAAM;AAAA,IACpD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,CAAC,mCAAmC,YAAY,OAAO;AAAA,IACrD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;AACA,MAAM,wBAAwB;AAAA,EAC5B,CAAC,mCAAmC,YAAY,OAAO;AAAA,IACrD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,CAAC,mCAAmC,YAAY,SAAS;AAAA,IACvD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,CAAC,mCAAmC,YAAY,WAAW;AAAA,IACzD,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;AAEA,MAAM,8BAA8B;AAAA,EAClC,CAAC,mCAAmC,SAAS,eAAe;AAAA,IAC1D,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,CAAC,m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D,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,GAAG;AACL;AACO,MAAM,yCAAyC;AAAA,EACpD,GAAG;AAAA,EACH,GAAG;AAAA,EACH,CAAC,mCAAmC,aAAa,YAAY;AAAA,IAC3D,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AACF;AACO,MAAM,uCAAuC;AAAA,EAClD,GAAG;AAAA,EACH,CAAC,mCAAmC,gBAAgB,YAAY;AAAA,IAC9D,YAAY;AAAA,IACZ,cAAc;AAAA,IACd,aAAa;AAAA,EACf;AAAA,EACA,GAAG;AACL;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { createRef } from "react";
|
|
3
|
-
import { monthNames } from "./constants";
|
|
4
|
-
import { prependStringWithPlaceHolders, deconstructValuesFromDateString, isIncompleteString } from "./stringHelpers";
|
|
5
|
-
import { convertToPositiveNumberIfPossible } from "./numberHelpers";
|
|
3
|
+
import { monthNames } from "./constants.js";
|
|
4
|
+
import { prependStringWithPlaceHolders, deconstructValuesFromDateString, isIncompleteString } from "./stringHelpers.js";
|
|
5
|
+
import { convertToPositiveNumberIfPossible } from "./numberHelpers.js";
|
|
6
6
|
const getDateValuesFromDate = (day) => ({
|
|
7
7
|
month: day?.getMonth?.(),
|
|
8
8
|
day: day?.getDate?.(),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/dateHelpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { createRef } from 'react';\nimport { monthNames } from './constants';\nimport { prependStringWithPlaceHolders, deconstructValuesFromDateString, isIncompleteString } from './stringHelpers';\nimport { convertToPositiveNumberIfPossible } from './numberHelpers';\nimport type { DSControlledDateTimePickerT } from '../propTypes';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes';\n\nexport const getDateValuesFromDate = (day: Date): DateValuesT => ({\n month: day?.getMonth?.() as DSControlledDateTimePickerInternalsT.DateMonth,\n day: day?.getDate?.() as DSControlledDateTimePickerInternalsT.DateDay,\n year: day?.getFullYear?.(),\n});\nexport const getDateStringFromDay = (day: Date): string => {\n const monthFromDay = prependStringWithPlaceHolders(`${day.getMonth() + 1}`, 2); // months from 1-12\n const dayFromDay = prependStringWithPlaceHolders(`${day.getDate()}`, 2);\n const yearFromDay = prependStringWithPlaceHolders(`${day.getFullYear()}`, 4);\n\n return `${monthFromDay}/${dayFromDay}/${yearFromDay}`;\n};\nexport const getTimeStringFromDay = (day: Date): string => {\n const hoursNum = day.getHours();\n const meridiem = hoursNum > 12 ? 'PM' : 'AM';\n const twelveHourFormat = hoursNum > 12 ? hoursNum - 12 : hoursNum;\n const minutesNum = day.getMinutes();\n\n const hoursFromDay = prependStringWithPlaceHolders(`${twelveHourFormat}`, 2);\n const minutesFromDay = prependStringWithPlaceHolders(`${minutesNum}`, 2);\n\n return `${hoursFromDay}:${minutesFromDay} ${meridiem}`;\n};\nexport const getMonthNameByMonthNumber = (monthNumber: number): string => monthNames[monthNumber];\nexport const isSameDateMoment = (dateA: Date, dateB: Date): boolean => dateA?.getTime?.() === dateB?.getTime?.();\n\nexport const compareTwoDatesDayEquality = (dayA: Date, dayB: Date): boolean => {\n const { day: currD, month: currM, year: currY } = getDateValuesFromDate(dayA);\n const { day: focusD, month: focusM, year: focusY } = getDateValuesFromDate(dayB);\n return currD === focusD && currM === focusM && currY === focusY;\n};\n\nexport const getLastDayOfMonth = (month: DSControlledDateTimePickerInternalsT.DateMonth, year: number): Date =>\n new Date(year, month + 1, 0);\nexport const isValidDayForTheMonth = (\n month: DSControlledDateTimePickerInternalsT.DateMonth,\n year: number,\n day: DSControlledDateTimePickerInternalsT.DateDay,\n): boolean => new Date(year, month, day)?.getMonth?.() === month;\nexport const getDayFromDateString = (dateString: string): Date | null => {\n const { month, day, year } = deconstructValuesFromDateString(dateString);\n const monthNum = convertToPositiveNumberIfPossible(month);\n const dayNum = convertToPositiveNumberIfPossible(day) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n const yearNum = convertToPositiveNumberIfPossible(year);\n if (\n monthNum !== -1 &&\n dayNum !== -1 &&\n yearNum !== -1 &&\n isValidDayForTheMonth((monthNum - 1) as DSControlledDateTimePickerInternalsT.DateMonth, yearNum, dayNum)\n )\n return new Date(yearNum, monthNum - 1, dayNum);\n return null;\n};\nexport const isValidDayForTheMonthDateString = (dateString: string): boolean => {\n if (isIncompleteString(dateString)) return true;\n const { month } = deconstructValuesFromDateString(dateString);\n const monthInt = convertToPositiveNumberIfPossible(month);\n if (monthInt === -1) return false;\n const monthDateMonth = (monthInt - 1) as DSControlledDateTimePickerInternalsT.DateMonth;\n return getDayFromDateString(dateString)?.getMonth?.() === monthDateMonth;\n};\n\nexport const getValidationDateStringMetaInfo = (\n dateString: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n getIsOutOfRangeDay = (day: string) => false,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n getIsDisabledDay = (day: string) => false,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {};\n if (!isIncompleteString(dateString)) {\n metaInfo.isDayPresentInMonth = isValidDayForTheMonthDateString(dateString);\n if (!metaInfo.isDayPresentInMonth)\n metaInfo.suggestedErrorMsg = 'The selected day is not part of the selected month';\n const day = getDayFromDateString(dateString);\n if (day) {\n metaInfo.isOutOfRangeDay = getIsOutOfRangeDay(dateString);\n metaInfo.isDisabledDay = getIsDisabledDay(dateString);\n if (metaInfo.isOutOfRangeDay || metaInfo.isDisabledDay)\n metaInfo.suggestedErrorMsg = 'The selected day is not allowed';\n }\n }\n return metaInfo;\n};\n// code adapted from https://github.com/datejs/Datejs/blob/master/src/core.js\nexport const isLeapYear = (year: number): boolean => (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\nexport const getHowManyDaysInMonth = (year: number, month: number): number => {\n const daysPerMonth = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n return daysPerMonth[month];\n};\n\nexport const dateIsLeapYear = (date: Date): boolean => isLeapYear(date.getFullYear());\n\nexport const dateGetDaysInMonth = (date: Date): number => getHowManyDaysInMonth(date.getFullYear(), date.getMonth());\n\nexport const dateAddMonths = (date: Date, value: number): Date => {\n const copiedDate = new Date(date.getTime());\n const n = copiedDate.getDate();\n copiedDate.setDate(1);\n copiedDate.setMonth(copiedDate.getMonth() + value);\n copiedDate.setDate(Math.min(n, dateGetDaysInMonth(copiedDate)));\n return copiedDate;\n};\nexport const dateAddYear = (date: Date, value: number): Date => dateAddMonths(date, value * 12);\n\ninterface DateValuesT {\n month: DSControlledDateTimePickerInternalsT.DateMonth;\n year: number;\n day?: DSControlledDateTimePickerInternalsT.DateDay;\n}\ninterface DateSumValuesT {\n monthsToSum?: number;\n yearsToSum?: number;\n daysToSum?: number;\n}\n// sumFromDateValues supports negative values to \"subtract\"\nexport const sumFromDateValues = (\n { month, year, day = 1 }: DateValuesT,\n { monthsToSum = 0, yearsToSum = 0, daysToSum = 0 }: DateSumValuesT,\n): DateValuesT => {\n let newDate = new Date(year, month, day);\n if (yearsToSum) newDate = dateAddYear(newDate, yearsToSum);\n\n if (monthsToSum) newDate = dateAddMonths(newDate, monthsToSum);\n\n if (daysToSum) newDate.setDate(newDate.getDate() + daysToSum);\n\n return {\n month: newDate.getMonth() as DSControlledDateTimePickerInternalsT.DateMonth,\n day: newDate.getDate() as DSControlledDateTimePickerInternalsT.DateDay,\n year: newDate.getFullYear(),\n };\n};\nexport const sumValuesToDate = (day: Date, sumValues: DateSumValuesT): Date => {\n const dateAsVals = getDateValuesFromDate(day);\n const { month, year, day: newD } = sumFromDateValues(dateAsVals, sumValues);\n return new Date(year, month, newD);\n};\nexport const subtractYears = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setFullYear(date.getFullYear() - howManyMore);\n return newDate;\n};\nexport const subtractMonths = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setMonth(date.getMonth() - howManyMore);\n return newDate;\n};\nexport const sumMonths = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setMonth(date.getMonth() + howManyMore);\n return newDate;\n};\nexport const sumYears = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setFullYear(date.getFullYear() + howManyMore);\n return newDate;\n};\n\nexport const getDaysInMonth = (month: number, year: number): Date[] => {\n const date = new Date(year, month, 1);\n const days: Date[] = [];\n while (date.getMonth() === month) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n};\nexport const getLastXDaysFromPreviousMonth = (month: number, year: number, howMany: number): Date[] => {\n const date = new Date(year, month, 1);\n const days: Date[] = [];\n while (days.length !== howMany) {\n date.setDate(date.getDate() - 1);\n days.push(new Date(date));\n }\n return days.reverse();\n};\nexport const getFirstXDaysFromNextMonth = (month: number, year: number, howMany: number): Date[] => {\n const date = sumMonths(new Date(year, month, 1), 1);\n const days: Date[] = [];\n while (days.length !== howMany) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n};\n\nexport const getFiveBySevenCurrentMonthDaysMatrix = (\n month: number,\n year: number,\n): DSControlledDateTimePickerInternalsT.MetaMonthDay[] => {\n const currentMonthDays = getDaysInMonth(month, year).map((day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: false,\n isNextMonthDay: false,\n isCurrMonthDay: true,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }));\n const firstDayOfTheMonthWeekDay = currentMonthDays?.[0]?.day?.getDay();\n const previousMonthDaysToPrepend = getLastXDaysFromPreviousMonth(month, year, firstDayOfTheMonthWeekDay).map(\n (day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: true,\n isNextMonthDay: false,\n isCurrMonthDay: false,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }),\n );\n const lastDayOfTheMonthWeekDay = currentMonthDays?.[currentMonthDays.length - 1]?.day?.getDay();\n const nextMonthDaysToAppend = getFirstXDaysFromNextMonth(month, year, 6 - lastDayOfTheMonthWeekDay).map((day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: false,\n isNextMonthDay: true,\n isCurrMonthDay: false,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }));\n\n return [...previousMonthDaysToPrepend, ...currentMonthDays, ...nextMonthDaysToAppend];\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { createRef } from 'react';\nimport { monthNames } from './constants.js';\nimport { prependStringWithPlaceHolders, deconstructValuesFromDateString, isIncompleteString } from './stringHelpers.js';\nimport { convertToPositiveNumberIfPossible } from './numberHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../propTypes.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\n\nexport const getDateValuesFromDate = (day: Date): DateValuesT => ({\n month: day?.getMonth?.() as DSControlledDateTimePickerInternalsT.DateMonth,\n day: day?.getDate?.() as DSControlledDateTimePickerInternalsT.DateDay,\n year: day?.getFullYear?.(),\n});\nexport const getDateStringFromDay = (day: Date): string => {\n const monthFromDay = prependStringWithPlaceHolders(`${day.getMonth() + 1}`, 2); // months from 1-12\n const dayFromDay = prependStringWithPlaceHolders(`${day.getDate()}`, 2);\n const yearFromDay = prependStringWithPlaceHolders(`${day.getFullYear()}`, 4);\n\n return `${monthFromDay}/${dayFromDay}/${yearFromDay}`;\n};\nexport const getTimeStringFromDay = (day: Date): string => {\n const hoursNum = day.getHours();\n const meridiem = hoursNum > 12 ? 'PM' : 'AM';\n const twelveHourFormat = hoursNum > 12 ? hoursNum - 12 : hoursNum;\n const minutesNum = day.getMinutes();\n\n const hoursFromDay = prependStringWithPlaceHolders(`${twelveHourFormat}`, 2);\n const minutesFromDay = prependStringWithPlaceHolders(`${minutesNum}`, 2);\n\n return `${hoursFromDay}:${minutesFromDay} ${meridiem}`;\n};\nexport const getMonthNameByMonthNumber = (monthNumber: number): string => monthNames[monthNumber];\nexport const isSameDateMoment = (dateA: Date, dateB: Date): boolean => dateA?.getTime?.() === dateB?.getTime?.();\n\nexport const compareTwoDatesDayEquality = (dayA: Date, dayB: Date): boolean => {\n const { day: currD, month: currM, year: currY } = getDateValuesFromDate(dayA);\n const { day: focusD, month: focusM, year: focusY } = getDateValuesFromDate(dayB);\n return currD === focusD && currM === focusM && currY === focusY;\n};\n\nexport const getLastDayOfMonth = (month: DSControlledDateTimePickerInternalsT.DateMonth, year: number): Date =>\n new Date(year, month + 1, 0);\nexport const isValidDayForTheMonth = (\n month: DSControlledDateTimePickerInternalsT.DateMonth,\n year: number,\n day: DSControlledDateTimePickerInternalsT.DateDay,\n): boolean => new Date(year, month, day)?.getMonth?.() === month;\nexport const getDayFromDateString = (dateString: string): Date | null => {\n const { month, day, year } = deconstructValuesFromDateString(dateString);\n const monthNum = convertToPositiveNumberIfPossible(month);\n const dayNum = convertToPositiveNumberIfPossible(day) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n const yearNum = convertToPositiveNumberIfPossible(year);\n if (\n monthNum !== -1 &&\n dayNum !== -1 &&\n yearNum !== -1 &&\n isValidDayForTheMonth((monthNum - 1) as DSControlledDateTimePickerInternalsT.DateMonth, yearNum, dayNum)\n )\n return new Date(yearNum, monthNum - 1, dayNum);\n return null;\n};\nexport const isValidDayForTheMonthDateString = (dateString: string): boolean => {\n if (isIncompleteString(dateString)) return true;\n const { month } = deconstructValuesFromDateString(dateString);\n const monthInt = convertToPositiveNumberIfPossible(month);\n if (monthInt === -1) return false;\n const monthDateMonth = (monthInt - 1) as DSControlledDateTimePickerInternalsT.DateMonth;\n return getDayFromDateString(dateString)?.getMonth?.() === monthDateMonth;\n};\n\nexport const getValidationDateStringMetaInfo = (\n dateString: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n getIsOutOfRangeDay = (day: string) => false,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n getIsDisabledDay = (day: string) => false,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {};\n if (!isIncompleteString(dateString)) {\n metaInfo.isDayPresentInMonth = isValidDayForTheMonthDateString(dateString);\n if (!metaInfo.isDayPresentInMonth)\n metaInfo.suggestedErrorMsg = 'The selected day is not part of the selected month';\n const day = getDayFromDateString(dateString);\n if (day) {\n metaInfo.isOutOfRangeDay = getIsOutOfRangeDay(dateString);\n metaInfo.isDisabledDay = getIsDisabledDay(dateString);\n if (metaInfo.isOutOfRangeDay || metaInfo.isDisabledDay)\n metaInfo.suggestedErrorMsg = 'The selected day is not allowed';\n }\n }\n return metaInfo;\n};\n// code adapted from https://github.com/datejs/Datejs/blob/master/src/core.js\nexport const isLeapYear = (year: number): boolean => (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\nexport const getHowManyDaysInMonth = (year: number, month: number): number => {\n const daysPerMonth = [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n return daysPerMonth[month];\n};\n\nexport const dateIsLeapYear = (date: Date): boolean => isLeapYear(date.getFullYear());\n\nexport const dateGetDaysInMonth = (date: Date): number => getHowManyDaysInMonth(date.getFullYear(), date.getMonth());\n\nexport const dateAddMonths = (date: Date, value: number): Date => {\n const copiedDate = new Date(date.getTime());\n const n = copiedDate.getDate();\n copiedDate.setDate(1);\n copiedDate.setMonth(copiedDate.getMonth() + value);\n copiedDate.setDate(Math.min(n, dateGetDaysInMonth(copiedDate)));\n return copiedDate;\n};\nexport const dateAddYear = (date: Date, value: number): Date => dateAddMonths(date, value * 12);\n\ninterface DateValuesT {\n month: DSControlledDateTimePickerInternalsT.DateMonth;\n year: number;\n day?: DSControlledDateTimePickerInternalsT.DateDay;\n}\ninterface DateSumValuesT {\n monthsToSum?: number;\n yearsToSum?: number;\n daysToSum?: number;\n}\n// sumFromDateValues supports negative values to \"subtract\"\nexport const sumFromDateValues = (\n { month, year, day = 1 }: DateValuesT,\n { monthsToSum = 0, yearsToSum = 0, daysToSum = 0 }: DateSumValuesT,\n): DateValuesT => {\n let newDate = new Date(year, month, day);\n if (yearsToSum) newDate = dateAddYear(newDate, yearsToSum);\n\n if (monthsToSum) newDate = dateAddMonths(newDate, monthsToSum);\n\n if (daysToSum) newDate.setDate(newDate.getDate() + daysToSum);\n\n return {\n month: newDate.getMonth() as DSControlledDateTimePickerInternalsT.DateMonth,\n day: newDate.getDate() as DSControlledDateTimePickerInternalsT.DateDay,\n year: newDate.getFullYear(),\n };\n};\nexport const sumValuesToDate = (day: Date, sumValues: DateSumValuesT): Date => {\n const dateAsVals = getDateValuesFromDate(day);\n const { month, year, day: newD } = sumFromDateValues(dateAsVals, sumValues);\n return new Date(year, month, newD);\n};\nexport const subtractYears = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setFullYear(date.getFullYear() - howManyMore);\n return newDate;\n};\nexport const subtractMonths = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setMonth(date.getMonth() - howManyMore);\n return newDate;\n};\nexport const sumMonths = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setMonth(date.getMonth() + howManyMore);\n return newDate;\n};\nexport const sumYears = (date: Date, howManyMore = 1): Date => {\n const newDate = new Date(date.getTime());\n newDate.setFullYear(date.getFullYear() + howManyMore);\n return newDate;\n};\n\nexport const getDaysInMonth = (month: number, year: number): Date[] => {\n const date = new Date(year, month, 1);\n const days: Date[] = [];\n while (date.getMonth() === month) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n};\nexport const getLastXDaysFromPreviousMonth = (month: number, year: number, howMany: number): Date[] => {\n const date = new Date(year, month, 1);\n const days: Date[] = [];\n while (days.length !== howMany) {\n date.setDate(date.getDate() - 1);\n days.push(new Date(date));\n }\n return days.reverse();\n};\nexport const getFirstXDaysFromNextMonth = (month: number, year: number, howMany: number): Date[] => {\n const date = sumMonths(new Date(year, month, 1), 1);\n const days: Date[] = [];\n while (days.length !== howMany) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n};\n\nexport const getFiveBySevenCurrentMonthDaysMatrix = (\n month: number,\n year: number,\n): DSControlledDateTimePickerInternalsT.MetaMonthDay[] => {\n const currentMonthDays = getDaysInMonth(month, year).map((day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: false,\n isNextMonthDay: false,\n isCurrMonthDay: true,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }));\n const firstDayOfTheMonthWeekDay = currentMonthDays?.[0]?.day?.getDay();\n const previousMonthDaysToPrepend = getLastXDaysFromPreviousMonth(month, year, firstDayOfTheMonthWeekDay).map(\n (day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: true,\n isNextMonthDay: false,\n isCurrMonthDay: false,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }),\n );\n const lastDayOfTheMonthWeekDay = currentMonthDays?.[currentMonthDays.length - 1]?.day?.getDay();\n const nextMonthDaysToAppend = getFirstXDaysFromNextMonth(month, year, 6 - lastDayOfTheMonthWeekDay).map((day) => ({\n day,\n dayAsString: getDateStringFromDay(day),\n isPrevMonthDay: false,\n isNextMonthDay: true,\n isCurrMonthDay: false,\n isHidden: false,\n dayBtnRef: createRef<HTMLButtonElement>(),\n }));\n\n return [...previousMonthDaysToPrepend, ...currentMonthDays, ...nextMonthDaysToAppend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|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { getValidationDateStringMetaInfo } from "./dateHelpers";
|
|
3
|
-
import { getValidationTimeStringMetaInfo } from "./timeHelpers";
|
|
2
|
+
import { getValidationDateStringMetaInfo } from "./dateHelpers.js";
|
|
3
|
+
import { getValidationTimeStringMetaInfo } from "./timeHelpers.js";
|
|
4
4
|
const getValidationDateTimeStringMetaInfo = (dateString, timeString, validators) => ({
|
|
5
5
|
...getValidationDateStringMetaInfo(dateString, validators.getIsOutOfRangeDay, validators.getIsDisabledDay),
|
|
6
6
|
...getValidationTimeStringMetaInfo(timeString, validators.getIsDisabledTime)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/dateTimeHelpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getValidationDateStringMetaInfo } from './dateHelpers';\nimport { getValidationTimeStringMetaInfo } from './timeHelpers';\nimport type { DSControlledDateTimePickerT } from '../propTypes';\n\ninterface Validators {\n getIsOutOfRangeDay: (day: string) => boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsDisabledTime: (val: string) => boolean;\n}\nexport const getValidationDateTimeStringMetaInfo = (\n dateString: string,\n timeString: string,\n validators: Validators,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => ({\n ...getValidationDateStringMetaInfo(dateString, validators.getIsOutOfRangeDay, validators.getIsDisabledDay),\n ...getValidationTimeStringMetaInfo(timeString, validators.getIsDisabledTime),\n});\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { getValidationDateStringMetaInfo } from './dateHelpers.js';\nimport { getValidationTimeStringMetaInfo } from './timeHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../propTypes.js';\n\ninterface Validators {\n getIsOutOfRangeDay: (day: string) => boolean;\n getIsDisabledDay: (day: string) => boolean;\n getIsDisabledTime: (val: string) => boolean;\n}\nexport const getValidationDateTimeStringMetaInfo = (\n dateString: string,\n timeString: string,\n validators: Validators,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => ({\n ...getValidationDateStringMetaInfo(dateString, validators.getIsOutOfRangeDay, validators.getIsDisabledDay),\n ...getValidationTimeStringMetaInfo(timeString, validators.getIsDisabledTime),\n});\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,uCAAuC;AAChD,SAAS,uCAAuC;AAQzC,MAAM,sCAAsC,CACjD,YACA,YACA,gBACuE;AAAA,EACvE,GAAG,gCAAgC,YAAY,WAAW,oBAAoB,WAAW,gBAAgB;AAAA,EACzG,GAAG,gCAAgC,YAAY,WAAW,iBAAiB;AAC7E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
|
|
4
|
-
import { getDayFromDateString } from "../dateHelpers";
|
|
3
|
+
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
|
|
4
|
+
import { getDayFromDateString } from "../dateHelpers.js";
|
|
5
5
|
const useGetDayFromDateString = () => {
|
|
6
6
|
const { dateStringFromProps } = useContext(ControlledDateTimePickerContext);
|
|
7
7
|
return useMemo(() => getDayFromDateString(dateStringFromProps), [dateStringFromProps]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/utils/hooks/useGetDayFromDateString.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { getDayFromDateString } from '../dateHelpers';\n\nexport const useGetDayFromDateString = (): Date | null => {\n const { dateStringFromProps } = useContext(ControlledDateTimePickerContext);\n return useMemo(() => getDayFromDateString(dateStringFromProps), [dateStringFromProps]);\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { getDayFromDateString } from '../dateHelpers.js';\n\nexport const useGetDayFromDateString = (): Date | null => {\n const { dateStringFromProps } = useContext(ControlledDateTimePickerContext);\n return useMemo(() => getDayFromDateString(dateStringFromProps), [dateStringFromProps]);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AACpC,SAAS,uCAAuC;AAChD,SAAS,4BAA4B;AAE9B,MAAM,0BAA0B,MAAmB;AACxD,QAAM,EAAE,oBAAoB,IAAI,WAAW,+BAA+B;AAC1E,SAAO,QAAQ,MAAM,qBAAqB,mBAAmB,GAAG,CAAC,mBAAmB,CAAC;AACvF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
|
|
4
|
-
import { deconstructValuesFromDateString } from "../stringHelpers";
|
|
3
|
+
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
|
|
4
|
+
import { deconstructValuesFromDateString } from "../stringHelpers.js";
|
|
5
5
|
const useGetMonthYearFromDateStringOrEmptyStartingMonth = () => {
|
|
6
6
|
const { dateStringFromProps, emptyPickerStartingMonth } = useContext(ControlledDateTimePickerContext);
|
|
7
7
|
return useMemo(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { deconstructValuesFromDateString } from '../stringHelpers';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nexport const useGetMonthYearFromDateStringOrEmptyStartingMonth = (): {\n year: number;\n month: DSControlledDateTimePickerInternalsT.DateMonth;\n} => {\n const { dateStringFromProps, emptyPickerStartingMonth } = useContext(ControlledDateTimePickerContext);\n\n return useMemo(() => {\n const { month: stringMonthVal, year: stringYearVal } = deconstructValuesFromDateString(dateStringFromProps);\n\n const { month: emptyStringSplitMonth, year: emptyStringSplitYear } =\n deconstructValuesFromDateString(emptyPickerStartingMonth);\n const userEmptyStringMonth = Number.parseInt(emptyStringSplitMonth, 10);\n const userEmptyStringYear = Number.parseInt(emptyStringSplitYear, 10);\n\n const month: DSControlledDateTimePickerInternalsT.DateMonth =\n stringMonthVal === '' || stringMonthVal.length !== 2\n ? ((userEmptyStringMonth - 1) as DSControlledDateTimePickerInternalsT.DateMonth)\n : ((Number.parseInt(stringMonthVal, 10) - 1) as DSControlledDateTimePickerInternalsT.DateMonth); // month is 0~11 in javascript Date...\n\n const year = stringYearVal === '' ? userEmptyStringYear : Number.parseInt(stringYearVal, 10);\n\n return { year, month };\n }, [dateStringFromProps, emptyPickerStartingMonth]);\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { deconstructValuesFromDateString } from '../stringHelpers.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nexport const useGetMonthYearFromDateStringOrEmptyStartingMonth = (): {\n year: number;\n month: DSControlledDateTimePickerInternalsT.DateMonth;\n} => {\n const { dateStringFromProps, emptyPickerStartingMonth } = useContext(ControlledDateTimePickerContext);\n\n return useMemo(() => {\n const { month: stringMonthVal, year: stringYearVal } = deconstructValuesFromDateString(dateStringFromProps);\n\n const { month: emptyStringSplitMonth, year: emptyStringSplitYear } =\n deconstructValuesFromDateString(emptyPickerStartingMonth);\n const userEmptyStringMonth = Number.parseInt(emptyStringSplitMonth, 10);\n const userEmptyStringYear = Number.parseInt(emptyStringSplitYear, 10);\n\n const month: DSControlledDateTimePickerInternalsT.DateMonth =\n stringMonthVal === '' || stringMonthVal.length !== 2\n ? ((userEmptyStringMonth - 1) as DSControlledDateTimePickerInternalsT.DateMonth)\n : ((Number.parseInt(stringMonthVal, 10) - 1) as DSControlledDateTimePickerInternalsT.DateMonth); // month is 0~11 in javascript Date...\n\n const year = stringYearVal === '' ? userEmptyStringYear : Number.parseInt(stringYearVal, 10);\n\n return { year, month };\n }, [dateStringFromProps, emptyPickerStartingMonth]);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,eAAe;AACpC,SAAS,uCAAuC;AAChD,SAAS,uCAAuC;AAGzC,MAAM,oDAAoD,MAG5D;AACH,QAAM,EAAE,qBAAqB,yBAAyB,IAAI,WAAW,+BAA+B;AAEpG,SAAO,QAAQ,MAAM;AACnB,UAAM,EAAE,OAAO,gBAAgB,MAAM,cAAc,IAAI,gCAAgC,mBAAmB;AAE1G,UAAM,EAAE,OAAO,uBAAuB,MAAM,qBAAqB,IAC/D,gCAAgC,wBAAwB;AAC1D,UAAM,uBAAuB,OAAO,SAAS,uBAAuB,EAAE;AACtE,UAAM,sBAAsB,OAAO,SAAS,sBAAsB,EAAE;AAEpE,UAAM,QACJ,mBAAmB,MAAM,eAAe,WAAW,IAC7C,uBAAuB,IACvB,OAAO,SAAS,gBAAgB,EAAE,IAAI;AAE9C,UAAM,OAAO,kBAAkB,KAAK,sBAAsB,OAAO,SAAS,eAAe,EAAE;AAE3F,WAAO,EAAE,MAAM,MAAM;AAAA,EACvB,GAAG,CAAC,qBAAqB,wBAAwB,CAAC;AACpD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useContext, useMemo } from "react";
|
|
3
|
-
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX";
|
|
4
|
-
import { deconstructValuesFromDateString } from "../stringHelpers";
|
|
5
|
-
import { convertToPositiveNumberIfPossible } from "../numberHelpers";
|
|
6
|
-
import { getDateValuesFromDate, isValidDayForTheMonth } from "../dateHelpers";
|
|
7
|
-
import { useGetDayFromDateString } from "./useGetDayFromDateString";
|
|
3
|
+
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
|
|
4
|
+
import { deconstructValuesFromDateString } from "../stringHelpers.js";
|
|
5
|
+
import { convertToPositiveNumberIfPossible } from "../numberHelpers.js";
|
|
6
|
+
import { getDateValuesFromDate, isValidDayForTheMonth } from "../dateHelpers.js";
|
|
7
|
+
import { useGetDayFromDateString } from "./useGetDayFromDateString.js";
|
|
8
8
|
const empty = {
|
|
9
9
|
startFocusedYear: null,
|
|
10
10
|
startFocusedDay: null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/utils/hooks/useGetStartingFocusedDay.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { deconstructValuesFromDateString } from '../stringHelpers';\nimport { convertToPositiveNumberIfPossible } from '../numberHelpers';\nimport { getDateValuesFromDate, isValidDayForTheMonth } from '../dateHelpers';\nimport { useGetDayFromDateString } from './useGetDayFromDateString';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\ninterface StartingFocusedDayT {\n startFocusedYear: number | null;\n startFocusedDay: number | null;\n startFocusedMonth: number | null;\n startFocusedDate: Date | null;\n}\nconst empty = {\n startFocusedYear: null,\n startFocusedDay: null,\n startFocusedMonth: null,\n startFocusedDate: null,\n};\nexport const useGetStartingFocusedDay = () => {\n const { onCalendarOpenFocusedDay } = useContext(ControlledDateTimePickerContext);\n const dayFromInputValues = useGetDayFromDateString();\n const {\n month: inputValuesSplitMonth,\n day: inputValuesSplitDay,\n year: inputValuesDaySplitYear,\n } = dayFromInputValues ? getDateValuesFromDate(dayFromInputValues) : { month: null, day: null, year: null };\n const isInputFilledAndValid =\n inputValuesSplitMonth &&\n inputValuesSplitDay &&\n inputValuesDaySplitYear &&\n isValidDayForTheMonth(inputValuesSplitMonth, inputValuesDaySplitYear, inputValuesSplitDay);\n const isOnCalendarOpenFocusedDayEmpty = !onCalendarOpenFocusedDay;\n const shouldFillWithOnCalendarOpenFocusedDay = !isInputFilledAndValid && !isOnCalendarOpenFocusedDayEmpty;\n return useMemo(() => {\n const startingDay: StartingFocusedDayT = { ...empty };\n\n // if input was filled start focus is the filled value (if it's valid day for the month)\n if (isInputFilledAndValid) {\n startingDay.startFocusedMonth = inputValuesSplitMonth;\n startingDay.startFocusedDay = inputValuesSplitDay;\n startingDay.startFocusedYear = inputValuesDaySplitYear;\n startingDay.startFocusedDate = dayFromInputValues;\n // if input was not filled (or filled invalid) and there is no onCalendarOpenFocusedDay start focus is not a day\n } else if (isOnCalendarOpenFocusedDayEmpty) {\n // if input was not filled and there is onCalendarOpenFocusedDay start focus is onCalendarOpenFocusedDay day\n return empty;\n } else if (shouldFillWithOnCalendarOpenFocusedDay) {\n const {\n month: focusedDaySplitMonth,\n day: focusedDaySplitDay,\n year: focusedDaySplitYear,\n } = deconstructValuesFromDateString(onCalendarOpenFocusedDay);\n const monthAsInt = convertToPositiveNumberIfPossible(focusedDaySplitMonth);\n const dayAsInt = convertToPositiveNumberIfPossible(focusedDaySplitDay);\n const yearAsInt = convertToPositiveNumberIfPossible(focusedDaySplitYear);\n // if this condition is false, return will be the same as return empty\n // because startFocusedMonth/Day/Year/Date will be === null\n // which is the expected result\n if (\n monthAsInt !== -1 &&\n dayAsInt !== -1 &&\n yearAsInt !== -1 &&\n isValidDayForTheMonth(\n (monthAsInt - 1) as DSControlledDateTimePickerInternalsT.DateMonth,\n yearAsInt,\n dayAsInt as DSControlledDateTimePickerInternalsT.DateDay,\n )\n ) {\n startingDay.startFocusedMonth = monthAsInt;\n startingDay.startFocusedDay = dayAsInt;\n startingDay.startFocusedYear = yearAsInt;\n startingDay.startFocusedDate = new Date(yearAsInt, monthAsInt - 1, dayAsInt);\n }\n }\n return startingDay;\n }, [\n dayFromInputValues,\n inputValuesDaySplitYear,\n inputValuesSplitDay,\n inputValuesSplitMonth,\n isInputFilledAndValid,\n isOnCalendarOpenFocusedDayEmpty,\n onCalendarOpenFocusedDay,\n shouldFillWithOnCalendarOpenFocusedDay,\n ]);\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\n/* eslint-disable complexity */\nimport { useContext, useMemo } from 'react';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { deconstructValuesFromDateString } from '../stringHelpers.js';\nimport { convertToPositiveNumberIfPossible } from '../numberHelpers.js';\nimport { getDateValuesFromDate, isValidDayForTheMonth } from '../dateHelpers.js';\nimport { useGetDayFromDateString } from './useGetDayFromDateString.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\ninterface StartingFocusedDayT {\n startFocusedYear: number | null;\n startFocusedDay: number | null;\n startFocusedMonth: number | null;\n startFocusedDate: Date | null;\n}\nconst empty = {\n startFocusedYear: null,\n startFocusedDay: null,\n startFocusedMonth: null,\n startFocusedDate: null,\n};\nexport const useGetStartingFocusedDay = () => {\n const { onCalendarOpenFocusedDay } = useContext(ControlledDateTimePickerContext);\n const dayFromInputValues = useGetDayFromDateString();\n const {\n month: inputValuesSplitMonth,\n day: inputValuesSplitDay,\n year: inputValuesDaySplitYear,\n } = dayFromInputValues ? getDateValuesFromDate(dayFromInputValues) : { month: null, day: null, year: null };\n const isInputFilledAndValid =\n inputValuesSplitMonth &&\n inputValuesSplitDay &&\n inputValuesDaySplitYear &&\n isValidDayForTheMonth(inputValuesSplitMonth, inputValuesDaySplitYear, inputValuesSplitDay);\n const isOnCalendarOpenFocusedDayEmpty = !onCalendarOpenFocusedDay;\n const shouldFillWithOnCalendarOpenFocusedDay = !isInputFilledAndValid && !isOnCalendarOpenFocusedDayEmpty;\n return useMemo(() => {\n const startingDay: StartingFocusedDayT = { ...empty };\n\n // if input was filled start focus is the filled value (if it's valid day for the month)\n if (isInputFilledAndValid) {\n startingDay.startFocusedMonth = inputValuesSplitMonth;\n startingDay.startFocusedDay = inputValuesSplitDay;\n startingDay.startFocusedYear = inputValuesDaySplitYear;\n startingDay.startFocusedDate = dayFromInputValues;\n // if input was not filled (or filled invalid) and there is no onCalendarOpenFocusedDay start focus is not a day\n } else if (isOnCalendarOpenFocusedDayEmpty) {\n // if input was not filled and there is onCalendarOpenFocusedDay start focus is onCalendarOpenFocusedDay day\n return empty;\n } else if (shouldFillWithOnCalendarOpenFocusedDay) {\n const {\n month: focusedDaySplitMonth,\n day: focusedDaySplitDay,\n year: focusedDaySplitYear,\n } = deconstructValuesFromDateString(onCalendarOpenFocusedDay);\n const monthAsInt = convertToPositiveNumberIfPossible(focusedDaySplitMonth);\n const dayAsInt = convertToPositiveNumberIfPossible(focusedDaySplitDay);\n const yearAsInt = convertToPositiveNumberIfPossible(focusedDaySplitYear);\n // if this condition is false, return will be the same as return empty\n // because startFocusedMonth/Day/Year/Date will be === null\n // which is the expected result\n if (\n monthAsInt !== -1 &&\n dayAsInt !== -1 &&\n yearAsInt !== -1 &&\n isValidDayForTheMonth(\n (monthAsInt - 1) as DSControlledDateTimePickerInternalsT.DateMonth,\n yearAsInt,\n dayAsInt as DSControlledDateTimePickerInternalsT.DateDay,\n )\n ) {\n startingDay.startFocusedMonth = monthAsInt;\n startingDay.startFocusedDay = dayAsInt;\n startingDay.startFocusedYear = yearAsInt;\n startingDay.startFocusedDate = new Date(yearAsInt, monthAsInt - 1, dayAsInt);\n }\n }\n return startingDay;\n }, [\n dayFromInputValues,\n inputValuesDaySplitYear,\n inputValuesSplitDay,\n inputValuesSplitMonth,\n isInputFilledAndValid,\n isOnCalendarOpenFocusedDayEmpty,\n onCalendarOpenFocusedDay,\n shouldFillWithOnCalendarOpenFocusedDay,\n ]);\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,YAAY,eAAe;AACpC,SAAS,uCAAuC;AAChD,SAAS,uCAAuC;AAChD,SAAS,yCAAyC;AAClD,SAAS,uBAAuB,6BAA6B;AAC7D,SAAS,+BAA+B;AASxC,MAAM,QAAQ;AAAA,EACZ,kBAAkB;AAAA,EAClB,iBAAiB;AAAA,EACjB,mBAAmB;AAAA,EACnB,kBAAkB;AACpB;AACO,MAAM,2BAA2B,MAAM;AAC5C,QAAM,EAAE,yBAAyB,IAAI,WAAW,+BAA+B;AAC/E,QAAM,qBAAqB,wBAAwB;AACnD,QAAM;AAAA,IACJ,OAAO;AAAA,IACP,KAAK;AAAA,IACL,MAAM;AAAA,EACR,IAAI,qBAAqB,sBAAsB,kBAAkB,IAAI,EAAE,OAAO,MAAM,KAAK,MAAM,MAAM,KAAK;AAC1G,QAAM,wBACJ,yBACA,uBACA,2BACA,sBAAsB,uBAAuB,yBAAyB,mBAAmB;AAC3F,QAAM,kCAAkC,CAAC;AACzC,QAAM,yCAAyC,CAAC,yBAAyB,CAAC;AAC1E,SAAO,QAAQ,MAAM;AACnB,UAAM,cAAmC,EAAE,GAAG,MAAM;AAGpD,QAAI,uBAAuB;AACzB,kBAAY,oBAAoB;AAChC,kBAAY,kBAAkB;AAC9B,kBAAY,mBAAmB;AAC/B,kBAAY,mBAAmB;AAAA,IAEjC,WAAW,iCAAiC;AAE1C,aAAO;AAAA,IACT,WAAW,wCAAwC;AACjD,YAAM;AAAA,QACJ,OAAO;AAAA,QACP,KAAK;AAAA,QACL,MAAM;AAAA,MACR,IAAI,gCAAgC,wBAAwB;AAC5D,YAAM,aAAa,kCAAkC,oBAAoB;AACzE,YAAM,WAAW,kCAAkC,kBAAkB;AACrE,YAAM,YAAY,kCAAkC,mBAAmB;AAIvE,UACE,eAAe,MACf,aAAa,MACb,cAAc,MACd;AAAA,QACG,aAAa;AAAA,QACd;AAAA,QACA;AAAA,MACF,GACA;AACA,oBAAY,oBAAoB;AAChC,oBAAY,kBAAkB;AAC9B,oBAAY,mBAAmB;AAC/B,oBAAY,mBAAmB,IAAI,KAAK,WAAW,aAAa,GAAG,QAAQ;AAAA,MAC7E;AAAA,IACF;AACA,WAAO;AAAA,EACT,GAAG;AAAA,IACD;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { monthNames, announcableCardinalDays } from "./constants";
|
|
3
|
-
import { convertToPositiveNumberIfPossible } from "./numberHelpers";
|
|
2
|
+
import { monthNames, announcableCardinalDays } from "./constants.js";
|
|
3
|
+
import { convertToPositiveNumberIfPossible } from "./numberHelpers.js";
|
|
4
4
|
const prependStringWithPlaceHolders = (val, finalLength, placeholder = "0") => {
|
|
5
5
|
if (val.length === finalLength)
|
|
6
6
|
return val;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/stringHelpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { monthNames, announcableCardinalDays } from './constants';\nimport { convertToPositiveNumberIfPossible } from './numberHelpers';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes';\n/* eslint-disable max-lines */\nexport const prependStringWithPlaceHolders = (val: string, finalLength: number, placeholder = '0'): string => {\n if (val.length === finalLength) return val;\n const stringAsAnArray = val.split('').reverse();\n return new Array(finalLength)\n .fill(placeholder)\n .map((_c, i) => (stringAsAnArray[i] ? stringAsAnArray[i] : placeholder))\n .reverse()\n .join('');\n};\nexport const fillStringWithPlaceHolders = (val: string, finalLength: number, placeholder = '_'): string => {\n if (val.length === finalLength) return val;\n const stringAsAnArray = val.split('');\n return new Array(finalLength)\n .fill(placeholder)\n .map((_c, i) => (stringAsAnArray[i] ? stringAsAnArray[i] : placeholder))\n .join('');\n};\n\nexport const getFormattedDateString = ({ month, day, year }: { month: string; day: string; year: string }): string => {\n const finalMonth = fillStringWithPlaceHolders(month, 2);\n const finalDay = fillStringWithPlaceHolders(day, 2);\n const finalYear = fillStringWithPlaceHolders(year, 4);\n return `${finalMonth}/${finalDay}/${finalYear}`;\n};\nexport const dateTimeToDate = (dateTime: string): string => dateTime?.split?.(' ')?.[0];\nexport const deconstructValuesFromDateString = (dateString: string): { month: string; day: string; year: string } => {\n const [dirtyMonth = '', dirtyDay = '', dirtyYear = ''] = dateString.split('/');\n const replaceAllRegexp = /_/g;\n return {\n month: (dirtyMonth || '').replace(replaceAllRegexp, ''),\n day: (dirtyDay || '').replace(replaceAllRegexp, ''),\n year: (dirtyYear || '').replace(replaceAllRegexp, ''),\n };\n};\nexport const deconstructValuesFromTimeString = (\n timeString: string,\n): { hours: string; minutes: string; meridiem: string } => {\n const [dirtyHour = '', dirtyMintuesAndMeridiem = ''] = timeString.split(':');\n const [dirtyMinutes = '', dirtyMeridiem = ''] = dirtyMintuesAndMeridiem.split(' ');\n const replaceAllRegexp = /_/g;\n return {\n hours: (dirtyHour || '').replace(replaceAllRegexp, ''),\n minutes: (dirtyMinutes || '').replace(replaceAllRegexp, ''),\n meridiem: (dirtyMeridiem || '').replace(replaceAllRegexp, ''),\n };\n};\n// https://regex101.com/r/U5r5lh/1/\nconst dateRegExp = /^[0-9_][0-9_]\\/[0-9_][0-9_]\\/[0-9_]{4}$/;\nexport const isValidDateString = (testString: string): boolean => {\n if (testString === '') return true;\n const isValidDateRegexp = dateRegExp.test(testString);\n if (!isValidDateRegexp) return false;\n const { month, day, year } = deconstructValuesFromDateString(testString);\n if (Number.parseInt(month, 10) > 12 || Number.parseInt(day, 10) > 31 || Number.parseInt(year, 10) > 9999)\n return false;\n\n return true;\n};\n\nexport const getFormattedTimeString = ({\n hours,\n minutes,\n // seconds,\n meridiem,\n}: {\n hours: string;\n minutes: string;\n // seconds:string;\n meridiem: string;\n}): string => {\n const finalHour = fillStringWithPlaceHolders(hours, 2);\n const finalMinutes = fillStringWithPlaceHolders(minutes, 2);\n // const finalSeconds = fillStringWithPlaceHolders(seconds, 2); // <-- seconds format\n const finalMeridiem = fillStringWithPlaceHolders(meridiem, 2);\n // return `${finalHour}:${finalMinutes}:${finalSeconds} ${finalMeridiem}`;// <-- seconds format\n return `${finalHour}:${finalMinutes} ${finalMeridiem}`;\n};\nexport const dateTimeToTime = (dateTime: string): string => {\n const [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n date,\n // timeNumbers = '__:__:__', // <-- seconds format\n timeNumbers = '__:__',\n timeMeridiem = '__',\n ] = dateTime.split(' ');\n return `${timeNumbers} ${timeMeridiem}`;\n};\nexport const deconstructTimeValues = (\n timeString: string,\n): {\n hours: string;\n minutes: string;\n meridiem: string;\n} => {\n const [dirtyTimes = '', dirtyMeridiem] = timeString.split(' '); // <--['__:__','__']\n const [dirtyHours, dirtyMinutes] = dirtyTimes.split(':'); // <--['__','__']\n const regex = /_/g; // Note the 'g' flag, which matches all occurrences of the expression\n const newValues = {\n hours: (dirtyHours || '').replace(regex, ''),\n minutes: (dirtyMinutes || '').replace(regex, ''),\n meridiem: (dirtyMeridiem || '').replace(regex, ''),\n };\n return newValues;\n};\n\n// https://regex101.com/r/jeBmNT/1\nconst timeRegExp = /^[0-9_][0-9_]:[0-9_][0-9_]\\s[aApP_][mM_]$/;\nexport const isValidTimeString = (testString: string): boolean => {\n if (testString === '') return true;\n const isValidTimeRegexp = timeRegExp.test(testString);\n if (!isValidTimeRegexp) return false;\n const { hours, minutes } = deconstructTimeValues(testString);\n if (Number.parseInt(hours, 10) > 12 || Number.parseInt(minutes, 10) > 60) return false;\n\n return true;\n};\n\nexport const isIncompleteString = (testString: string, placeholder = '_'): boolean =>\n testString === '' || testString.includes(placeholder);\n\nexport const isEmptyDateStringMask = (testString: string): boolean => testString === '__/__/____';\nexport const isEmptyTimeStringMask = (testString: string): boolean => testString === '__:__ __';\nexport const isEmptyDateTimeStringMask = (testString: string): boolean => testString === '__/__/____ __:__ __';\n\nexport const getAriaDayFromDateString = (dateString: string): string => {\n const { month: monthString, day: dayString, year: yearString } = deconstructValuesFromDateString(dateString);\n const monthNum = convertToPositiveNumberIfPossible(monthString);\n const dayNum = convertToPositiveNumberIfPossible(dayString) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n const yearNum = convertToPositiveNumberIfPossible(yearString);\n if (monthNum === -1 || dayNum === -1 || yearNum === -1) return '';\n return `${monthNames[monthNum - 1]} ${announcableCardinalDays[dayNum]} ${yearNum}`;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { monthNames, announcableCardinalDays } from './constants.js';\nimport { convertToPositiveNumberIfPossible } from './numberHelpers.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\n/* eslint-disable max-lines */\nexport const prependStringWithPlaceHolders = (val: string, finalLength: number, placeholder = '0'): string => {\n if (val.length === finalLength) return val;\n const stringAsAnArray = val.split('').reverse();\n return new Array(finalLength)\n .fill(placeholder)\n .map((_c, i) => (stringAsAnArray[i] ? stringAsAnArray[i] : placeholder))\n .reverse()\n .join('');\n};\nexport const fillStringWithPlaceHolders = (val: string, finalLength: number, placeholder = '_'): string => {\n if (val.length === finalLength) return val;\n const stringAsAnArray = val.split('');\n return new Array(finalLength)\n .fill(placeholder)\n .map((_c, i) => (stringAsAnArray[i] ? stringAsAnArray[i] : placeholder))\n .join('');\n};\n\nexport const getFormattedDateString = ({ month, day, year }: { month: string; day: string; year: string }): string => {\n const finalMonth = fillStringWithPlaceHolders(month, 2);\n const finalDay = fillStringWithPlaceHolders(day, 2);\n const finalYear = fillStringWithPlaceHolders(year, 4);\n return `${finalMonth}/${finalDay}/${finalYear}`;\n};\nexport const dateTimeToDate = (dateTime: string): string => dateTime?.split?.(' ')?.[0];\nexport const deconstructValuesFromDateString = (dateString: string): { month: string; day: string; year: string } => {\n const [dirtyMonth = '', dirtyDay = '', dirtyYear = ''] = dateString.split('/');\n const replaceAllRegexp = /_/g;\n return {\n month: (dirtyMonth || '').replace(replaceAllRegexp, ''),\n day: (dirtyDay || '').replace(replaceAllRegexp, ''),\n year: (dirtyYear || '').replace(replaceAllRegexp, ''),\n };\n};\nexport const deconstructValuesFromTimeString = (\n timeString: string,\n): { hours: string; minutes: string; meridiem: string } => {\n const [dirtyHour = '', dirtyMintuesAndMeridiem = ''] = timeString.split(':');\n const [dirtyMinutes = '', dirtyMeridiem = ''] = dirtyMintuesAndMeridiem.split(' ');\n const replaceAllRegexp = /_/g;\n return {\n hours: (dirtyHour || '').replace(replaceAllRegexp, ''),\n minutes: (dirtyMinutes || '').replace(replaceAllRegexp, ''),\n meridiem: (dirtyMeridiem || '').replace(replaceAllRegexp, ''),\n };\n};\n// https://regex101.com/r/U5r5lh/1/\nconst dateRegExp = /^[0-9_][0-9_]\\/[0-9_][0-9_]\\/[0-9_]{4}$/;\nexport const isValidDateString = (testString: string): boolean => {\n if (testString === '') return true;\n const isValidDateRegexp = dateRegExp.test(testString);\n if (!isValidDateRegexp) return false;\n const { month, day, year } = deconstructValuesFromDateString(testString);\n if (Number.parseInt(month, 10) > 12 || Number.parseInt(day, 10) > 31 || Number.parseInt(year, 10) > 9999)\n return false;\n\n return true;\n};\n\nexport const getFormattedTimeString = ({\n hours,\n minutes,\n // seconds,\n meridiem,\n}: {\n hours: string;\n minutes: string;\n // seconds:string;\n meridiem: string;\n}): string => {\n const finalHour = fillStringWithPlaceHolders(hours, 2);\n const finalMinutes = fillStringWithPlaceHolders(minutes, 2);\n // const finalSeconds = fillStringWithPlaceHolders(seconds, 2); // <-- seconds format\n const finalMeridiem = fillStringWithPlaceHolders(meridiem, 2);\n // return `${finalHour}:${finalMinutes}:${finalSeconds} ${finalMeridiem}`;// <-- seconds format\n return `${finalHour}:${finalMinutes} ${finalMeridiem}`;\n};\nexport const dateTimeToTime = (dateTime: string): string => {\n const [\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n date,\n // timeNumbers = '__:__:__', // <-- seconds format\n timeNumbers = '__:__',\n timeMeridiem = '__',\n ] = dateTime.split(' ');\n return `${timeNumbers} ${timeMeridiem}`;\n};\nexport const deconstructTimeValues = (\n timeString: string,\n): {\n hours: string;\n minutes: string;\n meridiem: string;\n} => {\n const [dirtyTimes = '', dirtyMeridiem] = timeString.split(' '); // <--['__:__','__']\n const [dirtyHours, dirtyMinutes] = dirtyTimes.split(':'); // <--['__','__']\n const regex = /_/g; // Note the 'g' flag, which matches all occurrences of the expression\n const newValues = {\n hours: (dirtyHours || '').replace(regex, ''),\n minutes: (dirtyMinutes || '').replace(regex, ''),\n meridiem: (dirtyMeridiem || '').replace(regex, ''),\n };\n return newValues;\n};\n\n// https://regex101.com/r/jeBmNT/1\nconst timeRegExp = /^[0-9_][0-9_]:[0-9_][0-9_]\\s[aApP_][mM_]$/;\nexport const isValidTimeString = (testString: string): boolean => {\n if (testString === '') return true;\n const isValidTimeRegexp = timeRegExp.test(testString);\n if (!isValidTimeRegexp) return false;\n const { hours, minutes } = deconstructTimeValues(testString);\n if (Number.parseInt(hours, 10) > 12 || Number.parseInt(minutes, 10) > 60) return false;\n\n return true;\n};\n\nexport const isIncompleteString = (testString: string, placeholder = '_'): boolean =>\n testString === '' || testString.includes(placeholder);\n\nexport const isEmptyDateStringMask = (testString: string): boolean => testString === '__/__/____';\nexport const isEmptyTimeStringMask = (testString: string): boolean => testString === '__:__ __';\nexport const isEmptyDateTimeStringMask = (testString: string): boolean => testString === '__/__/____ __:__ __';\n\nexport const getAriaDayFromDateString = (dateString: string): string => {\n const { month: monthString, day: dayString, year: yearString } = deconstructValuesFromDateString(dateString);\n const monthNum = convertToPositiveNumberIfPossible(monthString);\n const dayNum = convertToPositiveNumberIfPossible(dayString) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n const yearNum = convertToPositiveNumberIfPossible(yearString);\n if (monthNum === -1 || dayNum === -1 || yearNum === -1) return '';\n return `${monthNames[monthNum - 1]} ${announcableCardinalDays[dayNum]} ${yearNum}`;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,+BAA+B;AACpD,SAAS,yCAAyC;AAG3C,MAAM,gCAAgC,CAAC,KAAa,aAAqB,cAAc,QAAgB;AAC5G,MAAI,IAAI,WAAW;AAAa,WAAO;AACvC,QAAM,kBAAkB,IAAI,MAAM,EAAE,EAAE,QAAQ;AAC9C,SAAO,IAAI,MAAM,WAAW,EACzB,KAAK,WAAW,EAChB,IAAI,CAAC,IAAI,MAAO,gBAAgB,KAAK,gBAAgB,KAAK,WAAY,EACtE,QAAQ,EACR,KAAK,EAAE;AACZ;AACO,MAAM,6BAA6B,CAAC,KAAa,aAAqB,cAAc,QAAgB;AACzG,MAAI,IAAI,WAAW;AAAa,WAAO;AACvC,QAAM,kBAAkB,IAAI,MAAM,EAAE;AACpC,SAAO,IAAI,MAAM,WAAW,EACzB,KAAK,WAAW,EAChB,IAAI,CAAC,IAAI,MAAO,gBAAgB,KAAK,gBAAgB,KAAK,WAAY,EACtE,KAAK,EAAE;AACZ;AAEO,MAAM,yBAAyB,CAAC,EAAE,OAAO,KAAK,KAAK,MAA4D;AACpH,QAAM,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,CAAC,eAAgC,eAAe;AAC9E,MAAM,4BAA4B,CAAC,eAAgC,eAAe;AAElF,MAAM,2BAA2B,CAAC,eAA+B;AACtE,QAAM,EAAE,OAAO,aAAa,KAAK,WAAW,MAAM,WAAW,IAAI,gCAAgC,UAAU;AAC3G,QAAM,WAAW,kCAAkC,WAAW;AAC9D,QAAM,SAAS,kCAAkC,SAAS;AAC1D,QAAM,UAAU,kCAAkC,UAAU;AAC5D,MAAI,aAAa,MAAM,WAAW,MAAM,YAAY;AAAI,WAAO;AAC/D,SAAO,GAAG,WAAW,WAAW,MAAM,wBAAwB,WAAW;AAC3E;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import { isIncompleteString } from "./stringHelpers";
|
|
2
|
+
import { isIncompleteString } from "./stringHelpers.js";
|
|
3
3
|
const getValidationTimeStringMetaInfo = (timeString, getIsDisabledTime = (timeS) => false) => {
|
|
4
4
|
const metaInfo = {};
|
|
5
5
|
if (!isIncompleteString(timeString)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/timeHelpers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isIncompleteString } from './stringHelpers';\nimport type { DSControlledDateTimePickerT } from '../propTypes';\n\nexport const getValidationTimeStringMetaInfo = (\n timeString: string,\n getIsDisabledTime = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n timeS: string,\n ) => false,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {};\n if (!isIncompleteString(timeString)) {\n metaInfo.isDisabledTime = getIsDisabledTime(timeString);\n if (metaInfo.isDisabledTime) metaInfo.suggestedErrorMsg = 'The selected time is not allowed';\n }\n\n return metaInfo;\n};\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isIncompleteString } from './stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../propTypes.js';\n\nexport const getValidationTimeStringMetaInfo = (\n timeString: string,\n getIsDisabledTime = (\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars\n timeS: string,\n ) => false,\n): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {};\n if (!isIncompleteString(timeString)) {\n metaInfo.isDisabledTime = getIsDisabledTime(timeString);\n if (metaInfo.isDisabledTime) metaInfo.suggestedErrorMsg = 'The selected time is not allowed';\n }\n\n return metaInfo;\n};\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,0BAA0B;AAG5B,MAAM,kCAAkC,CAC7C,YACA,oBAAoB,CAElB,UACG,UACiE;AACtE,QAAM,WAA8E,CAAC;AACrF,MAAI,CAAC,mBAAmB,UAAU,GAAG;AACnC,aAAS,iBAAiB,kBAAkB,UAAU;AACtD,QAAI,SAAS;AAAgB,eAAS,oBAAoB;AAAA,EAC5D;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/utils/typeGuards.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSControlledDateTimePickerT } from '../propTypes';\n\nconst dateTimeTypes = ['full-date-time', 'date-time-inputs', 'date-time-picker', 'date-time-picker-controller-only'];\nconst dateTypes = ['full-date', 'date-inputs', 'date-picker', 'date-picker-controller-only'];\nconst timeTypes = ['full-time', 'time-inputs', 'time-picker', 'time-picker-controller-only'];\n\nexport const getIsDateTime = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.DateTimePickerProps | DSControlledDateTimePickerT.InternalDateTimePickerProps =>\n dateTimeTypes.includes(props.type);\n\nexport const getIsDate = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.DatePickerProps | DSControlledDateTimePickerT.InternalDatePickerProps =>\n dateTypes.includes(props.type);\n\nexport const getIsTime = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.TimePickerProps | DSControlledDateTimePickerT.InternalTimePickerProps =>\n timeTypes.includes(props.type);\n"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import type { DSControlledDateTimePickerT } from '../propTypes.js';\n\nconst dateTimeTypes = ['full-date-time', 'date-time-inputs', 'date-time-picker', 'date-time-picker-controller-only'];\nconst dateTypes = ['full-date', 'date-inputs', 'date-picker', 'date-picker-controller-only'];\nconst timeTypes = ['full-time', 'time-inputs', 'time-picker', 'time-picker-controller-only'];\n\nexport const getIsDateTime = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.DateTimePickerProps | DSControlledDateTimePickerT.InternalDateTimePickerProps =>\n dateTimeTypes.includes(props.type);\n\nexport const getIsDate = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.DatePickerProps | DSControlledDateTimePickerT.InternalDatePickerProps =>\n dateTypes.includes(props.type);\n\nexport const getIsTime = (\n props: DSControlledDateTimePickerT.Props | DSControlledDateTimePickerT.InternalProps,\n): props is DSControlledDateTimePickerT.TimePickerProps | DSControlledDateTimePickerT.InternalTimePickerProps =>\n timeTypes.includes(props.type);\n"],
|
|
5
5
|
"mappings": "AAAA,YAAY,WAAW;ACEvB,MAAM,gBAAgB,CAAC,kBAAkB,oBAAoB,oBAAoB,kCAAkC;AACnH,MAAM,YAAY,CAAC,aAAa,eAAe,eAAe,6BAA6B;AAC3F,MAAM,YAAY,CAAC,aAAa,eAAe,eAAe,6BAA6B;AAEpF,MAAM,gBAAgB,CAC3B,UAEA,cAAc,SAAS,MAAM,IAAI;AAE5B,MAAM,YAAY,CACvB,UAEA,UAAU,SAAS,MAAM,IAAI;AAExB,MAAM,YAAY,CACvB,UAEA,UAAU,SAAS,MAAM,IAAI;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-form-date-time-picker",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.16.0-next.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Date Time Picker",
|
|
6
6
|
"files": [
|
|
@@ -35,13 +35,14 @@
|
|
|
35
35
|
"indent": 4
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@elliemae/ds-button": "3.
|
|
39
|
-
"@elliemae/ds-
|
|
40
|
-
"@elliemae/ds-
|
|
41
|
-
"@elliemae/ds-
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-utilities": "3.
|
|
38
|
+
"@elliemae/ds-button": "3.16.0-next.10",
|
|
39
|
+
"@elliemae/ds-icon": "3.16.0-next.10",
|
|
40
|
+
"@elliemae/ds-popperjs": "3.16.0-next.10",
|
|
41
|
+
"@elliemae/ds-system": "3.16.0-next.10",
|
|
42
|
+
"@elliemae/ds-icons": "3.16.0-next.10",
|
|
43
|
+
"@elliemae/ds-props-helpers": "3.16.0-next.10",
|
|
44
|
+
"@elliemae/ds-utilities": "3.16.0-next.10",
|
|
45
|
+
"@elliemae/ds-grid": "3.16.0-next.10"
|
|
45
46
|
},
|
|
46
47
|
"devDependencies": {
|
|
47
48
|
"@elliemae/pui-theme": "~2.6.0",
|
|
@@ -71,7 +72,7 @@
|
|
|
71
72
|
"dts": "node ../../scripts/dts.mjs",
|
|
72
73
|
"dts:withdeps": "pnpm --filter {.}... dts",
|
|
73
74
|
"build": "cross-env NODE_ENV=production node ../../scripts/build/build.mjs",
|
|
74
|
-
"dev:build": "pnpm --filter {.}... build
|
|
75
|
+
"dev:build": "pnpm --filter {.}... build",
|
|
75
76
|
"dev:install": "pnpm --filter {.}... i --no-lockfile && pnpm run dev:build",
|
|
76
77
|
"checkDeps": "npx -yes ../ds-codemods check-missing-packages --projectFolderPath=\"./\" --ignorePackagesGlobPattern=\"\" --ignoreFilesGlobPattern=\"**/test-ables/*,**/tests/*\""
|
|
77
78
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DSControlledDateTimePickerT } from './propTypes';
|
|
2
|
-
declare const DSControlledDateTimePicker: {
|
|
3
|
-
(props: DSControlledDateTimePickerT.Props): JSX.Element;
|
|
4
|
-
displayName: string;
|
|
5
|
-
};
|
|
6
|
-
declare const DSControlledDateTimePickerWithSchema: import("@elliemae/ds-utilities/dist/types/props-helpers/propTypes/types").DocumentedReactComponent<DSControlledDateTimePickerT.Props>;
|
|
7
|
-
export { DSControlledDateTimePickerWithSchema, DSControlledDateTimePicker };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { ControlledDateTimePickerContextT } from './config/useControlledDateTimePicker';
|
|
3
|
-
/** Context for cross component communication */
|
|
4
|
-
export declare const ControlledDateTimePickerContext: import("react").Context<ControlledDateTimePickerContextT>;
|
|
5
|
-
export default ControlledDateTimePickerContext;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export declare const ControlledDateTimePickerDatatestid: {
|
|
2
|
-
readonly CONTAINER: "ds-controlled-date-time-picker-container";
|
|
3
|
-
readonly DATE_INPUTS: {
|
|
4
|
-
readonly MONTH: "ds-controlled-date-time-picker-month-input";
|
|
5
|
-
readonly DAY: "ds-controlled-date-time-picker-day-input";
|
|
6
|
-
readonly YEAR: "ds-controlled-date-time-picker-year-input";
|
|
7
|
-
};
|
|
8
|
-
readonly TIME_INPUTS: {
|
|
9
|
-
readonly HOUR: "ds-controlled-date-time-picker-hour-input";
|
|
10
|
-
readonly MINUTE: "ds-controlled-date-time-picker-minute-input";
|
|
11
|
-
readonly MERIDIEM: "ds-controlled-date-time-picker-meridiem-input";
|
|
12
|
-
};
|
|
13
|
-
readonly PICKER_ICONS: {
|
|
14
|
-
readonly CALENDAR: "ds-controlled-date-time-picker-calendar-trigger-icon";
|
|
15
|
-
readonly TIMEWHEEL: "ds-controlled-date-time-picker-timewheel-trigger-icon";
|
|
16
|
-
readonly CALENDAR_TIMEWHEEL: "ds-controlled-date-time-picker-calendar-timewheel-trigger-icon";
|
|
17
|
-
};
|
|
18
|
-
readonly CALENDAR: {
|
|
19
|
-
readonly HEADER_LABEL: "ds-controlled-date-time-picker-calendar-header-label";
|
|
20
|
-
readonly PREV_YEAR: "ds-controlled-date-time-picker-calendar-prev-year";
|
|
21
|
-
readonly PREV_MONTH: "ds-controlled-date-time-picker-calendar-prev-month";
|
|
22
|
-
readonly DAY: "ds-controlled-date-time-picker-calendar-day";
|
|
23
|
-
readonly FOCUSED_DAY: "ds-controlled-date-time-picker-calendar-focused-day";
|
|
24
|
-
readonly START_RANGE_DAY: "ds-controlled-date-time-picker-calendar-start-range-day";
|
|
25
|
-
readonly IN_RANGE_DAY: "ds-controlled-date-time-picker-calendar-in-range-day";
|
|
26
|
-
readonly END_RANGE_DAY: "ds-controlled-date-time-picker-calendar-end-range-day";
|
|
27
|
-
readonly SELECTED_DAY: "ds-controlled-date-time-picker-calendar-selected-day";
|
|
28
|
-
readonly SELECTED_FOCUSED_DAY: "ds-controlled-date-time-picker-calendar-selected-focused-day";
|
|
29
|
-
readonly NEXT_MONTH: "ds-controlled-date-time-picker-calendar-next-month";
|
|
30
|
-
readonly NEXT_YEAR: "ds-controlled-date-time-picker-calendar-next-year";
|
|
31
|
-
};
|
|
32
|
-
readonly TIMEWHEEL: {
|
|
33
|
-
readonly HEADER_LABEL: "ds-controlled-date-time-picker-timewheel-header-label";
|
|
34
|
-
readonly PREV_HOUR: "ds-controlled-date-time-picker-timewheel-prev-hour";
|
|
35
|
-
readonly HOUR: "ds-controlled-date-time-picker-timewheel-hour";
|
|
36
|
-
readonly CURRENT_HOUR: "ds-controlled-date-time-picker-timewheel-current-hour";
|
|
37
|
-
readonly NEXT_HOUR: "ds-controlled-date-time-picker-timewheel-next-hour";
|
|
38
|
-
readonly PREV_MINUTE: "ds-controlled-date-time-picker-timewheel-prev-minute";
|
|
39
|
-
readonly MINUTE: "ds-controlled-date-time-picker-timewheel-minute";
|
|
40
|
-
readonly CURRENT_MINUTE: "ds-controlled-date-time-picker-timewheel-current-minute";
|
|
41
|
-
readonly NEXT_MINUTE: "ds-controlled-date-time-picker-timewheel-next-minute";
|
|
42
|
-
readonly PREV_MERIDIEM: "ds-controlled-date-time-picker-timewheel-prev-meridiem";
|
|
43
|
-
readonly MERIDIEM: "ds-controlled-date-time-picker-timewheel-meridiem";
|
|
44
|
-
readonly CURRENT_MERIDIEM: "ds-controlled-date-time-picker-timewheel-current-meridiem";
|
|
45
|
-
readonly NEXT_MERIDIEM: "ds-controlled-date-time-picker-timewheel-next-meridiem";
|
|
46
|
-
};
|
|
47
|
-
readonly CONTEXTUAL_MENU: {
|
|
48
|
-
readonly CALENDAR: "ds-controlled-date-time-picker-calendar-context-content-wrapper";
|
|
49
|
-
readonly TIMEWHEEL: "ds-controlled-date-time-picker-timewheel-context-content-wrapper";
|
|
50
|
-
readonly CALENDAR_TIMEWHEEL: "ds-controlled-date-time-picker-calendar-timewheel-context-content-wrapper";
|
|
51
|
-
};
|
|
52
|
-
readonly CONTROLLER_COMPONENT: {
|
|
53
|
-
readonly CALENDAR: "ds-controlled-date-time-picker-calendar-controller-wrapper";
|
|
54
|
-
readonly TIMEWHEEL: "ds-controlled-date-time-picker-timewheel-controller-wrapper";
|
|
55
|
-
readonly CALENDAR_TIMEWHEEL: "ds-controlled-date-time-picker-calendar-timewheel-controller-wrapper";
|
|
56
|
-
};
|
|
57
|
-
readonly FOOTERS: {
|
|
58
|
-
readonly CALENDAR: "ds-controlled-date-time-picker-calendar-context-footer";
|
|
59
|
-
readonly TIMEWHEEL: "ds-controlled-date-time-picker-timewheel-context-footer";
|
|
60
|
-
readonly CALENDAR_TIMEWHEEL: "ds-controlled-date-time-picker-calendar-timewheel-context-footer";
|
|
61
|
-
};
|
|
62
|
-
readonly CLEAR_BUTTON: "ds-controlled-date-time-picker-clear-btn";
|
|
63
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export declare const CONTROLLED_DATE_TIME_PICKER_TYPES: {
|
|
2
|
-
readonly DATE_TIME: {
|
|
3
|
-
readonly FULL: "full-date-time";
|
|
4
|
-
readonly CONTROLLER_ONLY: "date-time-picker-controller-only";
|
|
5
|
-
readonly PICKER: "date-time-picker";
|
|
6
|
-
readonly INPUTS: "date-time-inputs";
|
|
7
|
-
};
|
|
8
|
-
readonly DATE: {
|
|
9
|
-
readonly FULL: "full-date";
|
|
10
|
-
readonly CONTROLLER_ONLY: "date-picker-controller-only";
|
|
11
|
-
readonly PICKER: "date-picker";
|
|
12
|
-
readonly INPUTS: "date-inputs";
|
|
13
|
-
};
|
|
14
|
-
readonly TIME: {
|
|
15
|
-
readonly FULL: "full-time";
|
|
16
|
-
readonly CONTROLLER_ONLY: "time-picker-controller-only";
|
|
17
|
-
readonly PICKER: "time-picker";
|
|
18
|
-
readonly INPUTS: "time-inputs";
|
|
19
|
-
};
|
|
20
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { useRelevantValueFromProps } from './useRelevantValueFromProps';
|
|
2
|
-
import type { useGetDestructuredValues } from './useGetDestructuredValues';
|
|
3
|
-
import type { useGetPropsBasedOnType } from './useGetPropsBasedOnType';
|
|
4
|
-
import type { useGetReferences } from './useGetReferences';
|
|
5
|
-
import type { useFocusTracker } from './useFocusTracker';
|
|
6
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
7
|
-
import type { DSControlledDateTimePickerInternalsT } from '../sharedTypes';
|
|
8
|
-
interface Config {
|
|
9
|
-
relevantValues: ReturnType<typeof useRelevantValueFromProps>;
|
|
10
|
-
destructuredValues: ReturnType<typeof useGetDestructuredValues>;
|
|
11
|
-
propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;
|
|
12
|
-
DOMRefs: ReturnType<typeof useGetReferences>;
|
|
13
|
-
focusTrackers: ReturnType<typeof useFocusTracker>;
|
|
14
|
-
}
|
|
15
|
-
export declare const useChangeHandlers: ({ relevantValues, destructuredValues, propsBasedOnType, focusTrackers }: Config) => {
|
|
16
|
-
handleChangeComposedDateTimeString: (newDateString: string, newTimeString: string, metaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo) => void;
|
|
17
|
-
handleChangeComposedDateString: (newDateString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => void;
|
|
18
|
-
handleChangeComposedTimeString: (newTimeString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => void;
|
|
19
|
-
handleChangeMonth: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
20
|
-
handleChangeDay: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
21
|
-
handleChangeYear: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
22
|
-
handleChangeHours: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
23
|
-
handleChangeMinutes: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
24
|
-
handleChangeMeridiem: DSControlledDateTimePickerT.OnInternalInputsChange;
|
|
25
|
-
handleClearAll: DSControlledDateTimePickerInternalsT.OnDSBtnClick;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { useFocusTracker } from './useFocusTracker';
|
|
2
|
-
import { useGetFlags } from './useGetFlags';
|
|
3
|
-
import { useGetReferences } from './useGetReferences';
|
|
4
|
-
import { useRelevantValueFromProps } from './useRelevantValueFromProps';
|
|
5
|
-
import { useGetPropsBasedOnType } from './useGetPropsBasedOnType';
|
|
6
|
-
import { useGetDestructuredValues } from './useGetDestructuredValues';
|
|
7
|
-
import { useChangeHandlers } from './useChangeHandlers';
|
|
8
|
-
import { useGlobalKeyHandlers } from './useGlobalKeyHandlers';
|
|
9
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
10
|
-
export type ControlledDateTimePickerContextT = ReturnType<typeof useGetFlags> & ReturnType<typeof useFocusTracker> & ReturnType<typeof useGetReferences> & ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useRelevantValueFromProps> & ReturnType<typeof useGetDestructuredValues> & ReturnType<typeof useChangeHandlers> & ReturnType<typeof useGlobalKeyHandlers> & {
|
|
11
|
-
props: DSControlledDateTimePickerT.InternalProps;
|
|
12
|
-
ariaCurrentValueForInputs: string;
|
|
13
|
-
globalAttrs: Record<string, unknown>;
|
|
14
|
-
xstyledAttrs: Record<string, unknown>;
|
|
15
|
-
};
|
|
16
|
-
export declare const useControlledDateTimePicker: (props: DSControlledDateTimePickerT.Props) => ControlledDateTimePickerContextT;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { useGetReferences } from './useGetReferences';
|
|
3
|
-
import type { useGetFlags } from './useGetFlags';
|
|
4
|
-
type LatestInteractionRegion = 'calendar-days' | 'calendar-head' | 'timewheel' | 'date-inputs' | 'time-inputs' | 'clear-btn' | 'picker-icon' | '';
|
|
5
|
-
type CurrFocusDescriber = 'first-segment' | 'month-input' | 'day-input' | 'year-input' | 'hour-input' | 'minute-input' | 'meridiem-input' | 'last-segment' | 'clear-btn' | 'date-picker-icon' | 'time-picker-icon' | 'datetime-picker-icon' | 'calendar-prev-month' | 'calendar-next-month' | 'calendar-prev-year' | 'calendar-next-year' | 'calendar-metafocused-day' | 'timewheel-curr-hour' | 'timewheel-curr-minute' | 'timewheel-curr-meridiem' | '';
|
|
6
|
-
interface Config {
|
|
7
|
-
DOMRefs: ReturnType<typeof useGetReferences>;
|
|
8
|
-
flags: ReturnType<typeof useGetFlags>;
|
|
9
|
-
}
|
|
10
|
-
export declare const useFocusTracker: ({ DOMRefs, flags }: Config) => {
|
|
11
|
-
latestInteractionRegion: LatestInteractionRegion;
|
|
12
|
-
setLatestInteractionRegion: import("react").Dispatch<import("react").SetStateAction<LatestInteractionRegion>>;
|
|
13
|
-
currFocusDescriber: CurrFocusDescriber;
|
|
14
|
-
setCurrFocusDescriber: import("react").Dispatch<import("react").SetStateAction<CurrFocusDescriber>>;
|
|
15
|
-
trackFocusResetter: () => void;
|
|
16
|
-
trackFocusMonthInput: () => void;
|
|
17
|
-
trackFocusDayInput: () => void;
|
|
18
|
-
trackFocusYearInput: () => void;
|
|
19
|
-
trackFocusHourInput: () => void;
|
|
20
|
-
trackFocusMinuteInput: () => void;
|
|
21
|
-
trackFocusMeridiemInput: () => void;
|
|
22
|
-
trackFocusClearBtn: () => void;
|
|
23
|
-
trackFocusDatePickerIcon: () => void;
|
|
24
|
-
trackFocusTimePickerIcon: () => void;
|
|
25
|
-
trackFocusDatetimePickerIcon: () => void;
|
|
26
|
-
trackFocusCalendarPrevMonth: () => void;
|
|
27
|
-
trackFocusCalendarNextMonth: () => void;
|
|
28
|
-
trackFocusCalendarPrevYear: () => void;
|
|
29
|
-
trackFocusCalendarNextYear: () => void;
|
|
30
|
-
trackFocusCalendarMetafocusedDay: () => void;
|
|
31
|
-
trackFocusTimewheelCurrHour: () => void;
|
|
32
|
-
trackFocusTimewheelCurrMinute: () => void;
|
|
33
|
-
trackFocusTimewheelCurrMeridiem: () => void;
|
|
34
|
-
trackFocusPicker: () => void;
|
|
35
|
-
trackFocusFirstSegment: () => void;
|
|
36
|
-
trackFocusLastSegment: () => void;
|
|
37
|
-
};
|
|
38
|
-
export {};
|