@elliemae/ds-controlled-form 2.4.2-rc.1 → 2.4.2-rc.13
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/cjs/autocomplete/config/useAutocomplete.js +0 -1
- package/cjs/autocomplete/parts/A11yFocusedOption.js +46 -0
- package/cjs/autocomplete/parts/container/Container.js +36 -24
- package/cjs/autocomplete/parts/container/styled.js +2 -2
- package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/cjs/autocomplete/parts/menu-list/MenuList.js +6 -6
- package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
- package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/cjs/autocomplete/parts/styled.js +2 -0
- package/cjs/autocomplete/utils/listHelper.js +1 -1
- package/cjs/checkbox/ControlledCheckbox.js +1 -1
- package/cjs/checkbox/config/useValidateProps.js +6 -3
- package/cjs/checkbox/react-desc-prop-types.js +2 -1
- package/cjs/checkbox/styles.js +73 -27
- package/cjs/checkbox/utils/styleHelpers.js +20 -2
- package/cjs/combobox/ComboBoxCTX.js +6 -3
- package/cjs/combobox/config/useComboBox.js +16 -6
- package/cjs/combobox/config/useCorrectOptions.js +1 -2
- package/cjs/combobox/parts/A11yFocusedOption.js +14 -6
- package/cjs/combobox/parts/A11ySelectedValues.js +2 -4
- package/cjs/combobox/parts/DropdownIndicator.js +15 -7
- package/cjs/combobox/parts/container/Container.js +11 -14
- package/cjs/combobox/parts/container/styled.js +11 -10
- package/cjs/combobox/parts/controls/Controls.js +19 -27
- package/cjs/combobox/parts/controls/styled.js +54 -22
- package/cjs/combobox/parts/controls/useOnPillsNavigation.js +7 -15
- package/cjs/combobox/parts/controls-input/ControlsInput.js +2 -2
- package/cjs/combobox/parts/controls-input/styled.js +41 -11
- package/cjs/combobox/parts/controls-input/useControlsInput.js +4 -7
- package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +19 -28
- package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
- package/cjs/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
- package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
- package/cjs/combobox/parts/header-list/styled.js +39 -10
- package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
- package/cjs/combobox/parts/menu-list/MenuList.js +8 -6
- package/cjs/combobox/parts/menu-list/styled.js +38 -20
- package/cjs/combobox/parts/menu-list/useItemRenderer.js +18 -17
- package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/cjs/combobox/parts/styled.js +6 -7
- package/cjs/combobox/react-desc-prop-types.js +3 -2
- package/cjs/combobox/sharedTypes.js +2 -2
- package/cjs/combobox/utils/listHelper.js +14 -9
- package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
- package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/cjs/date-time-picker/config/useChangeHandlers.js +11 -15
- package/cjs/date-time-picker/config/useControlledDateTimePicker.js +14 -10
- package/cjs/date-time-picker/config/useFocusTracker.js +136 -0
- package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/cjs/date-time-picker/config/useGetReferences.js +39 -18
- package/cjs/date-time-picker/config/useGlobalKeyHandlers.js +8 -12
- package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/cjs/date-time-picker/config/useValidateProps.js +42 -11
- package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +10 -2
- package/cjs/date-time-picker/parts/ClearButton/useClearButton.js +12 -25
- package/cjs/date-time-picker/parts/ControlledDateTimePickerContent.js +4 -7
- package/cjs/date-time-picker/parts/DateInputs/DDInput.js +8 -6
- package/cjs/date-time-picker/parts/DateInputs/DateInputs.js +9 -4
- package/cjs/date-time-picker/parts/DateInputs/MMInput.js +8 -6
- package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +8 -6
- package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +84 -113
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +25 -7
- package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +21 -17
- package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
- package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +13 -14
- package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +2 -39
- package/cjs/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +40 -73
- package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +18 -29
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -1
- package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +19 -27
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +15 -11
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +17 -13
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +15 -11
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +36 -230
- package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +12 -17
- package/cjs/date-time-picker/parts/Styleds.js +12 -6
- package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +7 -3
- package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +8 -7
- package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +8 -6
- package/cjs/date-time-picker/parts/TimeInputs/TimeInputs.js +11 -6
- package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +55 -97
- package/cjs/date-time-picker/utils/constants.js +0 -12
- package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
- package/cjs/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +38 -36
- package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
- package/cjs/input-group/InputGroup.js +8 -7
- package/cjs/input-group/exported-related/data-test-ids.js +12 -0
- package/cjs/input-group/exported-related/index.js +12 -0
- package/cjs/input-group/exported-related/theming.js +13 -0
- package/cjs/input-group/styled.js +90 -23
- package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/cjs/large-text-input/styles.js +27 -13
- package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
- package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
- package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
- package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
- package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/cjs/mask-hook/utils/flatStringArray.js +0 -1
- package/cjs/text-input/config/useInputText.js +0 -1
- package/cjs/text-input/styled/borders.js +18 -11
- package/cjs/text-input/styled/components.js +49 -10
- package/cjs/toggle/ControlledToggle.js +2 -3
- package/cjs/toggle/styles.js +7 -5
- package/esm/autocomplete/config/useAutocomplete.js +0 -1
- package/esm/autocomplete/parts/A11yFocusedOption.js +36 -0
- package/esm/autocomplete/parts/container/Container.js +39 -27
- package/esm/autocomplete/parts/container/styled.js +2 -2
- package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
- package/esm/autocomplete/parts/menu-list/MenuList.js +7 -7
- package/esm/autocomplete/parts/menu-list/styled.js +2 -2
- package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
- package/esm/autocomplete/parts/styled.js +1 -0
- package/esm/autocomplete/utils/listHelper.js +1 -1
- package/esm/checkbox/ControlledCheckbox.js +2 -2
- package/esm/checkbox/config/useValidateProps.js +6 -3
- package/esm/checkbox/react-desc-prop-types.js +2 -1
- package/esm/checkbox/styles.js +73 -24
- package/esm/checkbox/utils/styleHelpers.js +20 -2
- package/esm/combobox/ComboBoxCTX.js +6 -3
- package/esm/combobox/config/useComboBox.js +16 -6
- package/esm/combobox/config/useCorrectOptions.js +1 -2
- package/esm/combobox/parts/A11yFocusedOption.js +15 -7
- package/esm/combobox/parts/A11ySelectedValues.js +2 -4
- package/esm/combobox/parts/DropdownIndicator.js +15 -6
- package/esm/combobox/parts/container/Container.js +11 -14
- package/esm/combobox/parts/container/styled.js +11 -6
- package/esm/combobox/parts/controls/Controls.js +19 -27
- package/esm/combobox/parts/controls/styled.js +54 -18
- package/esm/combobox/parts/controls/useOnPillsNavigation.js +7 -15
- package/esm/combobox/parts/controls-input/ControlsInput.js +2 -2
- package/esm/combobox/parts/controls-input/styled.js +41 -7
- package/esm/combobox/parts/controls-input/useControlsInput.js +4 -7
- package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +20 -29
- package/esm/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
- package/esm/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
- package/esm/combobox/parts/header-list/HeaderList.js +1 -1
- package/esm/combobox/parts/header-list/styled.js +40 -7
- package/esm/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
- package/esm/combobox/parts/menu-list/MenuList.js +8 -6
- package/esm/combobox/parts/menu-list/styled.js +38 -17
- package/esm/combobox/parts/menu-list/useItemRenderer.js +20 -19
- package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
- package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
- package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
- package/esm/combobox/parts/styled.js +6 -3
- package/esm/combobox/react-desc-prop-types.js +3 -2
- package/esm/combobox/sharedTypes.js +2 -2
- package/esm/combobox/utils/listHelper.js +14 -10
- package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
- package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
- package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
- package/esm/date-time-picker/config/useChangeHandlers.js +11 -15
- package/esm/date-time-picker/config/useControlledDateTimePicker.js +14 -10
- package/esm/date-time-picker/config/useFocusTracker.js +132 -0
- package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
- package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
- package/esm/date-time-picker/config/useGetReferences.js +40 -19
- package/esm/date-time-picker/config/useGlobalKeyHandlers.js +8 -12
- package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
- package/esm/date-time-picker/config/useValidateProps.js +42 -11
- package/esm/date-time-picker/parts/ClearButton/ClearButton.js +10 -2
- package/esm/date-time-picker/parts/ClearButton/useClearButton.js +12 -25
- package/esm/date-time-picker/parts/ControlledDateTimePickerContent.js +4 -7
- package/esm/date-time-picker/parts/DateInputs/DDInput.js +8 -6
- package/esm/date-time-picker/parts/DateInputs/DateInputs.js +9 -4
- package/esm/date-time-picker/parts/DateInputs/MMInput.js +8 -6
- package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +8 -6
- package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +85 -114
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +26 -8
- package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +21 -17
- package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
- package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +12 -13
- package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
- package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +3 -40
- package/esm/date-time-picker/parts/Pickers/Calendar/useKeyboardHandlers.js +40 -73
- package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +18 -29
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +2 -1
- package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +19 -27
- package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +16 -12
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +18 -14
- package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +16 -12
- package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
- package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +1 -1
- package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
- package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
- package/esm/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.js +36 -230
- package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +12 -17
- package/esm/date-time-picker/parts/Styleds.js +12 -6
- package/esm/date-time-picker/parts/TimeInputs/HHInput.js +7 -3
- package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +8 -7
- package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +8 -6
- package/esm/date-time-picker/parts/TimeInputs/TimeInputs.js +11 -6
- package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +55 -97
- package/esm/date-time-picker/utils/constants.js +1 -7
- package/esm/date-time-picker/utils/dateHelpers.js +17 -34
- package/esm/date-time-picker/utils/hooks/useGetStartingFocusedDay.js +38 -36
- package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
- package/esm/date-time-picker/utils/stringHelpers.js +5 -11
- package/esm/input-group/InputGroup.js +5 -4
- package/esm/input-group/exported-related/data-test-ids.js +8 -0
- package/esm/input-group/exported-related/index.js +2 -0
- package/esm/input-group/exported-related/theming.js +8 -0
- package/esm/input-group/styled.js +89 -18
- package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
- package/esm/large-text-input/styles.js +27 -9
- package/esm/mask-hook/hooks/useNumberMask.js +1 -5
- package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
- package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
- package/esm/mask-hook/hooks/useSSNMask.js +1 -4
- package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
- package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
- package/esm/mask-hook/utils/flatStringArray.js +0 -1
- package/esm/text-input/config/useInputText.js +0 -1
- package/esm/text-input/styled/borders.js +18 -7
- package/esm/text-input/styled/components.js +49 -6
- package/esm/toggle/ControlledToggle.js +0 -1
- package/esm/toggle/styles.js +7 -5
- package/package.json +39 -15
- package/types/autocomplete/parts/A11yFocusedOption.d.ts +5 -0
- package/types/autocomplete/parts/container/styled.d.ts +1 -1
- package/types/autocomplete/parts/styled.d.ts +0 -0
- package/types/autocomplete/utils/listHelper.d.ts +5 -5
- package/types/checkbox/react-desc-prop-types.d.ts +1 -1
- package/types/checkbox/styles.d.ts +1 -0
- package/types/combobox/parts/menu-list/styled.d.ts +1 -0
- package/types/combobox/react-desc-prop-types.d.ts +8 -6
- package/types/combobox/sharedTypes.d.ts +3 -2
- package/types/combobox/utils/listHelper.d.ts +1 -0
- package/types/date-time-picker/config/useChangeHandlers.d.ts +3 -1
- package/types/date-time-picker/config/useControlledDateTimePicker.d.ts +2 -5
- package/types/date-time-picker/config/useFocusTracker.d.ts +38 -0
- package/types/date-time-picker/config/useGetPropsBasedOnType.d.ts +6 -6
- package/types/date-time-picker/config/useGetReferences.d.ts +30 -36
- package/types/date-time-picker/config/useGlobalKeyHandlers.d.ts +3 -1
- package/types/date-time-picker/parts/DateInputs/DDInput.d.ts +2 -1
- package/types/date-time-picker/parts/DateInputs/MMInput.d.ts +2 -1
- package/types/date-time-picker/parts/DateInputs/YYYYInput.d.ts +2 -1
- package/types/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.d.ts +14 -0
- package/types/date-time-picker/parts/Pickers/Calendar/useFocusLogic.d.ts +1 -2
- package/types/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.d.ts +19 -0
- package/types/date-time-picker/parts/Pickers/TimeWheel/useKeyboardHandlers.d.ts +0 -6
- package/types/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.d.ts +14 -0
- package/types/date-time-picker/parts/TimeInputs/HHInput.d.ts +2 -1
- package/types/date-time-picker/parts/TimeInputs/MeridiemInput.d.ts +2 -1
- package/types/date-time-picker/parts/TimeInputs/MinutesInput.d.ts +2 -1
- package/types/date-time-picker/propTypes.d.ts +117 -0
- package/types/date-time-picker/sharedTypes.d.ts +1 -1
- package/types/date-time-picker/utils/constants.d.ts +0 -6
- package/types/input-group/exported-related/data-test-ids.d.ts +6 -0
- package/types/input-group/exported-related/index.d.ts +2 -0
- package/types/input-group/exported-related/theming.d.ts +6 -0
- package/types/input-group/styled.d.ts +4 -7
- package/types/text-input/config/useInputText.d.ts +4 -4
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var ControlledDateTimePickerCTX = require('../../../ControlledDateTimePickerCTX.js');
|
|
7
|
-
var constants = require('../../../utils/constants.js');
|
|
8
7
|
|
|
9
8
|
/* eslint-disable @typescript-eslint/indent */
|
|
10
9
|
const useKeyboardHandlers = _ref => {
|
|
@@ -24,59 +23,42 @@ const useKeyboardHandlers = _ref => {
|
|
|
24
23
|
isWithDateInputs,
|
|
25
24
|
isWithCalendarToo,
|
|
26
25
|
isControllerOnly,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
prevHourBtnRef,
|
|
35
|
-
currHourBtnRef,
|
|
36
|
-
nextHourBtnRef,
|
|
37
|
-
prevMinutesBtnRef,
|
|
38
|
-
currMinutesBtnRef,
|
|
39
|
-
nextMinutesBtnRef,
|
|
40
|
-
prevMeridiemBtnRef,
|
|
41
|
-
currMeridiemBtnRef,
|
|
42
|
-
nextMeridiemBtnRef
|
|
26
|
+
trackFocusCalendarPrevMonth,
|
|
27
|
+
trackFocusTimewheelCurrHour,
|
|
28
|
+
trackFocusTimewheelCurrMinute,
|
|
29
|
+
trackFocusTimewheelCurrMeridiem,
|
|
30
|
+
trackFocusFirstSegment,
|
|
31
|
+
trackFocusMeridiemInput,
|
|
32
|
+
trackFocusYearInput
|
|
43
33
|
} = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
44
34
|
const onHomeKeyDownInsideTimeWheel = React.useCallback(() => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (isWithCalendarToo) prevMonthBtnRef === null || prevMonthBtnRef === void 0 ? void 0 : (_prevMonthBtnRef$curr = prevMonthBtnRef.current) === null || _prevMonthBtnRef$curr === void 0 ? void 0 : (_prevMonthBtnRef$curr2 = _prevMonthBtnRef$curr.focus) === null || _prevMonthBtnRef$curr2 === void 0 ? void 0 : _prevMonthBtnRef$curr2.call(_prevMonthBtnRef$curr);else currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre = currHourBtnRef.current) === null || _currHourBtnRef$curre === void 0 ? void 0 : (_currHourBtnRef$curre2 = _currHourBtnRef$curre.focus) === null || _currHourBtnRef$curre2 === void 0 ? void 0 : _currHourBtnRef$curre2.call(_currHourBtnRef$curre);
|
|
48
|
-
}, [currHourBtnRef, isWithCalendarToo, prevMonthBtnRef]);
|
|
35
|
+
if (isWithCalendarToo) trackFocusCalendarPrevMonth();else trackFocusTimewheelCurrHour();
|
|
36
|
+
}, [isWithCalendarToo, trackFocusCalendarPrevMonth, trackFocusTimewheelCurrHour]);
|
|
49
37
|
const onEndKeyDownInsideTimeWheel = React.useCallback(() => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c === void 0 ? void 0 : (_currMeridiemBtnRef$c2 = _currMeridiemBtnRef$c.focus) === null || _currMeridiemBtnRef$c2 === void 0 ? void 0 : _currMeridiemBtnRef$c2.call(_currMeridiemBtnRef$c);
|
|
53
|
-
}, [currMeridiemBtnRef]);
|
|
38
|
+
trackFocusTimewheelCurrMeridiem();
|
|
39
|
+
}, [trackFocusTimewheelCurrMeridiem]);
|
|
54
40
|
const onHomeKeyDownTriggerIcon = React.useCallback(() => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
if (!hideDate) monthInputRef === null || monthInputRef === void 0 ? void 0 : (_monthInputRef$curren = monthInputRef.current) === null || _monthInputRef$curren === void 0 ? void 0 : (_monthInputRef$curren2 = _monthInputRef$curren.focus) === null || _monthInputRef$curren2 === void 0 ? void 0 : _monthInputRef$curren2.call(_monthInputRef$curren);else if (!hideTime) hourInputRef === null || hourInputRef === void 0 ? void 0 : (_hourInputRef$current = hourInputRef.current) === null || _hourInputRef$current === void 0 ? void 0 : (_hourInputRef$current2 = _hourInputRef$current.focus) === null || _hourInputRef$current2 === void 0 ? void 0 : _hourInputRef$current2.call(_hourInputRef$current);
|
|
58
|
-
}, [hideDate, hideTime, monthInputRef, hourInputRef]);
|
|
41
|
+
trackFocusFirstSegment();
|
|
42
|
+
}, [trackFocusFirstSegment]);
|
|
59
43
|
const handlePickerIconKeyDown = React.useCallback(e => {
|
|
60
44
|
const {
|
|
61
45
|
key
|
|
62
46
|
} = e;
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
47
|
+
if (['Home', 'End'].includes(key)) e.preventDefault();
|
|
48
|
+
if (['Home', 'End'].includes(key)) e.stopPropagation();
|
|
65
49
|
if (key === 'Home') onHomeKeyDownTriggerIcon();
|
|
66
50
|
|
|
67
51
|
if (key === 'Backspace' && withAnyInputs) {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (isWithTimeInputs) meridiemInputRef === null || meridiemInputRef === void 0 ? void 0 : (_meridiemInputRef$cur = meridiemInputRef.current) === null || _meridiemInputRef$cur === void 0 ? void 0 : (_meridiemInputRef$cur2 = _meridiemInputRef$cur.focus) === null || _meridiemInputRef$cur2 === void 0 ? void 0 : _meridiemInputRef$cur2.call(_meridiemInputRef$cur);else if (isWithDateInputs) yearInputRef === null || yearInputRef === void 0 ? void 0 : (_yearInputRef$current = yearInputRef.current) === null || _yearInputRef$current === void 0 ? void 0 : (_yearInputRef$current2 = _yearInputRef$current.focus) === null || _yearInputRef$current2 === void 0 ? void 0 : _yearInputRef$current2.call(_yearInputRef$current);
|
|
52
|
+
if (isWithTimeInputs) trackFocusMeridiemInput();else if (isWithDateInputs) trackFocusYearInput();
|
|
71
53
|
}
|
|
72
|
-
}, [isWithDateInputs, isWithTimeInputs,
|
|
54
|
+
}, [isWithDateInputs, isWithTimeInputs, onHomeKeyDownTriggerIcon, trackFocusMeridiemInput, trackFocusYearInput, withAnyInputs]);
|
|
73
55
|
const handleCurrHourOnKeyDown = React.useCallback(e => {
|
|
74
56
|
const {
|
|
75
57
|
key,
|
|
76
58
|
shiftKey
|
|
77
59
|
} = e;
|
|
78
|
-
if (
|
|
79
|
-
if (
|
|
60
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.preventDefault();
|
|
61
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.stopPropagation();
|
|
80
62
|
let didTriggerHourChange = false;
|
|
81
63
|
|
|
82
64
|
if (key === 'ArrowUp') {
|
|
@@ -90,33 +72,25 @@ const useKeyboardHandlers = _ref => {
|
|
|
90
72
|
}
|
|
91
73
|
|
|
92
74
|
if (key === 'ArrowRight') {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
currMinutesBtnRef === null || currMinutesBtnRef === void 0 ? void 0 : (_currMinutesBtnRef$cu = currMinutesBtnRef.current) === null || _currMinutesBtnRef$cu === void 0 ? void 0 : (_currMinutesBtnRef$cu2 = _currMinutesBtnRef$cu.focus) === null || _currMinutesBtnRef$cu2 === void 0 ? void 0 : _currMinutesBtnRef$cu2.call(_currMinutesBtnRef$cu);
|
|
75
|
+
trackFocusTimewheelCurrMinute();
|
|
96
76
|
}
|
|
97
77
|
|
|
98
78
|
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
99
79
|
if (key === 'End') onEndKeyDownInsideTimeWheel(); // ensure the focus is in the correct button after up/down arrow
|
|
100
80
|
|
|
101
|
-
if (didTriggerHourChange)
|
|
102
|
-
var _currHourBtnRef$curre3, _currHourBtnRef$curre4;
|
|
103
|
-
|
|
104
|
-
return currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre3 = currHourBtnRef.current) === null || _currHourBtnRef$curre3 === void 0 ? void 0 : (_currHourBtnRef$curre4 = _currHourBtnRef$curre3.focus) === null || _currHourBtnRef$curre4 === void 0 ? void 0 : _currHourBtnRef$curre4.call(_currHourBtnRef$curre3);
|
|
105
|
-
}); // TAB CYCLE IMPLEMENTATION
|
|
81
|
+
if (didTriggerHourChange) trackFocusTimewheelCurrHour(); // TAB CYCLE IMPLEMENTATION
|
|
106
82
|
|
|
107
83
|
if (!isControllerOnly) if (key === 'Tab' && shiftKey && !isWithCalendarToo) {
|
|
108
|
-
var _currMeridiemBtnRef$c3, _currMeridiemBtnRef$c4;
|
|
109
|
-
|
|
110
84
|
e.preventDefault();
|
|
111
|
-
|
|
85
|
+
trackFocusTimewheelCurrMeridiem();
|
|
112
86
|
}
|
|
113
|
-
}, [
|
|
87
|
+
}, [handleNextHour, handlePrevHour, isControllerOnly, isWithCalendarToo, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, trackFocusTimewheelCurrHour, trackFocusTimewheelCurrMeridiem, trackFocusTimewheelCurrMinute]);
|
|
114
88
|
const handleCurrMinutesOnKeyDown = React.useCallback(e => {
|
|
115
89
|
const {
|
|
116
90
|
key
|
|
117
91
|
} = e;
|
|
118
|
-
if (
|
|
119
|
-
if (
|
|
92
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.preventDefault();
|
|
93
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.stopPropagation();
|
|
120
94
|
let didTriggerMinuteChange = false;
|
|
121
95
|
|
|
122
96
|
if (key === 'ArrowUp') {
|
|
@@ -130,33 +104,25 @@ const useKeyboardHandlers = _ref => {
|
|
|
130
104
|
}
|
|
131
105
|
|
|
132
106
|
if (key === 'ArrowLeft') {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre5 = currHourBtnRef.current) === null || _currHourBtnRef$curre5 === void 0 ? void 0 : (_currHourBtnRef$curre6 = _currHourBtnRef$curre5.focus) === null || _currHourBtnRef$curre6 === void 0 ? void 0 : _currHourBtnRef$curre6.call(_currHourBtnRef$curre5);
|
|
107
|
+
trackFocusTimewheelCurrHour();
|
|
136
108
|
}
|
|
137
109
|
|
|
138
110
|
if (key === 'ArrowRight') {
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c5 = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c5 === void 0 ? void 0 : (_currMeridiemBtnRef$c6 = _currMeridiemBtnRef$c5.focus) === null || _currMeridiemBtnRef$c6 === void 0 ? void 0 : _currMeridiemBtnRef$c6.call(_currMeridiemBtnRef$c5);
|
|
111
|
+
trackFocusTimewheelCurrMeridiem();
|
|
142
112
|
}
|
|
143
113
|
|
|
144
114
|
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
145
115
|
if (key === 'End') onEndKeyDownInsideTimeWheel(); // ensure the focus is in the correct button after up/down arrow
|
|
146
116
|
|
|
147
|
-
if (didTriggerMinuteChange)
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
return currMinutesBtnRef === null || currMinutesBtnRef === void 0 ? void 0 : (_currMinutesBtnRef$cu3 = currMinutesBtnRef.current) === null || _currMinutesBtnRef$cu3 === void 0 ? void 0 : (_currMinutesBtnRef$cu4 = _currMinutesBtnRef$cu3.focus) === null || _currMinutesBtnRef$cu4 === void 0 ? void 0 : _currMinutesBtnRef$cu4.call(_currMinutesBtnRef$cu3);
|
|
151
|
-
});
|
|
152
|
-
}, [onHomeKeyDownInsideTimeWheel, onEndKeyDownInsideTimeWheel, handlePrevMinute, handleNextMinute, currHourBtnRef, currMeridiemBtnRef, currMinutesBtnRef]);
|
|
117
|
+
if (didTriggerMinuteChange) trackFocusTimewheelCurrMinute();
|
|
118
|
+
}, [onHomeKeyDownInsideTimeWheel, onEndKeyDownInsideTimeWheel, handlePrevMinute, handleNextMinute, trackFocusTimewheelCurrHour, trackFocusTimewheelCurrMeridiem, trackFocusTimewheelCurrMinute]);
|
|
153
119
|
const handleCurrMeridiemOnKeyDown = React.useCallback(e => {
|
|
154
120
|
const {
|
|
155
121
|
key,
|
|
156
122
|
shiftKey
|
|
157
123
|
} = e;
|
|
158
|
-
if (
|
|
159
|
-
if (
|
|
124
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.preventDefault();
|
|
125
|
+
if (['Home', 'End', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight'].includes(key)) e.stopPropagation();
|
|
160
126
|
let didTriggerMeridiemChange = false;
|
|
161
127
|
|
|
162
128
|
if (key === 'ArrowUp') {
|
|
@@ -170,185 +136,25 @@ const useKeyboardHandlers = _ref => {
|
|
|
170
136
|
}
|
|
171
137
|
|
|
172
138
|
if (key === 'ArrowLeft') {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
// currSecondsBtnRef?.current?.focus?.();
|
|
176
|
-
currMinutesBtnRef === null || currMinutesBtnRef === void 0 ? void 0 : (_currMinutesBtnRef$cu5 = currMinutesBtnRef.current) === null || _currMinutesBtnRef$cu5 === void 0 ? void 0 : (_currMinutesBtnRef$cu6 = _currMinutesBtnRef$cu5.focus) === null || _currMinutesBtnRef$cu6 === void 0 ? void 0 : _currMinutesBtnRef$cu6.call(_currMinutesBtnRef$cu5);
|
|
139
|
+
trackFocusTimewheelCurrMinute();
|
|
177
140
|
}
|
|
178
141
|
|
|
179
142
|
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
180
143
|
if (key === 'End') onEndKeyDownInsideTimeWheel(); // ensure the focus is in the correct button after up/down arrow
|
|
181
144
|
|
|
182
|
-
if (didTriggerMeridiemChange)
|
|
183
|
-
var _currMeridiemBtnRef$c7, _currMeridiemBtnRef$c8;
|
|
184
|
-
|
|
185
|
-
return currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c7 = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c7 === void 0 ? void 0 : (_currMeridiemBtnRef$c8 = _currMeridiemBtnRef$c7.focus) === null || _currMeridiemBtnRef$c8 === void 0 ? void 0 : _currMeridiemBtnRef$c8.call(_currMeridiemBtnRef$c7);
|
|
186
|
-
}); // TAB CYCLE IMPLEMENTATION
|
|
145
|
+
if (didTriggerMeridiemChange) trackFocusTimewheelCurrMeridiem(); // TAB CYCLE IMPLEMENTATION
|
|
187
146
|
|
|
188
147
|
if (!isControllerOnly) if (key === 'Tab' && !shiftKey) {
|
|
189
|
-
var _prevMonthBtnRef$curr3, _prevMonthBtnRef$curr4, _currHourBtnRef$curre7, _currHourBtnRef$curre8;
|
|
190
|
-
|
|
191
148
|
e.preventDefault();
|
|
192
|
-
if (isWithCalendarToo)
|
|
193
|
-
}
|
|
194
|
-
}, [currHourBtnRef, currMeridiemBtnRef, currMinutesBtnRef, handleTimeWheelBtnChangeMeridiem, isControllerOnly, isWithCalendarToo, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, prevMonthBtnRef]);
|
|
195
|
-
const handlePrevHourBtnOnKeyDown = React.useCallback(e => {
|
|
196
|
-
const {
|
|
197
|
-
key
|
|
198
|
-
} = e;
|
|
199
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
200
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
201
|
-
|
|
202
|
-
if (key === 'ArrowRight') {
|
|
203
|
-
var _prevMinutesBtnRef$cu, _prevMinutesBtnRef$cu2;
|
|
204
|
-
|
|
205
|
-
prevMinutesBtnRef === null || prevMinutesBtnRef === void 0 ? void 0 : (_prevMinutesBtnRef$cu = prevMinutesBtnRef.current) === null || _prevMinutesBtnRef$cu === void 0 ? void 0 : (_prevMinutesBtnRef$cu2 = _prevMinutesBtnRef$cu.focus) === null || _prevMinutesBtnRef$cu2 === void 0 ? void 0 : _prevMinutesBtnRef$cu2.call(_prevMinutesBtnRef$cu);
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
if (key === 'ArrowDown') {
|
|
209
|
-
var _currHourBtnRef$curre9, _currHourBtnRef$curre10;
|
|
210
|
-
|
|
211
|
-
currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre9 = currHourBtnRef.current) === null || _currHourBtnRef$curre9 === void 0 ? void 0 : (_currHourBtnRef$curre10 = _currHourBtnRef$curre9.focus) === null || _currHourBtnRef$curre10 === void 0 ? void 0 : _currHourBtnRef$curre10.call(_currHourBtnRef$curre9);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
215
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
216
|
-
}, [currHourBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, prevMinutesBtnRef]);
|
|
217
|
-
const handlePrevMinuteBtnOnKeyDown = React.useCallback(e => {
|
|
218
|
-
const {
|
|
219
|
-
key
|
|
220
|
-
} = e;
|
|
221
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
222
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
223
|
-
|
|
224
|
-
if (key === 'ArrowRight') {
|
|
225
|
-
var _prevMeridiemBtnRef$c, _prevMeridiemBtnRef$c2;
|
|
226
|
-
|
|
227
|
-
// prevSecondsBtnRef?.current?.focus?.();
|
|
228
|
-
prevMeridiemBtnRef === null || prevMeridiemBtnRef === void 0 ? void 0 : (_prevMeridiemBtnRef$c = prevMeridiemBtnRef.current) === null || _prevMeridiemBtnRef$c === void 0 ? void 0 : (_prevMeridiemBtnRef$c2 = _prevMeridiemBtnRef$c.focus) === null || _prevMeridiemBtnRef$c2 === void 0 ? void 0 : _prevMeridiemBtnRef$c2.call(_prevMeridiemBtnRef$c);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
if (key === 'ArrowLeft') {
|
|
232
|
-
var _prevHourBtnRef$curre, _prevHourBtnRef$curre2;
|
|
233
|
-
|
|
234
|
-
prevHourBtnRef === null || prevHourBtnRef === void 0 ? void 0 : (_prevHourBtnRef$curre = prevHourBtnRef.current) === null || _prevHourBtnRef$curre === void 0 ? void 0 : (_prevHourBtnRef$curre2 = _prevHourBtnRef$curre.focus) === null || _prevHourBtnRef$curre2 === void 0 ? void 0 : _prevHourBtnRef$curre2.call(_prevHourBtnRef$curre);
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
if (key === 'ArrowDown') {
|
|
238
|
-
var _currMinutesBtnRef$cu7, _currMinutesBtnRef$cu8;
|
|
239
|
-
|
|
240
|
-
currMinutesBtnRef === null || currMinutesBtnRef === void 0 ? void 0 : (_currMinutesBtnRef$cu7 = currMinutesBtnRef.current) === null || _currMinutesBtnRef$cu7 === void 0 ? void 0 : (_currMinutesBtnRef$cu8 = _currMinutesBtnRef$cu7.focus) === null || _currMinutesBtnRef$cu8 === void 0 ? void 0 : _currMinutesBtnRef$cu8.call(_currMinutesBtnRef$cu7);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
244
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
245
|
-
}, [currMinutesBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, prevHourBtnRef, prevMeridiemBtnRef]);
|
|
246
|
-
const handlePrevMeridiemBtnOnKeyDown = React.useCallback(e => {
|
|
247
|
-
const {
|
|
248
|
-
key
|
|
249
|
-
} = e;
|
|
250
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
251
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
252
|
-
|
|
253
|
-
if (key === 'ArrowLeft') {
|
|
254
|
-
var _prevMinutesBtnRef$cu3, _prevMinutesBtnRef$cu4;
|
|
255
|
-
|
|
256
|
-
prevMinutesBtnRef === null || prevMinutesBtnRef === void 0 ? void 0 : (_prevMinutesBtnRef$cu3 = prevMinutesBtnRef.current) === null || _prevMinutesBtnRef$cu3 === void 0 ? void 0 : (_prevMinutesBtnRef$cu4 = _prevMinutesBtnRef$cu3.focus) === null || _prevMinutesBtnRef$cu4 === void 0 ? void 0 : _prevMinutesBtnRef$cu4.call(_prevMinutesBtnRef$cu3);
|
|
149
|
+
if (isWithCalendarToo) trackFocusCalendarPrevMonth();else trackFocusTimewheelCurrHour();
|
|
257
150
|
}
|
|
258
|
-
|
|
259
|
-
if (key === 'ArrowDown') {
|
|
260
|
-
var _currMeridiemBtnRef$c9, _currMeridiemBtnRef$c10;
|
|
261
|
-
|
|
262
|
-
currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c9 = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c9 === void 0 ? void 0 : (_currMeridiemBtnRef$c10 = _currMeridiemBtnRef$c9.focus) === null || _currMeridiemBtnRef$c10 === void 0 ? void 0 : _currMeridiemBtnRef$c10.call(_currMeridiemBtnRef$c9);
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
266
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
267
|
-
}, [currMeridiemBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, prevMinutesBtnRef]);
|
|
268
|
-
const handleNextHourBtnOnKeyDown = React.useCallback(e => {
|
|
269
|
-
const {
|
|
270
|
-
key
|
|
271
|
-
} = e;
|
|
272
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
273
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
274
|
-
|
|
275
|
-
if (key === 'ArrowRight') {
|
|
276
|
-
var _nextMinutesBtnRef$cu, _nextMinutesBtnRef$cu2;
|
|
277
|
-
|
|
278
|
-
nextMinutesBtnRef === null || nextMinutesBtnRef === void 0 ? void 0 : (_nextMinutesBtnRef$cu = nextMinutesBtnRef.current) === null || _nextMinutesBtnRef$cu === void 0 ? void 0 : (_nextMinutesBtnRef$cu2 = _nextMinutesBtnRef$cu.focus) === null || _nextMinutesBtnRef$cu2 === void 0 ? void 0 : _nextMinutesBtnRef$cu2.call(_nextMinutesBtnRef$cu);
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
if (key === 'ArrowUp') {
|
|
282
|
-
var _currHourBtnRef$curre11, _currHourBtnRef$curre12;
|
|
283
|
-
|
|
284
|
-
currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre11 = currHourBtnRef.current) === null || _currHourBtnRef$curre11 === void 0 ? void 0 : (_currHourBtnRef$curre12 = _currHourBtnRef$curre11.focus) === null || _currHourBtnRef$curre12 === void 0 ? void 0 : _currHourBtnRef$curre12.call(_currHourBtnRef$curre11);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
288
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
289
|
-
}, [currHourBtnRef, nextMinutesBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel]);
|
|
290
|
-
const handleNextMinuteBtnOnKeyDown = React.useCallback(e => {
|
|
291
|
-
const {
|
|
292
|
-
key
|
|
293
|
-
} = e;
|
|
294
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
295
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
296
|
-
|
|
297
|
-
if (key === 'ArrowRight') {
|
|
298
|
-
var _nextMeridiemBtnRef$c, _nextMeridiemBtnRef$c2;
|
|
299
|
-
|
|
300
|
-
nextMeridiemBtnRef === null || nextMeridiemBtnRef === void 0 ? void 0 : (_nextMeridiemBtnRef$c = nextMeridiemBtnRef.current) === null || _nextMeridiemBtnRef$c === void 0 ? void 0 : (_nextMeridiemBtnRef$c2 = _nextMeridiemBtnRef$c.focus) === null || _nextMeridiemBtnRef$c2 === void 0 ? void 0 : _nextMeridiemBtnRef$c2.call(_nextMeridiemBtnRef$c);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (key === 'ArrowLeft') {
|
|
304
|
-
var _nextHourBtnRef$curre, _nextHourBtnRef$curre2;
|
|
305
|
-
|
|
306
|
-
nextHourBtnRef === null || nextHourBtnRef === void 0 ? void 0 : (_nextHourBtnRef$curre = nextHourBtnRef.current) === null || _nextHourBtnRef$curre === void 0 ? void 0 : (_nextHourBtnRef$curre2 = _nextHourBtnRef$curre.focus) === null || _nextHourBtnRef$curre2 === void 0 ? void 0 : _nextHourBtnRef$curre2.call(_nextHourBtnRef$curre);
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
if (key === 'ArrowUp') {
|
|
310
|
-
var _currMinutesBtnRef$cu9, _currMinutesBtnRef$cu10;
|
|
311
|
-
|
|
312
|
-
currMinutesBtnRef === null || currMinutesBtnRef === void 0 ? void 0 : (_currMinutesBtnRef$cu9 = currMinutesBtnRef.current) === null || _currMinutesBtnRef$cu9 === void 0 ? void 0 : (_currMinutesBtnRef$cu10 = _currMinutesBtnRef$cu9.focus) === null || _currMinutesBtnRef$cu10 === void 0 ? void 0 : _currMinutesBtnRef$cu10.call(_currMinutesBtnRef$cu9);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
316
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
317
|
-
}, [currMinutesBtnRef, nextHourBtnRef, nextMeridiemBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel]);
|
|
318
|
-
const handleNextMeridiemBtnOnKeyDown = React.useCallback(e => {
|
|
319
|
-
const {
|
|
320
|
-
key
|
|
321
|
-
} = e;
|
|
322
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.preventDefault();
|
|
323
|
-
if (constants.homeEndAllArrowKeys.includes(key)) e.stopPropagation();
|
|
324
|
-
|
|
325
|
-
if (key === 'ArrowLeft') {
|
|
326
|
-
var _nextMinutesBtnRef$cu3, _nextMinutesBtnRef$cu4;
|
|
327
|
-
|
|
328
|
-
nextMinutesBtnRef === null || nextMinutesBtnRef === void 0 ? void 0 : (_nextMinutesBtnRef$cu3 = nextMinutesBtnRef.current) === null || _nextMinutesBtnRef$cu3 === void 0 ? void 0 : (_nextMinutesBtnRef$cu4 = _nextMinutesBtnRef$cu3.focus) === null || _nextMinutesBtnRef$cu4 === void 0 ? void 0 : _nextMinutesBtnRef$cu4.call(_nextMinutesBtnRef$cu3);
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
if (key === 'ArrowUp') {
|
|
332
|
-
var _currMeridiemBtnRef$c11, _currMeridiemBtnRef$c12;
|
|
333
|
-
|
|
334
|
-
currMeridiemBtnRef === null || currMeridiemBtnRef === void 0 ? void 0 : (_currMeridiemBtnRef$c11 = currMeridiemBtnRef.current) === null || _currMeridiemBtnRef$c11 === void 0 ? void 0 : (_currMeridiemBtnRef$c12 = _currMeridiemBtnRef$c11.focus) === null || _currMeridiemBtnRef$c12 === void 0 ? void 0 : _currMeridiemBtnRef$c12.call(_currMeridiemBtnRef$c11);
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
if (key === 'Home') onHomeKeyDownInsideTimeWheel();
|
|
338
|
-
if (key === 'End') onEndKeyDownInsideTimeWheel();
|
|
339
|
-
}, [currMeridiemBtnRef, nextMinutesBtnRef, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel]);
|
|
151
|
+
}, [handleTimeWheelBtnChangeMeridiem, isControllerOnly, isWithCalendarToo, onEndKeyDownInsideTimeWheel, onHomeKeyDownInsideTimeWheel, trackFocusCalendarPrevMonth, trackFocusTimewheelCurrHour, trackFocusTimewheelCurrMeridiem, trackFocusTimewheelCurrMinute]);
|
|
340
152
|
return React.useMemo(() => ({
|
|
341
|
-
handlePrevHourBtnOnKeyDown,
|
|
342
153
|
handleCurrHourOnKeyDown,
|
|
343
|
-
handleNextHourBtnOnKeyDown,
|
|
344
|
-
handlePrevMinuteBtnOnKeyDown,
|
|
345
154
|
handleCurrMinutesOnKeyDown,
|
|
346
|
-
handleNextMinuteBtnOnKeyDown,
|
|
347
|
-
handlePrevMeridiemBtnOnKeyDown,
|
|
348
155
|
handleCurrMeridiemOnKeyDown,
|
|
349
|
-
handleNextMeridiemBtnOnKeyDown,
|
|
350
156
|
handlePickerIconKeyDown
|
|
351
|
-
}), [handleCurrHourOnKeyDown, handleCurrMeridiemOnKeyDown, handleCurrMinutesOnKeyDown,
|
|
157
|
+
}), [handleCurrHourOnKeyDown, handleCurrMeridiemOnKeyDown, handleCurrMinutesOnKeyDown, handlePickerIconKeyDown]);
|
|
352
158
|
};
|
|
353
159
|
|
|
354
160
|
exports.useKeyboardHandlers = useKeyboardHandlers;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var reactPopper = require('react-popper');
|
|
8
7
|
var ControlledDateTimePickerCTX = require('../../../ControlledDateTimePickerCTX.js');
|
|
@@ -15,8 +14,11 @@ const usePopperTriggerLogic = () => {
|
|
|
15
14
|
onPickerClose,
|
|
16
15
|
onPickerOpen
|
|
17
16
|
},
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
isWithCalendarToo,
|
|
18
|
+
trackFocusTimewheelCurrHour,
|
|
19
|
+
trackFocusPicker,
|
|
20
|
+
latestInteractionRegion,
|
|
21
|
+
currFocusDescriber
|
|
20
22
|
} = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
21
23
|
const [showTimePicker, setShowTimePicker] = React.useState(false);
|
|
22
24
|
const [referenceElement, setReferenceElement] = React.useState(null);
|
|
@@ -38,37 +40,30 @@ const usePopperTriggerLogic = () => {
|
|
|
38
40
|
setShowTimePicker(oldShowCalendar => {
|
|
39
41
|
if (!oldShowCalendar) {
|
|
40
42
|
onPickerOpen();
|
|
41
|
-
if (!isWithCalendarToo)
|
|
42
|
-
var _currHourBtnRef$curre, _currHourBtnRef$curre2;
|
|
43
|
-
|
|
44
|
-
return currHourBtnRef === null || currHourBtnRef === void 0 ? void 0 : (_currHourBtnRef$curre = currHourBtnRef.current) === null || _currHourBtnRef$curre === void 0 ? void 0 : (_currHourBtnRef$curre2 = _currHourBtnRef$curre.focus) === null || _currHourBtnRef$curre2 === void 0 ? void 0 : _currHourBtnRef$curre2.call(_currHourBtnRef$curre);
|
|
45
|
-
});
|
|
43
|
+
if (!isWithCalendarToo) trackFocusTimewheelCurrHour();
|
|
46
44
|
} else onPickerClose();
|
|
47
45
|
|
|
48
46
|
return !oldShowCalendar;
|
|
49
47
|
});
|
|
50
|
-
}, [
|
|
48
|
+
}, [isWithCalendarToo, onPickerClose, onPickerOpen, trackFocusTimewheelCurrHour]);
|
|
51
49
|
useOnClickOutside.useOnClickOutside(popperElement, e => {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (e.target instanceof Element && !(pickerButtonRef !== null && pickerButtonRef !== void 0 && (_pickerButtonRef$curr = pickerButtonRef.current) !== null && _pickerButtonRef$curr !== void 0 && (_pickerButtonRef$curr2 = _pickerButtonRef$curr.contains) !== null && _pickerButtonRef$curr2 !== void 0 && _pickerButtonRef$curr2.call(_pickerButtonRef$curr, e === null || e === void 0 ? void 0 : e.target))) closeTimePicker();
|
|
50
|
+
if (e.target instanceof Element && !pickerButtonRef?.current?.contains?.(e?.target)) closeTimePicker();
|
|
55
51
|
});
|
|
56
52
|
const handleSetTriggerRef = React.useCallback(newRef => {
|
|
57
53
|
pickerButtonRef.current = newRef;
|
|
58
54
|
setReferenceElement(newRef);
|
|
59
|
-
|
|
55
|
+
if (latestInteractionRegion === 'picker-icon' && currFocusDescriber === 'time-picker-icon') newRef?.focus();
|
|
56
|
+
}, [currFocusDescriber, latestInteractionRegion, pickerButtonRef]);
|
|
60
57
|
const handleMenuWrapperKeyDown = React.useCallback(e => {
|
|
61
58
|
const {
|
|
62
59
|
key
|
|
63
60
|
} = e;
|
|
64
61
|
|
|
65
62
|
if (key === 'Escape') {
|
|
66
|
-
var _pickerButtonRef$curr3, _pickerButtonRef$curr4;
|
|
67
|
-
|
|
68
63
|
closeTimePicker();
|
|
69
|
-
|
|
64
|
+
trackFocusPicker();
|
|
70
65
|
}
|
|
71
|
-
}, [closeTimePicker,
|
|
66
|
+
}, [closeTimePicker, trackFocusPicker]);
|
|
72
67
|
return React.useMemo(() => ({
|
|
73
68
|
showTimePicker,
|
|
74
69
|
setShowTimePicker,
|
|
@@ -26,7 +26,7 @@ const Styled2DigitsInput = /*#__PURE__*/styled__default["default"](ResettedInput
|
|
|
26
26
|
let {
|
|
27
27
|
disabled
|
|
28
28
|
} = _ref;
|
|
29
|
-
return disabled ?
|
|
29
|
+
return disabled ? `color: #616b7f;` : ``;
|
|
30
30
|
});
|
|
31
31
|
const StyledMin4DigitsInput = /*#__PURE__*/styled__default["default"](ResettedInput).withConfig({
|
|
32
32
|
componentId: "sc-2wbvze-4"
|
|
@@ -34,7 +34,7 @@ const StyledMin4DigitsInput = /*#__PURE__*/styled__default["default"](ResettedIn
|
|
|
34
34
|
let {
|
|
35
35
|
disabled
|
|
36
36
|
} = _ref2;
|
|
37
|
-
return disabled ?
|
|
37
|
+
return disabled ? `color: #616b7f;` : ``;
|
|
38
38
|
});
|
|
39
39
|
const StyledInputsWrapperGrid = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
40
40
|
componentId: "sc-2wbvze-5"
|
|
@@ -42,7 +42,11 @@ const StyledInputsWrapperGrid = /*#__PURE__*/styled__default["default"](dsGrid.G
|
|
|
42
42
|
let {
|
|
43
43
|
isControllerOnly
|
|
44
44
|
} = _ref3;
|
|
45
|
-
return isControllerOnly ?
|
|
45
|
+
return isControllerOnly ? `` : `
|
|
46
|
+
height: 28px;
|
|
47
|
+
border-width: 1px;
|
|
48
|
+
border-style: solid;
|
|
49
|
+
`;
|
|
46
50
|
}, _ref4 => {
|
|
47
51
|
let {
|
|
48
52
|
theme,
|
|
@@ -67,7 +71,7 @@ const StyledInputsWrapperGrid = /*#__PURE__*/styled__default["default"](dsGrid.G
|
|
|
67
71
|
theme,
|
|
68
72
|
disabled
|
|
69
73
|
} = _ref7;
|
|
70
|
-
return disabled ?
|
|
74
|
+
return disabled ? `background-color: ${theme.colors.neutral[100]};` : ``;
|
|
71
75
|
});
|
|
72
76
|
const StyledDateInputsWrapperGrid = /*#__PURE__*/styled__default["default"].div.withConfig({
|
|
73
77
|
componentId: "sc-2wbvze-6"
|
|
@@ -81,14 +85,16 @@ const StyledPickersIconsWrapperGrid = /*#__PURE__*/styled__default["default"](ds
|
|
|
81
85
|
let {
|
|
82
86
|
isControllerOnly
|
|
83
87
|
} = _ref8;
|
|
84
|
-
return isControllerOnly ?
|
|
88
|
+
return isControllerOnly ? `` : `height: 26px;`;
|
|
85
89
|
}, _ref9 => {
|
|
86
90
|
let {
|
|
87
91
|
theme,
|
|
88
92
|
isControllerOnly,
|
|
89
93
|
hasError
|
|
90
94
|
} = _ref9;
|
|
91
|
-
return isControllerOnly ?
|
|
95
|
+
return isControllerOnly ? `` : `
|
|
96
|
+
border-left: 1px solid ${hasError ? theme.colors.danger[900] : theme.colors.neutral[200]}
|
|
97
|
+
`;
|
|
92
98
|
});
|
|
93
99
|
const StyledFocusWithIn = /*#__PURE__*/styled__default["default"](dsGrid.Grid).withConfig({
|
|
94
100
|
componentId: "sc-2wbvze-9"
|
|
@@ -30,7 +30,8 @@ const HHInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
30
30
|
placeholder,
|
|
31
31
|
ariaCurrentValueForInputs,
|
|
32
32
|
contextRef,
|
|
33
|
-
autoFocusHourInput
|
|
33
|
+
autoFocusHourInput,
|
|
34
|
+
isFocused
|
|
34
35
|
} = _ref;
|
|
35
36
|
const validateOnChange = React.useCallback(e => {
|
|
36
37
|
if (isInvalidHour(e.target.value)) {
|
|
@@ -47,9 +48,12 @@ const HHInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
47
48
|
onFocus: onFocus,
|
|
48
49
|
onKeyDown: onKeyDown,
|
|
49
50
|
value: value,
|
|
50
|
-
ref:
|
|
51
|
+
ref: DomElem => {
|
|
52
|
+
contextRef.current = DomElem;
|
|
53
|
+
if (isFocused) DomElem?.focus?.();
|
|
54
|
+
},
|
|
51
55
|
placeholder: placeholder,
|
|
52
|
-
"aria-label":
|
|
56
|
+
"aria-label": `hours input field ${ariaCurrentValueForInputs}`,
|
|
53
57
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.HOUR,
|
|
54
58
|
disabled: disabled,
|
|
55
59
|
"aria-disabled": disabled
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var Styleds = require('../Styleds.js');
|
|
8
7
|
var ControlledDateTimePickerDatatestid = require('../../ControlledDateTimePickerDatatestid.js');
|
|
@@ -33,12 +32,11 @@ const MeridiemInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
33
32
|
disabled,
|
|
34
33
|
placeholder,
|
|
35
34
|
ariaCurrentValueForInputs,
|
|
36
|
-
contextRef
|
|
35
|
+
contextRef,
|
|
36
|
+
isFocused
|
|
37
37
|
} = _ref;
|
|
38
38
|
const validateOnChange = React.useCallback(e => {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (isInvalidMeridiem(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
|
|
39
|
+
if (isInvalidMeridiem(e?.target?.value)) {
|
|
42
40
|
e.preventDefault();
|
|
43
41
|
return;
|
|
44
42
|
}
|
|
@@ -51,9 +49,12 @@ const MeridiemInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
51
49
|
onFocus: onFocus,
|
|
52
50
|
onKeyDown: onKeyDown,
|
|
53
51
|
value: value,
|
|
54
|
-
ref:
|
|
52
|
+
ref: DomElem => {
|
|
53
|
+
contextRef.current = DomElem;
|
|
54
|
+
if (isFocused) DomElem?.focus?.();
|
|
55
|
+
},
|
|
55
56
|
placeholder: placeholder,
|
|
56
|
-
"aria-label":
|
|
57
|
+
"aria-label": `meridiem input field ${ariaCurrentValueForInputs}`,
|
|
57
58
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MERIDIEM,
|
|
58
59
|
disabled: disabled,
|
|
59
60
|
"aria-disabled": disabled
|
|
@@ -29,12 +29,11 @@ const MinutesInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
29
29
|
disabled,
|
|
30
30
|
placeholder,
|
|
31
31
|
ariaCurrentValueForInputs,
|
|
32
|
-
contextRef
|
|
32
|
+
contextRef,
|
|
33
|
+
isFocused
|
|
33
34
|
} = _ref;
|
|
34
35
|
const validateOnChange = React.useCallback(e => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (isInvalidMinute(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
|
|
36
|
+
if (isInvalidMinute(e?.target?.value)) {
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
@@ -47,9 +46,12 @@ const MinutesInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
47
46
|
onFocus: onFocus,
|
|
48
47
|
onKeyDown: onKeyDown,
|
|
49
48
|
value: value,
|
|
50
|
-
ref:
|
|
49
|
+
ref: DomElem => {
|
|
50
|
+
contextRef.current = DomElem;
|
|
51
|
+
if (isFocused) DomElem?.focus?.();
|
|
52
|
+
},
|
|
51
53
|
placeholder: placeholder,
|
|
52
|
-
"aria-label":
|
|
54
|
+
"aria-label": `minutes input field ${ariaCurrentValueForInputs}`,
|
|
53
55
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.TIME_INPUTS.MINUTE,
|
|
54
56
|
disabled: disabled,
|
|
55
57
|
"aria-disabled": disabled
|
|
@@ -43,7 +43,9 @@ const TimeInputs = () => {
|
|
|
43
43
|
hourInputRef,
|
|
44
44
|
minutesInputRef,
|
|
45
45
|
meridiemInputRef,
|
|
46
|
-
ariaCurrentValueForInputs
|
|
46
|
+
ariaCurrentValueForInputs,
|
|
47
|
+
latestInteractionRegion,
|
|
48
|
+
currFocusDescriber
|
|
47
49
|
} = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
48
50
|
return /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
49
51
|
cols: [config.fixedValues.smallInputWidth, config.fixedValues.separatorWidth, config.fixedValues.smallInputWidth, config.fixedValues.separatorWidth, config.fixedValues.smallInputWidth]
|
|
@@ -57,29 +59,32 @@ const TimeInputs = () => {
|
|
|
57
59
|
placeholder: "HH",
|
|
58
60
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
59
61
|
autoFocusHourInput: autoFocusHourInput,
|
|
60
|
-
disabled: disabled
|
|
62
|
+
disabled: disabled,
|
|
63
|
+
isFocused: latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'hour-input'
|
|
61
64
|
})), _StyledColonSeparator || (_StyledColonSeparator = /*#__PURE__*/_jsx__default["default"](Styleds.StyledColonSeparator, {
|
|
62
65
|
alignItems: "center"
|
|
63
66
|
}, void 0, ":")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](MinutesInput.MinutesInput, {
|
|
64
67
|
value: minutes,
|
|
65
68
|
onChange: onMinutesChange,
|
|
66
69
|
onBlur: onMinutesBlur,
|
|
67
|
-
onFocus:
|
|
70
|
+
onFocus: onMinutesFocus,
|
|
68
71
|
onKeyDown: onMinutesKeyDown,
|
|
69
72
|
contextRef: minutesInputRef,
|
|
70
73
|
placeholder: "MM",
|
|
71
74
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
72
|
-
disabled: disabled
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
isFocused: latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'minute-input'
|
|
73
77
|
})), _StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](Styleds.StyledSeparator, {}, void 0, " ")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](MeridiemInput.MeridiemInput, {
|
|
74
78
|
value: meridiem,
|
|
75
79
|
onChange: onMeridiemChange,
|
|
76
80
|
onBlur: onMeridiemBlur,
|
|
77
|
-
onFocus:
|
|
81
|
+
onFocus: onMeridiemFocus,
|
|
78
82
|
onKeyDown: onMeridiemKeyDown,
|
|
79
83
|
contextRef: meridiemInputRef,
|
|
80
84
|
placeholder: "AM",
|
|
81
85
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
82
|
-
disabled: disabled
|
|
86
|
+
disabled: disabled,
|
|
87
|
+
isFocused: latestInteractionRegion === 'time-inputs' && currFocusDescriber === 'meridiem-input'
|
|
83
88
|
})));
|
|
84
89
|
};
|
|
85
90
|
|