@elliemae/ds-form-date-time-picker 3.18.0-next.0 → 3.18.0-next.2
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/useControlledDateTimePicker.js +7 -4
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js +4 -10
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +3 -8
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/cjs/parts/DateInputs/DDInput.js +2 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +5 -19
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/cjs/parts/DateInputs/MMInput.js +2 -2
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +3 -8
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +3 -8
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +6 -27
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +4 -16
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +6 -9
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Day.js +3 -5
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +3 -9
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +4 -9
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +4 -9
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +6 -9
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +5 -22
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +6 -23
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +5 -22
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +3 -12
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +3 -8
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +4 -9
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +6 -9
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Styleds.js.map +1 -1
- package/dist/cjs/parts/TimeInputs/HHInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +5 -19
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/utils/dateHelpers.js.map +1 -1
- package/dist/esm/config/useControlledDateTimePicker.js +8 -5
- package/dist/esm/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/esm/config/useGlobalKeyHandlers.js.map +2 -2
- package/dist/esm/parts/ClearButton/ClearButton.js +4 -10
- package/dist/esm/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/esm/parts/ControlledDateTimePickerContent.js +3 -8
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/esm/parts/DateInputs/DDInput.js +2 -2
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +5 -19
- package/dist/esm/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/esm/parts/DateInputs/MMInput.js +2 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +3 -8
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +3 -8
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +6 -27
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +4 -16
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +6 -9
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/Day.js +3 -5
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js.map +1 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +3 -9
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +4 -9
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +4 -9
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +6 -9
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +5 -22
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +6 -23
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +5 -22
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/Styleds.js.map +1 -1
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +3 -12
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +3 -8
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +4 -9
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +6 -9
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Styleds.js.map +1 -1
- package/dist/esm/parts/TimeInputs/HHInput.js +2 -2
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +5 -19
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/esm/utils/dateHelpers.js.map +1 -1
- package/dist/types/config/useControlledDateTimePicker.d.ts +1 -0
- package/dist/types/config/useGlobalKeyHandlers.d.ts +2 -2
- package/dist/types/parts/DateInputs/DDInput.d.ts +3 -2
- package/dist/types/parts/DateInputs/MMInput.d.ts +4 -3
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +3 -2
- package/dist/types/parts/Pickers/Calendar/Styleds.d.ts +11 -11
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/Styleds.d.ts +4 -4
- package/dist/types/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.d.ts +1 -1
- package/dist/types/parts/Pickers/TimeWheel/Styleds.d.ts +24 -0
- package/dist/types/parts/Styleds.d.ts +17 -10
- package/dist/types/parts/TimeInputs/HHInput.d.ts +3 -2
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +3 -2
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +3 -2
- package/dist/types/sharedTypes.d.ts +1 -1
- package/package.json +11 -11
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/config/useGlobalKeyHandlers.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 '../propTypes.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<
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,aAAa,eAAe;AAMrC,SAAS,iCAAiC,sBAAsB,4BAA4B;AAC5F,SAAS,uCAAuC;AAChD,SAAS,iCAAiC,uCAAuC;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,4BAA4B;AAAA,IAChC,CACE,GACA,WAA8E,EAAE,wBAAwB,KAAK,MAC1G;AACH,YAAM,MAAM,oBAAI,KAAK;AACrB,YAAM,gBAAgB,qBAAqB,GAAG;AAC9C,YAAM,gBAAgB,qBAAqB,GAAG;AAC9C,YAAM,gBAA0E;AAAA,QAC9E,GAAG;AAAA,QACH,GAAG,gCAAgC,eAAe,oBAAoB,gBAAgB;AAAA,QACtF,GAAG,gCAAgC,eAAe,iBAAiB;AAAA,QACnE,eAAe;AAAA,MACjB;AACA,YAAM,EAAE,OAAO,KAAK,KAAK,IAAI,gCAAgC,aAAa;AAC1E,uBAAiB,OAAO,GAAG,QAAQ;AACnC,qBAAe,KAAK,GAAG,QAAQ;AAC/B,sBAAgB,MAAM,GAAG,QAAQ;AACjC,YAAM,EAAE,OAAO,SAAS,SAAS,IAAI,gCAAgC,aAAa;AAClF,sBAAgB,OAAO,GAAG,QAAQ;AAClC,wBAAkB,SAAS,GAAG,QAAQ;AACtC,0BAAoB,UAAU,GAAG,QAAQ;AACzC,yCAAmC,eAAe,eAAe,aAAa;AAK9E,UAAI,gCAAgC,CAAC;AAAe,2BAAmB;AAAA;AAClE,8BAAsB;AAAA,IAC7B;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,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB,CAAC,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* 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 '../propTypes.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"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACKvB,SAAS,aAAa,eAAe;AAMrC,SAAS,iCAAiC,sBAAsB,4BAA4B;AAC5F,SAAS,uCAAuC;AAChD,SAAS,iCAAiC,uCAAuC;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,4BAA4B;AAAA,IAChC,CACE,GACA,WAA8E,EAAE,wBAAwB,KAAK,MAC1G;AACH,YAAM,MAAM,oBAAI,KAAK;AACrB,YAAM,gBAAgB,qBAAqB,GAAG;AAC9C,YAAM,gBAAgB,qBAAqB,GAAG;AAC9C,YAAM,gBAA0E;AAAA,QAC9E,GAAG;AAAA,QACH,GAAG,gCAAgC,eAAe,oBAAoB,gBAAgB;AAAA,QACtF,GAAG,gCAAgC,eAAe,iBAAiB;AAAA,QACnE,eAAe;AAAA,MACjB;AACA,YAAM,EAAE,OAAO,KAAK,KAAK,IAAI,gCAAgC,aAAa;AAC1E,uBAAiB,OAAO,GAAG,QAAQ;AACnC,qBAAe,KAAK,GAAG,QAAQ;AAC/B,sBAAgB,MAAM,GAAG,QAAQ;AACjC,YAAM,EAAE,OAAO,SAAS,SAAS,IAAI,gCAAgC,aAAa;AAClF,sBAAgB,OAAO,GAAG,QAAQ;AAClC,wBAAkB,SAAS,GAAG,QAAQ;AACtC,0BAAoB,UAAU,GAAG,QAAQ;AACzC,yCAAmC,eAAe,eAAe,aAAa;AAK9E,UAAI,gCAAgC,CAAC;AAAe,2BAAmB;AAAA;AAClE,8BAAsB;AAAA,IAC7B;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,MACA;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAkB;AAAA,IACtB,CAAC,MAA2C;AAC1C,YAAM,EAAE,KAAK,SAAS,QAAQ,IAAI;AAClC,WAAK,WAAW,YAAY,QAAQ,KAAK;AACvC,kCAA0B,CAAC;AAAA,MAC7B;AACA,WAAK,WAAW,aAAa,QAAQ,YAAY,QAAQ;AAAc,uBAAe,CAAC;AAAA,IACzF;AAAA,IACA,CAAC,gBAAgB,yBAAyB;AAAA,EAC5C;AAEA,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,IACA,CAAC,2BAA2B,eAAe;AAAA,EAC7C;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { CloseMedium } from "@elliemae/ds-icons";
|
|
5
|
-
import { DSIconColors } from "@elliemae/ds-icon";
|
|
6
5
|
import { BUTTON_SIZES } from "@elliemae/ds-button";
|
|
7
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
8
6
|
import { StyledClearButton } from "../Styleds.js";
|
|
9
7
|
import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
|
|
10
8
|
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
|
|
@@ -14,11 +12,7 @@ const ClearButton = () => {
|
|
|
14
12
|
const styledsAttrs = {
|
|
15
13
|
shouldDisplay: withClearBtn
|
|
16
14
|
};
|
|
17
|
-
const { latestInteractionRegion, currFocusDescriber,
|
|
18
|
-
const ariaAndDataProps = React2.useMemo(
|
|
19
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CLEAR_BUTTON]),
|
|
20
|
-
[props]
|
|
21
|
-
);
|
|
15
|
+
const { latestInteractionRegion, currFocusDescriber, getProps } = useContext(ControlledDateTimePickerContext);
|
|
22
16
|
return /* @__PURE__ */ jsx(
|
|
23
17
|
StyledClearButton,
|
|
24
18
|
{
|
|
@@ -34,9 +28,9 @@ const ClearButton = () => {
|
|
|
34
28
|
onClick: onClearClick,
|
|
35
29
|
onKeyDown: onClearButtonKeyDown,
|
|
36
30
|
type: "button",
|
|
31
|
+
getOwnerProps: getProps,
|
|
37
32
|
...styledsAttrs,
|
|
38
|
-
|
|
39
|
-
children: /* @__PURE__ */ jsx(CloseMedium, { color: DSIconColors.PRIMARY })
|
|
33
|
+
children: /* @__PURE__ */ jsx(CloseMedium, { color: ["brand-primary", "600"] })
|
|
40
34
|
}
|
|
41
35
|
);
|
|
42
36
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/ClearButton/ClearButton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */\nimport React, { useContext } from 'react';\nimport { CloseMedium } from '@elliemae/ds-icons';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { StyledClearButton } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { useClearButton } from './useClearButton.js';\n\nexport const ClearButton = (): JSX.Element => {\n const { onClearClick, onClearButtonKeyDown, clearButtonRef, withClearBtn } = useClearButton();\n const styledsAttrs = {\n shouldDisplay: withClearBtn,\n };\n const { latestInteractionRegion, currFocusDescriber, getProps } = useContext(ControlledDateTimePickerContext);\n\n return (\n <StyledClearButton\n aria-label=\"clear selected date\"\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n data-testid={ControlledDateTimePickerDatatestid.CLEAR_BUTTON}\n innerRef={(DomElem: HTMLButtonElement) => {\n clearButtonRef.current = DomElem;\n if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();\n }}\n onClick={onClearClick}\n onKeyDown={onClearButtonKeyDown}\n type=\"button\"\n getOwnerProps={getProps}\n {...styledsAttrs}\n >\n <CloseMedium color={['brand-primary', '600']} />\n </StyledClearButton>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACgCjB;AA/BN,SAAgB,kBAAkB;AAClC,SAAS,mBAAmB;AAC5B,SAAS,oBAAoB;AAC7B,SAAS,yBAAyB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,sBAAsB;AAExB,MAAM,cAAc,MAAmB;AAC5C,QAAM,EAAE,cAAc,sBAAsB,gBAAgB,aAAa,IAAI,eAAe;AAC5F,QAAM,eAAe;AAAA,IACnB,eAAe;AAAA,EACjB;AACA,QAAM,EAAE,yBAAyB,oBAAoB,SAAS,IAAI,WAAW,+BAA+B;AAE5G,SACE;AAAA,IAAC;AAAA;AAAA,MACC,cAAW;AAAA,MACX,YAAW;AAAA,MACX,MAAM,aAAa;AAAA,MACnB,eAAa,mCAAmC;AAAA,MAChD,UAAU,CAAC,YAA+B;AACxC,uBAAe,UAAU;AACzB,YAAI,4BAA4B,eAAe,uBAAuB;AAAa,mBAAS,QAAQ;AAAA,MACtG;AAAA,MACA,SAAS;AAAA,MACT,WAAW;AAAA,MACX,MAAK;AAAA,MACL,eAAe;AAAA,MACd,GAAG;AAAA,MAEJ,8BAAC,eAAY,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,EAChD;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
6
5
|
import { ControlledDateTimePickerContext } from "../ControlledDateTimePickerCTX.js";
|
|
7
6
|
import { StyledInputsWrapperGrid } from "./Styleds.js";
|
|
8
7
|
import { DateInputs } from "./DateInputs/DateInputs.js";
|
|
@@ -12,8 +11,8 @@ import { ClearButton } from "./ClearButton/ClearButton.js";
|
|
|
12
11
|
import { ControlledDateTimePickerDatatestid } from "../ControlledDateTimePickerDatatestid.js";
|
|
13
12
|
const ControlledDateTimePickerContent = () => {
|
|
14
13
|
const {
|
|
15
|
-
props,
|
|
16
14
|
props: { hasError, disabled },
|
|
15
|
+
getProps,
|
|
17
16
|
hideDate,
|
|
18
17
|
hideTime,
|
|
19
18
|
withAnyPicker,
|
|
@@ -25,10 +24,6 @@ const ControlledDateTimePickerContent = () => {
|
|
|
25
24
|
onGlobalKeyDown,
|
|
26
25
|
trackFocusResetter
|
|
27
26
|
} = useContext(ControlledDateTimePickerContext);
|
|
28
|
-
const ariaAndDataProps = React2.useMemo(
|
|
29
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTAINER]),
|
|
30
|
-
[props]
|
|
31
|
-
);
|
|
32
27
|
const styledsAttrs = {
|
|
33
28
|
justPicker: hideDate && hideTime,
|
|
34
29
|
withAnyPicker,
|
|
@@ -57,8 +52,8 @@ const ControlledDateTimePickerContent = () => {
|
|
|
57
52
|
disabled,
|
|
58
53
|
onBlur: trackFocusResetter,
|
|
59
54
|
"data-testid": ControlledDateTimePickerDatatestid.CONTAINER,
|
|
55
|
+
getOwnerProps: getProps,
|
|
60
56
|
...styledsAttrs,
|
|
61
|
-
...ariaAndDataProps,
|
|
62
57
|
...globalAttrs,
|
|
63
58
|
...xstyledAttrs,
|
|
64
59
|
children: [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/parts/ControlledDateTimePickerContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable complexity */\nimport React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../ControlledDateTimePickerCTX.js';\nimport { StyledInputsWrapperGrid } from './Styleds.js';\nimport { DateInputs } from './DateInputs/DateInputs.js';\nimport { TimeInputs } from './TimeInputs/TimeInputs.js';\nimport { PickersIcons } from './Pickers/PickersIcons.js';\nimport { ClearButton } from './ClearButton/ClearButton.js';\nimport { ControlledDateTimePickerDatatestid } from '../ControlledDateTimePickerDatatestid.js';\n\nexport const ControlledDateTimePickerContent = (): JSX.Element => {\n const {\n props: { hasError, disabled },\n getProps,\n hideDate,\n hideTime,\n withAnyPicker,\n withAnyRightController,\n shouldPreserveClearableSpace,\n isControllerOnly,\n globalAttrs,\n xstyledAttrs,\n onGlobalKeyDown,\n trackFocusResetter,\n } = useContext(ControlledDateTimePickerContext);\n\n const styledsAttrs = {\n justPicker: hideDate && hideTime,\n withAnyPicker,\n hasError,\n isControllerOnly,\n };\n\n const mainCols = [];\n if (!hideDate) mainCols.push('auto');\n if (!hideTime) mainCols.push('auto');\n if (withAnyRightController) mainCols.push('auto');\n\n const rightControlCols = [];\n if (shouldPreserveClearableSpace) rightControlCols.push('28px');\n if (withAnyPicker) rightControlCols.push('auto');\n\n return (\n <>\n {/* The <div> element is catching the component-wise global hotkeys, there is no valid aria role for this */}\n {/* eslint-disable-next-line max-len */}\n {/* https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */}\n {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}\n <StyledInputsWrapperGrid\n cols={mainCols}\n gutter=\"xxs\"\n pr={!withAnyRightController ? '2px' : '0px'}\n onKeyDown={onGlobalKeyDown}\n disabled={disabled}\n onBlur={trackFocusResetter}\n data-testid={ControlledDateTimePickerDatatestid.CONTAINER}\n getOwnerProps={getProps}\n {...styledsAttrs}\n {...globalAttrs}\n {...xstyledAttrs}\n >\n {hideDate ? null : <DateInputs />}\n {hideTime ? null : <TimeInputs />}\n {withAnyRightController ? (\n <Grid cols={rightControlCols}>\n {shouldPreserveClearableSpace ? <ClearButton /> : null}\n {withAnyPicker ? <PickersIcons /> : null}\n </Grid>\n ) : null}\n </StyledInputsWrapperGrid>\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC4CnB,mBAkBuB,KAGjB,YArBN;AA3CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,+BAA+B;AACxC,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAC5B,SAAS,0CAA0C;AAE5C,MAAM,kCAAkC,MAAmB;AAChE,QAAM;AAAA,IACJ,OAAO,EAAE,UAAU,SAAS;AAAA,IAC5B;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,QAAM,eAAe;AAAA,IACnB,YAAY,YAAY;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,EACF;AAEA,QAAM,WAAW,CAAC;AAClB,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI,CAAC;AAAU,aAAS,KAAK,MAAM;AACnC,MAAI;AAAwB,aAAS,KAAK,MAAM;AAEhD,QAAM,mBAAmB,CAAC;AAC1B,MAAI;AAA8B,qBAAiB,KAAK,MAAM;AAC9D,MAAI;AAAe,qBAAiB,KAAK,MAAM;AAE/C,SACE,gCAKE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,MACN,QAAO;AAAA,MACP,IAAI,CAAC,yBAAyB,QAAQ;AAAA,MACtC,WAAW;AAAA,MACX;AAAA,MACA,QAAQ;AAAA,MACR,eAAa,mCAAmC;AAAA,MAChD,eAAe;AAAA,MACd,GAAG;AAAA,MACH,GAAG;AAAA,MACH,GAAG;AAAA,MAEH;AAAA,mBAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,WAAW,OAAO,oBAAC,cAAW;AAAA,QAC9B,yBACC,qBAAC,QAAK,MAAM,kBACT;AAAA,yCAA+B,oBAAC,eAAY,IAAK;AAAA,UACjD,gBAAgB,oBAAC,gBAAa,IAAK;AAAA,WACtC,IACE;AAAA;AAAA;AAAA,EACN,GACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ const DDInput = React2.memo(
|
|
|
22
22
|
placeholder,
|
|
23
23
|
ariaCurrentValueForInputs,
|
|
24
24
|
isFocused,
|
|
25
|
-
|
|
25
|
+
getProps
|
|
26
26
|
}) => {
|
|
27
27
|
const validateOnChange = useCallback(
|
|
28
28
|
(e) => {
|
|
@@ -52,7 +52,7 @@ const DDInput = React2.memo(
|
|
|
52
52
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY,
|
|
53
53
|
disabled,
|
|
54
54
|
"aria-disabled": disabled,
|
|
55
|
-
|
|
55
|
+
getOwnerProps: getProps
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DDInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n isFocused: boolean;\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidDay = (day: string) => {\n if (day === '') return false;\n const numberOnly = regExpNumbers.test(day);\n return day.length > 2 || day === '00' || !numberOnly || Number.parseInt(day, 10) > 31;\n};\n\ninterface DDInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const DDInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n contextRef,\n placeholder,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: DDInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidDay(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`day input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmDjB;AAnDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,0BAA0B;AAInC,MAAM,gBAAgB;AACtB,MAAM,eAAe,CAAC,QAAgB;AACpC,MAAI,QAAQ;AAAI,WAAO;AACvB,QAAM,aAAa,cAAc,KAAK,GAAG;AACzC,SAAO,IAAI,SAAS,KAAK,QAAQ,QAAQ,CAAC,cAAc,OAAO,SAAS,KAAK,EAAE,IAAI;AACrF;AAeO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,aAAa,GAAG,eAAe,KAAK,GAAG;AACzC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,oBAAoB;AAAA,QAChC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
3
|
+
import { useContext } from "react";
|
|
4
4
|
import { Grid } from "@elliemae/ds-grid";
|
|
5
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
6
|
-
import { ControlledDateTimePickerDatatestid } from "../../ControlledDateTimePickerDatatestid.js";
|
|
7
5
|
import { ControlledDateTimePickerContext } from "../../ControlledDateTimePickerCTX.js";
|
|
8
6
|
import { MMInput } from "./MMInput.js";
|
|
9
7
|
import { DDInput } from "./DDInput.js";
|
|
@@ -39,20 +37,8 @@ const DateInputs = () => {
|
|
|
39
37
|
ariaCurrentValueForInputs,
|
|
40
38
|
latestInteractionRegion,
|
|
41
39
|
currFocusDescriber,
|
|
42
|
-
|
|
40
|
+
getProps
|
|
43
41
|
} = useContext(ControlledDateTimePickerContext);
|
|
44
|
-
const ariaAndDataPropsMonth = React2.useMemo(
|
|
45
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH]),
|
|
46
|
-
[props]
|
|
47
|
-
);
|
|
48
|
-
const ariaAndDataPropsDay = React2.useMemo(
|
|
49
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY]),
|
|
50
|
-
[props]
|
|
51
|
-
);
|
|
52
|
-
const ariaAndDataPropsYear = React2.useMemo(
|
|
53
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR]),
|
|
54
|
-
[props]
|
|
55
|
-
);
|
|
56
42
|
return /* @__PURE__ */ jsxs(
|
|
57
43
|
Grid,
|
|
58
44
|
{
|
|
@@ -79,7 +65,7 @@ const DateInputs = () => {
|
|
|
79
65
|
ariaCurrentValueForInputs,
|
|
80
66
|
disabled,
|
|
81
67
|
isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "month-input",
|
|
82
|
-
|
|
68
|
+
getProps
|
|
83
69
|
}
|
|
84
70
|
) }),
|
|
85
71
|
/* @__PURE__ */ jsx(StyledSeparator, { alignItems: "center", children: "/" }),
|
|
@@ -96,7 +82,7 @@ const DateInputs = () => {
|
|
|
96
82
|
ariaCurrentValueForInputs,
|
|
97
83
|
disabled,
|
|
98
84
|
isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "day-input",
|
|
99
|
-
|
|
85
|
+
getProps
|
|
100
86
|
}
|
|
101
87
|
) }),
|
|
102
88
|
/* @__PURE__ */ jsx(StyledSeparator, { alignItems: "center", children: "/" }),
|
|
@@ -113,7 +99,7 @@ const DateInputs = () => {
|
|
|
113
99
|
ariaCurrentValueForInputs,
|
|
114
100
|
disabled,
|
|
115
101
|
isFocused: latestInteractionRegion === "date-inputs" && currFocusDescriber === "year-input",
|
|
116
|
-
|
|
102
|
+
getProps
|
|
117
103
|
}
|
|
118
104
|
) })
|
|
119
105
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/DateInputs.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX.js';\nimport { MMInput } from './MMInput.js';\nimport { DDInput } from './DDInput.js';\nimport { YYYYInput } from './YYYYInput.js';\nimport { StyledFocusWithIn, StyledSeparator } from '../Styleds.js';\nimport { useDateInputs } from './useDateInputs.js';\nimport { fixedValues } from '../config.js';\n\nexport const DateInputs = (): JSX.Element => {\n const {\n month,\n day,\n year,\n autoFocusMonthInput,\n innerRefMonthInput,\n onMonthChange,\n onDayChange,\n onYearChange,\n onMonthBlur,\n onDayBlur,\n onYearBlur,\n onMonthFocus,\n onDayFocus,\n onYearFocus,\n onMonthKeyDown,\n onDayKeyDown,\n onYearKeyDown,\n disabled,\n } = useDateInputs();\n // we do this here so MMInput,DDInput,YYYYInput can be pure component memoized via React.memo\n const {\n monthInputRef,\n dayInputRef,\n yearInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n getProps,\n } = useContext(ControlledDateTimePickerContext);\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.largeInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <MMInput\n onChange={onMonthChange}\n onBlur={onMonthBlur}\n onFocus={onMonthFocus}\n onKeyDown={onMonthKeyDown}\n value={month}\n contextRef={monthInputRef}\n innerRef={innerRefMonthInput}\n autoFocusMonthInput={autoFocusMonthInput}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <DDInput\n onChange={onDayChange}\n onBlur={onDayBlur}\n onFocus={onDayFocus}\n onKeyDown={onDayKeyDown}\n value={day}\n contextRef={dayInputRef}\n placeholder=\"DD\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n <StyledSeparator alignItems=\"center\">/</StyledSeparator>\n <StyledFocusWithIn>\n <YYYYInput\n onChange={onYearChange}\n onBlur={onYearBlur}\n onFocus={onYearFocus}\n onKeyDown={onYearKeyDown}\n value={year}\n contextRef={yearInputRef}\n placeholder=\"YYYY\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'}\n getProps={getProps}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2CnB,SAUI,KAVJ;AA3CJ,SAAgB,kBAAkB;AAClC,SAAS,YAAY;AACrB,SAAS,uCAAuC;AAChD,SAAS,eAAe;AACxB,SAAS,eAAe;AACxB,SAAS,iBAAiB;AAC1B,SAAS,mBAAmB,uBAAuB;AACnD,SAAS,qBAAqB;AAC9B,SAAS,mBAAmB;AAErB,MAAM,aAAa,MAAmB;AAC3C,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,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,cAAc;AAElB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,QACZ,YAAY;AAAA,MACd;AAAA,MAEA;AAAA,4BAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,UAAU;AAAA,YACV;AAAA,YACA,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA,QACA,oBAAC,mBAAgB,YAAW,UAAS,eAAC;AAAA,QACtC,oBAAC,qBACC;AAAA,UAAC;AAAA;AAAA,YACC,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,OAAO;AAAA,YACP,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E;AAAA;AAAA,QACF,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -25,7 +25,7 @@ const MMInput = React2.memo(
|
|
|
25
25
|
autoFocusMonthInput,
|
|
26
26
|
ariaCurrentValueForInputs,
|
|
27
27
|
isFocused,
|
|
28
|
-
|
|
28
|
+
getProps
|
|
29
29
|
}) => {
|
|
30
30
|
const validateOnChange = useCallback(
|
|
31
31
|
(e) => {
|
|
@@ -66,7 +66,7 @@ const MMInput = React2.memo(
|
|
|
66
66
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
|
|
67
67
|
disabled,
|
|
68
68
|
"aria-disabled": disabled,
|
|
69
|
-
|
|
69
|
+
getOwnerProps: getProps
|
|
70
70
|
}
|
|
71
71
|
);
|
|
72
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/MMInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo } from 'react';\nimport { setMultipleRefs } from '@elliemae/ds-utilities';\nimport { Styled2DigitsInput } from '../Styleds.js';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMonth = (month: string) => {\n if (month === '') return false;\n const numberOnly = regExpNumbers.test(month);\n return month.length > 2 || month === '00' || !numberOnly || Number.parseInt(month, 10) > 12;\n};\ninterface MMInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n autoFocusMonthInput: boolean;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n innerRef?:\n | React.MutableRefObject<HTMLInputElement | HTMLButtonElement | null>\n | ((ref: HTMLInputElement | HTMLButtonElement | null) => void);\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const MMInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n innerRef,\n autoFocusMonthInput,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: MMInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMonth(e?.target?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n\n const handleRef = useCallback(\n (DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n },\n [contextRef, isFocused],\n );\n\n const currentRef = useMemo(() => {\n if (innerRef) {\n return setMultipleRefs([handleRef, innerRef]);\n }\n return handleRef;\n }, [handleRef, innerRef]);\n\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusMonthInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={currentRef}\n placeholder={placeholder}\n aria-label={`month input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyEjB;AAzEN,OAAOA,UAAS,aAAa,eAAe;AAC5C,SAAS,uBAAuB;AAChC,SAAS,0BAA0B;AACnC,SAAS,0CAA0C;AAInD,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,CAAC,UAAkB;AACxC,MAAI,UAAU;AAAI,WAAO;AACzB,QAAM,aAAa,cAAc,KAAK,KAAK;AAC3C,SAAO,MAAM,SAAS,KAAK,UAAU,QAAQ,CAAC,cAAc,OAAO,SAAS,OAAO,EAAE,IAAI;AAC3F;AAkBO,MAAM,UAAUA,OAAM;AAAA,EAC3B,CAAC;AAAA,IACC;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,MAAmC;AACjC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,eAAe,GAAG,QAAQ,KAAK,GAAG;AACpC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AAEA,UAAM,YAAY;AAAA,MAChB,CAAC,YAA8B;AAC7B,QAAC,WAAwD,UAAU;AACnE,YAAI;AAAW,mBAAS,QAAQ;AAAA,MAClC;AAAA,MACA,CAAC,YAAY,SAAS;AAAA,IACxB;AAEA,UAAM,aAAa,QAAQ,MAAM;AAC/B,UAAI,UAAU;AACZ,eAAO,gBAAgB,CAAC,WAAW,QAAQ,CAAC;AAAA,MAC9C;AACA,aAAO;AAAA,IACT,GAAG,CAAC,WAAW,QAAQ,CAAC;AAExB,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK;AAAA,QACL;AAAA,QACA,cAAY,sBAAsB;AAAA,QAClC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -22,7 +22,7 @@ const YYYYInput = React2.memo(
|
|
|
22
22
|
contextRef,
|
|
23
23
|
ariaCurrentValueForInputs,
|
|
24
24
|
isFocused,
|
|
25
|
-
|
|
25
|
+
getProps
|
|
26
26
|
}) => {
|
|
27
27
|
const validateOnChange = useCallback(
|
|
28
28
|
(e) => {
|
|
@@ -52,7 +52,7 @@ const YYYYInput = React2.memo(
|
|
|
52
52
|
"data-testid": ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR,
|
|
53
53
|
disabled,
|
|
54
54
|
"aria-disabled": disabled,
|
|
55
|
-
|
|
55
|
+
getOwnerProps: getProps
|
|
56
56
|
}
|
|
57
57
|
);
|
|
58
58
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/DateInputs/YYYYInput.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledMin4DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid.js';\nimport { StyledMin4DigitsInput } from '../Styleds.js';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes.js';\nimport type { ControlledDateTimePickerContextT } from '../../config/useControlledDateTimePicker.js';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidYear = (year: string) => {\n if (year === '') return false;\n const numberOnly = regExpNumbers.test(year);\n return year.length > 4 || !numberOnly || Number.parseInt(year, 10) > 9999;\n};\n\ninterface YYYYInputsPropsT {\n onChange: DSControlledDateTimePickerInternalsT.OnChangeFunc;\n onBlur: DSControlledDateTimePickerInternalsT.OnBlurFunc;\n onFocus: DSControlledDateTimePickerInternalsT.OnFocusFunc;\n onKeyDown: DSControlledDateTimePickerInternalsT.OnKeyDown;\n value: string;\n disabled: boolean;\n contextRef: React.MutableRefObject<HTMLInputElement | null>;\n placeholder: string;\n ariaCurrentValueForInputs: string;\n isFocused: boolean;\n getProps: ControlledDateTimePickerContextT['getProps'];\n}\nexport const YYYYInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n contextRef,\n ariaCurrentValueForInputs,\n isFocused,\n getProps,\n }: YYYYInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidYear(e?.currentTarget?.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <StyledMin4DigitsInput\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n (contextRef as React.MutableRefObject<HTMLInputElement>).current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`year input field, ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR}\n disabled={disabled}\n aria-disabled={disabled}\n getOwnerProps={getProps}\n />\n );\n },\n);\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACmDjB;AAnDN,OAAOA,UAAS,mBAAmB;AACnC,SAAS,0CAA0C;AACnD,SAAS,6BAA6B;AAItC,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,SAAiB;AACtC,MAAI,SAAS;AAAI,WAAO;AACxB,QAAM,aAAa,cAAc,KAAK,IAAI;AAC1C,SAAO,KAAK,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,MAAM,EAAE,IAAI;AACvE;AAeO,MAAM,YAAYA,OAAM;AAAA,EAC7B,CAAC;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,MAAqC;AACnC,UAAM,mBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,GAAG,eAAe,KAAK,GAAG;AAC1C,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,UAAC,WAAwD,UAAU;AACnE,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,mCAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACf,eAAe;AAAA;AAAA,IACjB;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { useContext } from "react";
|
|
5
4
|
import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid.js";
|
|
6
5
|
import { CalendarBody } from "./CalendarBody.js";
|
|
7
6
|
import { CalendarHead } from "./CalendarHead.js";
|
|
@@ -10,18 +9,14 @@ import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePick
|
|
|
10
9
|
import { CalendarContext } from "./CalendarContext.js";
|
|
11
10
|
import { StyledShadowWrapper, StyledCalendarWrapper } from "./Styleds.js";
|
|
12
11
|
const CalendarContent = ({ className = "" }) => {
|
|
13
|
-
const {
|
|
12
|
+
const { getProps } = useContext(ControlledDateTimePickerContext);
|
|
14
13
|
const { daysMatrixByWeekday } = useContext(CalendarContext);
|
|
15
|
-
const ariaAndDataProps = React2.useMemo(
|
|
16
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR]),
|
|
17
|
-
[props]
|
|
18
|
-
);
|
|
19
14
|
return /* @__PURE__ */ jsx(
|
|
20
15
|
StyledShadowWrapper,
|
|
21
16
|
{
|
|
22
17
|
className,
|
|
23
18
|
"data-testid": ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR,
|
|
24
|
-
|
|
19
|
+
getOwnerProps: getProps,
|
|
25
20
|
children: /* @__PURE__ */ jsxs(StyledCalendarWrapper, { children: [
|
|
26
21
|
/* @__PURE__ */ jsx(CalendarHead, {}),
|
|
27
22
|
/* @__PURE__ */ jsx(CalendarBody, { weekRowsNum: daysMatrixByWeekday.length }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarContent.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-len */\nimport React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { CalendarBody } from './CalendarBody.js';\nimport { CalendarHead } from './CalendarHead.js';\nimport { CalendarFooter } from './CalendarFooter.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarContext } from './CalendarContext.js';\nimport { StyledShadowWrapper, StyledCalendarWrapper } from './Styleds.js';\n\n// ({ className = '' }: { className?: string })\n// <StyledShadowWrapper className={className}>\n// is required for styled-components, without this we can't styled(CalendarContent)...\n// https://stackoverflow.com/questions/52542817/styled-components-not-applying-style-to-custom-functional-react-component\nexport const CalendarContent = ({ className = '' }: { className?: string }): JSX.Element => {\n const { getProps } = useContext(ControlledDateTimePickerContext);\n const { daysMatrixByWeekday } = useContext(CalendarContext);\n\n return (\n <StyledShadowWrapper\n className={className}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.CALENDAR}\n getOwnerProps={getProps}\n >\n <StyledCalendarWrapper>\n <CalendarHead />\n <CalendarBody weekRowsNum={daysMatrixByWeekday.length} />\n <CalendarFooter />\n </StyledCalendarWrapper>\n </StyledShadowWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACwBjB,SACE,KADF;AAvBN,SAAgB,kBAAkB;AAClC,SAAS,0CAA0C;AACnD,SAAS,oBAAoB;AAC7B,SAAS,oBAAoB;AAC7B,SAAS,sBAAsB;AAC/B,SAAS,uCAAuC;AAChD,SAAS,uBAAuB;AAChC,SAAS,qBAAqB,6BAA6B;AAMpD,MAAM,kBAAkB,CAAC,EAAE,YAAY,GAAG,MAA2C;AAC1F,QAAM,EAAE,SAAS,IAAI,WAAW,+BAA+B;AAC/D,QAAM,EAAE,oBAAoB,IAAI,WAAW,eAAe;AAE1D,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa,mCAAmC,qBAAqB;AAAA,MACrE,eAAe;AAAA,MAEf,+BAAC,yBACC;AAAA,4BAAC,gBAAa;AAAA,QACd,oBAAC,gBAAa,aAAa,oBAAoB,QAAQ;AAAA,QACvD,oBAAC,kBAAe;AAAA,SAClB;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,27 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
3
|
+
import { useContext } from "react";
|
|
5
4
|
import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid.js";
|
|
6
5
|
import { ControlledDateTimePickerContext } from "../../../ControlledDateTimePickerCTX.js";
|
|
7
6
|
import { CalendarFooterMessage } from "./Styleds.js";
|
|
8
7
|
const CalendarFooter = () => {
|
|
9
8
|
const {
|
|
10
|
-
props,
|
|
11
9
|
props: { pickerFooterMsg, hasError },
|
|
10
|
+
getProps,
|
|
12
11
|
isWithTimeWheelToo
|
|
13
12
|
} = useContext(ControlledDateTimePickerContext);
|
|
14
|
-
const ariaAndDataProps = React2.useMemo(
|
|
15
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR]),
|
|
16
|
-
[props]
|
|
17
|
-
);
|
|
18
13
|
if (pickerFooterMsg !== void 0 && !isWithTimeWheelToo && hasError)
|
|
19
14
|
return /* @__PURE__ */ jsx(
|
|
20
15
|
CalendarFooterMessage,
|
|
21
16
|
{
|
|
22
17
|
role: "alert",
|
|
23
18
|
"data-testid": ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR,
|
|
24
|
-
|
|
19
|
+
getOwnerProps: getProps,
|
|
25
20
|
children: pickerFooterMsg
|
|
26
21
|
}
|
|
27
22
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/parts/Pickers/Calendar/CalendarFooter.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid.js';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX.js';\nimport { CalendarFooterMessage } from './Styleds.js';\n\nexport const CalendarFooter: React.ComponentType = () => {\n const {\n props: { pickerFooterMsg, hasError },\n getProps,\n isWithTimeWheelToo,\n } = useContext(ControlledDateTimePickerContext);\n if (pickerFooterMsg !== undefined && !isWithTimeWheelToo && hasError)\n return (\n <CalendarFooterMessage\n role=\"alert\"\n data-testid={ControlledDateTimePickerDatatestid.FOOTERS.CALENDAR}\n getOwnerProps={getProps}\n >\n {pickerFooterMsg}\n </CalendarFooterMessage>\n );\n return null;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACajB;AAbN,SAAgB,kBAAkB;AAClC,SAAS,0CAA0C;AACnD,SAAS,uCAAuC;AAChD,SAAS,6BAA6B;AAE/B,MAAM,iBAAsC,MAAM;AACvD,QAAM;AAAA,IACJ,OAAO,EAAE,iBAAiB,SAAS;AAAA,IACnC;AAAA,IACA;AAAA,EACF,IAAI,WAAW,+BAA+B;AAC9C,MAAI,oBAAoB,UAAa,CAAC,sBAAsB;AAC1D,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAa,mCAAmC,QAAQ;AAAA,QACxD,eAAe;AAAA,QAEd;AAAA;AAAA,IACH;AAEJ,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useCallback, useContext, useMemo } from "react";
|
|
4
|
-
import { getPropsPerDatatestid } from "@elliemae/ds-props-helpers";
|
|
5
4
|
import { BUTTON_SIZES } from "@elliemae/ds-button";
|
|
6
5
|
import { ChevronDoubleLeft, ChevronLeft, ChevronDoubleRight, ChevronRight } from "@elliemae/ds-icons";
|
|
7
6
|
import { ControlledDateTimePickerDatatestid } from "../../../ControlledDateTimePickerDatatestid.js";
|
|
@@ -39,28 +38,8 @@ const CalendarHead = () => {
|
|
|
39
38
|
nextYearBtnRef,
|
|
40
39
|
latestInteractionRegion,
|
|
41
40
|
currFocusDescriber,
|
|
42
|
-
|
|
41
|
+
getProps
|
|
43
42
|
} = useContext(ControlledDateTimePickerContext);
|
|
44
|
-
const ariaAndDataPropsPrevYear = useMemo(
|
|
45
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR]),
|
|
46
|
-
[props]
|
|
47
|
-
);
|
|
48
|
-
const ariaAndDataPropsPrevMonth = useMemo(
|
|
49
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH]),
|
|
50
|
-
[props]
|
|
51
|
-
);
|
|
52
|
-
const ariaAndDataPropsHeaderLabel = useMemo(
|
|
53
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL]),
|
|
54
|
-
[props]
|
|
55
|
-
);
|
|
56
|
-
const ariaAndDataPropsNextMonth = useMemo(
|
|
57
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH]),
|
|
58
|
-
[props]
|
|
59
|
-
);
|
|
60
|
-
const ariaAndDataPropsNextYear = useMemo(
|
|
61
|
-
() => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR]),
|
|
62
|
-
[props]
|
|
63
|
-
);
|
|
64
43
|
const handlePrevYearRef = useCallback(
|
|
65
44
|
(ButtonDomNode) => {
|
|
66
45
|
prevYearBtnRef.current = ButtonDomNode;
|
|
@@ -107,7 +86,7 @@ const CalendarHead = () => {
|
|
|
107
86
|
tabIndex: isControllerOnly ? -1 : 0,
|
|
108
87
|
"data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_YEAR,
|
|
109
88
|
type: "button",
|
|
110
|
-
|
|
89
|
+
getOwnerProps: getProps,
|
|
111
90
|
children: /* @__PURE__ */ jsx(ChevronDoubleLeft, { height: 14, width: 14, fill: "#25292f" })
|
|
112
91
|
}
|
|
113
92
|
),
|
|
@@ -124,7 +103,7 @@ const CalendarHead = () => {
|
|
|
124
103
|
onFocus: onPrevMonthFocus,
|
|
125
104
|
"data-testid": ControlledDateTimePickerDatatestid.CALENDAR.PREV_MONTH,
|
|
126
105
|
type: "button",
|
|
127
|
-
|
|
106
|
+
getOwnerProps: getProps,
|
|
128
107
|
children: /* @__PURE__ */ jsx(ChevronLeft, { height: 14, width: 14, fill: "#25292f" })
|
|
129
108
|
}
|
|
130
109
|
),
|
|
@@ -132,7 +111,7 @@ const CalendarHead = () => {
|
|
|
132
111
|
StyledHeaderLabel,
|
|
133
112
|
{
|
|
134
113
|
"data-testid": ControlledDateTimePickerDatatestid.CALENDAR.HEADER_LABEL,
|
|
135
|
-
|
|
114
|
+
getOwnerProps: getProps,
|
|
136
115
|
children: currentFormatedDate
|
|
137
116
|
}
|
|
138
117
|
),
|
|
@@ -148,7 +127,7 @@ const CalendarHead = () => {
|
|
|
148
127
|
onFocus: onNextMonthFocus,
|
|
149
128
|
"data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_MONTH,
|
|
150
129
|
type: "button",
|
|
151
|
-
|
|
130
|
+
getOwnerProps: getProps,
|
|
152
131
|
children: /* @__PURE__ */ jsx(ChevronRight, { height: 14, width: 14, fill: "#25292f" })
|
|
153
132
|
}
|
|
154
133
|
),
|
|
@@ -164,7 +143,7 @@ const CalendarHead = () => {
|
|
|
164
143
|
onFocus: onNextYearFocus,
|
|
165
144
|
"data-testid": ControlledDateTimePickerDatatestid.CALENDAR.NEXT_YEAR,
|
|
166
145
|
type: "button",
|
|
167
|
-
|
|
146
|
+
getOwnerProps: getProps,
|
|
168
147
|
children: /* @__PURE__ */ jsx(ChevronDoubleRight, { height: 14, width: 14, fill: "#25292f" })
|
|
169
148
|
}
|
|
170
149
|
)
|