@elliemae/ds-form-date-time-picker 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ControlledDateTimePicker.js +9 -5
- package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/ControlledDateTimePickerCTX.js +4 -0
- package/dist/cjs/ControlledDateTimePickerCTX.js.map +2 -2
- package/dist/cjs/ControlledDateTimePickerDatatestid.js +4 -0
- package/dist/cjs/ControlledDateTimePickerDatatestid.js.map +1 -1
- package/dist/cjs/ControlledDateTimePickerTypes.js +4 -0
- package/dist/cjs/ControlledDateTimePickerTypes.js.map +1 -1
- package/dist/cjs/config/useChangeHandlers.js +9 -4
- package/dist/cjs/config/useChangeHandlers.js.map +2 -2
- package/dist/cjs/config/useControlledDateTimePicker.js +15 -10
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useFocusTracker.js +4 -0
- package/dist/cjs/config/useFocusTracker.js.map +2 -2
- package/dist/cjs/config/useGetDestructuredValues.js +11 -4
- package/dist/cjs/config/useGetDestructuredValues.js.map +2 -2
- package/dist/cjs/config/useGetFlags.js +6 -2
- package/dist/cjs/config/useGetFlags.js.map +2 -2
- package/dist/cjs/config/useGetPropsBasedOnType.js +6 -2
- package/dist/cjs/config/useGetPropsBasedOnType.js.map +2 -2
- package/dist/cjs/config/useGetPropsWithDefault.js +5 -1
- package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/cjs/config/useGetReferences.js +4 -0
- package/dist/cjs/config/useGetReferences.js.map +2 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js +8 -4
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/cjs/config/useRelevantValueFromProps.js +6 -2
- package/dist/cjs/config/useRelevantValueFromProps.js.map +2 -2
- package/dist/cjs/config/useValidateProps.js +7 -3
- package/dist/cjs/config/useValidateProps.js.map +2 -2
- package/dist/cjs/exported-related/theming.js +4 -0
- package/dist/cjs/exported-related/theming.js.map +1 -1
- package/dist/cjs/index.js +13 -9
- package/dist/cjs/index.js.map +2 -2
- package/dist/cjs/package.json +7 -0
- package/dist/cjs/parts/ClearButton/ClearButton.js +8 -4
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +2 -2
- package/dist/cjs/parts/ClearButton/useClearButton.js +5 -1
- package/dist/cjs/parts/ClearButton/useClearButton.js.map +2 -2
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +11 -7
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js +6 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +12 -8
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js +6 -2
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +6 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/useDateInputs.js +8 -4
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Calendar.js +9 -5
- package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js +7 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarBody.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +11 -7
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js +4 -0
- package/dist/cjs/parts/Pickers/Calendar/CalendarContext.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js +6 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +7 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +9 -5
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +8 -4
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js +7 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js +5 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarWeekDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +8 -4
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- 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 +5 -1
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js +9 -5
- package/dist/cjs/parts/Pickers/Calendar/useConfigCalendarCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +6 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +6 -2
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +7 -2
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +5 -1
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js +10 -6
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheel.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +9 -5
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js +4 -0
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +7 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +8 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +8 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js +6 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +8 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/PickersIcons.js +9 -5
- package/dist/cjs/parts/Pickers/PickersIcons.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +9 -5
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +8 -4
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +9 -5
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +5 -1
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js +9 -5
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheel.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +11 -7
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js +4 -0
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContext.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +7 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +8 -4
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -4
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js +7 -3
- package/dist/cjs/parts/Pickers/TimeWheel/useConfigTimePickerCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +8 -4
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js +5 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +5 -1
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +2 -2
- package/dist/cjs/parts/Styleds.js +5 -1
- package/dist/cjs/parts/Styleds.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js +6 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +6 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +6 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +12 -8
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js +6 -2
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +2 -2
- package/dist/cjs/parts/config.js +4 -0
- package/dist/cjs/parts/config.js.map +1 -1
- package/dist/cjs/propTypes.js +5 -1
- package/dist/cjs/propTypes.js.map +2 -2
- package/dist/cjs/sharedTypes.js +4 -0
- package/dist/cjs/sharedTypes.js.map +2 -2
- package/dist/cjs/tests/custom-props/customProps.js +4 -0
- package/dist/cjs/tests/custom-props/customProps.js.map +1 -1
- package/dist/cjs/utils/constants.js +4 -0
- package/dist/cjs/utils/constants.js.map +1 -1
- package/dist/cjs/utils/dateHelpers.js +7 -3
- package/dist/cjs/utils/dateHelpers.js.map +2 -2
- package/dist/cjs/utils/dateTimeHelpers.js +6 -2
- package/dist/cjs/utils/dateTimeHelpers.js.map +2 -2
- package/dist/cjs/utils/hooks/useGetDayFromDateString.js +6 -2
- package/dist/cjs/utils/hooks/useGetDayFromDateString.js.map +2 -2
- package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js +6 -2
- package/dist/cjs/utils/hooks/useGetMonthYearFromDateStringOrEmptyStartingMonth.js.map +2 -2
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js +9 -5
- package/dist/cjs/utils/hooks/useGetStartingFocusedDay.js.map +2 -2
- package/dist/cjs/utils/hooks/useOnClickOutside.js +4 -0
- package/dist/cjs/utils/hooks/useOnClickOutside.js.map +1 -1
- package/dist/cjs/utils/numberHelpers.js +4 -0
- package/dist/cjs/utils/numberHelpers.js.map +1 -1
- package/dist/cjs/utils/stringHelpers.js +9 -2
- package/dist/cjs/utils/stringHelpers.js.map +2 -2
- package/dist/cjs/utils/timeHelpers.js +5 -1
- package/dist/cjs/utils/timeHelpers.js.map +2 -2
- package/dist/cjs/utils/typeGuards.js +4 -0
- package/dist/cjs/utils/typeGuards.js.map +2 -2
- package/dist/esm/ControlledDateTimePicker.js +5 -5
- package/dist/esm/ControlledDateTimePicker.js.map +1 -1
- package/dist/esm/ControlledDateTimePickerCTX.js.map +1 -1
- package/dist/esm/config/useChangeHandlers.js +5 -4
- package/dist/esm/config/useChangeHandlers.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +11 -10
- package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useFocusTracker.js.map +1 -1
- package/dist/esm/config/useGetDestructuredValues.js +7 -4
- package/dist/esm/config/useGetDestructuredValues.js.map +2 -2
- package/dist/esm/config/useGetFlags.js +2 -2
- package/dist/esm/config/useGetFlags.js.map +1 -1
- package/dist/esm/config/useGetPropsBasedOnType.js +2 -2
- package/dist/esm/config/useGetPropsBasedOnType.js.map +2 -2
- package/dist/esm/config/useGetPropsWithDefault.js +1 -1
- package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
- package/dist/esm/config/useGetReferences.js.map +1 -1
- package/dist/esm/config/useGlobalKeyHandlers.js +4 -4
- package/dist/esm/config/useGlobalKeyHandlers.js.map +2 -2
- 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 +4 -4
- package/dist/esm/parts/ClearButton/ClearButton.js.map +2 -2
- 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 +7 -7
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/DateInputs.js +8 -8
- package/dist/esm/parts/DateInputs/DateInputs.js.map +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/YYYYInput.js +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/useDateInputs.js +4 -4
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/Calendar.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +1 -1
- 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 +7 -7
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +2 -2
- 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 +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +5 -5
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +4 -4
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +1 -1
- 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 +4 -4
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Day.js +7 -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 +2 -2
- 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 +2 -2
- 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 +3 -2
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +2 -2
- 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 +5 -5
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContext.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +4 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +4 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +2 -2
- 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 +5 -5
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +4 -4
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +5 -5
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +2 -2
- 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 +7 -7
- 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 +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +4 -4
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +4 -4
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/MinutesInput.js +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/TimeInputs.js +8 -8
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +2 -2
- package/dist/esm/parts/TimeInputs/useTimeInputs.js +2 -2
- package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +1 -1
- package/dist/esm/propTypes.js +1 -1
- package/dist/esm/propTypes.js.map +1 -1
- package/dist/esm/tests/custom-props/customProps.js.map +1 -1
- package/dist/esm/utils/dateHelpers.js +3 -3
- package/dist/esm/utils/dateHelpers.js.map +2 -2
- 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 +5 -2
- package/dist/esm/utils/stringHelpers.js.map +2 -2
- 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 +13 -13
- 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 -17
- package/dist/types/parts/DateInputs/DateInputs.d.ts +0 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +0 -19
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +0 -17
- 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 -18
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +0 -17
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +0 -17
- 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 -105
- package/dist/types/sharedTypes.d.ts +0 -95
- package/dist/types/tests/custom-props/customProps.d.ts +0 -397
- package/dist/types/tests/custom-props/date-time-picker.date-custom-props.test.d.ts +0 -1
- package/dist/types/tests/custom-props/date-time-picker.date-time-custom-props.test.d.ts +0 -1
- package/dist/types/tests/custom-props/date-time-picker.time-custom-props.test.d.ts +0 -1
- 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
|
@@ -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;
|
|
@@ -54,6 +54,7 @@ const isValidDateString = (testString) => {
|
|
|
54
54
|
const getFormattedTimeString = ({
|
|
55
55
|
hours,
|
|
56
56
|
minutes,
|
|
57
|
+
// seconds,
|
|
57
58
|
meridiem
|
|
58
59
|
}) => {
|
|
59
60
|
const finalHour = fillStringWithPlaceHolders(hours, 2);
|
|
@@ -63,7 +64,9 @@ const getFormattedTimeString = ({
|
|
|
63
64
|
};
|
|
64
65
|
const dateTimeToTime = (dateTime) => {
|
|
65
66
|
const [
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars
|
|
66
68
|
date,
|
|
69
|
+
// timeNumbers = '__:__:__', // <-- seconds format
|
|
67
70
|
timeNumbers = "__:__",
|
|
68
71
|
timeMeridiem = "__"
|
|
69
72
|
] = dateTime.split(" ");
|
|
@@ -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"],
|
|
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,
|
|
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
|
+
"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,CAAC,IAAI,gBAAgB,CAAC,IAAI,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,CAAC,IAAI,gBAAgB,CAAC,IAAI,WAAY,EACtE,KAAK,EAAE;AACZ;AAEO,MAAM,yBAAyB,CAAC,EAAE,OAAO,KAAK,KAAK,MAA4D;AACpH,QAAM,aAAa,2BAA2B,OAAO,CAAC;AACtD,QAAM,WAAW,2BAA2B,KAAK,CAAC;AAClD,QAAM,YAAY,2BAA2B,MAAM,CAAC;AACpD,SAAO,GAAG,cAAc,YAAY;AACtC;AACO,MAAM,iBAAiB,CAAC,aAA6B,UAAU,QAAQ,GAAG,IAAI,CAAC;AAC/E,MAAM,kCAAkC,CAAC,eAAqE;AACnH,QAAM,CAAC,aAAa,IAAI,WAAW,IAAI,YAAY,EAAE,IAAI,WAAW,MAAM,GAAG;AAC7E,QAAM,mBAAmB;AACzB,SAAO;AAAA,IACL,QAAQ,cAAc,IAAI,QAAQ,kBAAkB,EAAE;AAAA,IACtD,MAAM,YAAY,IAAI,QAAQ,kBAAkB,EAAE;AAAA,IAClD,OAAO,aAAa,IAAI,QAAQ,kBAAkB,EAAE;AAAA,EACtD;AACF;AACO,MAAM,kCAAkC,CAC7C,eACyD;AACzD,QAAM,CAAC,YAAY,IAAI,0BAA0B,EAAE,IAAI,WAAW,MAAM,GAAG;AAC3E,QAAM,CAAC,eAAe,IAAI,gBAAgB,EAAE,IAAI,wBAAwB,MAAM,GAAG;AACjF,QAAM,mBAAmB;AACzB,SAAO;AAAA,IACL,QAAQ,aAAa,IAAI,QAAQ,kBAAkB,EAAE;AAAA,IACrD,UAAU,gBAAgB,IAAI,QAAQ,kBAAkB,EAAE;AAAA,IAC1D,WAAW,iBAAiB,IAAI,QAAQ,kBAAkB,EAAE;AAAA,EAC9D;AACF;AAEA,MAAM,aAAa;AACZ,MAAM,oBAAoB,CAAC,eAAgC;AAChE,MAAI,eAAe;AAAI,WAAO;AAC9B,QAAM,oBAAoB,WAAW,KAAK,UAAU;AACpD,MAAI,CAAC;AAAmB,WAAO;AAC/B,QAAM,EAAE,OAAO,KAAK,KAAK,IAAI,gCAAgC,UAAU;AACvE,MAAI,OAAO,SAAS,OAAO,EAAE,IAAI,MAAM,OAAO,SAAS,KAAK,EAAE,IAAI,MAAM,OAAO,SAAS,MAAM,EAAE,IAAI;AAClG,WAAO;AAET,SAAO;AACT;AAEO,MAAM,yBAAyB,CAAC;AAAA,EACrC;AAAA,EACA;AAAA;AAAA,EAEA;AACF,MAKc;AACZ,QAAM,YAAY,2BAA2B,OAAO,CAAC;AACrD,QAAM,eAAe,2BAA2B,SAAS,CAAC;AAE1D,QAAM,gBAAgB,2BAA2B,UAAU,CAAC;AAE5D,SAAO,GAAG,aAAa,gBAAgB;AACzC;AACO,MAAM,iBAAiB,CAAC,aAA6B;AAC1D,QAAM;AAAA;AAAA,IAEJ;AAAA;AAAA,IAEA,cAAc;AAAA,IACd,eAAe;AAAA,EACjB,IAAI,SAAS,MAAM,GAAG;AACtB,SAAO,GAAG,eAAe;AAC3B;AACO,MAAM,wBAAwB,CACnC,eAKG;AACH,QAAM,CAAC,aAAa,IAAI,aAAa,IAAI,WAAW,MAAM,GAAG;AAC7D,QAAM,CAAC,YAAY,YAAY,IAAI,WAAW,MAAM,GAAG;AACvD,QAAM,QAAQ;AACd,QAAM,YAAY;AAAA,IAChB,QAAQ,cAAc,IAAI,QAAQ,OAAO,EAAE;AAAA,IAC3C,UAAU,gBAAgB,IAAI,QAAQ,OAAO,EAAE;AAAA,IAC/C,WAAW,iBAAiB,IAAI,QAAQ,OAAO,EAAE;AAAA,EACnD;AACA,SAAO;AACT;AAGA,MAAM,aAAa;AACZ,MAAM,oBAAoB,CAAC,eAAgC;AAChE,MAAI,eAAe;AAAI,WAAO;AAC9B,QAAM,oBAAoB,WAAW,KAAK,UAAU;AACpD,MAAI,CAAC;AAAmB,WAAO;AAC/B,QAAM,EAAE,OAAO,QAAQ,IAAI,sBAAsB,UAAU;AAC3D,MAAI,OAAO,SAAS,OAAO,EAAE,IAAI,MAAM,OAAO,SAAS,SAAS,EAAE,IAAI;AAAI,WAAO;AAEjF,SAAO;AACT;AAEO,MAAM,qBAAqB,CAAC,YAAoB,cAAc,QACnE,eAAe,MAAM,WAAW,SAAS,WAAW;AAE/C,MAAM,wBAAwB,CAAC,eAAgC,eAAe;AAC9E,MAAM,wBAAwB,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,CAAC,KAAK,wBAAwB,MAAM,KAAK;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.16.
|
|
3
|
+
"version": "3.16.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Controlled Form Date Time Picker",
|
|
6
6
|
"files": [
|
|
@@ -35,26 +35,26 @@
|
|
|
35
35
|
"indent": 4
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@elliemae/ds-button": "3.16.
|
|
39
|
-
"@elliemae/ds-grid": "3.16.
|
|
40
|
-
"@elliemae/ds-icon": "3.16.
|
|
41
|
-
"@elliemae/ds-icons": "3.16.
|
|
42
|
-
"@elliemae/ds-
|
|
43
|
-
"@elliemae/ds-
|
|
44
|
-
"@elliemae/ds-
|
|
45
|
-
"@elliemae/ds-
|
|
38
|
+
"@elliemae/ds-button": "3.16.1",
|
|
39
|
+
"@elliemae/ds-grid": "3.16.1",
|
|
40
|
+
"@elliemae/ds-icon": "3.16.1",
|
|
41
|
+
"@elliemae/ds-icons": "3.16.1",
|
|
42
|
+
"@elliemae/ds-popperjs": "3.16.1",
|
|
43
|
+
"@elliemae/ds-props-helpers": "3.16.1",
|
|
44
|
+
"@elliemae/ds-system": "3.16.1",
|
|
45
|
+
"@elliemae/ds-utilities": "3.16.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@elliemae/pui-theme": "~2.
|
|
48
|
+
"@elliemae/pui-theme": "~2.7.0",
|
|
49
49
|
"@testing-library/dom": "~8.19.0",
|
|
50
|
-
"@testing-library/jest-dom": "~5.16.
|
|
50
|
+
"@testing-library/jest-dom": "~5.16.5",
|
|
51
51
|
"@testing-library/react": "~12.1.3",
|
|
52
52
|
"@testing-library/user-event": "~13.5.0",
|
|
53
|
-
"styled-components": "~5.3.
|
|
53
|
+
"styled-components": "~5.3.9",
|
|
54
54
|
"styled-system": "~5.1.5"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@elliemae/pui-theme": "~2.
|
|
57
|
+
"@elliemae/pui-theme": "~2.7.0",
|
|
58
58
|
"react": "^17.0.2",
|
|
59
59
|
"react-dom": "^17.0.2",
|
|
60
60
|
"styled-components": "~5.3.6",
|
|
@@ -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-props-helpers/dist/types/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 {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import type { useGetFlags } from './useGetFlags';
|
|
2
|
-
import type { useGetPropsBasedOnType } from './useGetPropsBasedOnType';
|
|
3
|
-
type UseGetDestructuredDateValues = (config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>) => {
|
|
4
|
-
month: string;
|
|
5
|
-
day: string;
|
|
6
|
-
year: string;
|
|
7
|
-
monthNum: number;
|
|
8
|
-
dayNum: number;
|
|
9
|
-
yearNum: number;
|
|
10
|
-
announcedMonth: string;
|
|
11
|
-
announcedDay: string;
|
|
12
|
-
announcedYear: string;
|
|
13
|
-
announcedDateValues: string;
|
|
14
|
-
};
|
|
15
|
-
export declare const useGetDestructuredDateValues: UseGetDestructuredDateValues;
|
|
16
|
-
type UseGetDestructuredTimeValues = (config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>) => {
|
|
17
|
-
hours: string;
|
|
18
|
-
minutes: string;
|
|
19
|
-
meridiem: string;
|
|
20
|
-
hoursNum: number;
|
|
21
|
-
minutesNum: number;
|
|
22
|
-
announcedHours: string;
|
|
23
|
-
announcedMinutes: string;
|
|
24
|
-
announcedMeridiem: string;
|
|
25
|
-
announcedTimeValues: string;
|
|
26
|
-
};
|
|
27
|
-
export declare const useGetDestructuredTimeValues: UseGetDestructuredTimeValues;
|
|
28
|
-
type UseGetDestructuredValues = (config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>) => ReturnType<typeof useGetDestructuredDateValues> & ReturnType<typeof useGetDestructuredTimeValues>;
|
|
29
|
-
export declare const useGetDestructuredValues: UseGetDestructuredValues;
|
|
30
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
3
|
-
export declare const useGetFlags: (props: DSControlledDateTimePickerT.InternalProps) => {
|
|
4
|
-
isDateSelector: boolean;
|
|
5
|
-
hideTime: boolean;
|
|
6
|
-
hideDateTimePicker: boolean;
|
|
7
|
-
hideTimePicker: boolean;
|
|
8
|
-
isTimeSelector: boolean;
|
|
9
|
-
isDateTimeSelector: boolean;
|
|
10
|
-
isWithCalendarToo: boolean;
|
|
11
|
-
isWithTimeWheelToo: boolean;
|
|
12
|
-
isWithTimeInputs: boolean;
|
|
13
|
-
isWithTimeInputsOnly: boolean;
|
|
14
|
-
autoFocusHourTimeWheel: boolean;
|
|
15
|
-
autoFocusHourInput: boolean;
|
|
16
|
-
hideDate: boolean;
|
|
17
|
-
hideDatePicker: boolean;
|
|
18
|
-
isControllerOnly: boolean;
|
|
19
|
-
withAnyInputs: boolean;
|
|
20
|
-
withAnyPicker: boolean;
|
|
21
|
-
withClearBtn: boolean;
|
|
22
|
-
isWithDateInputs: boolean;
|
|
23
|
-
isWithDateInputsOnly: boolean;
|
|
24
|
-
autoFocusMonthInput: boolean;
|
|
25
|
-
autoFocusPrevMonthArrow: boolean;
|
|
26
|
-
innerRefMonthInput: import("react").MutableRefObject<HTMLInputElement | HTMLButtonElement | null> | undefined;
|
|
27
|
-
innerRefPrevMonthArrow: import("react").MutableRefObject<HTMLInputElement | HTMLButtonElement | null> | undefined;
|
|
28
|
-
shouldPreserveClearableSpace: boolean;
|
|
29
|
-
withAnyRightController: boolean;
|
|
30
|
-
};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
2
|
-
export declare const useGetPropsBasedOnType: (propsWithDefaults: DSControlledDateTimePickerT.InternalProps) => {
|
|
3
|
-
getIsDisabledDay: BooleanGetter<string>;
|
|
4
|
-
getIsOutOfRangeDay: BooleanGetter<string>;
|
|
5
|
-
getIsStartRangeDay: BooleanGetter<string> | (() => void);
|
|
6
|
-
getIsDayInRange: BooleanGetter<string> | (() => void);
|
|
7
|
-
getIsEndRangeDay: BooleanGetter<string> | (() => void);
|
|
8
|
-
appOnDateChange: DSControlledDateTimePickerT.OnDateChange;
|
|
9
|
-
appOnMonthChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
10
|
-
appOnDayChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
11
|
-
appOnYearChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
12
|
-
appDate: string;
|
|
13
|
-
getIsDisabledTime: BooleanGetter<string>;
|
|
14
|
-
appOnTimeChange: DSControlledDateTimePickerT.OnTimeChange;
|
|
15
|
-
appOnHourChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
16
|
-
appOnMinuteChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
17
|
-
appOnMeridiemChange: DSControlledDateTimePickerT.AppOnInputChange;
|
|
18
|
-
appTime: string;
|
|
19
|
-
appDateTime: string;
|
|
20
|
-
appOnDateTimeChange: DSControlledDateTimePickerT.OnDateTimeChange;
|
|
21
|
-
emptyPickerStartingMonth: string;
|
|
22
|
-
onCalendarOpenFocusedDay: string | undefined;
|
|
23
|
-
minutesInterval: number;
|
|
24
|
-
onTimeWheelOpenStartingTime: string;
|
|
25
|
-
isDate: boolean;
|
|
26
|
-
isTime: boolean;
|
|
27
|
-
isDateTime: boolean;
|
|
28
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { useGetFlags } from './useGetFlags';
|
|
3
|
-
type FirstSegment = 'month-input' | 'hour-input' | 'date-picker-icon' | 'time-picker-icon' | 'datetime-picker-icon' | '';
|
|
4
|
-
type LastSegment = 'year-input' | 'meridiem-input' | 'clear-btn' | 'date-picker-icon' | 'time-picker-icon' | 'datetime-picker-icon' | '';
|
|
5
|
-
export declare const useGetReferences: ({ isWithDateInputs, isWithTimeInputs, isDateSelector, isTimeSelector, isDateTimeSelector, withAnyPicker, withClearBtn, }: ReturnType<typeof useGetFlags>) => {
|
|
6
|
-
monthInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
7
|
-
dayInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
8
|
-
yearInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
9
|
-
hourInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
10
|
-
minutesInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
11
|
-
meridiemInputRef: import("react").MutableRefObject<HTMLInputElement>;
|
|
12
|
-
clearButtonRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
13
|
-
pickerButtonRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
14
|
-
prevYearBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
15
|
-
prevMonthBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
16
|
-
nextMonthBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
17
|
-
nextYearBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
18
|
-
calendarDaysWrapperRef: import("react").MutableRefObject<HTMLDivElement>;
|
|
19
|
-
prevHourBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
20
|
-
currHourBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
21
|
-
nextHourBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
22
|
-
prevMinutesBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
23
|
-
currMinutesBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
24
|
-
nextMinutesBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
25
|
-
prevMeridiemBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
26
|
-
currMeridiemBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
27
|
-
nextMeridiemBtnRef: import("react").MutableRefObject<HTMLButtonElement>;
|
|
28
|
-
firstSegmentRef: import("react").MutableRefObject<HTMLInputElement | HTMLButtonElement>;
|
|
29
|
-
lastSegmentRef: import("react").MutableRefObject<HTMLInputElement | HTMLButtonElement>;
|
|
30
|
-
firstSegment: FirstSegment;
|
|
31
|
-
lastSegment: LastSegment;
|
|
32
|
-
};
|
|
33
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { useChangeHandlers } from './useChangeHandlers';
|
|
2
|
-
import type { useGetPropsBasedOnType } from './useGetPropsBasedOnType';
|
|
3
|
-
import type { useGetReferences } from './useGetReferences';
|
|
4
|
-
import type { useGetFlags } from './useGetFlags';
|
|
5
|
-
import type { useFocusTracker } from './useFocusTracker';
|
|
6
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
7
|
-
interface Config {
|
|
8
|
-
propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;
|
|
9
|
-
changeHandlers: ReturnType<typeof useChangeHandlers>;
|
|
10
|
-
DOMRefs: ReturnType<typeof useGetReferences>;
|
|
11
|
-
flags: ReturnType<typeof useGetFlags>;
|
|
12
|
-
focusTrackers: ReturnType<typeof useFocusTracker>;
|
|
13
|
-
}
|
|
14
|
-
export declare const useGlobalKeyHandlers: ({ propsBasedOnType, changeHandlers, focusTrackers, flags }: Config) => {
|
|
15
|
-
onFillWithCurrentDateKeys: (e: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>, metaInfo?: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => void;
|
|
16
|
-
onGlobalKeyDown: (e: React.KeyboardEvent<HTMLInputElement | HTMLButtonElement>) => void;
|
|
17
|
-
};
|
|
18
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import type { DSControlledDateTimePickerT } from '../propTypes';
|
|
3
|
-
export declare const useRelevantValueFromProps: (props: DSControlledDateTimePickerT.InternalProps) => {
|
|
4
|
-
dateStringFromProps: string;
|
|
5
|
-
timeStringFromProps: string;
|
|
6
|
-
tempDateString: string;
|
|
7
|
-
setTempDateString: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
8
|
-
tempTimeString: string;
|
|
9
|
-
setTimeString: import("react").Dispatch<import("react").SetStateAction<string>>;
|
|
10
|
-
};
|