@elliemae/ds-form-date-time-picker 3.16.0-next.2 → 3.16.0-next.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ControlledDateTimePicker.js +2 -2
- package/dist/cjs/ControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useChangeHandlers.js.map +2 -2
- package/dist/cjs/config/useControlledDateTimePicker.js +3 -3
- package/dist/cjs/config/useControlledDateTimePicker.js.map +2 -2
- package/dist/cjs/config/useGetFlags.js +6 -6
- package/dist/cjs/config/useGetFlags.js.map +2 -2
- package/dist/cjs/config/useGetPropsWithDefault.js +2 -2
- package/dist/cjs/config/useGetPropsWithDefault.js.map +2 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js +8 -2
- package/dist/cjs/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/cjs/parts/ControlledDateTimePickerContent.js +8 -1
- package/dist/cjs/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/cjs/parts/DateInputs/DDInput.js +4 -2
- package/dist/cjs/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/DateInputs.js +23 -5
- package/dist/cjs/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/cjs/parts/DateInputs/MMInput.js +4 -2
- package/dist/cjs/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/cjs/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/cjs/parts/DateInputs/useDateInputs.js +1 -1
- package/dist/cjs/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/Calendar.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js +9 -1
- package/dist/cjs/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js +16 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js +35 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js +16 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js +8 -2
- package/dist/cjs/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/Calendar/Day.js +4 -0
- package/dist/cjs/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +8 -2
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +8 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +10 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +9 -1
- package/dist/cjs/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js +23 -2
- package/dist/cjs/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js +24 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js +23 -2
- package/dist/cjs/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js +19 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js +16 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +16 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -2
- package/dist/cjs/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/cjs/parts/TimeInputs/HHInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/cjs/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/cjs/parts/TimeInputs/TimeInputs.js +23 -5
- package/dist/cjs/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/cjs/propTypes.js +28 -26
- package/dist/cjs/propTypes.js.map +2 -2
- package/dist/cjs/sharedTypes.js.map +1 -1
- package/dist/cjs/tests/custom-props/customProps.js +233 -0
- package/dist/cjs/tests/custom-props/customProps.js.map +7 -0
- package/dist/esm/ControlledDateTimePicker.js +1 -1
- package/dist/esm/ControlledDateTimePicker.js.map +1 -1
- package/dist/esm/config/useChangeHandlers.js.map +2 -2
- package/dist/esm/config/useControlledDateTimePicker.js +1 -1
- package/dist/esm/config/useControlledDateTimePicker.js.map +1 -1
- package/dist/esm/config/useGetFlags.js +6 -6
- package/dist/esm/config/useGetFlags.js.map +2 -2
- package/dist/esm/config/useGetPropsWithDefault.js +1 -1
- package/dist/esm/config/useGetPropsWithDefault.js.map +1 -1
- package/dist/esm/parts/ClearButton/ClearButton.js +8 -2
- package/dist/esm/parts/ClearButton/ClearButton.js.map +3 -3
- package/dist/esm/parts/ControlledDateTimePickerContent.js +8 -1
- package/dist/esm/parts/ControlledDateTimePickerContent.js.map +3 -3
- package/dist/esm/parts/DateInputs/DDInput.js +4 -2
- package/dist/esm/parts/DateInputs/DDInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/DateInputs.js +23 -5
- package/dist/esm/parts/DateInputs/DateInputs.js.map +3 -3
- package/dist/esm/parts/DateInputs/MMInput.js +4 -2
- package/dist/esm/parts/DateInputs/MMInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js +4 -2
- package/dist/esm/parts/DateInputs/YYYYInput.js.map +2 -2
- package/dist/esm/parts/DateInputs/useDateInputs.js +1 -1
- package/dist/esm/parts/DateInputs/useDateInputs.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/Calendar.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js +9 -1
- package/dist/esm/parts/Pickers/Calendar/CalendarContent.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js +16 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js +35 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarHead.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js +16 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/CalendarMonthDays.js.map +2 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js +8 -2
- package/dist/esm/parts/Pickers/Calendar/CalendarWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/Calendar/Day.js +4 -0
- package/dist/esm/parts/Pickers/Calendar/Day.js.map +2 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js +8 -2
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelContent.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js +8 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +10 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js +9 -1
- package/dist/esm/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js +23 -2
- package/dist/esm/parts/Pickers/TimeWheel/HoursList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js +24 -2
- package/dist/esm/parts/Pickers/TimeWheel/MeridiemList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js +23 -2
- package/dist/esm/parts/Pickers/TimeWheel/MinutesList.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js +19 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelContent.js.map +2 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js +16 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelFooter.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +16 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js.map +3 -3
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js +8 -2
- package/dist/esm/parts/Pickers/TimeWheel/TimeWheelWrapper.js.map +3 -3
- package/dist/esm/parts/TimeInputs/HHInput.js +4 -2
- package/dist/esm/parts/TimeInputs/HHInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MeridiemInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js +4 -2
- package/dist/esm/parts/TimeInputs/MinutesInput.js.map +2 -2
- package/dist/esm/parts/TimeInputs/TimeInputs.js +23 -5
- package/dist/esm/parts/TimeInputs/TimeInputs.js.map +3 -3
- package/dist/esm/propTypes.js +9 -2
- package/dist/esm/propTypes.js.map +2 -2
- package/dist/esm/tests/custom-props/customProps.js +207 -0
- package/dist/esm/tests/custom-props/customProps.js.map +7 -0
- package/dist/types/ControlledDateTimePicker.d.ts +1 -1
- package/dist/types/config/useGetFlags.d.ts +2 -2
- package/dist/types/parts/DateInputs/DDInput.d.ts +2 -1
- package/dist/types/parts/DateInputs/MMInput.d.ts +3 -2
- package/dist/types/parts/DateInputs/YYYYInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/HHInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MeridiemInput.d.ts +2 -1
- package/dist/types/parts/TimeInputs/MinutesInput.d.ts +2 -1
- package/dist/types/propTypes.d.ts +11 -3
- package/dist/types/sharedTypes.d.ts +1 -1
- package/dist/types/tests/custom-props/customProps.d.ts +397 -0
- package/dist/types/tests/custom-props/date-time-picker.date-custom-props.test.d.ts +1 -0
- package/dist/types/tests/custom-props/date-time-picker.date-time-custom-props.test.d.ts +1 -0
- package/dist/types/tests/custom-props/date-time-picker.time-custom-props.test.d.ts +1 -0
- package/package.json +10 -9
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/MinutesList.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext, useCallback } from 'react';\nimport { ChevronSmallUp, ChevronSmallDown } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { convertToPositiveNumberIfPossible } from '../../../utils/numberHelpers';\nimport { StyledWheelList, StyledWheelListItem, StyledTimeBtn, StyledWheelChangeTimeBtn } from './Styleds';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const MinutesList = (): JSX.Element => {\n const {\n currHourNum,\n currMinuteNum,\n currMeridiem,\n visibleMinutes,\n handlePrevMinute,\n handleNextMinute,\n handleTimeWheelBtnChangeMinutes,\n handleCurrMinutesOnKeyDown,\n } = useContext(TimeWheelContext);\n const {\n prevMinutesBtnRef,\n currMinutesBtnRef,\n nextMinutesBtnRef,\n getIsDisabledTime,\n minutes,\n currFocusDescriber,\n latestInteractionRegion,\n } = useContext(ControlledDateTimePickerContext);\n const handleCurrMeridiemRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n setTimeout(() => {\n currMinutesBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-minute')\n ButtonDomNode?.focus?.();\n });\n },\n [currFocusDescriber, latestInteractionRegion, currMinutesBtnRef],\n );\n return (\n <StyledWheelList>\n <StyledWheelListItem>\n <StyledWheelChangeTimeBtn\n aria-label=\"subtract one minute\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handlePrevMinute}\n innerRef={prevMinutesBtnRef}\n tabIndex={-1}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MINUTE}\n type=\"button\"\n >\n <ChevronSmallUp color={['brand-primary', '700']} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n {visibleMinutes.map((minutesString) => {\n const key = `timewheel-minutes-${minutesString || ''}`;\n if (!minutesString) return <StyledWheelListItem key={key} />;\n const currMinutesTimeString = `${currHourNum}:${minutesString} ${currMeridiem}`;\n const isEmptyCurrValueCurrentListItem =\n !minutes && convertToPositiveNumberIfPossible(minutesString) === currMinuteNum;\n const isCurrentListItem = isEmptyCurrValueCurrentListItem || minutes === minutesString;\n const isDisabled = getIsDisabledTime(currMinutesTimeString);\n\n const tabIndex = isCurrentListItem ? 0 : -1;\n const btnProps = {\n onKeyDown: isCurrentListItem ? handleCurrMinutesOnKeyDown : undefined,\n innerRef: isCurrentListItem ? handleCurrMeridiemRef : undefined,\n };\n const styledProps = { isCurrentListItem, isDisabled };\n return (\n <StyledWheelListItem\n key={key}\n isCurrentListItem={isCurrentListItem}\n selected={convertToPositiveNumberIfPossible(minutesString) === currMinuteNum}\n >\n <StyledTimeBtn\n {...styledProps}\n data-testid={\n ControlledDateTimePickerDatatestid.TIMEWHEEL[isCurrentListItem ? 'CURRENT_MINUTE' : 'MINUTE']\n }\n selected={minutes.length === 2 && convertToPositiveNumberIfPossible(minutesString) === currMinuteNum}\n aria-label={`${minutesString} minutes`}\n aria-disabled={isDisabled}\n buttonType=\"raw\"\n size=\"m\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => handleTimeWheelBtnChangeMinutes(minutesString, e)}\n tabIndex={tabIndex}\n role=\"spinbutton\"\n aria-valuemax={59}\n aria-valuemin={0}\n aria-valuenow={currMinuteNum}\n aria-valuetext={`${minutesString} minutes`}\n type=\"button\"\n {...btnProps}\n >\n {minutesString}\n </StyledTimeBtn>\n </StyledWheelListItem>\n );\n })}\n <StyledWheelListItem>\n <StyledWheelChangeTimeBtn\n aria-label=\"add one minute\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleNextMinute}\n innerRef={nextMinutesBtnRef}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MINUTE}\n tabIndex={-1}\n type=\"button\"\n >\n <ChevronSmallDown color={['brand-primary', '700']} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n </StyledWheelList>\n );\n};\n\nexport default MinutesList;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/* eslint-disable complexity */\nimport React, { useContext, useCallback } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ChevronSmallUp, ChevronSmallDown } from '@elliemae/ds-icons';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { convertToPositiveNumberIfPossible } from '../../../utils/numberHelpers';\nimport { StyledWheelList, StyledWheelListItem, StyledTimeBtn, StyledWheelChangeTimeBtn } from './Styleds';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const MinutesList = (): JSX.Element => {\n const {\n currHourNum,\n currMinuteNum,\n currMeridiem,\n visibleMinutes,\n handlePrevMinute,\n handleNextMinute,\n handleTimeWheelBtnChangeMinutes,\n handleCurrMinutesOnKeyDown,\n } = useContext(TimeWheelContext);\n const {\n prevMinutesBtnRef,\n currMinutesBtnRef,\n nextMinutesBtnRef,\n getIsDisabledTime,\n minutes,\n currFocusDescriber,\n latestInteractionRegion,\n props,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataPropsPrevMinute = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MINUTE]),\n [props],\n );\n const ariaAndDataPropsNextMinute = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MINUTE]),\n [props],\n );\n const ariaAndDataPropsCurrMinute = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIMEWHEEL.CURRENT_MINUTE]),\n [props],\n );\n const ariaAndDataPropsMinute = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIMEWHEEL.MINUTE]),\n [props],\n );\n\n const handleCurrMeridiemRef = useCallback(\n (ButtonDomNode: HTMLButtonElement) => {\n setTimeout(() => {\n currMinutesBtnRef.current = ButtonDomNode;\n if (latestInteractionRegion === 'timewheel' && currFocusDescriber === 'timewheel-curr-minute')\n ButtonDomNode?.focus?.();\n });\n },\n [currFocusDescriber, latestInteractionRegion, currMinutesBtnRef],\n );\n return (\n <StyledWheelList>\n <StyledWheelListItem>\n <StyledWheelChangeTimeBtn\n aria-label=\"subtract one minute\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handlePrevMinute}\n innerRef={prevMinutesBtnRef}\n tabIndex={-1}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.PREV_MINUTE}\n type=\"button\"\n {...ariaAndDataPropsPrevMinute}\n >\n <ChevronSmallUp color={['brand-primary', '700']} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n {visibleMinutes.map((minutesString) => {\n const key = `timewheel-minutes-${minutesString || ''}`;\n if (!minutesString) return <StyledWheelListItem key={key} />;\n const currMinutesTimeString = `${currHourNum}:${minutesString} ${currMeridiem}`;\n const isEmptyCurrValueCurrentListItem =\n !minutes && convertToPositiveNumberIfPossible(minutesString) === currMinuteNum;\n const isCurrentListItem = isEmptyCurrValueCurrentListItem || minutes === minutesString;\n const isDisabled = getIsDisabledTime(currMinutesTimeString);\n\n const tabIndex = isCurrentListItem ? 0 : -1;\n const btnProps = {\n onKeyDown: isCurrentListItem ? handleCurrMinutesOnKeyDown : undefined,\n innerRef: isCurrentListItem ? handleCurrMeridiemRef : undefined,\n };\n const styledProps = { isCurrentListItem, isDisabled };\n return (\n <StyledWheelListItem\n key={key}\n isCurrentListItem={isCurrentListItem}\n selected={convertToPositiveNumberIfPossible(minutesString) === currMinuteNum}\n >\n <StyledTimeBtn\n {...styledProps}\n data-testid={\n ControlledDateTimePickerDatatestid.TIMEWHEEL[isCurrentListItem ? 'CURRENT_MINUTE' : 'MINUTE']\n }\n selected={minutes.length === 2 && convertToPositiveNumberIfPossible(minutesString) === currMinuteNum}\n aria-label={`${minutesString} minutes`}\n aria-disabled={isDisabled}\n buttonType=\"raw\"\n size=\"m\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => handleTimeWheelBtnChangeMinutes(minutesString, e)}\n tabIndex={tabIndex}\n role=\"spinbutton\"\n aria-valuemax={59}\n aria-valuemin={0}\n aria-valuenow={currMinuteNum}\n aria-valuetext={`${minutesString} minutes`}\n type=\"button\"\n {...btnProps}\n {...(isCurrentListItem ? ariaAndDataPropsCurrMinute : ariaAndDataPropsMinute)}\n >\n {minutesString}\n </StyledTimeBtn>\n </StyledWheelListItem>\n );\n })}\n <StyledWheelListItem>\n <StyledWheelChangeTimeBtn\n aria-label=\"add one minute\"\n buttonType=\"raw\"\n size=\"m\"\n onClick={handleNextMinute}\n innerRef={nextMinutesBtnRef}\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.NEXT_MINUTE}\n tabIndex={-1}\n type=\"button\"\n {...ariaAndDataPropsNextMinute}\n >\n <ChevronSmallDown color={['brand-primary', '700']} />\n </StyledWheelChangeTimeBtn>\n </StyledWheelListItem>\n </StyledWheelList>\n );\n};\n\nexport default MinutesList;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD2DnB;AA1DJ,mBAA+C;AAC/C,8BAAsC;AACtC,sBAAiD;AACjD,gDAAmD;AACnD,yCAAgD;AAChD,2BAAkD;AAClD,qBAA8F;AAC9F,8BAAiC;AAE1B,MAAM,cAAc,MAAmB;AAC5C,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,wCAAgB;AAC/B,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,6BAA6B,aAAAA,QAAM;AAAA,IACvC,UAAM,+CAAsB,MAAM,6EAAmC,UAAU,YAAY;AAAA,IAC3F,CAAC,KAAK;AAAA,EACR;AACA,QAAM,6BAA6B,aAAAA,QAAM;AAAA,IACvC,UAAM,+CAAsB,MAAM,6EAAmC,UAAU,YAAY;AAAA,IAC3F,CAAC,KAAK;AAAA,EACR;AACA,QAAM,6BAA6B,aAAAA,QAAM;AAAA,IACvC,UAAM,+CAAsB,MAAM,6EAAmC,UAAU,eAAe;AAAA,IAC9F,CAAC,KAAK;AAAA,EACR;AACA,QAAM,yBAAyB,aAAAA,QAAM;AAAA,IACnC,UAAM,+CAAsB,MAAM,6EAAmC,UAAU,OAAO;AAAA,IACtF,CAAC,KAAK;AAAA,EACR;AAEA,QAAM,4BAAwB;AAAA,IAC5B,CAAC,kBAAqC;AACpC,iBAAW,MAAM;AACf,0BAAkB,UAAU;AAC5B,YAAI,4BAA4B,eAAe,uBAAuB;AACpE,yBAAe,QAAQ;AAAA,MAC3B,CAAC;AAAA,IACH;AAAA,IACA,CAAC,oBAAoB,yBAAyB,iBAAiB;AAAA,EACjE;AACA,SACE,6CAAC,kCACC;AAAA,gDAAC,sCACC;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,UAAU;AAAA,QACV,eAAa,6EAAmC,UAAU;AAAA,QAC1D,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,sDAAC,kCAAe,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IACnD,GACF;AAAA,IACC,eAAe,IAAI,CAAC,kBAAkB;AACrC,YAAM,MAAM,qBAAqB,iBAAiB;AAClD,UAAI,CAAC;AAAe,eAAO,4CAAC,wCAAyB,GAAK;AAC1D,YAAM,wBAAwB,GAAG,eAAe,iBAAiB;AACjE,YAAM,kCACJ,CAAC,eAAW,wDAAkC,aAAa,MAAM;AACnE,YAAM,oBAAoB,mCAAmC,YAAY;AACzE,YAAM,aAAa,kBAAkB,qBAAqB;AAE1D,YAAM,WAAW,oBAAoB,IAAI;AACzC,YAAM,WAAW;AAAA,QACf,WAAW,oBAAoB,6BAA6B;AAAA,QAC5D,UAAU,oBAAoB,wBAAwB;AAAA,MACxD;AACA,YAAM,cAAc,EAAE,mBAAmB,WAAW;AACpD,aACE;AAAA,QAAC;AAAA;AAAA,UAEC;AAAA,UACA,cAAU,wDAAkC,aAAa,MAAM;AAAA,UAE/D;AAAA,YAAC;AAAA;AAAA,cACE,GAAG;AAAA,cACJ,eACE,6EAAmC,UAAU,oBAAoB,mBAAmB;AAAA,cAEtF,UAAU,QAAQ,WAAW,SAAK,wDAAkC,aAAa,MAAM;AAAA,cACvF,cAAY,GAAG;AAAA,cACf,iBAAe;AAAA,cACf,YAAW;AAAA,cACX,MAAK;AAAA,cACL,SAAS,CAAC,MAA2C,gCAAgC,eAAe,CAAC;AAAA,cACrG;AAAA,cACA,MAAK;AAAA,cACL,iBAAe;AAAA,cACf,iBAAe;AAAA,cACf,iBAAe;AAAA,cACf,kBAAgB,GAAG;AAAA,cACnB,MAAK;AAAA,cACJ,GAAG;AAAA,cACH,GAAI,oBAAoB,6BAA6B;AAAA,cAErD;AAAA;AAAA,UACH;AAAA;AAAA,QA1BK;AAAA,MA2BP;AAAA,IAEJ,CAAC;AAAA,IACD,4CAAC,sCACC;AAAA,MAAC;AAAA;AAAA,QACC,cAAW;AAAA,QACX,YAAW;AAAA,QACX,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,eAAa,6EAAmC,UAAU;AAAA,QAC1D,UAAU;AAAA,QACV,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,sDAAC,oCAAiB,OAAO,CAAC,iBAAiB,KAAK,GAAG;AAAA;AAAA,IACrD,GACF;AAAA,KACF;AAEJ;AAEA,IAAO,sBAAQ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -30,6 +30,7 @@ module.exports = __toCommonJS(TimeWheelContent_exports);
|
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
32
|
var import_react = __toESM(require("react"));
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
34
|
var import_ControlledDateTimePickerDatatestid = require("../../../ControlledDateTimePickerDatatestid");
|
|
34
35
|
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX");
|
|
35
36
|
var import_Styleds = require("./Styleds");
|
|
@@ -38,14 +39,30 @@ var import_MinutesList = require("./MinutesList");
|
|
|
38
39
|
var import_MeridiemList = require("./MeridiemList");
|
|
39
40
|
var import_TimeWheelFooter = require("./TimeWheelFooter");
|
|
40
41
|
const TimeWheelContent = import_react.default.memo(() => {
|
|
41
|
-
const { isControllerOnly, hours, minutes, meridiem } = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
42
|
+
const { isControllerOnly, hours, minutes, meridiem, props } = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
43
|
+
const ariaAndDataPropsHeaderLabel = import_react.default.useMemo(
|
|
44
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIMEWHEEL.HEADER_LABEL]),
|
|
45
|
+
[props]
|
|
46
|
+
);
|
|
47
|
+
const ariaAndDataPropsTimewheel = import_react.default.useMemo(
|
|
48
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL]),
|
|
49
|
+
[props]
|
|
50
|
+
);
|
|
42
51
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
43
52
|
import_Styleds.StyledTimePickerContainer,
|
|
44
53
|
{
|
|
45
54
|
isControllerOnly,
|
|
46
55
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL,
|
|
56
|
+
...ariaAndDataPropsTimewheel,
|
|
47
57
|
children: [
|
|
48
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
58
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
59
|
+
import_Styleds.StyledTimePickerHead,
|
|
60
|
+
{
|
|
61
|
+
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIMEWHEEL.HEADER_LABEL,
|
|
62
|
+
...ariaAndDataPropsHeaderLabel,
|
|
63
|
+
children: `${hours || "__"}:${minutes || "__"} ${meridiem || "__"}`
|
|
64
|
+
}
|
|
65
|
+
),
|
|
49
66
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_Styleds.StyledTimePickerWheelsLegend, { children: [
|
|
50
67
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "H" }),
|
|
51
68
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: "M" }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/TimeWheelContent.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport {\n StyledTimePickerContainer,\n StyledTimePickerHead,\n StyledTimePickerWheelsLegend,\n StyledTimePickerWheelWrapper,\n} from './Styleds';\nimport { HoursList } from './HoursList';\nimport { MinutesList } from './MinutesList';\nimport { MeridiemList } from './MeridiemList';\nimport { TimeWheelFooter } from './TimeWheelFooter';\n\nexport const TimeWheelContent = React.memo(() => {\n const { isControllerOnly, hours, minutes, meridiem } = useContext(ControlledDateTimePickerContext);\n return (\n <StyledTimePickerContainer\n isControllerOnly={isControllerOnly}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL}\n >\n <StyledTimePickerHead
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport {\n StyledTimePickerContainer,\n StyledTimePickerHead,\n StyledTimePickerWheelsLegend,\n StyledTimePickerWheelWrapper,\n} from './Styleds';\nimport { HoursList } from './HoursList';\nimport { MinutesList } from './MinutesList';\nimport { MeridiemList } from './MeridiemList';\nimport { TimeWheelFooter } from './TimeWheelFooter';\n\nexport const TimeWheelContent = React.memo(() => {\n const { isControllerOnly, hours, minutes, meridiem, props } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataPropsHeaderLabel = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIMEWHEEL.HEADER_LABEL]),\n [props],\n );\n const ariaAndDataPropsTimewheel = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL]),\n [props],\n );\n return (\n <StyledTimePickerContainer\n isControllerOnly={isControllerOnly}\n data-testid={ControlledDateTimePickerDatatestid.CONTROLLER_COMPONENT.TIMEWHEEL}\n {...ariaAndDataPropsTimewheel}\n >\n <StyledTimePickerHead\n data-testid={ControlledDateTimePickerDatatestid.TIMEWHEEL.HEADER_LABEL}\n {...ariaAndDataPropsHeaderLabel}\n >{`${hours || '__'}:${minutes || '__'} ${meridiem || '__'}`}</StyledTimePickerHead>\n <StyledTimePickerWheelsLegend>\n <div>H</div>\n <div>M</div>\n <div>A</div>\n </StyledTimePickerWheelsLegend>\n <StyledTimePickerWheelWrapper>\n <HoursList />\n <MinutesList />\n <MeridiemList />\n </StyledTimePickerWheelWrapper>\n <TimeWheelFooter />\n </StyledTimePickerContainer>\n );\n});\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;AD+BjB;AA/BN,mBAAkC;AAClC,8BAAsC;AACtC,gDAAmD;AACnD,yCAAgD;AAChD,qBAKO;AACP,uBAA0B;AAC1B,yBAA4B;AAC5B,0BAA6B;AAC7B,6BAAgC;AAEzB,MAAM,mBAAmB,aAAAA,QAAM,KAAK,MAAM;AAC/C,QAAM,EAAE,kBAAkB,OAAO,SAAS,UAAU,MAAM,QAAI,yBAAW,kEAA+B;AACxG,QAAM,8BAA8B,aAAAA,QAAM;AAAA,IACxC,UAAM,+CAAsB,MAAM,6EAAmC,UAAU,aAAa;AAAA,IAC5F,CAAC,KAAK;AAAA,EACR;AACA,QAAM,4BAA4B,aAAAA,QAAM;AAAA,IACtC,UAAM,+CAAsB,MAAM,6EAAmC,qBAAqB,UAAU;AAAA,IACpG,CAAC,KAAK;AAAA,EACR;AACA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,eAAa,6EAAmC,qBAAqB;AAAA,MACpE,GAAG;AAAA,MAEJ;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,eAAa,6EAAmC,UAAU;AAAA,YACzD,GAAG;AAAA,YACJ,aAAG,SAAS,QAAQ,WAAW,QAAQ,YAAY;AAAA;AAAA,QAAO;AAAA,QAC5D,6CAAC,+CACC;AAAA,sDAAC,SAAI,eAAC;AAAA,UACN,4CAAC,SAAI,eAAC;AAAA,UACN,4CAAC,SAAI,eAAC;AAAA,WACR;AAAA,QACA,6CAAC,+CACC;AAAA,sDAAC,8BAAU;AAAA,UACX,4CAAC,kCAAY;AAAA,UACb,4CAAC,oCAAa;AAAA,WAChB;AAAA,QACA,4CAAC,0CAAgB;AAAA;AAAA;AAAA,EACnB;AAEJ,CAAC;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,17 +29,31 @@ __export(TimeWheelFooter_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(TimeWheelFooter_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var import_react = require("react");
|
|
32
|
+
var import_react = __toESM(require("react"));
|
|
33
33
|
var import_ControlledDateTimePickerDatatestid = require("../../../ControlledDateTimePickerDatatestid");
|
|
34
34
|
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX");
|
|
35
35
|
var import_Styleds = require("./Styleds");
|
|
36
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
36
37
|
const TimeWheelFooter = () => {
|
|
37
38
|
const {
|
|
39
|
+
props,
|
|
38
40
|
props: { pickerFooterMsg, hasError },
|
|
39
41
|
isWithCalendarToo
|
|
40
42
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
43
|
+
const ariaAndDataProps = import_react.default.useMemo(
|
|
44
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL]),
|
|
45
|
+
[props]
|
|
46
|
+
);
|
|
41
47
|
if (!isWithCalendarToo && pickerFooterMsg !== void 0 && hasError)
|
|
42
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
48
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
49
|
+
import_Styleds.TimeWheelFooterMessage,
|
|
50
|
+
{
|
|
51
|
+
role: "alert",
|
|
52
|
+
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL,
|
|
53
|
+
...ariaAndDataProps,
|
|
54
|
+
children: pickerFooterMsg
|
|
55
|
+
}
|
|
56
|
+
);
|
|
43
57
|
return null;
|
|
44
58
|
};
|
|
45
59
|
//# sourceMappingURL=TimeWheelFooter.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/TimeWheelFooter.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelFooterMessage } from './Styleds';\n\nexport const TimeWheelFooter: React.ComponentType = () => {\n const {\n props: { pickerFooterMsg, hasError },\n isWithCalendarToo,\n } = useContext(ControlledDateTimePickerContext);\n if (!isWithCalendarToo && pickerFooterMsg !== undefined && hasError)\n return (\n <TimeWheelFooterMessage
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelFooterMessage } from './Styleds';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\n\nexport const TimeWheelFooter: React.ComponentType = () => {\n const {\n props,\n props: { pickerFooterMsg, hasError },\n isWithCalendarToo,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL]),\n [props],\n );\n if (!isWithCalendarToo && pickerFooterMsg !== undefined && hasError)\n return (\n <TimeWheelFooterMessage\n role=\"alert\"\n data-testid={ControlledDateTimePickerDatatestid.FOOTERS.TIMEWHEEL}\n {...ariaAndDataProps}\n >\n {pickerFooterMsg}\n </TimeWheelFooterMessage>\n );\n return null;\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADkBjB;AAlBN,mBAAkC;AAClC,gDAAmD;AACnD,yCAAgD;AAChD,qBAAuC;AACvC,8BAAsC;AAE/B,MAAM,kBAAuC,MAAM;AACxD,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,iBAAiB,SAAS;AAAA,IACnC;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,UAAM,+CAAsB,MAAM,6EAAmC,QAAQ,UAAU;AAAA,IACvF,CAAC,KAAK;AAAA,EACR;AACA,MAAI,CAAC,qBAAqB,oBAAoB,UAAa;AACzD,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,eAAa,6EAAmC,QAAQ;AAAA,QACvD,GAAG;AAAA,QAEH;AAAA;AAAA,IACH;AAEJ,SAAO;AACT;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,7 +29,8 @@ __export(TimeWheelIconTrigger_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(TimeWheelIconTrigger_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var import_react = require("react");
|
|
32
|
+
var import_react = __toESM(require("react"));
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
34
|
var import_ds_button = require("@elliemae/ds-button");
|
|
34
35
|
var import_ds_icons = require("@elliemae/ds-icons");
|
|
35
36
|
var import_TimeWheelContext = require("./TimeWheelContext");
|
|
@@ -39,9 +40,14 @@ var import_Styleds = require("./Styleds");
|
|
|
39
40
|
const TimeWheelIconTrigger = () => {
|
|
40
41
|
const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = (0, import_react.useContext)(import_TimeWheelContext.TimeWheelContext);
|
|
41
42
|
const {
|
|
43
|
+
props,
|
|
42
44
|
props: { disabled },
|
|
43
45
|
ariaCurrentValueForInputs
|
|
44
46
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
47
|
+
const ariaAndDataProps = import_react.default.useMemo(
|
|
48
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]),
|
|
49
|
+
[props]
|
|
50
|
+
);
|
|
45
51
|
return (0, import_react.useMemo)(
|
|
46
52
|
() => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
47
53
|
import_Styleds.StyledIconTriggerButton,
|
|
@@ -55,10 +61,18 @@ const TimeWheelIconTrigger = () => {
|
|
|
55
61
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL,
|
|
56
62
|
disabled,
|
|
57
63
|
type: "button",
|
|
64
|
+
...ariaAndDataProps,
|
|
58
65
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ds_icons.RecentDocuments, {})
|
|
59
66
|
}
|
|
60
67
|
),
|
|
61
|
-
[
|
|
68
|
+
[
|
|
69
|
+
ariaAndDataProps,
|
|
70
|
+
ariaCurrentValueForInputs,
|
|
71
|
+
disabled,
|
|
72
|
+
handlePickerIconKeyDown,
|
|
73
|
+
handleSetTriggerRef,
|
|
74
|
+
handleToggleTimePicker
|
|
75
|
+
]
|
|
62
76
|
);
|
|
63
77
|
};
|
|
64
78
|
//# sourceMappingURL=TimeWheelIconTrigger.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/TimeWheelIconTrigger.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { StyledIconTriggerButton } from './Styleds';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const TimeWheelIconTrigger = (): JSX.Element => {\n const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);\n const {\n props: { disabled },\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n onClick={handleToggleTimePicker}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL}\n disabled={disabled}\n type=\"button\"\n >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [ariaCurrentValueForInputs
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React, { useContext, useMemo } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { BUTTON_SIZES } from '@elliemae/ds-button';\nimport { RecentDocuments } from '@elliemae/ds-icons';\nimport { TimeWheelContext } from './TimeWheelContext';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { StyledIconTriggerButton } from './Styleds';\n\n// we memoize the Icon for maximum optimization\n// this is particularly useful due to how usePopper needs to check the references\n// since references are saved in a immutable way, we make sure to shortcircuit useless-re-renders\nexport const TimeWheelIconTrigger = (): JSX.Element => {\n const { handleSetTriggerRef, handleToggleTimePicker, handlePickerIconKeyDown } = useContext(TimeWheelContext);\n const {\n props,\n props: { disabled },\n ariaCurrentValueForInputs,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL]),\n [props],\n );\n return useMemo(\n () => (\n <StyledIconTriggerButton\n aria-label={`time picker context menu trigger, ${ariaCurrentValueForInputs}`}\n buttonType=\"icon\"\n size={BUTTON_SIZES.M}\n innerRef={handleSetTriggerRef}\n onClick={handleToggleTimePicker}\n onKeyDown={handlePickerIconKeyDown}\n data-testid={ControlledDateTimePickerDatatestid.PICKER_ICONS.TIMEWHEEL}\n disabled={disabled}\n type=\"button\"\n {...ariaAndDataProps}\n >\n <RecentDocuments />\n </StyledIconTriggerButton>\n ),\n [\n ariaAndDataProps,\n ariaCurrentValueForInputs,\n disabled,\n handlePickerIconKeyDown,\n handleSetTriggerRef,\n handleToggleTimePicker,\n ],\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqCf;AArCR,mBAA2C;AAC3C,8BAAsC;AACtC,uBAA6B;AAC7B,sBAAgC;AAChC,8BAAiC;AACjC,gDAAmD;AACnD,yCAAgD;AAChD,qBAAwC;AAKjC,MAAM,uBAAuB,MAAmB;AACrD,QAAM,EAAE,qBAAqB,wBAAwB,wBAAwB,QAAI,yBAAW,wCAAgB;AAC5G,QAAM;AAAA,IACJ;AAAA,IACA,OAAO,EAAE,SAAS;AAAA,IAClB;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,UAAM,+CAAsB,MAAM,6EAAmC,aAAa,UAAU;AAAA,IAC5F,CAAC,KAAK;AAAA,EACR;AACA,aAAO;AAAA,IACL,MACE;AAAA,MAAC;AAAA;AAAA,QACC,cAAY,qCAAqC;AAAA,QACjD,YAAW;AAAA,QACX,MAAM,8BAAa;AAAA,QACnB,UAAU;AAAA,QACV,SAAS;AAAA,QACT,WAAW;AAAA,QACX,eAAa,6EAAmC,aAAa;AAAA,QAC7D;AAAA,QACA,MAAK;AAAA,QACJ,GAAG;AAAA,QAEJ,sDAAC,mCAAgB;AAAA;AAAA,IACnB;AAAA,IAEF;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,7 +29,8 @@ __export(TimeWheelWrapper_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(TimeWheelWrapper_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var import_react = require("react");
|
|
32
|
+
var import_react = __toESM(require("react"));
|
|
33
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
33
34
|
var import_ds_popperjs = require("@elliemae/ds-popperjs");
|
|
34
35
|
var import_ControlledDateTimePickerDatatestid = require("../../../ControlledDateTimePickerDatatestid");
|
|
35
36
|
var import_ControlledDateTimePickerCTX = require("../../../ControlledDateTimePickerCTX");
|
|
@@ -37,7 +38,11 @@ var import_TimeWheelContent = require("./TimeWheelContent");
|
|
|
37
38
|
var import_TimeWheelContext = require("./TimeWheelContext");
|
|
38
39
|
const TimeWheelWrapper = () => {
|
|
39
40
|
const { referenceElement, closeTimePicker } = (0, import_react.useContext)(import_TimeWheelContext.TimeWheelContext);
|
|
40
|
-
const { isControllerOnly } = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
41
|
+
const { isControllerOnly, props } = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
42
|
+
const ariaAndDataProps = import_react.default.useMemo(
|
|
43
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]),
|
|
44
|
+
[props]
|
|
45
|
+
);
|
|
41
46
|
if (isControllerOnly)
|
|
42
47
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TimeWheelContent.TimeWheelContent, {});
|
|
43
48
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -48,6 +53,7 @@ const TimeWheelWrapper = () => {
|
|
|
48
53
|
referenceElement,
|
|
49
54
|
withoutArrow: true,
|
|
50
55
|
onClickOutside: closeTimePicker,
|
|
56
|
+
...ariaAndDataProps,
|
|
51
57
|
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_TimeWheelContent.TimeWheelContent, {})
|
|
52
58
|
}
|
|
53
59
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/parts/Pickers/TimeWheel/TimeWheelWrapper.tsx", "../../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelContent } from './TimeWheelContent';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const TimeWheelWrapper = (): JSX.Element => {\n const { referenceElement, closeTimePicker } = useContext(TimeWheelContext);\n const { isControllerOnly } = useContext(ControlledDateTimePickerContext);\n if (isControllerOnly) return <TimeWheelContent />;\n return (\n <DSPopperJS\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeTimePicker}\n >\n <TimeWheelContent />\n </DSPopperJS>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { DSPopperJS } from '@elliemae/ds-popperjs';\nimport { ControlledDateTimePickerDatatestid } from '../../../ControlledDateTimePickerDatatestid';\nimport { ControlledDateTimePickerContext } from '../../../ControlledDateTimePickerCTX';\nimport { TimeWheelContent } from './TimeWheelContent';\nimport { TimeWheelContext } from './TimeWheelContext';\n\nexport const TimeWheelWrapper = (): JSX.Element => {\n const { referenceElement, closeTimePicker } = useContext(TimeWheelContext);\n const { isControllerOnly, props } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataProps = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL]),\n [props],\n );\n if (isControllerOnly) return <TimeWheelContent />;\n return (\n <DSPopperJS\n showPopover\n data-testid={ControlledDateTimePickerDatatestid.CONTEXTUAL_MENU.TIMEWHEEL}\n referenceElement={referenceElement}\n withoutArrow\n onClickOutside={closeTimePicker}\n {...ariaAndDataProps}\n >\n <TimeWheelContent />\n </DSPopperJS>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADeQ;AAf/B,mBAAkC;AAClC,8BAAsC;AACtC,yBAA2B;AAC3B,gDAAmD;AACnD,yCAAgD;AAChD,8BAAiC;AACjC,8BAAiC;AAE1B,MAAM,mBAAmB,MAAmB;AACjD,QAAM,EAAE,kBAAkB,gBAAgB,QAAI,yBAAW,wCAAgB;AACzE,QAAM,EAAE,kBAAkB,MAAM,QAAI,yBAAW,kEAA+B;AAC9E,QAAM,mBAAmB,aAAAA,QAAM;AAAA,IAC7B,UAAM,+CAAsB,MAAM,6EAAmC,gBAAgB,UAAU;AAAA,IAC/F,CAAC,KAAK;AAAA,EACR;AACA,MAAI;AAAkB,WAAO,4CAAC,4CAAiB;AAC/C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAW;AAAA,MACX,eAAa,6EAAmC,gBAAgB;AAAA,MAChE;AAAA,MACA,cAAY;AAAA,MACZ,gBAAgB;AAAA,MACf,GAAG;AAAA,MAEJ,sDAAC,4CAAiB;AAAA;AAAA,EACpB;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -51,7 +51,8 @@ const HHInput = import_react.default.memo(
|
|
|
51
51
|
ariaCurrentValueForInputs,
|
|
52
52
|
contextRef,
|
|
53
53
|
autoFocusHourInput,
|
|
54
|
-
isFocused
|
|
54
|
+
isFocused,
|
|
55
|
+
ariaAndDataProps
|
|
55
56
|
}) => {
|
|
56
57
|
const validateOnChange = (0, import_react.useCallback)(
|
|
57
58
|
(e) => {
|
|
@@ -81,7 +82,8 @@ const HHInput = import_react.default.memo(
|
|
|
81
82
|
"aria-label": `hours input field ${ariaCurrentValueForInputs}`,
|
|
82
83
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR,
|
|
83
84
|
disabled,
|
|
84
|
-
"aria-disabled": disabled
|
|
85
|
+
"aria-disabled": disabled,
|
|
86
|
+
...ariaAndDataProps
|
|
85
87
|
}
|
|
86
88
|
);
|
|
87
89
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/TimeInputs/HHInput.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidHour = (hours: string) => {\n if (hours === '') return false;\n const numberOnly = regExpNumbers.test(hours);\n return hours.length > 2 || hours === '00' || !numberOnly || Number.parseInt(hours, 10) > 12;\n};\ninterface HHInputsPropsT {\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 autoFocusHourInput: boolean;\n isFocused: boolean;\n}\nexport const HHInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n autoFocusHourInput,\n isFocused,\n }: HHInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidHour(e.target.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusHourInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`hours input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidHour = (hours: string) => {\n if (hours === '') return false;\n const numberOnly = regExpNumbers.test(hours);\n return hours.length > 2 || hours === '00' || !numberOnly || Number.parseInt(hours, 10) > 12;\n};\ninterface HHInputsPropsT {\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 autoFocusHourInput: boolean;\n isFocused: boolean;\n ariaAndDataProps?: AriaAndDataProps;\n}\nexport const HHInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n autoFocusHourInput,\n isFocused,\n ariaAndDataProps,\n }: HHInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidHour(e.target.value)) {\n e.preventDefault();\n return;\n }\n onChange(e);\n },\n [onChange],\n );\n return (\n <Styled2DigitsInput\n autoFocus={autoFocusHourInput}\n onChange={validateOnChange}\n onBlur={onBlur}\n onFocus={onFocus}\n onKeyDown={onKeyDown}\n value={value}\n ref={(DomElem: HTMLInputElement) => {\n contextRef.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`hours input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADmDjB;AAnDN,mBAAmC;AACnC,qBAAmC;AACnC,gDAAmD;AAGnD,MAAM,gBAAgB;AACtB,MAAM,gBAAgB,CAAC,UAAkB;AACvC,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;AAeO,MAAM,UAAU,aAAAA,QAAM;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,EACF,MAAmC;AACjC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,cAAc,EAAE,OAAO,KAAK,GAAG;AACjC,YAAE,eAAe;AACjB;AAAA,QACF;AACA,iBAAS,CAAC;AAAA,MACZ;AAAA,MACA,CAAC,QAAQ;AAAA,IACX;AACA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,WAAW;AAAA,QACX,UAAU;AAAA,QACV;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,KAAK,CAAC,YAA8B;AAClC,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,qBAAqB;AAAA,QACjC,eAAa,6EAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -53,7 +53,8 @@ const MeridiemInput = import_react.default.memo(
|
|
|
53
53
|
placeholder,
|
|
54
54
|
ariaCurrentValueForInputs,
|
|
55
55
|
contextRef,
|
|
56
|
-
isFocused
|
|
56
|
+
isFocused,
|
|
57
|
+
ariaAndDataProps
|
|
57
58
|
}) => {
|
|
58
59
|
const validateOnChange = (0, import_react.useCallback)(
|
|
59
60
|
(e) => {
|
|
@@ -82,7 +83,8 @@ const MeridiemInput = import_react.default.memo(
|
|
|
82
83
|
"aria-label": `meridiem input field ${ariaCurrentValueForInputs}`,
|
|
83
84
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM,
|
|
84
85
|
disabled,
|
|
85
|
-
"aria-disabled": disabled
|
|
86
|
+
"aria-disabled": disabled,
|
|
87
|
+
...ariaAndDataProps
|
|
86
88
|
}
|
|
87
89
|
);
|
|
88
90
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/TimeInputs/MeridiemInput.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst validFirstDigits = ['a', 'A', 'p', 'P'];\nconst validSecondDigits = ['m', 'M'];\nconst isInvalidMeridiem = (meridiem: string) => {\n if (meridiem === '') return false;\n const [firstDigit, secondDigit] = meridiem.split('');\n const isValidFirstDigit = (meridiem.length < 1 && !firstDigit) || validFirstDigits.includes(firstDigit);\n const isValidSecondDigit = !secondDigit || validSecondDigits.includes(secondDigit);\n return meridiem.length > 2 || !isValidFirstDigit || !isValidSecondDigit;\n};\n\ninterface MeridiemInputsPropsT {\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}\nexport const MeridiemInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n }: MeridiemInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMeridiem(e?.target?.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.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`meridiem input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { Styled2DigitsInput } from '../Styleds';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst validFirstDigits = ['a', 'A', 'p', 'P'];\nconst validSecondDigits = ['m', 'M'];\nconst isInvalidMeridiem = (meridiem: string) => {\n if (meridiem === '') return false;\n const [firstDigit, secondDigit] = meridiem.split('');\n const isValidFirstDigit = (meridiem.length < 1 && !firstDigit) || validFirstDigits.includes(firstDigit);\n const isValidSecondDigit = !secondDigit || validSecondDigits.includes(secondDigit);\n return meridiem.length > 2 || !isValidFirstDigit || !isValidSecondDigit;\n};\n\ninterface MeridiemInputsPropsT {\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 ariaAndDataProps?: AriaAndDataProps;\n}\nexport const MeridiemInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n ariaAndDataProps,\n }: MeridiemInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMeridiem(e?.target?.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.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`meridiem input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADqDjB;AArDN,mBAAmC;AACnC,qBAAmC;AACnC,gDAAmD;AAGnD,MAAM,mBAAmB,CAAC,KAAK,KAAK,KAAK,GAAG;AAC5C,MAAM,oBAAoB,CAAC,KAAK,GAAG;AACnC,MAAM,oBAAoB,CAAC,aAAqB;AAC9C,MAAI,aAAa;AAAI,WAAO;AAC5B,QAAM,CAAC,YAAY,WAAW,IAAI,SAAS,MAAM,EAAE;AACnD,QAAM,oBAAqB,SAAS,SAAS,KAAK,CAAC,cAAe,iBAAiB,SAAS,UAAU;AACtG,QAAM,qBAAqB,CAAC,eAAe,kBAAkB,SAAS,WAAW;AACjF,SAAO,SAAS,SAAS,KAAK,CAAC,qBAAqB,CAAC;AACvD;AAeO,MAAM,gBAAgB,aAAAA,QAAM;AAAA,EACjC,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,MAAyC;AACvC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,kBAAkB,GAAG,QAAQ,KAAK,GAAG;AACvC,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,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,wBAAwB;AAAA,QACpC,eAAa,6EAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -50,7 +50,8 @@ const MinutesInput = import_react.default.memo(
|
|
|
50
50
|
placeholder,
|
|
51
51
|
ariaCurrentValueForInputs,
|
|
52
52
|
contextRef,
|
|
53
|
-
isFocused
|
|
53
|
+
isFocused,
|
|
54
|
+
ariaAndDataProps
|
|
54
55
|
}) => {
|
|
55
56
|
const validateOnChange = (0, import_react.useCallback)(
|
|
56
57
|
(e) => {
|
|
@@ -79,7 +80,8 @@ const MinutesInput = import_react.default.memo(
|
|
|
79
80
|
"aria-label": `minutes input field ${ariaCurrentValueForInputs}`,
|
|
80
81
|
"data-testid": import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE,
|
|
81
82
|
disabled,
|
|
82
|
-
"aria-disabled": disabled
|
|
83
|
+
"aria-disabled": disabled,
|
|
84
|
+
...ariaAndDataProps
|
|
83
85
|
}
|
|
84
86
|
);
|
|
85
87
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/TimeInputs/MinutesInput.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { Styled2DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMinute = (minutes: string) => {\n if (minutes === '') return false;\n const numberOnly = regExpNumbers.test(minutes);\n return minutes.length > 2 || !numberOnly || Number.parseInt(minutes, 10) > 60;\n};\ninterface MinutesInputsPropsT {\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}\nexport const MinutesInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n }: MinutesInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMinute(e?.target?.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.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`minutes input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE}\n disabled={disabled}\n aria-disabled={disabled}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
4
|
+
"sourcesContent": ["import React, { useCallback } from 'react';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { Styled2DigitsInput } from '../Styleds';\nimport type { DSControlledDateTimePickerInternalsT } from '../../sharedTypes';\n\nconst regExpNumbers = /^[0-9]+$/;\nconst isInvalidMinute = (minutes: string) => {\n if (minutes === '') return false;\n const numberOnly = regExpNumbers.test(minutes);\n return minutes.length > 2 || !numberOnly || Number.parseInt(minutes, 10) > 60;\n};\ninterface MinutesInputsPropsT {\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 ariaAndDataProps?: AriaAndDataProps;\n}\nexport const MinutesInput = React.memo(\n ({\n onChange,\n onBlur,\n onFocus,\n onKeyDown,\n value,\n disabled,\n placeholder,\n ariaCurrentValueForInputs,\n contextRef,\n isFocused,\n ariaAndDataProps,\n }: MinutesInputsPropsT): JSX.Element => {\n const validateOnChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n if (isInvalidMinute(e?.target?.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.current = DomElem;\n if (isFocused) DomElem?.focus?.();\n }}\n placeholder={placeholder}\n aria-label={`minutes input field ${ariaCurrentValueForInputs}`}\n data-testid={ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE}\n disabled={disabled}\n aria-disabled={disabled}\n {...ariaAndDataProps}\n />\n );\n },\n);\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADiDjB;AAjDN,mBAAmC;AACnC,gDAAmD;AACnD,qBAAmC;AAGnC,MAAM,gBAAgB;AACtB,MAAM,kBAAkB,CAAC,YAAoB;AAC3C,MAAI,YAAY;AAAI,WAAO;AAC3B,QAAM,aAAa,cAAc,KAAK,OAAO;AAC7C,SAAO,QAAQ,SAAS,KAAK,CAAC,cAAc,OAAO,SAAS,SAAS,EAAE,IAAI;AAC7E;AAcO,MAAM,eAAe,aAAAA,QAAM;AAAA,EAChC,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,MAAwC;AACtC,UAAM,uBAAmB;AAAA,MACvB,CAAC,MAA2C;AAC1C,YAAI,gBAAgB,GAAG,QAAQ,KAAK,GAAG;AACrC,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,qBAAW,UAAU;AACrB,cAAI;AAAW,qBAAS,QAAQ;AAAA,QAClC;AAAA,QACA;AAAA,QACA,cAAY,uBAAuB;AAAA,QACnC,eAAa,6EAAmC,YAAY;AAAA,QAC5D;AAAA,QACA,iBAAe;AAAA,QACd,GAAG;AAAA;AAAA,IACN;AAAA,EAEJ;AACF;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -29,9 +29,11 @@ __export(TimeInputs_exports, {
|
|
|
29
29
|
module.exports = __toCommonJS(TimeInputs_exports);
|
|
30
30
|
var React = __toESM(require("react"));
|
|
31
31
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
32
|
-
var import_react = require("react");
|
|
32
|
+
var import_react = __toESM(require("react"));
|
|
33
33
|
var import_ds_grid = require("@elliemae/ds-grid");
|
|
34
|
+
var import_ds_props_helpers = require("@elliemae/ds-props-helpers");
|
|
34
35
|
var import_ControlledDateTimePickerCTX = require("../../ControlledDateTimePickerCTX");
|
|
36
|
+
var import_ControlledDateTimePickerDatatestid = require("../../ControlledDateTimePickerDatatestid");
|
|
35
37
|
var import_HHInput = require("./HHInput");
|
|
36
38
|
var import_MinutesInput = require("./MinutesInput");
|
|
37
39
|
var import_MeridiemInput = require("./MeridiemInput");
|
|
@@ -64,8 +66,21 @@ const TimeInputs = () => {
|
|
|
64
66
|
meridiemInputRef,
|
|
65
67
|
ariaCurrentValueForInputs,
|
|
66
68
|
latestInteractionRegion,
|
|
67
|
-
currFocusDescriber
|
|
69
|
+
currFocusDescriber,
|
|
70
|
+
props
|
|
68
71
|
} = (0, import_react.useContext)(import_ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
72
|
+
const ariaAndDataPropsHoursInput = import_react.default.useMemo(
|
|
73
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR]),
|
|
74
|
+
[props]
|
|
75
|
+
);
|
|
76
|
+
const ariaAndDataPropsMinutesInput = import_react.default.useMemo(
|
|
77
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE]),
|
|
78
|
+
[props]
|
|
79
|
+
);
|
|
80
|
+
const ariaAndDataPropsMeridiemInput = import_react.default.useMemo(
|
|
81
|
+
() => (0, import_ds_props_helpers.getPropsPerDatatestid)(props[import_ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM]),
|
|
82
|
+
[props]
|
|
83
|
+
);
|
|
69
84
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
70
85
|
import_ds_grid.Grid,
|
|
71
86
|
{
|
|
@@ -90,7 +105,8 @@ const TimeInputs = () => {
|
|
|
90
105
|
ariaCurrentValueForInputs,
|
|
91
106
|
autoFocusHourInput,
|
|
92
107
|
disabled,
|
|
93
|
-
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "hour-input"
|
|
108
|
+
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "hour-input",
|
|
109
|
+
ariaAndDataProps: ariaAndDataPropsHoursInput
|
|
94
110
|
}
|
|
95
111
|
) }),
|
|
96
112
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledColonSeparator, { alignItems: "center", children: ":" }),
|
|
@@ -106,7 +122,8 @@ const TimeInputs = () => {
|
|
|
106
122
|
placeholder: "MM",
|
|
107
123
|
ariaCurrentValueForInputs,
|
|
108
124
|
disabled,
|
|
109
|
-
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "minute-input"
|
|
125
|
+
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "minute-input",
|
|
126
|
+
ariaAndDataProps: ariaAndDataPropsMinutesInput
|
|
110
127
|
}
|
|
111
128
|
) }),
|
|
112
129
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_Styleds.StyledSeparator, { children: " " }),
|
|
@@ -122,7 +139,8 @@ const TimeInputs = () => {
|
|
|
122
139
|
placeholder: "AM",
|
|
123
140
|
ariaCurrentValueForInputs,
|
|
124
141
|
disabled,
|
|
125
|
-
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "meridiem-input"
|
|
142
|
+
isFocused: latestInteractionRegion === "time-inputs" && currFocusDescriber === "meridiem-input",
|
|
143
|
+
ariaAndDataProps: ariaAndDataPropsMeridiemInput
|
|
126
144
|
}
|
|
127
145
|
) })
|
|
128
146
|
]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/parts/TimeInputs/TimeInputs.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
-
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["import React, { useContext } from 'react';\nimport { Grid } from '@elliemae/ds-grid';\nimport { getPropsPerDatatestid } from '@elliemae/ds-props-helpers';\nimport { ControlledDateTimePickerContext } from '../../ControlledDateTimePickerCTX';\nimport { ControlledDateTimePickerDatatestid } from '../../ControlledDateTimePickerDatatestid';\nimport { HHInput } from './HHInput';\nimport { MinutesInput } from './MinutesInput';\nimport { MeridiemInput } from './MeridiemInput';\nimport { useTimeInputs } from './useTimeInputs';\nimport { fixedValues } from '../config';\nimport { StyledColonSeparator, StyledSeparator, StyledFocusWithIn } from '../Styleds';\n\nexport const TimeInputs = (): JSX.Element => {\n const {\n autoFocusHourInput,\n disabled,\n onHoursChange,\n onMinutesChange,\n onMeridiemChange,\n onHoursBlur,\n onMinutesBlur,\n onMeridiemBlur,\n onHoursFocus,\n onMeridiemFocus,\n onMinutesFocus,\n onHoursKeyDown,\n onMinutesKeyDown,\n onMeridiemKeyDown,\n } = useTimeInputs();\n\n // we do this here so HHInput,MinutesInput, MeridiemInput can be pure components memoized via React.memo\n const {\n hours,\n minutes,\n meridiem,\n hourInputRef,\n minutesInputRef,\n meridiemInputRef,\n ariaCurrentValueForInputs,\n latestInteractionRegion,\n currFocusDescriber,\n props,\n } = useContext(ControlledDateTimePickerContext);\n const ariaAndDataPropsHoursInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR]),\n [props],\n );\n const ariaAndDataPropsMinutesInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE]),\n [props],\n );\n const ariaAndDataPropsMeridiemInput = React.useMemo(\n () => getPropsPerDatatestid(props[ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM]),\n [props],\n );\n\n return (\n <Grid\n cols={[\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n fixedValues.separatorWidth,\n fixedValues.smallInputWidth,\n ]}\n >\n <StyledFocusWithIn>\n <HHInput\n value={hours}\n onChange={onHoursChange}\n onBlur={onHoursBlur}\n onFocus={onHoursFocus}\n onKeyDown={onHoursKeyDown}\n contextRef={hourInputRef}\n placeholder=\"HH\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n autoFocusHourInput={autoFocusHourInput}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'hour-input'}\n ariaAndDataProps={ariaAndDataPropsHoursInput}\n />\n </StyledFocusWithIn>\n <StyledColonSeparator alignItems=\"center\">:</StyledColonSeparator>\n <StyledFocusWithIn>\n <MinutesInput\n value={minutes}\n onChange={onMinutesChange}\n onBlur={onMinutesBlur}\n onFocus={onMinutesFocus}\n onKeyDown={onMinutesKeyDown}\n contextRef={minutesInputRef}\n placeholder=\"MM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'minute-input'}\n ariaAndDataProps={ariaAndDataPropsMinutesInput}\n />\n </StyledFocusWithIn>\n <StyledSeparator> </StyledSeparator>\n <StyledFocusWithIn>\n <MeridiemInput\n value={meridiem}\n onChange={onMeridiemChange}\n onBlur={onMeridiemBlur}\n onFocus={onMeridiemFocus}\n onKeyDown={onMeridiemKeyDown}\n contextRef={meridiemInputRef}\n placeholder=\"AM\"\n ariaCurrentValueForInputs={ariaCurrentValueForInputs}\n disabled={disabled}\n isFocused={latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'meridiem-input'}\n ariaAndDataProps={ariaAndDataPropsMeridiemInput}\n />\n </StyledFocusWithIn>\n </Grid>\n );\n};\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADyDnB;AAzDJ,mBAAkC;AAClC,qBAAqB;AACrB,8BAAsC;AACtC,yCAAgD;AAChD,gDAAmD;AACnD,qBAAwB;AACxB,0BAA6B;AAC7B,2BAA8B;AAC9B,2BAA8B;AAC9B,oBAA4B;AAC5B,qBAAyE;AAElE,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,EACF,QAAI,oCAAc;AAGlB,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,QAAI,yBAAW,kEAA+B;AAC9C,QAAM,6BAA6B,aAAAA,QAAM;AAAA,IACvC,UAAM,+CAAsB,MAAM,6EAAmC,YAAY,KAAK;AAAA,IACtF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,+BAA+B,aAAAA,QAAM;AAAA,IACzC,UAAM,+CAAsB,MAAM,6EAAmC,YAAY,OAAO;AAAA,IACxF,CAAC,KAAK;AAAA,EACR;AACA,QAAM,gCAAgC,aAAAA,QAAM;AAAA,IAC1C,UAAM,+CAAsB,MAAM,6EAAmC,YAAY,SAAS;AAAA,IAC1F,CAAC,KAAK;AAAA,EACR;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,MAAM;AAAA,QACJ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,QACZ,0BAAY;AAAA,MACd;AAAA,MAEA;AAAA,oDAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,4CAAC,uCAAqB,YAAW,UAAS,eAAC;AAAA,QAC3C,4CAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA,QACA,4CAAC,kCAAgB,eAAC;AAAA,QAClB,4CAAC,oCACC;AAAA,UAAC;AAAA;AAAA,YACC,OAAO;AAAA,YACP,UAAU;AAAA,YACV,QAAQ;AAAA,YACR,SAAS;AAAA,YACT,WAAW;AAAA,YACX,YAAY;AAAA,YACZ,aAAY;AAAA,YACZ;AAAA,YACA;AAAA,YACA,WAAW,4BAA4B,iBAAiB,uBAAuB;AAAA,YAC/E,kBAAkB;AAAA;AAAA,QACpB,GACF;AAAA;AAAA;AAAA,EACF;AAEJ;",
|
|
6
|
+
"names": ["React"]
|
|
7
7
|
}
|