@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
|
@@ -2,46 +2,77 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/es.error.cause.js');
|
|
5
6
|
var stringHelpers = require('../utils/stringHelpers.js');
|
|
6
7
|
var numberHelpers = require('../utils/numberHelpers.js');
|
|
7
8
|
var typeGuards = require('../utils/typeGuards.js');
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
const PREPEND = `ControlledDateTimePicker:
|
|
11
|
+
Invalid configuration detected::
|
|
12
|
+
|
|
13
|
+
`;
|
|
11
14
|
const NOT_A_DEFECT = ''; // '\n\n\t\tThis is not a defect, please check\n\n\t\thttps://qa.dimsum.rd.elliemae.io/?path=/story/components-desktop-components-d-controlledform-date-time-picker--basic\n\n\t\tfor instructions on how to use the component correctly\n\n';
|
|
12
15
|
|
|
13
|
-
const INLINE_RECEIVED_PREPEND =
|
|
16
|
+
const INLINE_RECEIVED_PREPEND = `
|
|
17
|
+
|
|
18
|
+
Received:`;
|
|
14
19
|
|
|
15
20
|
const throwInvalidDateTimeError = invalidValue => {
|
|
16
|
-
throw new Error(
|
|
21
|
+
throw new Error(`${PREPEND}the "dateTime" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
|
|
17
22
|
};
|
|
18
23
|
|
|
19
24
|
const throwInvalidDaterror = invalidValue => {
|
|
20
|
-
throw new Error(
|
|
25
|
+
throw new Error(`${PREPEND}the "date" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
|
|
21
26
|
};
|
|
22
27
|
|
|
23
28
|
const throwInvalidTimerror = invalidValue => {
|
|
24
|
-
throw new Error(
|
|
29
|
+
throw new Error(`${PREPEND}the "time" you are providing is not respecting the format it must respect.${INLINE_RECEIVED_PREPEND}${invalidValue}(${typeof invalidValue})${NOT_A_DEFECT}`);
|
|
25
30
|
};
|
|
26
31
|
|
|
27
32
|
const throwUncontrolledDateError = (date, onDateChange) => {
|
|
28
|
-
throw new Error(
|
|
33
|
+
throw new Error(`${PREPEND}you are trying to use a date selector while providing a non-string "date" or providing a non-function to "onDateChange"
|
|
34
|
+
the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
|
|
35
|
+
|
|
36
|
+
Received:
|
|
37
|
+
date: ${date}(${typeof date})
|
|
38
|
+
onDateChange: (${typeof onDateChange})
|
|
39
|
+
${NOT_A_DEFECT}`);
|
|
29
40
|
};
|
|
30
41
|
|
|
31
42
|
const throwUncontrolledTimeError = (time, onTimeChange) => {
|
|
32
|
-
throw new Error(
|
|
43
|
+
throw new Error(`${PREPEND}you are trying to use a time selector while providing a non-string "time" or providing a non-function to "onTimeChange"
|
|
44
|
+
the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
|
|
45
|
+
|
|
46
|
+
Received:
|
|
47
|
+
time: ${time}(${typeof time})
|
|
48
|
+
onTimeChange: (${typeof onTimeChange})
|
|
49
|
+
${NOT_A_DEFECT}`);
|
|
33
50
|
};
|
|
34
51
|
|
|
35
52
|
const throwUncontrolledDateTimeError = (dateTime, onDateTimeChange) => {
|
|
36
|
-
throw new Error(
|
|
53
|
+
throw new Error(`${PREPEND}you are trying to use a date-time selector while providing a non-string "dateTime" or providing a non-function to "onDateTimeChange"
|
|
54
|
+
the full-controlled pattern must be used\n\tcheck https://reactjs.org/docs/forms.html#controlled-components for more informations
|
|
55
|
+
|
|
56
|
+
Received:
|
|
57
|
+
dateTime: ${dateTime}(${typeof dateTime})
|
|
58
|
+
onDateTimeChange: (${typeof onDateTimeChange})
|
|
59
|
+
${NOT_A_DEFECT}`);
|
|
37
60
|
};
|
|
38
61
|
|
|
39
62
|
const throwInvalidEmptyPickerStartingMonthError = emptyPickerStartingMonth => {
|
|
40
|
-
throw new Error(
|
|
63
|
+
throw new Error(`${PREPEND}the provided emptyPickerStartingMonth props is invalid. please provide a string with the format mm/__/yyyy, (mm 01~12, yyyy 0001~9999)
|
|
64
|
+
|
|
65
|
+
Received:
|
|
66
|
+
${emptyPickerStartingMonth}(${typeof emptyPickerStartingMonth})
|
|
67
|
+
${NOT_A_DEFECT}`);
|
|
41
68
|
};
|
|
42
69
|
|
|
43
70
|
const throwInvalidOnCalendarOpenFocusedDayError = onCalendarOpenFocusedDay => {
|
|
44
|
-
throw new Error(
|
|
71
|
+
throw new Error(`${PREPEND}the provided onCalendarOpenFocusedDay props is invalid. please provide a string with the format mm/dd/yyyy, (mm 01~12, dd 01~31, yyyy 0001~9999)
|
|
72
|
+
|
|
73
|
+
Received:
|
|
74
|
+
${onCalendarOpenFocusedDay}(${typeof onCalendarOpenFocusedDay})
|
|
75
|
+
${NOT_A_DEFECT}`);
|
|
45
76
|
};
|
|
46
77
|
|
|
47
78
|
const useValidateProps = props => {
|
|
@@ -9,12 +9,13 @@ require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
|
9
9
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
10
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
-
require('react');
|
|
12
|
+
var React = require('react');
|
|
13
13
|
var dsIcons = require('@elliemae/ds-icons');
|
|
14
14
|
var dsIcon = require('@elliemae/ds-icon');
|
|
15
15
|
var DSButton = require('@elliemae/ds-button');
|
|
16
16
|
var Styleds = require('../Styleds.js');
|
|
17
17
|
var ControlledDateTimePickerDatatestid = require('../../ControlledDateTimePickerDatatestid.js');
|
|
18
|
+
var ControlledDateTimePickerCTX = require('../../ControlledDateTimePickerCTX.js');
|
|
18
19
|
var useClearButton = require('./useClearButton.js');
|
|
19
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
20
21
|
|
|
@@ -36,12 +37,19 @@ const ClearButton = () => {
|
|
|
36
37
|
const styledsAttrs = {
|
|
37
38
|
shouldDisplay: withClearBtn
|
|
38
39
|
};
|
|
40
|
+
const {
|
|
41
|
+
latestInteractionRegion,
|
|
42
|
+
currFocusDescriber
|
|
43
|
+
} = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
39
44
|
return /*#__PURE__*/jsxRuntime.jsx(Styleds.StyledClearButton, _objectSpread(_objectSpread({
|
|
40
45
|
"aria-label": "clear selected date",
|
|
41
46
|
buttonType: "icon",
|
|
42
47
|
size: DSButton.BUTTON_SIZES.M,
|
|
43
48
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.CLEAR_BUTTON,
|
|
44
|
-
innerRef:
|
|
49
|
+
innerRef: DomElem => {
|
|
50
|
+
clearButtonRef.current = DomElem;
|
|
51
|
+
if (latestInteractionRegion === 'clear-btn' && currFocusDescriber === 'clear-btn') DomElem?.focus?.();
|
|
52
|
+
},
|
|
45
53
|
onClick: onClearClick,
|
|
46
54
|
onKeyDown: onClearButtonKeyDown
|
|
47
55
|
}, styledsAttrs), {}, {
|
|
@@ -15,32 +15,21 @@ const useClearButton = () => {
|
|
|
15
15
|
withAnyInputs,
|
|
16
16
|
isWithTimeInputs,
|
|
17
17
|
isWithDateInputs,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
meridiemInputRef,
|
|
23
|
-
yearInputRef,
|
|
24
|
-
setLatestInteractionRegion
|
|
18
|
+
trackFocusFirstSegment,
|
|
19
|
+
trackFocusMeridiemInput,
|
|
20
|
+
trackFocusYearInput,
|
|
21
|
+
trackFocusPicker
|
|
25
22
|
} = React.useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
26
|
-
const focusFirstRegion = React.useCallback(() => {
|
|
27
|
-
var _hourInputRef$current, _hourInputRef$current2, _monthInputRef$curren, _monthInputRef$curren2;
|
|
28
|
-
|
|
29
|
-
if (withAnyInputs) if (isTimeSelector) 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);else 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);
|
|
30
|
-
}, [withAnyInputs, isTimeSelector, hourInputRef, monthInputRef]);
|
|
31
23
|
const onClearClick = React.useCallback(e => {
|
|
32
24
|
handleClearAll(e);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}, [focusFirstRegion, handleClearAll, setLatestInteractionRegion]);
|
|
25
|
+
trackFocusFirstSegment();
|
|
26
|
+
}, [handleClearAll, trackFocusFirstSegment]);
|
|
36
27
|
const onHomeKeyDown = React.useCallback(() => {
|
|
37
|
-
|
|
38
|
-
}, [
|
|
28
|
+
trackFocusFirstSegment();
|
|
29
|
+
}, [trackFocusFirstSegment]);
|
|
39
30
|
const onEndKeyDown = React.useCallback(() => {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
if (withAnyPicker) pickerButtonRef === null || pickerButtonRef === void 0 ? void 0 : (_pickerButtonRef$curr = pickerButtonRef.current) === null || _pickerButtonRef$curr === void 0 ? void 0 : (_pickerButtonRef$curr2 = _pickerButtonRef$curr.focus) === null || _pickerButtonRef$curr2 === void 0 ? void 0 : _pickerButtonRef$curr2.call(_pickerButtonRef$curr);
|
|
43
|
-
}, [withAnyPicker, pickerButtonRef]);
|
|
31
|
+
if (withAnyPicker) trackFocusPicker();
|
|
32
|
+
}, [withAnyPicker, trackFocusPicker]);
|
|
44
33
|
const onClearButtonKeyDown = React.useCallback(e => {
|
|
45
34
|
const {
|
|
46
35
|
key
|
|
@@ -53,11 +42,9 @@ const useClearButton = () => {
|
|
|
53
42
|
if (key === 'End') onEndKeyDown();
|
|
54
43
|
|
|
55
44
|
if (key === 'Backspace' && withAnyInputs) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
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);
|
|
45
|
+
if (isWithTimeInputs) trackFocusMeridiemInput();else if (isWithDateInputs) trackFocusYearInput();
|
|
59
46
|
}
|
|
60
|
-
}, [isWithDateInputs, isWithTimeInputs,
|
|
47
|
+
}, [isWithDateInputs, isWithTimeInputs, onEndKeyDown, onHomeKeyDown, trackFocusMeridiemInput, trackFocusYearInput, withAnyInputs]);
|
|
61
48
|
return React.useMemo(() => ({
|
|
62
49
|
onClearClick,
|
|
63
50
|
onClearButtonKeyDown,
|
|
@@ -41,13 +41,13 @@ const ControlledDateTimePickerContent = () => {
|
|
|
41
41
|
hideTime,
|
|
42
42
|
hideTimePicker,
|
|
43
43
|
hideDateTimePicker,
|
|
44
|
-
setLatestInteractionRegion,
|
|
45
44
|
withAnyPicker,
|
|
46
45
|
withAnyRightController,
|
|
47
46
|
shouldPreserveClearableSpace,
|
|
48
47
|
isControllerOnly,
|
|
49
48
|
dataAttrs,
|
|
50
|
-
onGlobalKeyDown
|
|
49
|
+
onGlobalKeyDown,
|
|
50
|
+
trackFocusResetter
|
|
51
51
|
} = React__default["default"].useContext(ControlledDateTimePickerCTX.ControlledDateTimePickerContext);
|
|
52
52
|
const styledsAttrs = {
|
|
53
53
|
justPicker: hideDate && hideTime,
|
|
@@ -55,9 +55,6 @@ const ControlledDateTimePickerContent = () => {
|
|
|
55
55
|
hasError,
|
|
56
56
|
isControllerOnly
|
|
57
57
|
};
|
|
58
|
-
const resetLatestInteraction = React__default["default"].useCallback(() => {
|
|
59
|
-
setLatestInteractionRegion('');
|
|
60
|
-
}, [setLatestInteractionRegion]);
|
|
61
58
|
const mainCols = [];
|
|
62
59
|
if (!hideDate) mainCols.push('auto');
|
|
63
60
|
if (!hideTime) mainCols.push('auto');
|
|
@@ -70,9 +67,9 @@ const ControlledDateTimePickerContent = () => {
|
|
|
70
67
|
cols: mainCols,
|
|
71
68
|
gutter: "xxs",
|
|
72
69
|
pr: hideDatePicker && hideTimePicker && hideDateTimePicker ? '2px' : undefined,
|
|
73
|
-
onBlur: resetLatestInteraction,
|
|
74
70
|
onKeyDown: onGlobalKeyDown,
|
|
75
|
-
disabled: disabled
|
|
71
|
+
disabled: disabled,
|
|
72
|
+
onBlur: trackFocusResetter
|
|
76
73
|
}, styledsAttrs), dataAttrs), {}, {
|
|
77
74
|
children: [hideDate ? null : _DateInputs || (_DateInputs = /*#__PURE__*/_jsx__default["default"](DateInputs.DateInputs, {})), hideTime ? null : _TimeInputs || (_TimeInputs = /*#__PURE__*/_jsx__default["default"](TimeInputs.TimeInputs, {})), withAnyRightController ? /*#__PURE__*/_jsx__default["default"](dsGrid.Grid, {
|
|
78
75
|
cols: rightControlCols
|
|
@@ -29,12 +29,11 @@ const DDInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
29
29
|
disabled,
|
|
30
30
|
contextRef,
|
|
31
31
|
placeholder,
|
|
32
|
-
ariaCurrentValueForInputs
|
|
32
|
+
ariaCurrentValueForInputs,
|
|
33
|
+
isFocused
|
|
33
34
|
} = _ref;
|
|
34
35
|
const validateOnChange = React.useCallback(e => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (isInvalidDay(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
|
|
36
|
+
if (isInvalidDay(e?.target?.value)) {
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
@@ -47,9 +46,12 @@ const DDInput = /*#__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": `day input field, ${ariaCurrentValueForInputs}`,
|
|
53
55
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.DAY,
|
|
54
56
|
disabled: disabled,
|
|
55
57
|
"aria-disabled": disabled
|
|
@@ -43,7 +43,9 @@ const DateInputs = () => {
|
|
|
43
43
|
monthInputRef,
|
|
44
44
|
dayInputRef,
|
|
45
45
|
yearInputRef,
|
|
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.largeInputWidth]
|
|
@@ -57,7 +59,8 @@ const DateInputs = () => {
|
|
|
57
59
|
autoFocusMonthInput: autoFocusMonthInput,
|
|
58
60
|
placeholder: "MM",
|
|
59
61
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
60
|
-
disabled: disabled
|
|
62
|
+
disabled: disabled,
|
|
63
|
+
isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'month-input'
|
|
61
64
|
})), _StyledSeparator || (_StyledSeparator = /*#__PURE__*/_jsx__default["default"](Styleds.StyledSeparator, {
|
|
62
65
|
alignItems: "center"
|
|
63
66
|
}, void 0, "/")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](DDInput.DDInput, {
|
|
@@ -69,7 +72,8 @@ const DateInputs = () => {
|
|
|
69
72
|
contextRef: dayInputRef,
|
|
70
73
|
placeholder: "DD",
|
|
71
74
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
72
|
-
disabled: disabled
|
|
75
|
+
disabled: disabled,
|
|
76
|
+
isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'day-input'
|
|
73
77
|
})), _StyledSeparator2 || (_StyledSeparator2 = /*#__PURE__*/_jsx__default["default"](Styleds.StyledSeparator, {
|
|
74
78
|
alignItems: "center"
|
|
75
79
|
}, void 0, "/")), /*#__PURE__*/_jsx__default["default"](Styleds.StyledFocusWithIn, {}, void 0, /*#__PURE__*/_jsx__default["default"](YYYYInput.YYYYInput, {
|
|
@@ -81,7 +85,8 @@ const DateInputs = () => {
|
|
|
81
85
|
contextRef: yearInputRef,
|
|
82
86
|
placeholder: "YYYY",
|
|
83
87
|
ariaCurrentValueForInputs: ariaCurrentValueForInputs,
|
|
84
|
-
disabled: disabled
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
isFocused: latestInteractionRegion === 'date-inputs' && currFocusDescriber === 'year-input'
|
|
85
90
|
})));
|
|
86
91
|
};
|
|
87
92
|
|
|
@@ -30,12 +30,11 @@ const MMInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
30
30
|
placeholder,
|
|
31
31
|
contextRef,
|
|
32
32
|
autoFocusMonthInput,
|
|
33
|
-
ariaCurrentValueForInputs
|
|
33
|
+
ariaCurrentValueForInputs,
|
|
34
|
+
isFocused
|
|
34
35
|
} = _ref;
|
|
35
36
|
const validateOnChange = React.useCallback(e => {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
if (isInvalidMonth(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
|
|
37
|
+
if (isInvalidMonth(e?.target?.value)) {
|
|
39
38
|
e.preventDefault();
|
|
40
39
|
return;
|
|
41
40
|
}
|
|
@@ -49,9 +48,12 @@ const MMInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
49
48
|
onFocus: onFocus,
|
|
50
49
|
onKeyDown: onKeyDown,
|
|
51
50
|
value: value,
|
|
52
|
-
ref:
|
|
51
|
+
ref: DomElem => {
|
|
52
|
+
contextRef.current = DomElem;
|
|
53
|
+
if (isFocused) DomElem?.focus?.();
|
|
54
|
+
},
|
|
53
55
|
placeholder: placeholder,
|
|
54
|
-
"aria-label":
|
|
56
|
+
"aria-label": `month input field, ${ariaCurrentValueForInputs}`,
|
|
55
57
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.MONTH,
|
|
56
58
|
disabled: disabled,
|
|
57
59
|
"aria-disabled": disabled
|
|
@@ -29,12 +29,11 @@ const YYYYInput = /*#__PURE__*/React__default["default"].memo(_ref => {
|
|
|
29
29
|
disabled,
|
|
30
30
|
placeholder,
|
|
31
31
|
contextRef,
|
|
32
|
-
ariaCurrentValueForInputs
|
|
32
|
+
ariaCurrentValueForInputs,
|
|
33
|
+
isFocused
|
|
33
34
|
} = _ref;
|
|
34
35
|
const validateOnChange = React.useCallback(e => {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (isInvalidYear(e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value)) {
|
|
36
|
+
if (isInvalidYear(e?.target?.value)) {
|
|
38
37
|
e.preventDefault();
|
|
39
38
|
return;
|
|
40
39
|
}
|
|
@@ -47,9 +46,12 @@ const YYYYInput = /*#__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": `year input field, ${ariaCurrentValueForInputs}`,
|
|
53
55
|
"data-testid": ControlledDateTimePickerDatatestid.ControlledDateTimePickerDatatestid.DATE_INPUTS.YEAR,
|
|
54
56
|
disabled: disabled,
|
|
55
57
|
"aria-disabled": disabled
|