@elliemae/ds-form-date-time-picker 3.35.0 → 3.36.0-next.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/config/useChangeHandlers.js +3 -6
- package/dist/cjs/config/useChangeHandlers.js.map +1 -1
- package/dist/cjs/config/useControlledDateTimePicker.js.map +1 -1
- package/dist/cjs/config/useFocusTracker.js +56 -112
- package/dist/cjs/config/useFocusTracker.js.map +1 -1
- package/dist/cjs/config/useGetDestructuredValues.js.map +1 -1
- package/dist/cjs/config/useGetPropsBasedOnType.js.map +1 -1
- package/dist/cjs/config/useGetReferences.js +11 -22
- package/dist/cjs/config/useGetReferences.js.map +1 -1
- package/dist/cjs/config/useGlobalKeyHandlers.js +3 -6
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +1 -1
- package/dist/cjs/config/useRelevantValueFromProps.js +4 -8
- package/dist/cjs/config/useRelevantValueFromProps.js.map +1 -1
- package/dist/cjs/config/useValidateProps.js +4 -8
- package/dist/cjs/config/useValidateProps.js.map +1 -1
- package/dist/cjs/index.js +0 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/parts/ClearButton/ClearButton.js +1 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +1 -1
- package/dist/cjs/parts/ClearButton/useClearButton.js +7 -14
- package/dist/cjs/parts/ClearButton/useClearButton.js.map +1 -1
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +5 -10
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +1 -1
- package/dist/cjs/parts/DateInputs/DDInput.js +2 -4
- package/dist/cjs/parts/DateInputs/DDInput.js.map +1 -1
- package/dist/cjs/parts/DateInputs/MMInput.js +2 -4
- package/dist/cjs/parts/DateInputs/MMInput.js.map +1 -1
- package/dist/cjs/parts/DateInputs/YYYYInput.js +2 -4
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +1 -1
- package/dist/cjs/parts/DateInputs/useDateInputs.js +38 -76
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarDaysList.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +2 -4
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/Day.js +9 -18
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js +2 -4
- package/dist/cjs/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js +17 -34
- package/dist/cjs/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js +5 -10
- package/dist/cjs/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +2 -4
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +8 -16
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +1 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +1 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js +8 -16
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +2 -4
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +14 -28
- package/dist/cjs/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js +24 -48
- package/dist/cjs/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +3 -6
- package/dist/cjs/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
- package/dist/cjs/parts/Styleds.js +1 -2
- package/dist/cjs/parts/Styleds.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/HHInput.js +2 -4
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +2 -4
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +2 -4
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js +33 -66
- package/dist/cjs/parts/TimeInputs/useTimeInputs.js.map +1 -1
- package/dist/cjs/utils/dateHelpers.js +6 -12
- package/dist/cjs/utils/dateHelpers.js.map +1 -1
- package/dist/cjs/utils/numberHelpers.js +1 -2
- package/dist/cjs/utils/numberHelpers.js.map +1 -1
- package/dist/cjs/utils/stringHelpers.js +8 -16
- package/dist/cjs/utils/stringHelpers.js.map +1 -1
- package/dist/cjs/utils/timeHelpers.js +1 -2
- package/dist/cjs/utils/timeHelpers.js.map +1 -1
- package/dist/esm/config/useChangeHandlers.js +3 -6
- package/dist/esm/config/useChangeHandlers.js.map +1 -1
- package/dist/esm/config/useControlledDateTimePicker.js.map +1 -1
- package/dist/esm/config/useFocusTracker.js +56 -112
- package/dist/esm/config/useFocusTracker.js.map +1 -1
- package/dist/esm/config/useGetDestructuredValues.js.map +1 -1
- package/dist/esm/config/useGetPropsBasedOnType.js.map +1 -1
- package/dist/esm/config/useGetReferences.js +11 -22
- package/dist/esm/config/useGetReferences.js.map +1 -1
- package/dist/esm/config/useGlobalKeyHandlers.js +3 -6
- package/dist/esm/config/useGlobalKeyHandlers.js.map +1 -1
- package/dist/esm/config/useRelevantValueFromProps.js +4 -8
- package/dist/esm/config/useRelevantValueFromProps.js.map +1 -1
- package/dist/esm/config/useValidateProps.js +4 -8
- package/dist/esm/config/useValidateProps.js.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/parts/ClearButton/ClearButton.js +1 -2
- package/dist/esm/parts/ClearButton/ClearButton.js.map +1 -1
- package/dist/esm/parts/ClearButton/useClearButton.js +7 -14
- package/dist/esm/parts/ClearButton/useClearButton.js.map +1 -1
- package/dist/esm/parts/ControlledDateTimePickerContent.js +5 -10
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +1 -1
- package/dist/esm/parts/DateInputs/DDInput.js +2 -4
- package/dist/esm/parts/DateInputs/DDInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/MMInput.js +2 -4
- package/dist/esm/parts/DateInputs/MMInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/YYYYInput.js +2 -4
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +1 -1
- package/dist/esm/parts/DateInputs/useDateInputs.js +38 -76
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarDaysList.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +2 -4
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/Day.js +9 -18
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js +2 -4
- package/dist/esm/parts/Pickers/Calendar/useFocusLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js +17 -34
- package/dist/esm/parts/Pickers/Calendar/useKeyboardHandlers.js.map +1 -1
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js +5 -10
- package/dist/esm/parts/Pickers/Calendar/usePopperTriggerLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +2 -4
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +8 -16
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +1 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +1 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js +8 -16
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +2 -4
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +14 -28
- package/dist/esm/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js +24 -48
- package/dist/esm/parts/Pickers/TimeWheel/useKeyboardHandlers.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +3 -6
- package/dist/esm/parts/Pickers/TimeWheel/usePopperTriggerLogic.js.map +1 -1
- package/dist/esm/parts/Styleds.js +1 -2
- package/dist/esm/parts/Styleds.js.map +1 -1
- package/dist/esm/parts/TimeInputs/HHInput.js +2 -4
- package/dist/esm/parts/TimeInputs/HHInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +2 -4
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/MinutesInput.js +2 -4
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +1 -1
- package/dist/esm/parts/TimeInputs/useTimeInputs.js +33 -66
- package/dist/esm/parts/TimeInputs/useTimeInputs.js.map +1 -1
- package/dist/esm/utils/dateHelpers.js +6 -12
- package/dist/esm/utils/dateHelpers.js.map +1 -1
- package/dist/esm/utils/numberHelpers.js +1 -2
- package/dist/esm/utils/numberHelpers.js.map +1 -1
- package/dist/esm/utils/stringHelpers.js +8 -16
- package/dist/esm/utils/stringHelpers.js.map +1 -1
- package/dist/esm/utils/timeHelpers.js +1 -2
- package/dist/esm/utils/timeHelpers.js.map +1 -1
- package/dist/types/parts/Pickers/Calendar/CalendarContent.d.ts +1 -1
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +21 -0
- package/package.json +10 -10
|
@@ -266,12 +266,9 @@ const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnTyp
|
|
|
266
266
|
appOnHourChange("", e, metaInfo);
|
|
267
267
|
appOnMinuteChange("", e, metaInfo);
|
|
268
268
|
appOnMeridiemChange("", e, metaInfo);
|
|
269
|
-
if (isDateTime)
|
|
270
|
-
|
|
271
|
-
if (
|
|
272
|
-
handleChangeComposedDateString("__/__/____", metaInfo);
|
|
273
|
-
if (isTime)
|
|
274
|
-
handleChangeComposedTimeString("__:__ __", metaInfo);
|
|
269
|
+
if (isDateTime) handleChangeComposedDateTimeString("__/__/____", "__:__ __", metaInfo);
|
|
270
|
+
if (isDate) handleChangeComposedDateString("__/__/____", metaInfo);
|
|
271
|
+
if (isTime) handleChangeComposedTimeString("__:__ __", metaInfo);
|
|
275
272
|
trackFocusFirstSegment();
|
|
276
273
|
},
|
|
277
274
|
[
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useChangeHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo } from 'react';\nimport type { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport type { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport type { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useFocusTracker } from './useFocusTracker.js';\nimport { getValidationDateStringMetaInfo } from '../utils/dateHelpers.js';\nimport { getValidationTimeStringMetaInfo } from '../utils/timeHelpers.js';\nimport {\n isEmptyDateStringMask,\n isEmptyTimeStringMask,\n isEmptyDateTimeStringMask,\n getFormattedDateString,\n getFormattedTimeString,\n} from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\nimport { defaultMetaInfo } from '../utils/constants.js';\ninterface Config {\n relevantValues: ReturnType<typeof useRelevantValueFromProps>;\n destructuredValues: ReturnType<typeof useGetDestructuredValues>;\n propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;\n DOMRefs: ReturnType<typeof useGetReferences>;\n focusTrackers: ReturnType<typeof useFocusTracker>;\n}\n\nexport const useChangeHandlers = ({ relevantValues, destructuredValues, propsBasedOnType, focusTrackers }: Config) => {\n const { tempDateString, setTempDateString, tempTimeString, setTimeString } = relevantValues;\n const {\n getIsDisabledDay,\n getIsOutOfRangeDay,\n appOnDateChange,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n getIsDisabledTime,\n appOnTimeChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n appOnDateTimeChange,\n isDateTime,\n isDate,\n isTime,\n } = propsBasedOnType;\n const { month, day, year, hours, minutes, meridiem } = destructuredValues;\n const { trackFocusFirstSegment } = focusTrackers;\n\n const getDateMetaInfo = useCallback(\n (\n newDateString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalDateString = newDateString || tempDateString;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(finalDateString, getIsOutOfRangeDay, getIsDisabledDay),\n };\n return finalMetaInfo;\n },\n [tempDateString, getIsDisabledDay, getIsOutOfRangeDay],\n );\n\n const getTimeMetaInfo = useCallback(\n (\n newTimeString: string | null = null,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {},\n ): Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> => {\n const finalTimeString = newTimeString || tempTimeString;\n const finalMetaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(finalTimeString, getIsDisabledTime),\n };\n return finalMetaInfo;\n },\n [tempTimeString, getIsDisabledTime],\n );\n\n const handleChangeComposedDateTimeString = useCallback(\n (\n newDateString: string,\n newTimeString: string,\n metaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo,\n ): void => {\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTempDateString(newDateString);\n\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTimeString(newTimeString);\n\n const newDateTimeString = `${newDateString} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [\n appOnDateChange,\n setTempDateString,\n appOnTimeChange,\n setTimeString,\n getTimeMetaInfo,\n getDateMetaInfo,\n appOnDateTimeChange,\n ],\n );\n const handleChangeComposedDateString = useCallback(\n (newDateString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n // if we receive an \"empty\" mask, we comunicate empty string to the app\n const appDateString = isEmptyDateStringMask(newDateString) ? '' : newDateString;\n appOnDateChange(appDateString, metaInfo); // don't do this on useEffect to avoid complete chaos\n setTempDateString(newDateString);\n const newDateTimeString = `${newDateString} ${tempTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(tempTimeString, metaInfo),\n ...getDateMetaInfo(newDateString, metaInfo),\n newDateString,\n newTimeString: tempTimeString,\n newDateTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnDateChange, setTempDateString, tempTimeString, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n const handleChangeComposedTimeString = useCallback(\n (newTimeString: string, metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo>) => {\n const appTimeString = isEmptyTimeStringMask(newTimeString) ? '' : newTimeString;\n appOnTimeChange(appTimeString, metaInfo); // don't do this on useEffect to avoid complete chaos\n\n setTimeString(newTimeString);\n const newDateTimeString = `${tempDateString} ${newTimeString}`;\n const newMetaInfo = {\n ...metaInfo,\n ...getTimeMetaInfo(newTimeString, metaInfo),\n ...getDateMetaInfo(tempDateString, metaInfo),\n newDateTimeString,\n newDateString: tempDateString,\n newTimeString,\n };\n\n const appDateTimeString = isEmptyDateTimeStringMask(newDateTimeString) ? '' : newDateTimeString;\n appOnDateTimeChange(appDateTimeString, newMetaInfo); // don't do this on useEffect to avoid complete chaos\n },\n [appOnTimeChange, setTimeString, tempDateString, getTimeMetaInfo, getDateMetaInfo, appOnDateTimeChange],\n );\n\n const handleChangeMonth: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMonth, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month: newMonth,\n day,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnMonthChange(newMonth, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [day, year, getIsOutOfRangeDay, getIsDisabledDay, appOnMonthChange, handleChangeComposedDateString],\n );\n const handleChangeDay: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newDay, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day: newDay,\n year,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnDayChange(newDay, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, year, getIsOutOfRangeDay, getIsDisabledDay, appOnDayChange, handleChangeComposedDateString],\n );\n const handleChangeYear: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newYear, e, metaInfo = defaultMetaInfo) => {\n const newDateString = getFormattedDateString({\n month,\n day,\n year: newYear,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(newDateString, getIsOutOfRangeDay, getIsDisabledDay),\n newDateString,\n };\n appOnYearChange(newYear, e, finalMetaInfo);\n handleChangeComposedDateString(newDateString, finalMetaInfo);\n },\n [month, day, getIsOutOfRangeDay, getIsDisabledDay, appOnYearChange, handleChangeComposedDateString],\n );\n\n const handleChangeHours: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newHours, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours: newHours,\n minutes,\n // seconds,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnHourChange(newHours, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [minutes, meridiem, getIsDisabledTime, appOnHourChange, handleChangeComposedTimeString],\n );\n const handleChangeMinutes: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMinutes, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes: newMinutes,\n meridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMinuteChange(newMinutes, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, meridiem, getIsDisabledTime, appOnMinuteChange, handleChangeComposedTimeString],\n );\n const handleChangeMeridiem: DSControlledDateTimePickerT.OnInternalInputsChange = useCallback(\n (newMeridiem, e, metaInfo = defaultMetaInfo) => {\n const newTimeString = getFormattedTimeString({\n hours,\n minutes,\n meridiem: newMeridiem,\n });\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationTimeStringMetaInfo(newTimeString, getIsDisabledTime),\n newTimeString,\n };\n appOnMeridiemChange(newMeridiem, e, finalMetaInfo);\n handleChangeComposedTimeString(newTimeString, finalMetaInfo);\n },\n [hours, minutes, getIsDisabledTime, appOnMeridiemChange, handleChangeComposedTimeString],\n );\n\n const handleClearAll: DSControlledDateTimePickerInternalsT.OnDSBtnClick = useCallback(\n (e) => {\n const metaInfo = {\n isAutomaticFillTrigger: false,\n isClearButtonAction: true,\n newDateString: '',\n newTimeString: '',\n newDateTimeString: '',\n };\n appOnMonthChange('', e, metaInfo);\n appOnDayChange('', e, metaInfo);\n appOnYearChange('', e, metaInfo);\n appOnHourChange('', e, metaInfo);\n appOnMinuteChange('', e, metaInfo);\n appOnMeridiemChange('', e, metaInfo);\n if (isDateTime) handleChangeComposedDateTimeString('__/__/____', '__:__ __', metaInfo);\n if (isDate) handleChangeComposedDateString('__/__/____', metaInfo);\n if (isTime) handleChangeComposedTimeString('__:__ __', metaInfo);\n trackFocusFirstSegment();\n },\n [\n appOnDayChange,\n appOnHourChange,\n appOnMeridiemChange,\n appOnMinuteChange,\n appOnMonthChange,\n appOnYearChange,\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n isDate,\n isDateTime,\n isTime,\n trackFocusFirstSegment,\n ],\n );\n\n return useMemo(\n () => ({\n handleChangeComposedDateTimeString,\n handleChangeComposedDateString,\n handleChangeComposedTimeString,\n handleChangeMonth,\n handleChangeDay,\n handleChangeYear,\n handleChangeHours,\n handleChangeMinutes,\n handleChangeMeridiem,\n handleClearAll,\n }),\n [\n handleChangeComposedDateString,\n handleChangeComposedDateTimeString,\n handleChangeComposedTimeString,\n handleChangeDay,\n handleChangeHours,\n handleChangeMeridiem,\n handleChangeMinutes,\n handleChangeMonth,\n handleChangeYear,\n handleClearAll,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAqC;AAMrC,yBAAgD;AAChD,yBAAgD;AAChD,2BAMO;AAGP,uBAAgC;AASzB,MAAM,oBAAoB,CAAC,EAAE,gBAAgB,oBAAoB,kBAAkB,cAAc,MAAc;AACpH,QAAM,EAAE,gBAAgB,mBAAmB,gBAAgB,cAAc,IAAI;AAC7E,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,OAAO,KAAK,MAAM,OAAO,SAAS,SAAS,IAAI;AACvD,QAAM,EAAE,uBAAuB,IAAI;AA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,QACrB,eAAe;AAAA,QACf,eAAe;AAAA,QACf,mBAAmB;AAAA,MACrB;AACA,uBAAiB,IAAI,GAAG,QAAQ;AAChC,qBAAe,IAAI,GAAG,QAAQ;AAC9B,sBAAgB,IAAI,GAAG,QAAQ;AAC/B,sBAAgB,IAAI,GAAG,QAAQ;AAC/B,wBAAkB,IAAI,GAAG,QAAQ;AACjC,0BAAoB,IAAI,GAAG,QAAQ;AACnC,UAAI,WAAY,oCAAmC,cAAc,YAAY,QAAQ;AACrF,UAAI,OAAQ,gCAA+B,cAAc,QAAQ;AACjE,UAAI,OAAQ,gCAA+B,YAAY,QAAQ;AAC/D,6BAAuB;AAAA,IACzB;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useControlledDateTimePicker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { useGetGlobalAttributes, useGetXstyledProps } from '@elliemae/ds-props-helpers';\nimport { useGetDatePickerWithDefaultsProps } from './useGetPropsWithDefault.js';\nimport { useFocusTracker } from './useFocusTracker.js';\nimport { useGetFlags } from './useGetFlags.js';\nimport { useGetReferences } from './useGetReferences.js';\nimport { useRelevantValueFromProps } from './useRelevantValueFromProps.js';\nimport { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport { useGetDestructuredValues } from './useGetDestructuredValues.js';\nimport { useChangeHandlers } from './useChangeHandlers.js';\nimport { useGlobalKeyHandlers } from './useGlobalKeyHandlers.js';\nimport { useValidateProps } from './useValidateProps.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\nexport type ControlledDateTimePickerContextT = ReturnType<typeof useGetFlags> &\n ReturnType<typeof useFocusTracker> &\n ReturnType<typeof useGetReferences> &\n ReturnType<typeof useGetPropsBasedOnType> &\n ReturnType<typeof useRelevantValueFromProps> &\n ReturnType<typeof useGetDestructuredValues> &\n ReturnType<typeof useChangeHandlers> &\n ReturnType<typeof useGlobalKeyHandlers> & {\n props: DSControlledDateTimePickerT.InternalProps;\n getProps: () => DSControlledDateTimePickerT.InternalProps;\n ariaCurrentValueForInputs: string;\n globalAttrs: Record<string, unknown>;\n xstyledAttrs: Record<string, unknown>;\n };\n\nexport const useControlledDateTimePicker = (\n props: DSControlledDateTimePickerT.Props,\n): ControlledDateTimePickerContextT => {\n // if we detect wrong props configuration we throw meaningful errors\n useValidateProps(props);\n\n const propsWithDefaults = useGetDatePickerWithDefaultsProps(props);\n\n const flags = useGetFlags(propsWithDefaults);\n const DOMRefs = useGetReferences(flags); // refs are used for \"auto-advance\" feature\n const focusTrackers = useFocusTracker({ DOMRefs, flags });\n const relevantValues = useRelevantValueFromProps(propsWithDefaults);\n const propsBasedOnType = useGetPropsBasedOnType(propsWithDefaults);\n const destructuredValues = useGetDestructuredValues({ ...propsBasedOnType, ...flags });\n const changeHandlers = useChangeHandlers({\n relevantValues,\n destructuredValues,\n propsBasedOnType,\n DOMRefs,\n focusTrackers,\n });\n\n const globalKeyHandlers = useGlobalKeyHandlers({ changeHandlers, propsBasedOnType, DOMRefs, flags, focusTrackers });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call\n // const dataAttrs = getDataProps<DSControlledDateTimePickerT.InternalProps>(propsWithDefaults);\n\n const xstyledAttrs = useGetXstyledProps(propsWithDefaults) as Record<string, unknown>;\n\n const globalAttrs = useGetGlobalAttributes(propsWithDefaults) as Record<string, unknown>;\n\n const { announcedDateValues, announcedTimeValues } = destructuredValues;\n const { isWithDateInputs, isDateTimeSelector, isWithTimeInputs } = flags;\n\n const ariaCurrentValueForInputs = `current values: ${isWithDateInputs ? `${announcedDateValues}` : ''}${\n isDateTimeSelector ? ', ' : ''\n }${isWithTimeInputs ? `${announcedTimeValues}` : ''}`;\n\n const getProps = useCallback(() => propsWithDefaults, [propsWithDefaults]);\n\n const ctx = React.useMemo(\n () => ({\n props: propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n xstyledAttrs,\n globalAttrs,\n ...focusTrackers,\n ...flags,\n ...DOMRefs,\n ...relevantValues,\n ...propsBasedOnType,\n ...destructuredValues,\n ...changeHandlers,\n ...globalKeyHandlers,\n }),\n [\n propsWithDefaults,\n getProps,\n ariaCurrentValueForInputs,\n xstyledAttrs,\n globalAttrs,\n focusTrackers,\n flags,\n DOMRefs,\n relevantValues,\n propsBasedOnType,\n destructuredValues,\n changeHandlers,\n globalKeyHandlers,\n ],\n );\n\n return ctx;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAmC;AACnC,8BAA2D;AAC3D,oCAAkD;AAClD,6BAAgC;AAChC,yBAA4B;AAC5B,8BAAiC;AACjC,uCAA0C;AAC1C,oCAAuC;AACvC,sCAAyC;AACzC,+BAAkC;AAClC,kCAAqC;AACrC,8BAAiC;AAkB1B,MAAM,8BAA8B,CACzC,UACqC;AAErC,gDAAi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M,uBAAmB,sDAAuB,iBAAiB;AACjE,QAAM,yBAAqB,0DAAyB,EAAE,GAAG,kBAAkB,GAAG,MAAM,CAAC;AACrF,QAAM,qBAAiB,4CAAkB;AAAA,IACvC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,wBAAoB,kDAAqB,EAAE,gBAAgB,kBAAkB,SAAS,OAAO,cAAc,CAAC;AAKlH,QAAM,mBAAe,4CAAmB,iBAAiB;AAEzD,QAAM,kBAAc,gDAAuB,iBAAiB;AAE5D,QAAM,EAAE,qBAAqB,oBAAoB,IAAI;AACrD,QAAM,EAAE,kBAAkB,oBAAoB,iBAAiB,IAAI;AAEnE,QAAM,4BAA4B,mBAAmB,mBAAmB,GAAG,mBAAmB,KAAK,EAAE,GACnG,qBAAqB,OAAO,EAC9B,GAAG,mBAAmB,GAAG,mBAAmB,KAAK,EAAE;AAEnD,QAAM,eAAW,0BAAY,MAAM,mBAAmB,CAAC,iBAAiB,CAAC;AAEzE,QAAM,MAAM,aAAAA,QAAM;AAAA,IAChB,OAAO;AAAA,MACL,OAAO;AAAA,MACP;AAAA,MACA;AAAA;AAAA,MAEA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AACT;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -40,52 +40,33 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
40
40
|
const { isDateSelector, isTimeSelector } = flags;
|
|
41
41
|
const trackFocusPicker = (0, import_react.useCallback)(() => {
|
|
42
42
|
let picker = "datetime-picker-icon";
|
|
43
|
-
if (isDateSelector)
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
if (latestInteractionRegion !== "picker-icon")
|
|
48
|
-
setLatestInteractionRegion("picker-icon");
|
|
49
|
-
if (picker !== currFocusDescriber)
|
|
50
|
-
setCurrFocusDescriber(picker);
|
|
43
|
+
if (isDateSelector) picker = "date-picker-icon";
|
|
44
|
+
if (isTimeSelector) picker = "time-picker-icon";
|
|
45
|
+
if (latestInteractionRegion !== "picker-icon") setLatestInteractionRegion("picker-icon");
|
|
46
|
+
if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);
|
|
51
47
|
}, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);
|
|
52
48
|
const trackFocusFirstSegment = (0, import_react.useCallback)(() => {
|
|
53
49
|
let region = "date-inputs";
|
|
54
|
-
if (firstSegment === "hour-input")
|
|
55
|
-
|
|
56
|
-
if (firstSegment === "
|
|
57
|
-
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
if (firstSegment === "datetime-picker-icon")
|
|
61
|
-
region = "picker-icon";
|
|
62
|
-
if (region !== latestInteractionRegion)
|
|
63
|
-
setLatestInteractionRegion(region);
|
|
64
|
-
if (firstSegment !== currFocusDescriber)
|
|
65
|
-
setCurrFocusDescriber(firstSegment);
|
|
50
|
+
if (firstSegment === "hour-input") region = "time-inputs";
|
|
51
|
+
if (firstSegment === "date-picker-icon") region = "picker-icon";
|
|
52
|
+
if (firstSegment === "time-picker-icon") region = "picker-icon";
|
|
53
|
+
if (firstSegment === "datetime-picker-icon") region = "picker-icon";
|
|
54
|
+
if (region !== latestInteractionRegion) setLatestInteractionRegion(region);
|
|
55
|
+
if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);
|
|
66
56
|
}, [currFocusDescriber, firstSegment, latestInteractionRegion]);
|
|
67
57
|
const trackFocusLastSegment = (0, import_react.useCallback)(() => {
|
|
68
58
|
let region = "date-inputs";
|
|
69
|
-
if (lastSegment === "meridiem-input")
|
|
70
|
-
|
|
71
|
-
if (lastSegment === "
|
|
72
|
-
|
|
73
|
-
if (lastSegment === "
|
|
74
|
-
|
|
75
|
-
if (lastSegment
|
|
76
|
-
region = "picker-icon";
|
|
77
|
-
if (lastSegment === "datetime-picker-icon")
|
|
78
|
-
region = "picker-icon";
|
|
79
|
-
if (region !== latestInteractionRegion)
|
|
80
|
-
setLatestInteractionRegion(region);
|
|
81
|
-
if (lastSegment !== currFocusDescriber)
|
|
82
|
-
setCurrFocusDescriber(lastSegment);
|
|
59
|
+
if (lastSegment === "meridiem-input") region = "time-inputs";
|
|
60
|
+
if (lastSegment === "clear-btn") region = "clear-btn";
|
|
61
|
+
if (lastSegment === "date-picker-icon") region = "picker-icon";
|
|
62
|
+
if (lastSegment === "time-picker-icon") region = "picker-icon";
|
|
63
|
+
if (lastSegment === "datetime-picker-icon") region = "picker-icon";
|
|
64
|
+
if (region !== latestInteractionRegion) setLatestInteractionRegion(region);
|
|
65
|
+
if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);
|
|
83
66
|
}, [currFocusDescriber, lastSegment, latestInteractionRegion]);
|
|
84
67
|
const trackFocusResetter = (0, import_react.useCallback)(() => {
|
|
85
|
-
if (latestInteractionRegion !== "")
|
|
86
|
-
|
|
87
|
-
if (currFocusDescriber !== "")
|
|
88
|
-
setCurrFocusDescriber("");
|
|
68
|
+
if (latestInteractionRegion !== "") setLatestInteractionRegion("");
|
|
69
|
+
if (currFocusDescriber !== "") setCurrFocusDescriber("");
|
|
89
70
|
}, [currFocusDescriber, latestInteractionRegion]);
|
|
90
71
|
const handleComponentBlurs = (0, import_react.useCallback)(() => {
|
|
91
72
|
let shouldShortCircuit = false;
|
|
@@ -95,8 +76,7 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
95
76
|
shouldShortCircuit = true;
|
|
96
77
|
if (latestInteractionRegion === "timewheel" && currFocusDescriber === "timewheel-curr-hour")
|
|
97
78
|
shouldShortCircuit = true;
|
|
98
|
-
if (shouldShortCircuit)
|
|
99
|
-
return;
|
|
79
|
+
if (shouldShortCircuit) return;
|
|
100
80
|
trackFocusResetter();
|
|
101
81
|
}, [currFocusDescriber, latestInteractionRegion, trackFocusResetter]);
|
|
102
82
|
return (0, import_react.useMemo)(
|
|
@@ -107,112 +87,76 @@ const useFocusTracker = ({ DOMRefs, flags }) => {
|
|
|
107
87
|
setCurrFocusDescriber,
|
|
108
88
|
trackFocusResetter,
|
|
109
89
|
trackFocusMonthInput: () => {
|
|
110
|
-
if (latestInteractionRegion !== "date-inputs")
|
|
111
|
-
|
|
112
|
-
if (currFocusDescriber !== "month-input")
|
|
113
|
-
setCurrFocusDescriber("month-input");
|
|
90
|
+
if (latestInteractionRegion !== "date-inputs") setLatestInteractionRegion("date-inputs");
|
|
91
|
+
if (currFocusDescriber !== "month-input") setCurrFocusDescriber("month-input");
|
|
114
92
|
},
|
|
115
93
|
trackFocusDayInput: () => {
|
|
116
|
-
if (latestInteractionRegion !== "date-inputs")
|
|
117
|
-
|
|
118
|
-
if (currFocusDescriber !== "day-input")
|
|
119
|
-
setCurrFocusDescriber("day-input");
|
|
94
|
+
if (latestInteractionRegion !== "date-inputs") setLatestInteractionRegion("date-inputs");
|
|
95
|
+
if (currFocusDescriber !== "day-input") setCurrFocusDescriber("day-input");
|
|
120
96
|
},
|
|
121
97
|
trackFocusYearInput: () => {
|
|
122
|
-
if (latestInteractionRegion !== "date-inputs")
|
|
123
|
-
|
|
124
|
-
if (currFocusDescriber !== "year-input")
|
|
125
|
-
setCurrFocusDescriber("year-input");
|
|
98
|
+
if (latestInteractionRegion !== "date-inputs") setLatestInteractionRegion("date-inputs");
|
|
99
|
+
if (currFocusDescriber !== "year-input") setCurrFocusDescriber("year-input");
|
|
126
100
|
},
|
|
127
101
|
trackFocusHourInput: () => {
|
|
128
|
-
if (latestInteractionRegion !== "time-inputs")
|
|
129
|
-
|
|
130
|
-
if (currFocusDescriber !== "hour-input")
|
|
131
|
-
setCurrFocusDescriber("hour-input");
|
|
102
|
+
if (latestInteractionRegion !== "time-inputs") setLatestInteractionRegion("time-inputs");
|
|
103
|
+
if (currFocusDescriber !== "hour-input") setCurrFocusDescriber("hour-input");
|
|
132
104
|
},
|
|
133
105
|
trackFocusMinuteInput: () => {
|
|
134
|
-
if (latestInteractionRegion !== "time-inputs")
|
|
135
|
-
|
|
136
|
-
if (currFocusDescriber !== "minute-input")
|
|
137
|
-
setCurrFocusDescriber("minute-input");
|
|
106
|
+
if (latestInteractionRegion !== "time-inputs") setLatestInteractionRegion("time-inputs");
|
|
107
|
+
if (currFocusDescriber !== "minute-input") setCurrFocusDescriber("minute-input");
|
|
138
108
|
},
|
|
139
109
|
trackFocusMeridiemInput: () => {
|
|
140
|
-
if (latestInteractionRegion !== "time-inputs")
|
|
141
|
-
|
|
142
|
-
if (currFocusDescriber !== "meridiem-input")
|
|
143
|
-
setCurrFocusDescriber("meridiem-input");
|
|
110
|
+
if (latestInteractionRegion !== "time-inputs") setLatestInteractionRegion("time-inputs");
|
|
111
|
+
if (currFocusDescriber !== "meridiem-input") setCurrFocusDescriber("meridiem-input");
|
|
144
112
|
},
|
|
145
113
|
trackFocusClearBtn: () => {
|
|
146
|
-
if (latestInteractionRegion !== "clear-btn")
|
|
147
|
-
|
|
148
|
-
if (currFocusDescriber !== "clear-btn")
|
|
149
|
-
setCurrFocusDescriber("clear-btn");
|
|
114
|
+
if (latestInteractionRegion !== "clear-btn") setLatestInteractionRegion("clear-btn");
|
|
115
|
+
if (currFocusDescriber !== "clear-btn") setCurrFocusDescriber("clear-btn");
|
|
150
116
|
},
|
|
151
117
|
trackFocusDatePickerIcon: () => {
|
|
152
|
-
if (latestInteractionRegion !== "picker-icon")
|
|
153
|
-
|
|
154
|
-
if (currFocusDescriber !== "date-picker-icon")
|
|
155
|
-
setCurrFocusDescriber("date-picker-icon");
|
|
118
|
+
if (latestInteractionRegion !== "picker-icon") setLatestInteractionRegion("picker-icon");
|
|
119
|
+
if (currFocusDescriber !== "date-picker-icon") setCurrFocusDescriber("date-picker-icon");
|
|
156
120
|
},
|
|
157
121
|
trackFocusTimePickerIcon: () => {
|
|
158
|
-
if (latestInteractionRegion !== "picker-icon")
|
|
159
|
-
|
|
160
|
-
if (currFocusDescriber !== "time-picker-icon")
|
|
161
|
-
setCurrFocusDescriber("time-picker-icon");
|
|
122
|
+
if (latestInteractionRegion !== "picker-icon") setLatestInteractionRegion("picker-icon");
|
|
123
|
+
if (currFocusDescriber !== "time-picker-icon") setCurrFocusDescriber("time-picker-icon");
|
|
162
124
|
},
|
|
163
125
|
trackFocusDatetimePickerIcon: () => {
|
|
164
|
-
if (latestInteractionRegion !== "picker-icon")
|
|
165
|
-
|
|
166
|
-
if (currFocusDescriber !== "datetime-picker-icon")
|
|
167
|
-
setCurrFocusDescriber("datetime-picker-icon");
|
|
126
|
+
if (latestInteractionRegion !== "picker-icon") setLatestInteractionRegion("picker-icon");
|
|
127
|
+
if (currFocusDescriber !== "datetime-picker-icon") setCurrFocusDescriber("datetime-picker-icon");
|
|
168
128
|
},
|
|
169
129
|
trackFocusCalendarPrevMonth: () => {
|
|
170
|
-
if (latestInteractionRegion !== "calendar-head")
|
|
171
|
-
|
|
172
|
-
if (currFocusDescriber !== "calendar-prev-month")
|
|
173
|
-
setCurrFocusDescriber("calendar-prev-month");
|
|
130
|
+
if (latestInteractionRegion !== "calendar-head") setLatestInteractionRegion("calendar-head");
|
|
131
|
+
if (currFocusDescriber !== "calendar-prev-month") setCurrFocusDescriber("calendar-prev-month");
|
|
174
132
|
},
|
|
175
133
|
trackFocusCalendarNextMonth: () => {
|
|
176
|
-
if (latestInteractionRegion !== "calendar-head")
|
|
177
|
-
|
|
178
|
-
if (currFocusDescriber !== "calendar-next-month")
|
|
179
|
-
setCurrFocusDescriber("calendar-next-month");
|
|
134
|
+
if (latestInteractionRegion !== "calendar-head") setLatestInteractionRegion("calendar-head");
|
|
135
|
+
if (currFocusDescriber !== "calendar-next-month") setCurrFocusDescriber("calendar-next-month");
|
|
180
136
|
},
|
|
181
137
|
trackFocusCalendarPrevYear: () => {
|
|
182
|
-
if (latestInteractionRegion !== "calendar-head")
|
|
183
|
-
|
|
184
|
-
if (currFocusDescriber !== "calendar-prev-year")
|
|
185
|
-
setCurrFocusDescriber("calendar-prev-year");
|
|
138
|
+
if (latestInteractionRegion !== "calendar-head") setLatestInteractionRegion("calendar-head");
|
|
139
|
+
if (currFocusDescriber !== "calendar-prev-year") setCurrFocusDescriber("calendar-prev-year");
|
|
186
140
|
},
|
|
187
141
|
trackFocusCalendarNextYear: () => {
|
|
188
|
-
if (latestInteractionRegion !== "calendar-head")
|
|
189
|
-
|
|
190
|
-
if (currFocusDescriber !== "calendar-next-year")
|
|
191
|
-
setCurrFocusDescriber("calendar-next-year");
|
|
142
|
+
if (latestInteractionRegion !== "calendar-head") setLatestInteractionRegion("calendar-head");
|
|
143
|
+
if (currFocusDescriber !== "calendar-next-year") setCurrFocusDescriber("calendar-next-year");
|
|
192
144
|
},
|
|
193
145
|
trackFocusCalendarMetafocusedDay: () => {
|
|
194
|
-
if (latestInteractionRegion !== "calendar-days")
|
|
195
|
-
|
|
196
|
-
if (currFocusDescriber !== "calendar-metafocused-day")
|
|
197
|
-
setCurrFocusDescriber("calendar-metafocused-day");
|
|
146
|
+
if (latestInteractionRegion !== "calendar-days") setLatestInteractionRegion("calendar-days");
|
|
147
|
+
if (currFocusDescriber !== "calendar-metafocused-day") setCurrFocusDescriber("calendar-metafocused-day");
|
|
198
148
|
},
|
|
199
149
|
trackFocusTimewheelCurrHour: () => {
|
|
200
|
-
if (latestInteractionRegion !== "timewheel")
|
|
201
|
-
|
|
202
|
-
if (currFocusDescriber !== "timewheel-curr-hour")
|
|
203
|
-
setCurrFocusDescriber("timewheel-curr-hour");
|
|
150
|
+
if (latestInteractionRegion !== "timewheel") setLatestInteractionRegion("timewheel");
|
|
151
|
+
if (currFocusDescriber !== "timewheel-curr-hour") setCurrFocusDescriber("timewheel-curr-hour");
|
|
204
152
|
},
|
|
205
153
|
trackFocusTimewheelCurrMinute: () => {
|
|
206
|
-
if (latestInteractionRegion !== "timewheel")
|
|
207
|
-
|
|
208
|
-
if (currFocusDescriber !== "timewheel-curr-minute")
|
|
209
|
-
setCurrFocusDescriber("timewheel-curr-minute");
|
|
154
|
+
if (latestInteractionRegion !== "timewheel") setLatestInteractionRegion("timewheel");
|
|
155
|
+
if (currFocusDescriber !== "timewheel-curr-minute") setCurrFocusDescriber("timewheel-curr-minute");
|
|
210
156
|
},
|
|
211
157
|
trackFocusTimewheelCurrMeridiem: () => {
|
|
212
|
-
if (latestInteractionRegion !== "timewheel")
|
|
213
|
-
|
|
214
|
-
if (currFocusDescriber !== "timewheel-curr-meridiem")
|
|
215
|
-
setCurrFocusDescriber("timewheel-curr-meridiem");
|
|
158
|
+
if (latestInteractionRegion !== "timewheel") setLatestInteractionRegion("timewheel");
|
|
159
|
+
if (currFocusDescriber !== "timewheel-curr-meridiem") setCurrFocusDescriber("timewheel-curr-meridiem");
|
|
216
160
|
},
|
|
217
161
|
trackFocusPicker,
|
|
218
162
|
trackFocusFirstSegment,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useFocusTracker.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-lines */\n/* eslint-disable indent */\n/* eslint-disable max-params */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo, useState } from 'react';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\n\ntype LatestInteractionRegion =\n | 'calendar-days'\n | 'calendar-head'\n | 'timewheel'\n | 'date-inputs'\n | 'time-inputs'\n | 'clear-btn'\n | 'picker-icon'\n | '';\ntype CurrFocusDescriber =\n | 'first-segment'\n | 'month-input'\n | 'day-input'\n | 'year-input'\n | 'hour-input'\n | 'minute-input'\n | 'meridiem-input'\n | 'last-segment'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | 'calendar-prev-month'\n | 'calendar-next-month'\n | 'calendar-prev-year'\n | 'calendar-next-year'\n | 'calendar-metafocused-day'\n | 'timewheel-curr-hour'\n | 'timewheel-curr-minute'\n | 'timewheel-curr-meridiem'\n | '';\n\ninterface Config {\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n}\nexport const useFocusTracker = ({ DOMRefs, flags }: Config) => {\n const [latestInteractionRegion, setLatestInteractionRegion] = useState<LatestInteractionRegion>('');\n const [currFocusDescriber, setCurrFocusDescriber] = useState<CurrFocusDescriber>('');\n const { firstSegment, lastSegment } = DOMRefs;\n const { isDateSelector, isTimeSelector } = flags;\n\n const trackFocusPicker = useCallback(() => {\n let picker = 'datetime-picker-icon' as CurrFocusDescriber;\n if (isDateSelector) picker = 'date-picker-icon';\n if (isTimeSelector) picker = 'time-picker-icon';\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (picker !== currFocusDescriber) setCurrFocusDescriber(picker);\n }, [currFocusDescriber, isDateSelector, isTimeSelector, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the first segment can be:\n - month-input (when date inputs are present)\n - hour-input (when ONLY time inputs are present)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusFirstSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (firstSegment === 'hour-input') region = 'time-inputs';\n if (firstSegment === 'date-picker-icon') region = 'picker-icon';\n if (firstSegment === 'time-picker-icon') region = 'picker-icon';\n if (firstSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (firstSegment !== currFocusDescriber) setCurrFocusDescriber(firstSegment);\n }, [currFocusDescriber, firstSegment, latestInteractionRegion]);\n\n /*\n depending on the polymorphic props, the last segment can be:\n - year-input (when ONLY date inputs are present)\n - meridiem-input (when time inputs are present)\n - clear-btn (when clearable is true and there is no picker)\n - datetime-picker-icon (when picker is present and we are selecting both date and time)\n - date-picker-icon (when picker is present and no time selection is involved)\n - time-picker-icon (when picker is present and no date selection is involved)\n */\n const trackFocusLastSegment = useCallback(() => {\n let region = 'date-inputs' as LatestInteractionRegion;\n if (lastSegment === 'meridiem-input') region = 'time-inputs';\n if (lastSegment === 'clear-btn') region = 'clear-btn';\n if (lastSegment === 'date-picker-icon') region = 'picker-icon';\n if (lastSegment === 'time-picker-icon') region = 'picker-icon';\n if (lastSegment === 'datetime-picker-icon') region = 'picker-icon';\n if (region !== latestInteractionRegion) setLatestInteractionRegion(region);\n if (lastSegment !== currFocusDescriber) setCurrFocusDescriber(lastSegment);\n }, [currFocusDescriber, lastSegment, latestInteractionRegion]);\n\n const trackFocusResetter = useCallback(() => {\n if (latestInteractionRegion !== '') setLatestInteractionRegion('');\n if (currFocusDescriber !== '') setCurrFocusDescriber('');\n }, [currFocusDescriber, latestInteractionRegion]);\n\n const handleComponentBlurs = useCallback(() => {\n /* our code base is trying to avoid side-effects and we also try to be imperative\n due to how \"portals\" work, when we open a portal the \"blur\" event is triggered\n we need to distinguish between\n - a blur that is caused by a portal opening\n vs\n - a blur that is caused by a user moving focus to another element\n we can do this by checking the currFocusDescriber and latestInteractionRegion\n we know that blur is triggered by portal opening when:\n - latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day'\n (this is the case when we open the calendar or calendarWithTimeWheel with a preselected date)\n - latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month'\n (this is the case when we open the calendar or calendarWithTimeWheel without a preselected date)\n - latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour'\n (this is the case when we open any timewheel ONLY)\n */\n let shouldShortCircuit = false;\n // preselected date OR filled date value OR onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-days' && currFocusDescriber === 'calendar-metafocused-day')\n shouldShortCircuit = true;\n // empty date value AND no onCalendarOpenFocusedDay is present\n if (latestInteractionRegion === 'calendar-head' && currFocusDescriber === 'calendar-prev-month')\n shouldShortCircuit = true;\n\n // only time wheel is present in the contextual region\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-hour')\n shouldShortCircuit = true;\n\n if (shouldShortCircuit) return;\n trackFocusResetter();\n }, [currFocusDescriber, latestInteractionRegion, trackFocusResetter]);\n\n return useMemo(\n () => ({\n latestInteractionRegion,\n setLatestInteractionRegion,\n currFocusDescriber,\n setCurrFocusDescriber,\n trackFocusResetter,\n trackFocusMonthInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'month-input') setCurrFocusDescriber('month-input');\n },\n trackFocusDayInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'day-input') setCurrFocusDescriber('day-input');\n },\n trackFocusYearInput: () => {\n if (latestInteractionRegion !== 'date-inputs') setLatestInteractionRegion('date-inputs');\n if (currFocusDescriber !== 'year-input') setCurrFocusDescriber('year-input');\n },\n trackFocusHourInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'hour-input') setCurrFocusDescriber('hour-input');\n },\n trackFocusMinuteInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'minute-input') setCurrFocusDescriber('minute-input');\n },\n trackFocusMeridiemInput: () => {\n if (latestInteractionRegion !== 'time-inputs') setLatestInteractionRegion('time-inputs');\n if (currFocusDescriber !== 'meridiem-input') setCurrFocusDescriber('meridiem-input');\n },\n trackFocusClearBtn: () => {\n if (latestInteractionRegion !== 'clear-btn') setLatestInteractionRegion('clear-btn');\n if (currFocusDescriber !== 'clear-btn') setCurrFocusDescriber('clear-btn');\n },\n trackFocusDatePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'date-picker-icon') setCurrFocusDescriber('date-picker-icon');\n },\n trackFocusTimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'time-picker-icon') setCurrFocusDescriber('time-picker-icon');\n },\n trackFocusDatetimePickerIcon: () => {\n if (latestInteractionRegion !== 'picker-icon') setLatestInteractionRegion('picker-icon');\n if (currFocusDescriber !== 'datetime-picker-icon') setCurrFocusDescriber('datetime-picker-icon');\n },\n trackFocusCalendarPrevMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-month') setCurrFocusDescriber('calendar-prev-month');\n },\n trackFocusCalendarNextMonth: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-month') setCurrFocusDescriber('calendar-next-month');\n },\n trackFocusCalendarPrevYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-prev-year') setCurrFocusDescriber('calendar-prev-year');\n },\n trackFocusCalendarNextYear: () => {\n if (latestInteractionRegion !== 'calendar-head') setLatestInteractionRegion('calendar-head');\n if (currFocusDescriber !== 'calendar-next-year') setCurrFocusDescriber('calendar-next-year');\n },\n trackFocusCalendarMetafocusedDay: () => {\n if (latestInteractionRegion !== 'calendar-days') setLatestInteractionRegion('calendar-days');\n if (currFocusDescriber !== 'calendar-metafocused-day') setCurrFocusDescriber('calendar-metafocused-day');\n },\n trackFocusTimewheelCurrHour: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-hour') setCurrFocusDescriber('timewheel-curr-hour');\n },\n trackFocusTimewheelCurrMinute: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-minute') setCurrFocusDescriber('timewheel-curr-minute');\n },\n trackFocusTimewheelCurrMeridiem: () => {\n if (latestInteractionRegion !== 'timewheel') setLatestInteractionRegion('timewheel');\n if (currFocusDescriber !== 'timewheel-curr-meridiem') setCurrFocusDescriber('timewheel-curr-meridiem');\n },\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n }),\n [\n latestInteractionRegion,\n currFocusDescriber,\n trackFocusResetter,\n trackFocusPicker,\n trackFocusFirstSegment,\n trackFocusLastSegment,\n handleComponentBlurs,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,uBAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAA6B,EAAE;AACnF,QAAM,EAAE,cAAc,YAAY,IAAI;AACtC,QAAM,EAAE,gBAAgB,eAAe,IAAI;AAE3C,QAAM,uBAAmB,0BAAY,MAAM;AACzC,QAAI,SAAS;AACb,QAAI
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAA+C;AAwCxC,MAAM,kBAAkB,CAAC,EAAE,SAAS,MAAM,MAAc;AAC7D,QAAM,CAAC,yBAAyB,0BAA0B,QAAI,uBAAkC,EAAE;AAClG,QAAM,CAAC,oBAAoB,qBAAqB,QAAI,uBAA6B,E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AAA,MACA,iCAAiC,MAAM;AACrC,YAAI,4BAA4B,YAAa,4BAA2B,WAAW;AACnF,YAAI,uBAAuB,0BAA2B,uBAAsB,yBAAyB;AAAA,MACvG;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetDestructuredValues.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\nimport { useMemo } from 'react';\nimport {\n dateTimeToTime,\n deconstructTimeValues,\n dateTimeToDate,\n deconstructValuesFromDateString,\n fillStringWithPlaceHolders,\n} from '../utils/stringHelpers.js';\nimport type { useGetFlags } from './useGetFlags.js';\nimport type { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport { convertToPositiveNumberIfPossible } from '../utils/numberHelpers.js';\nimport { monthNames, announcableCardinalDays } from '../utils/constants.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../sharedTypes.js';\n\ntype UseGetDestructuredDateValues = (\n config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>,\n) => {\n month: string;\n day: string;\n year: string;\n monthNum: number;\n dayNum: number;\n yearNum: number;\n announcedMonth: string;\n announcedDay: string;\n announcedYear: string;\n announcedDateValues: string;\n};\n// this is because it's fully controlled\n// our source of truth is either the date props or dateTime props\n// based on wheter it's a dateTime picker\n// or a date picker (it's date picker when hideTime is true)\nexport const useGetDestructuredDateValues: UseGetDestructuredDateValues = ({\n appDate,\n appDateTime,\n isDateTimeSelector,\n}) => {\n const dateStringFromProps = isDateTimeSelector ? dateTimeToDate(appDateTime) : appDate;\n const deconstructedValues = deconstructValuesFromDateString(dateStringFromProps);\n const { month, day, year } = deconstructedValues;\n const monthNum = convertToPositiveNumberIfPossible(month);\n const dayNum = convertToPositiveNumberIfPossible(day) as DSControlledDateTimePickerInternalsT.DateDay | -1;\n const yearNum = convertToPositiveNumberIfPossible(year);\n const announcedMonth = monthNum !== -1 ? monthNames[monthNum - 1] : 'empty month';\n const announcedDay = dayNum !== -1 ? announcableCardinalDays[dayNum] : 'empty day';\n const announcedYear = yearNum !== -1 ? fillStringWithPlaceHolders(`${yearNum}`, 4, '0') : 'empty year';\n const announcedDateValues = `${announcedMonth}, ${announcedDay}, ${announcedYear}`;\n\n return useMemo(\n () => ({\n month,\n day,\n year,\n monthNum,\n dayNum,\n yearNum,\n announcedMonth,\n announcedDay,\n announcedYear,\n announcedDateValues,\n }),\n [announcedDay, announcedMonth, announcedYear, announcedDateValues, day, dayNum, month, monthNum, year, yearNum],\n );\n};\n\ntype UseGetDestructuredTimeValues = (\n config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>,\n) => {\n hours: string;\n minutes: string;\n meridiem: string;\n hoursNum: number;\n minutesNum: number;\n announcedHours: string;\n announcedMinutes: string;\n announcedMeridiem: string;\n announcedTimeValues: string;\n};\n// this is because it's fully controlled\n// our source of truth is either the time props or dateTime props\n// based on wheter it's a dateTime picker\n// or a time picker (it's time picker when hideDate is true)\nexport const useGetDestructuredTimeValues: UseGetDestructuredTimeValues = ({\n appTime,\n appDateTime,\n isDateTimeSelector,\n}) => {\n const timeStringFromProps = isDateTimeSelector ? dateTimeToTime(appDateTime) : appTime;\n const deconstructedValues = deconstructTimeValues(timeStringFromProps);\n const { hours, minutes, meridiem } = deconstructedValues;\n const hoursNum = convertToPositiveNumberIfPossible(hours);\n const minutesNum = convertToPositiveNumberIfPossible(minutes);\n\n // 01 -> 1 ~ 09 -> 9 || 1_ -> 1 ~ 9_ -> 9 || empty...\n const announcedHours = hoursNum !== -1 ? `${hoursNum}` : 'empty hours';\n // 01 -> 1 ~ 09 -> 9 || 1_ -> 1 ~ 9_ -> 9 || empty...\n const announcedMinutes = minutesNum !== -1 ? `${minutesNum}` : 'empty minutes';\n const announcedMeridiem =\n // eslint-disable-next-line no-nested-ternary\n meridiem === 'PM' ? `post meridiem` : meridiem === 'AM' ? 'ante meridiem' : 'empty meriediem';\n const announcedTimeValues = `${announcedHours}, ${announcedMinutes}, ${announcedMeridiem}`;\n\n return useMemo(\n () => ({\n hours,\n minutes,\n meridiem,\n hoursNum,\n minutesNum,\n announcedHours,\n announcedMinutes,\n announcedMeridiem,\n announcedTimeValues,\n }),\n [\n hours,\n minutes,\n meridiem,\n hoursNum,\n minutesNum,\n announcedHours,\n announcedMinutes,\n announcedMeridiem,\n announcedTimeValues,\n ],\n );\n};\n\ntype UseGetDestructuredValues = (\n config: ReturnType<typeof useGetPropsBasedOnType> & ReturnType<typeof useGetFlags>,\n) => ReturnType<typeof useGetDestructuredDateValues> & ReturnType<typeof useGetDestructuredTimeValues>;\n\nexport const useGetDestructuredValues: UseGetDestructuredValues = (config) => {\n const dateValues = useGetDestructuredDateValues(config);\n const timeValues = useGetDestructuredTimeValues(config);\n\n return useMemo(\n () => ({\n ...dateValues,\n ...timeValues,\n }),\n [dateValues, timeValues],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAwB;AACxB,2BAMO;AAGP,2BAAkD;AAClD,uBAAoD;AAqB7C,MAAM,+BAA6D,CAAC;AAAA,EACzE;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,sBAAsB,yBAAqB,qCAAe,WAAW,IAAI;AAC/E,QAAM,0BAAsB,sDAAgC,mBAAmB;AAC/E,QAAM,EAAE,OAAO,KAAK,KAAK,IAAI;AAC7B,QAAM,eAAW,wDAAkC,KAAK;AACxD,QAAM,aAAS,w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M;AACJ,QAAM,sBAAsB,yBAAqB,qCAAe,WAAW,IAAI;AAC/E,QAAM,0BAAsB,4CAAsB,mBAAmB;AACrE,QAAM,EAAE,OAAO,SAAS,SAAS,IAAI;AACrC,QAAM,eAAW,wDAAkC,KAAK;AACxD,QAAM,iBAAa,wDAAkC,OAAO;AAG5D,QAAM,iBAAiB,aAAa,KAAK,GAAG,QAAQ,KAAK;AAEzD,QAAM,mBAAmB,eAAe,KAAK,GAAG,UAAU,KAAK;AAC/D,QAAM;AAAA;AAAA,IAEJ,aAAa,OAAO,kBAAkB,aAAa,OAAO,kBAAkB;AAAA;AAC9E,QAAM,sBAAsB,GAAG,cAAc,KAAK,gBAAgB,KAAK,iBAAiB;AAExF,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;AAMO,MAAM,2BAAqD,CAAC,WAAW;AAC5E,QAAM,aAAa,6BAA6B,MAAM;AACtD,QAAM,aAAa,6BAA6B,MAAM;AAEtD,aAAO;AAAA,IACL,OAAO;AAAA,MACL,GAAG;AAAA,MACH,GAAG;AAAA,IACL;AAAA,IACA,CAAC,YAAY,UAAU;AAAA,EACzB;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetPropsBasedOnType.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useMemo } from 'react';\nimport { getIsDateTime, getIsDate, getIsTime } from '../utils/typeGuards.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nconst noop = () => {};\nconst defaultReturnFalse = () => false;\n\nexport const useGetPropsBasedOnType = (propsWithDefaults: DSControlledDateTimePickerT.InternalProps) => {\n const isDateTime = getIsDateTime(propsWithDefaults);\n const isDate = getIsDate(propsWithDefaults);\n const isTime = getIsTime(propsWithDefaults);\n\n /* -------------------------- -------------- --------------------------*/\n /* -------------------------- DATE OPTIONALS --------------------------*/\n /* -------------------------- -------------- --------------------------*/\n const getIsDisabledDay =\n (isDateTime || isDate) && propsWithDefaults.getIsDisabledDay\n ? propsWithDefaults.getIsDisabledDay\n : defaultReturnFalse;\n const getIsOutOfRangeDay =\n (isDateTime || isDate) && propsWithDefaults.getIsOutOfRangeDay\n ? propsWithDefaults.getIsOutOfRangeDay\n : defaultReturnFalse;\n const appOnMonthChange =\n (isDateTime || isDate) && propsWithDefaults.onMonthChange ? propsWithDefaults.onMonthChange : noop;\n const appOnDayChange = (isDateTime || isDate) && propsWithDefaults.onDayChange ? propsWithDefaults.onDayChange : noop;\n const appOnYearChange =\n (isDateTime || isDate) && propsWithDefaults.onYearChange ? propsWithDefaults.onYearChange : noop;\n\n const emptyPickerStartingMonthDefault = `${new Date().getMonth() + 1}/__/${new Date().getFullYear()}`;\n const emptyPickerStartingMonth =\n (isDateTime || isDate) && propsWithDefaults.emptyPickerStartingMonth\n ? propsWithDefaults.emptyPickerStartingMonth\n : emptyPickerStartingMonthDefault;\n const onCalendarOpenFocusedDay =\n (isDateTime || isDate) && propsWithDefaults.onCalendarOpenFocusedDay\n ? propsWithDefaults.onCalendarOpenFocusedDay\n : undefined;\n /* -------------------------- -------------- --------------------------*/\n /* -------------------------- TIME OPTIONALS --------------------------*/\n /* -------------------------- -------------- --------------------------*/\n const getIsDisabledTime =\n (isDateTime || isTime) && propsWithDefaults.getIsDisabledTime\n ? propsWithDefaults.getIsDisabledTime\n : defaultReturnFalse;\n const appOnHourChange =\n (isDateTime || isTime) && propsWithDefaults.onHourChange ? propsWithDefaults.onHourChange : noop;\n const appOnMinuteChange =\n (isDateTime || isTime) && propsWithDefaults.onMinuteChange ? propsWithDefaults.onMinuteChange : noop;\n const appOnMeridiemChange =\n (isDateTime || isTime) && propsWithDefaults.onMeridiemChange ? propsWithDefaults.onMeridiemChange : noop;\n const minutesInterval =\n (isDateTime || isTime) && propsWithDefaults.minutesInterval ? propsWithDefaults.minutesInterval : 1;\n const onTimeWheelOpenStartingTime =\n (isDateTime || isTime) && propsWithDefaults.onTimeWheelOpenStartingTime\n ? propsWithDefaults.onTimeWheelOpenStartingTime\n : '01:00 AM';\n\n /* --------- ------------------------------------ ---------------------*/\n /* --------- SPECIFIC REQUIRED DATETIME OPTIONALS ---------------------*/\n /* --------- ------------------------------------ ---------------------*/\n const appOnDateChange =\n (isDateTime || isDate) && propsWithDefaults.onDateChange ? propsWithDefaults.onDateChange : noop;\n const appOnTimeChange =\n (isDateTime || isTime) && propsWithDefaults.onTimeChange ? propsWithDefaults.onTimeChange : noop;\n /* ---------------------- ---------------------- ----------------------*/\n /* ---------------------- DATE-RELATED OPTIONALS ----------------------*/\n /* ---------------------- ---------------------- ----------------------*/\n const getIsStartRangeDay =\n (isDateTime || isDate) && propsWithDefaults.getIsStartRangeDay ? propsWithDefaults.getIsStartRangeDay : noop;\n const getIsDayInRange =\n (isDateTime || isDate) && propsWithDefaults.getIsDayInRange ? propsWithDefaults.getIsDayInRange : noop;\n const getIsEndRangeDay =\n (isDateTime || isDate) && propsWithDefaults.getIsEndRangeDay ? propsWithDefaults.getIsEndRangeDay : noop;\n\n /* --------------------- ----------------------- ------------------------*/\n /* --------------------- TYPE SPECIFIC REQUIREDS ------------------------*/\n /* --------------------- ----------------------- ------------------------*/\n const appDate = isDate ? propsWithDefaults.date : '';\n const appTime = isTime ? propsWithDefaults.time : '';\n const appDateTime = isDateTime ? propsWithDefaults.dateTime : '';\n const appOnDateTimeChange = isDateTime ? propsWithDefaults.onDateTimeChange : noop;\n\n return useMemo(\n () => ({\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnDateChange,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n appDate,\n getIsDisabledTime,\n appOnTimeChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n appTime,\n appDateTime,\n appOnDateTimeChange,\n emptyPickerStartingMonth,\n onCalendarOpenFocusedDay,\n minutesInterval,\n onTimeWheelOpenStartingTime,\n isDate,\n isTime,\n isDateTime,\n }),\n [\n getIsDisabledDay,\n getIsOutOfRangeDay,\n getIsStartRangeDay,\n getIsDayInRange,\n getIsEndRangeDay,\n appOnDateChange,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n appDate,\n getIsDisabledTime,\n appOnTimeChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n appTime,\n appDateTime,\n appOnDateTimeChange,\n emptyPickerStartingMonth,\n onCalendarOpenFocusedDay,\n minutesInterval,\n onTimeWheelOpenStartingTime,\n isDate,\n isTime,\n isDateTime,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAwB;AACxB,wBAAoD;AAIpD,MAAM,OAAO,MAAM;AAAC;AACpB,MAAM,qBAAqB,MAAM;AAE1B,MAAM,yBAAyB,CAAC,sBAAiE;AACtG,QAAM,iBAAa,iCAAc,iBAAiB;AAClD,QAAM,aAAS,6BAAU,iBAAiB;AAC1C,QAAM,aAAS,6BAAU,iBAAiB;AAK1C,QAAM,oBACH,cAAc,WAAW,kBAAkB,mBACxC,kBAAkB,mBAClB;AACN,QAAM,sBACH,cAAc,WAAW,kBAAkB,qBACxC,kBAAkB,qBAClB;AACN,QAAM,oBACH,cAAc,WAAW,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AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -69,42 +69,31 @@ const useGetReferences = ({
|
|
|
69
69
|
let firstSegmentRef = (0, import_react.useRef)(null);
|
|
70
70
|
if (isWithDateInputs) {
|
|
71
71
|
firstSegmentRef = monthInputRef;
|
|
72
|
-
if (firstSegment !== "month-input")
|
|
73
|
-
setFirstSegment("month-input");
|
|
72
|
+
if (firstSegment !== "month-input") setFirstSegment("month-input");
|
|
74
73
|
} else if (isWithTimeInputs) {
|
|
75
74
|
firstSegmentRef = hourInputRef;
|
|
76
|
-
if (firstSegment !== "hour-input")
|
|
77
|
-
setFirstSegment("hour-input");
|
|
75
|
+
if (firstSegment !== "hour-input") setFirstSegment("hour-input");
|
|
78
76
|
} else if (withAnyPicker) {
|
|
79
77
|
firstSegmentRef = pickerButtonRef;
|
|
80
|
-
if (isDateSelector && firstSegment !== "date-picker-icon")
|
|
81
|
-
|
|
82
|
-
if (
|
|
83
|
-
setFirstSegment("time-picker-icon");
|
|
84
|
-
if (isDateTimeSelector && firstSegment !== "datetime-picker-icon")
|
|
85
|
-
setFirstSegment("datetime-picker-icon");
|
|
78
|
+
if (isDateSelector && firstSegment !== "date-picker-icon") setFirstSegment("date-picker-icon");
|
|
79
|
+
if (isTimeSelector && firstSegment !== "time-picker-icon") setFirstSegment("time-picker-icon");
|
|
80
|
+
if (isDateTimeSelector && firstSegment !== "datetime-picker-icon") setFirstSegment("datetime-picker-icon");
|
|
86
81
|
}
|
|
87
82
|
let lastSegmentRef = (0, import_react.useRef)(null);
|
|
88
83
|
if (withAnyPicker) {
|
|
89
84
|
lastSegmentRef = pickerButtonRef;
|
|
90
|
-
if (isDateSelector && lastSegment !== "date-picker-icon")
|
|
91
|
-
|
|
92
|
-
if (
|
|
93
|
-
setLastSegment("time-picker-icon");
|
|
94
|
-
if (isDateTimeSelector && lastSegment !== "datetime-picker-icon")
|
|
95
|
-
setLastSegment("datetime-picker-icon");
|
|
85
|
+
if (isDateSelector && lastSegment !== "date-picker-icon") setLastSegment("date-picker-icon");
|
|
86
|
+
if (isTimeSelector && lastSegment !== "time-picker-icon") setLastSegment("time-picker-icon");
|
|
87
|
+
if (isDateTimeSelector && lastSegment !== "datetime-picker-icon") setLastSegment("datetime-picker-icon");
|
|
96
88
|
} else if (withClearBtn) {
|
|
97
89
|
lastSegmentRef = clearButtonRef;
|
|
98
|
-
if (lastSegment !== "clear-btn")
|
|
99
|
-
setLastSegment("clear-btn");
|
|
90
|
+
if (lastSegment !== "clear-btn") setLastSegment("clear-btn");
|
|
100
91
|
} else if (isWithTimeInputs) {
|
|
101
92
|
lastSegmentRef = meridiemInputRef;
|
|
102
|
-
if (lastSegment !== "meridiem-input")
|
|
103
|
-
setLastSegment("meridiem-input");
|
|
93
|
+
if (lastSegment !== "meridiem-input") setLastSegment("meridiem-input");
|
|
104
94
|
} else if (isWithDateInputs) {
|
|
105
95
|
lastSegmentRef = yearInputRef;
|
|
106
|
-
if (lastSegment !== "year-input")
|
|
107
|
-
setLastSegment("year-input");
|
|
96
|
+
if (lastSegment !== "year-input") setLastSegment("year-input");
|
|
108
97
|
}
|
|
109
98
|
return (0, import_react.useMemo)(
|
|
110
99
|
() => ({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGetReferences.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useRef, useMemo, useState } from 'react';\nimport type { useGetFlags } from './useGetFlags.js';\ntype FirstSegment =\n | 'month-input'\n | 'hour-input'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\ntype LastSegment =\n | 'year-input'\n | 'meridiem-input'\n | 'clear-btn'\n | 'date-picker-icon'\n | 'time-picker-icon'\n | 'datetime-picker-icon'\n | '';\nexport const useGetReferences = ({\n isWithDateInputs,\n isWithTimeInputs,\n isDateSelector,\n isTimeSelector,\n isDateTimeSelector,\n withAnyPicker,\n withClearBtn,\n}: ReturnType<typeof useGetFlags>) => {\n // those 2 states are needed for focus tracking\n const [firstSegment, setFirstSegment] = useState<FirstSegment>('');\n const [lastSegment, setLastSegment] = useState<LastSegment>('');\n // refs are used for \"auto-advance\" feature\n const monthInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const dayInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const yearInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const hourInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const minutesInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const meridiemInputRef = useRef<HTMLInputElement>(null) as React.MutableRefObject<HTMLInputElement>;\n const clearButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const pickerButtonRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n\n const prevYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextMonthBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextYearBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const calendarDaysWrapperRef = useRef<HTMLDivElement>(null) as React.MutableRefObject<HTMLDivElement>;\n\n const prevHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextHourBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMinutesBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currMinutesBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextMinutesBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const prevMeridiemBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const currMeridiemBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n const nextMeridiemBtnRef = useRef<HTMLButtonElement>(null) as React.MutableRefObject<HTMLButtonElement>;\n\n let firstSegmentRef = useRef<HTMLInputElement | HTMLButtonElement>(null) as React.MutableRefObject<\n HTMLInputElement | HTMLButtonElement\n >;\n if (isWithDateInputs) {\n firstSegmentRef = monthInputRef;\n if (firstSegment !== 'month-input') setFirstSegment('month-input');\n } else if (isWithTimeInputs) {\n firstSegmentRef = hourInputRef;\n if (firstSegment !== 'hour-input') setFirstSegment('hour-input');\n } else if (withAnyPicker) {\n firstSegmentRef = pickerButtonRef;\n if (isDateSelector && firstSegment !== 'date-picker-icon') setFirstSegment('date-picker-icon');\n if (isTimeSelector && firstSegment !== 'time-picker-icon') setFirstSegment('time-picker-icon');\n if (isDateTimeSelector && firstSegment !== 'datetime-picker-icon') setFirstSegment('datetime-picker-icon');\n }\n\n let lastSegmentRef = useRef<HTMLInputElement | HTMLButtonElement>(null) as React.MutableRefObject<\n HTMLInputElement | HTMLButtonElement\n >;\n if (withAnyPicker) {\n lastSegmentRef = pickerButtonRef;\n if (isDateSelector && lastSegment !== 'date-picker-icon') setLastSegment('date-picker-icon');\n if (isTimeSelector && lastSegment !== 'time-picker-icon') setLastSegment('time-picker-icon');\n if (isDateTimeSelector && lastSegment !== 'datetime-picker-icon') setLastSegment('datetime-picker-icon');\n } else if (withClearBtn) {\n lastSegmentRef = clearButtonRef;\n if (lastSegment !== 'clear-btn') setLastSegment('clear-btn');\n } else if (isWithTimeInputs) {\n lastSegmentRef = meridiemInputRef;\n if (lastSegment !== 'meridiem-input') setLastSegment('meridiem-input');\n } else if (isWithDateInputs) {\n lastSegmentRef = yearInputRef;\n if (lastSegment !== 'year-input') setLastSegment('year-input');\n }\n\n return useMemo(\n () => ({\n monthInputRef,\n dayInputRef,\n yearInputRef,\n hourInputRef,\n minutesInputRef,\n meridiemInputRef,\n clearButtonRef,\n pickerButtonRef,\n prevYearBtnRef,\n prevMonthBtnRef,\n nextMonthBtnRef,\n nextYearBtnRef,\n calendarDaysWrapperRef,\n prevHourBtnRef,\n currHourBtnRef,\n nextHourBtnRef,\n prevMinutesBtnRef,\n currMinutesBtnRef,\n nextMinutesBtnRef,\n prevMeridiemBtnRef,\n currMeridiemBtnRef,\n nextMeridiemBtnRef,\n firstSegmentRef,\n lastSegmentRef,\n firstSegment,\n lastSegment,\n }),\n [firstSegment, lastSegment],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAA0C;AAiBnC,MAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAsC;AAEpC,QAAM,CAAC,cAAc,eAAe,QAAI,uBAAuB,EAAE;AACjE,QAAM,CAAC,aAAa,cAAc,QAAI,uBAAsB,EAAE;AAE9D,QAAM,oBAAgB,qBAAyB,IAAI;AACnD,QAAM,kBAAc,qBAAyB,IAAI;AACjD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,mBAAe,qBAAyB,IAAI;AAClD,QAAM,sBAAkB,qBAAyB,IAAI;AACrD,QAAM,uBAAmB,qBAAyB,IAAI;AACtD,QAAM,qBAAiB,qBAA0B,IAAI;AACrD,QAAM,sBAAkB,qBAA0B,IAAI;AAEtD,QAAM,qBAAiB,qBAA0B,IAA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,EACvE,WAAW,kBAAkB;AAC3B,qBAAiB;AACjB,QAAI,gBAAgB,aAAc,gBAAe,YAAY;AAAA,EAC/D;AAEA,aAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,cAAc,WAAW;AAAA,EAC5B;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -71,10 +71,8 @@ const useGlobalKeyHandlers = ({ propsBasedOnType, changeHandlers, focusTrackers,
|
|
|
71
71
|
appOnMinuteChange(minutes, e, metaInfo);
|
|
72
72
|
appOnMeridiemChange(meridiem, e, metaInfo);
|
|
73
73
|
handleChangeComposedDateTimeString(nowDateString, nowTimeString, finalMetaInfo);
|
|
74
|
-
if (shouldPreserveClearableSpace && !withAnyPicker)
|
|
75
|
-
|
|
76
|
-
else
|
|
77
|
-
trackFocusLastSegment();
|
|
74
|
+
if (shouldPreserveClearableSpace && !withAnyPicker) trackFocusClearBtn();
|
|
75
|
+
else trackFocusLastSegment();
|
|
78
76
|
},
|
|
79
77
|
[
|
|
80
78
|
appOnDayChange,
|
|
@@ -99,8 +97,7 @@ const useGlobalKeyHandlers = ({ propsBasedOnType, changeHandlers, focusTrackers,
|
|
|
99
97
|
if ((ctrlKey || metaKey) && key === ";") {
|
|
100
98
|
onFillWithCurrentDateKeys(e);
|
|
101
99
|
}
|
|
102
|
-
if ((ctrlKey || metaKey) && (key === "Delete" || key === "Backspace"))
|
|
103
|
-
handleClearAll(e);
|
|
100
|
+
if ((ctrlKey || metaKey) && (key === "Delete" || key === "Backspace")) handleClearAll(e);
|
|
104
101
|
},
|
|
105
102
|
[handleClearAll, onFillWithCurrentDateKeys]
|
|
106
103
|
);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/config/useGlobalKeyHandlers.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable no-nested-ternary */\n/* eslint-disable max-lines */\n/* eslint-disable import/prefer-default-export */\n/* eslint-disable complexity */\n/* eslint-disable max-statements */\nimport { useCallback, useMemo } from 'react';\nimport type { useChangeHandlers } from './useChangeHandlers.js';\nimport type { useGetPropsBasedOnType } from './useGetPropsBasedOnType.js';\nimport type { useGetReferences } from './useGetReferences.js';\nimport type { useGetFlags } from './useGetFlags.js';\nimport type { useFocusTracker } from './useFocusTracker.js';\nimport { getValidationDateStringMetaInfo, getDateStringFromDay, getTimeStringFromDay } from '../utils/dateHelpers.js';\nimport { getValidationTimeStringMetaInfo } from '../utils/timeHelpers.js';\nimport { deconstructValuesFromDateString, deconstructValuesFromTimeString } from '../utils/stringHelpers.js';\nimport type { DSControlledDateTimePickerT } from '../react-desc-prop-types.js';\n\ninterface Config {\n propsBasedOnType: ReturnType<typeof useGetPropsBasedOnType>;\n changeHandlers: ReturnType<typeof useChangeHandlers>;\n DOMRefs: ReturnType<typeof useGetReferences>;\n flags: ReturnType<typeof useGetFlags>;\n focusTrackers: ReturnType<typeof useFocusTracker>;\n}\n\nexport const useGlobalKeyHandlers = ({ propsBasedOnType, changeHandlers, focusTrackers, flags }: Config) => {\n const {\n getIsOutOfRangeDay,\n getIsDisabledDay,\n getIsDisabledTime,\n appOnMonthChange,\n appOnDayChange,\n appOnYearChange,\n appOnHourChange,\n appOnMinuteChange,\n appOnMeridiemChange,\n } = propsBasedOnType;\n const { handleChangeComposedDateTimeString, handleClearAll } = changeHandlers;\n const { trackFocusLastSegment, trackFocusClearBtn } = focusTrackers;\n const { withAnyPicker, shouldPreserveClearableSpace } = flags;\n\n const onFillWithCurrentDateKeys = useCallback(\n (\n e: React.KeyboardEvent<HTMLDivElement>,\n metaInfo: Partial<DSControlledDateTimePickerT.InternalInputsChangeMetaInfo> = { isAutomaticFillTrigger: true },\n ) => {\n const now = new Date();\n const nowDateString = getDateStringFromDay(now);\n const nowTimeString = getTimeStringFromDay(now);\n const finalMetaInfo: DSControlledDateTimePickerT.InternalInputsChangeMetaInfo = {\n ...metaInfo,\n ...getValidationDateStringMetaInfo(nowDateString, getIsOutOfRangeDay, getIsDisabledDay),\n ...getValidationTimeStringMetaInfo(nowTimeString, getIsDisabledTime),\n newDateString: nowDateString,\n };\n const { month, day, year } = deconstructValuesFromDateString(nowDateString);\n appOnMonthChange(month, e, metaInfo);\n appOnDayChange(day, e, metaInfo);\n appOnYearChange(year, e, metaInfo);\n const { hours, minutes, meridiem } = deconstructValuesFromTimeString(nowTimeString);\n appOnHourChange(hours, e, metaInfo);\n appOnMinuteChange(minutes, e, metaInfo);\n appOnMeridiemChange(meridiem, e, metaInfo);\n handleChangeComposedDateTimeString(nowDateString, nowTimeString, finalMetaInfo);\n // trackFocusLastSegment is not enough here,\n // after this key combination the value may change from empty to non-empty\n // when non empty the last segment may become the clear-btn (clear btn only appears when non empty)\n // as such this must be micro-managed here\n if (shouldPreserveClearableSpace && !withAnyPicker) trackFocusClearBtn();\n else trackFocusLastSegment();\n },\n [\n appOnDayChange,\n appOnHourChange,\n appOnMeridiemChange,\n appOnMinuteChange,\n appOnMonthChange,\n appOnYearChange,\n getIsDisabledDay,\n getIsDisabledTime,\n getIsOutOfRangeDay,\n handleChangeComposedDateTimeString,\n shouldPreserveClearableSpace,\n trackFocusClearBtn,\n trackFocusLastSegment,\n withAnyPicker,\n ],\n );\n\n const onGlobalKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n const { key, ctrlKey, metaKey } = e;\n if ((ctrlKey || metaKey) && key === ';') {\n onFillWithCurrentDateKeys(e);\n }\n if ((ctrlKey || metaKey) && (key === 'Delete' || key === 'Backspace')) handleClearAll(e);\n },\n [handleClearAll, onFillWithCurrentDateKeys],\n );\n\n return useMemo(\n () => ({\n onFillWithCurrentDateKeys,\n onGlobalKeyDown,\n }),\n [onFillWithCurrentDateKeys, onGlobalKeyDown],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADKvB,mBAAqC;AAMrC,yBAA4F;AAC5F,yBAAgD;AAChD,2BAAiF;AAW1E,MAAM,uBAAuB,CAAC,EAAE,kBAAkB,gBAAgB,eAAe,MAAM,MAAc;AAC1G,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AACJ,QAAM,EAAE,oCAAoC,eAAe,IAAI;AAC/D,QAAM,EAAE,uBAAuB,mBAAmB,IAAI;AACtD,QAAM,EAAE,eAAe,6BAA6B,IAAI;AAExD,QAAM,gCAA4B;AAAA,IAChC,CACE,GACA,WAA8E,EAAE,wBAAwB,KAAK,MAC1G;AACH,YAAM,MAAM,oBAAI,KAAK;AACrB,YAAM,oBAAgB,yCAAqB,GAAG;AAC9C,YAAM,oBAAgB,yCAAqB,GAAG;AAC9C,YAAM,gBAA0E;AAAA,QAC9E,GAAG;AAAA,QACH,OAAG,oDAAgC,eAAe,oBAAoB,gBAAgB;AAAA,QACtF,OAAG,oDAAgC,eAAe,iBAAiB;AAAA,QACnE,eAAe;AAAA,MACjB;AACA,YAAM,EAAE,OAAO,KAAK,KAAK,QAAI,sDAAgC,aAAa;AAC1E,uBAAiB,OAAO,GAAG,QAAQ;AACnC,qBAAe,KAAK,GAAG,QAAQ;AAC/B,sBAAgB,MAAM,GAAG,QAAQ;AACjC,YAAM,EAAE,OAAO,SAAS,SAAS,QAAI,sDAAg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