@elliemae/ds-controlled-form 2.4.2-rc.9 → 2.4.3-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/cjs/autocomplete/config/useAutocomplete.js +0 -1
  2. package/cjs/autocomplete/parts/A11yFocusedOption.js +46 -0
  3. package/cjs/autocomplete/parts/container/Container.js +36 -24
  4. package/cjs/autocomplete/parts/container/styled.js +2 -2
  5. package/cjs/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  6. package/cjs/autocomplete/parts/menu-list/MenuList.js +6 -6
  7. package/cjs/autocomplete/parts/menu-list/styled.js +2 -2
  8. package/cjs/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  9. package/cjs/autocomplete/parts/styled.js +2 -0
  10. package/cjs/autocomplete/utils/listHelper.js +1 -1
  11. package/cjs/checkbox/ControlledCheckbox.js +9 -4
  12. package/cjs/checkbox/config/useValidateProps.js +6 -3
  13. package/cjs/checkbox/react-desc-prop-types.js +2 -1
  14. package/cjs/checkbox/styles.js +93 -32
  15. package/cjs/checkbox/utils/styleHelpers.js +20 -2
  16. package/cjs/combobox/ComboBoxCTX.js +6 -3
  17. package/cjs/combobox/config/useComboBox.js +16 -6
  18. package/cjs/combobox/config/useCorrectOptions.js +1 -2
  19. package/cjs/combobox/parts/A11yFocusedOption.js +14 -6
  20. package/cjs/combobox/parts/A11ySelectedValues.js +2 -4
  21. package/cjs/combobox/parts/DropdownIndicator.js +15 -7
  22. package/cjs/combobox/parts/container/Container.js +11 -14
  23. package/cjs/combobox/parts/container/styled.js +11 -10
  24. package/cjs/combobox/parts/controls/Controls.js +19 -27
  25. package/cjs/combobox/parts/controls/styled.js +54 -22
  26. package/cjs/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  27. package/cjs/combobox/parts/controls-input/ControlsInput.js +2 -2
  28. package/cjs/combobox/parts/controls-input/styled.js +41 -11
  29. package/cjs/combobox/parts/controls-input/useControlsInput.js +4 -7
  30. package/cjs/combobox/parts/controls-input/useKeyboardNavigation.js +19 -28
  31. package/cjs/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  32. package/cjs/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  33. package/cjs/combobox/parts/header-list/HeaderList.js +1 -1
  34. package/cjs/combobox/parts/header-list/styled.js +39 -10
  35. package/cjs/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  36. package/cjs/combobox/parts/menu-list/MenuList.js +8 -6
  37. package/cjs/combobox/parts/menu-list/styled.js +38 -20
  38. package/cjs/combobox/parts/menu-list/useItemRenderer.js +18 -17
  39. package/cjs/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  40. package/cjs/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  41. package/cjs/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  42. package/cjs/combobox/parts/styled.js +6 -7
  43. package/cjs/combobox/react-desc-prop-types.js +3 -2
  44. package/cjs/combobox/sharedTypes.js +2 -2
  45. package/cjs/combobox/utils/listHelper.js +14 -9
  46. package/cjs/date-range-picker/config/useRangePickerLogic.js +4 -8
  47. package/cjs/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  48. package/cjs/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  49. package/cjs/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  50. package/cjs/date-time-picker/config/useChangeHandlers.js +3 -3
  51. package/cjs/date-time-picker/config/useControlledDateTimePicker.js +1 -1
  52. package/cjs/date-time-picker/config/useFocusTracker.js +1 -1
  53. package/cjs/date-time-picker/config/useGetDestructuredValues.js +6 -6
  54. package/cjs/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  55. package/cjs/date-time-picker/config/useGetReferences.js +1 -1
  56. package/cjs/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  57. package/cjs/date-time-picker/config/useValidateProps.js +42 -11
  58. package/cjs/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
  59. package/cjs/date-time-picker/parts/DateInputs/DDInput.js +3 -7
  60. package/cjs/date-time-picker/parts/DateInputs/MMInput.js +3 -7
  61. package/cjs/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
  62. package/cjs/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
  63. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  64. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
  65. package/cjs/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  66. package/cjs/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
  67. package/cjs/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -15
  68. package/cjs/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +1 -2
  69. package/cjs/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  70. package/cjs/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
  71. package/cjs/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
  72. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
  73. package/cjs/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
  74. package/cjs/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
  75. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
  76. package/cjs/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
  77. package/cjs/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  78. package/cjs/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -15
  79. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
  80. package/cjs/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  81. package/cjs/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  82. package/cjs/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
  83. package/cjs/date-time-picker/parts/Styleds.js +12 -6
  84. package/cjs/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
  85. package/cjs/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
  86. package/cjs/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
  87. package/cjs/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
  88. package/cjs/date-time-picker/utils/dateHelpers.js +17 -34
  89. package/cjs/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  90. package/cjs/date-time-picker/utils/stringHelpers.js +5 -11
  91. package/cjs/input-group/InputGroup.js +8 -7
  92. package/cjs/input-group/exported-related/data-test-ids.js +12 -0
  93. package/cjs/input-group/exported-related/index.js +12 -0
  94. package/cjs/input-group/exported-related/theming.js +13 -0
  95. package/cjs/input-group/styled.js +90 -23
  96. package/cjs/large-text-input/DSControlledLargeTextInput.js +1 -1
  97. package/cjs/large-text-input/styles.js +27 -13
  98. package/cjs/mask-hook/hooks/useNumberMask.js +1 -5
  99. package/cjs/mask-hook/hooks/usePhoneMask.js +1 -4
  100. package/cjs/mask-hook/hooks/useRegExpMask.js +4 -7
  101. package/cjs/mask-hook/hooks/useSSNMask.js +1 -4
  102. package/cjs/mask-hook/hooks/useZipCodeMask.js +1 -4
  103. package/cjs/mask-hook/utils/addSpecialCharacters.js +0 -1
  104. package/cjs/mask-hook/utils/flatStringArray.js +0 -1
  105. package/cjs/text-input/config/useInputText.js +0 -1
  106. package/cjs/text-input/styled/borders.js +18 -11
  107. package/cjs/text-input/styled/components.js +49 -10
  108. package/cjs/toggle/ControlledToggle.js +2 -3
  109. package/cjs/toggle/styles.js +7 -5
  110. package/esm/autocomplete/config/useAutocomplete.js +0 -1
  111. package/esm/autocomplete/parts/A11yFocusedOption.js +36 -0
  112. package/esm/autocomplete/parts/container/Container.js +39 -27
  113. package/esm/autocomplete/parts/container/styled.js +2 -2
  114. package/esm/autocomplete/parts/container/useKeyboardNavigation.js +2 -2
  115. package/esm/autocomplete/parts/menu-list/MenuList.js +7 -7
  116. package/esm/autocomplete/parts/menu-list/styled.js +2 -2
  117. package/esm/autocomplete/parts/menu-list/useItemRenderer.js +1 -1
  118. package/esm/autocomplete/parts/styled.js +1 -0
  119. package/esm/autocomplete/utils/listHelper.js +1 -1
  120. package/esm/checkbox/ControlledCheckbox.js +10 -5
  121. package/esm/checkbox/config/useValidateProps.js +6 -3
  122. package/esm/checkbox/react-desc-prop-types.js +2 -1
  123. package/esm/checkbox/styles.js +93 -29
  124. package/esm/checkbox/utils/styleHelpers.js +20 -2
  125. package/esm/combobox/ComboBoxCTX.js +6 -3
  126. package/esm/combobox/config/useComboBox.js +16 -6
  127. package/esm/combobox/config/useCorrectOptions.js +1 -2
  128. package/esm/combobox/parts/A11yFocusedOption.js +15 -7
  129. package/esm/combobox/parts/A11ySelectedValues.js +2 -4
  130. package/esm/combobox/parts/DropdownIndicator.js +15 -6
  131. package/esm/combobox/parts/container/Container.js +11 -14
  132. package/esm/combobox/parts/container/styled.js +11 -6
  133. package/esm/combobox/parts/controls/Controls.js +19 -27
  134. package/esm/combobox/parts/controls/styled.js +54 -18
  135. package/esm/combobox/parts/controls/useOnPillsNavigation.js +7 -15
  136. package/esm/combobox/parts/controls-input/ControlsInput.js +2 -2
  137. package/esm/combobox/parts/controls-input/styled.js +41 -7
  138. package/esm/combobox/parts/controls-input/useControlsInput.js +4 -7
  139. package/esm/combobox/parts/controls-input/useKeyboardNavigation.js +20 -29
  140. package/esm/combobox/parts/controls-input/useMaskedOnChange.js +7 -7
  141. package/esm/combobox/parts/dropdown-indicator/DropdownIndicator.js +2 -2
  142. package/esm/combobox/parts/header-list/HeaderList.js +1 -1
  143. package/esm/combobox/parts/header-list/styled.js +40 -7
  144. package/esm/combobox/parts/header-list/useHeaderListHandlers.js +7 -14
  145. package/esm/combobox/parts/menu-list/MenuList.js +8 -6
  146. package/esm/combobox/parts/menu-list/styled.js +38 -17
  147. package/esm/combobox/parts/menu-list/useItemRenderer.js +20 -19
  148. package/esm/combobox/parts/multi-selected-values-container/MultiSelectedValuesContainer.js +1 -1
  149. package/esm/combobox/parts/multi-selected-values-container/RemovableSelectedValuePill.js +1 -3
  150. package/esm/combobox/parts/multi-selected-values-container/useGroupPills.js +1 -2
  151. package/esm/combobox/parts/styled.js +6 -3
  152. package/esm/combobox/react-desc-prop-types.js +3 -2
  153. package/esm/combobox/sharedTypes.js +2 -2
  154. package/esm/combobox/utils/listHelper.js +14 -10
  155. package/esm/date-range-picker/config/useRangePickerLogic.js +3 -7
  156. package/esm/date-range-picker/parts/ControlledDateRangeCalendar.js +0 -2
  157. package/esm/date-range-picker/parts/ControlledDateRangeFromDate.js +0 -2
  158. package/esm/date-range-picker/parts/ControlledDateRangeToDate.js +0 -2
  159. package/esm/date-time-picker/config/useChangeHandlers.js +3 -3
  160. package/esm/date-time-picker/config/useControlledDateTimePicker.js +1 -1
  161. package/esm/date-time-picker/config/useFocusTracker.js +1 -1
  162. package/esm/date-time-picker/config/useGetDestructuredValues.js +6 -6
  163. package/esm/date-time-picker/config/useGetPropsBasedOnType.js +1 -1
  164. package/esm/date-time-picker/config/useGetReferences.js +1 -1
  165. package/esm/date-time-picker/config/useRelevantValueFromProps.js +1 -1
  166. package/esm/date-time-picker/config/useValidateProps.js +42 -11
  167. package/esm/date-time-picker/parts/ClearButton/ClearButton.js +1 -3
  168. package/esm/date-time-picker/parts/DateInputs/DDInput.js +3 -7
  169. package/esm/date-time-picker/parts/DateInputs/MMInput.js +3 -7
  170. package/esm/date-time-picker/parts/DateInputs/YYYYInput.js +3 -7
  171. package/esm/date-time-picker/parts/DateInputs/useDateInputs.js +13 -23
  172. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarDaysList.js +4 -4
  173. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarHead.js +6 -14
  174. package/esm/date-time-picker/parts/Pickers/Calendar/CalendarIconTrigger.js +1 -1
  175. package/esm/date-time-picker/parts/Pickers/Calendar/Day.js +8 -10
  176. package/esm/date-time-picker/parts/Pickers/Calendar/Styleds.js +44 -14
  177. package/esm/date-time-picker/parts/Pickers/Calendar/useConfigCalendarCTX.js +0 -1
  178. package/esm/date-time-picker/parts/Pickers/Calendar/useCurrentDisplayedMonthYearLogic.js +2 -1
  179. package/esm/date-time-picker/parts/Pickers/Calendar/useFocusLogic.js +0 -1
  180. package/esm/date-time-picker/parts/Pickers/Calendar/usePopperTriggerLogic.js +3 -5
  181. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/CalendarWithTimeWheelIconTrigger.js +1 -1
  182. package/esm/date-time-picker/parts/Pickers/CalendarWithTimeWheel/useConfigCalendarWithTimeWheelCTX.js +3 -5
  183. package/esm/date-time-picker/parts/Pickers/TimeWheel/HoursList.js +5 -7
  184. package/esm/date-time-picker/parts/Pickers/TimeWheel/MeridiemList.js +6 -8
  185. package/esm/date-time-picker/parts/Pickers/TimeWheel/MinutesList.js +5 -7
  186. package/esm/date-time-picker/parts/Pickers/TimeWheel/SecondsList.js +2 -2
  187. package/esm/date-time-picker/parts/Pickers/TimeWheel/Styleds.js +47 -14
  188. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelContent.js +2 -5
  189. package/esm/date-time-picker/parts/Pickers/TimeWheel/TimeWheelIconTrigger.js +1 -1
  190. package/esm/date-time-picker/parts/Pickers/TimeWheel/useCurrentDisplayedWheelsLogic.js +3 -3
  191. package/esm/date-time-picker/parts/Pickers/TimeWheel/usePopperTriggerLogic.js +2 -5
  192. package/esm/date-time-picker/parts/Styleds.js +12 -6
  193. package/esm/date-time-picker/parts/TimeInputs/HHInput.js +2 -4
  194. package/esm/date-time-picker/parts/TimeInputs/MeridiemInput.js +3 -8
  195. package/esm/date-time-picker/parts/TimeInputs/MinutesInput.js +3 -7
  196. package/esm/date-time-picker/parts/TimeInputs/useTimeInputs.js +14 -26
  197. package/esm/date-time-picker/utils/dateHelpers.js +17 -34
  198. package/esm/date-time-picker/utils/hooks/useOnClickOutside.js +1 -3
  199. package/esm/date-time-picker/utils/stringHelpers.js +5 -11
  200. package/esm/input-group/InputGroup.js +5 -4
  201. package/esm/input-group/exported-related/data-test-ids.js +8 -0
  202. package/esm/input-group/exported-related/index.js +2 -0
  203. package/esm/input-group/exported-related/theming.js +8 -0
  204. package/esm/input-group/styled.js +89 -18
  205. package/esm/large-text-input/DSControlledLargeTextInput.js +1 -1
  206. package/esm/large-text-input/styles.js +27 -9
  207. package/esm/mask-hook/hooks/useNumberMask.js +1 -5
  208. package/esm/mask-hook/hooks/usePhoneMask.js +1 -4
  209. package/esm/mask-hook/hooks/useRegExpMask.js +4 -7
  210. package/esm/mask-hook/hooks/useSSNMask.js +1 -4
  211. package/esm/mask-hook/hooks/useZipCodeMask.js +1 -4
  212. package/esm/mask-hook/utils/addSpecialCharacters.js +0 -1
  213. package/esm/mask-hook/utils/flatStringArray.js +0 -1
  214. package/esm/text-input/config/useInputText.js +0 -1
  215. package/esm/text-input/styled/borders.js +18 -7
  216. package/esm/text-input/styled/components.js +49 -6
  217. package/esm/toggle/ControlledToggle.js +0 -1
  218. package/esm/toggle/styles.js +7 -5
  219. package/package.json +35 -15
  220. package/types/autocomplete/parts/A11yFocusedOption.d.ts +5 -0
  221. package/types/autocomplete/parts/container/styled.d.ts +1 -1
  222. package/types/autocomplete/parts/styled.d.ts +0 -0
  223. package/types/autocomplete/utils/listHelper.d.ts +5 -5
  224. package/types/checkbox/react-desc-prop-types.d.ts +2 -1
  225. package/types/checkbox/styles.d.ts +1 -0
  226. package/types/combobox/parts/menu-list/styled.d.ts +1 -0
  227. package/types/combobox/react-desc-prop-types.d.ts +8 -6
  228. package/types/combobox/sharedTypes.d.ts +3 -2
  229. package/types/combobox/utils/listHelper.d.ts +1 -0
  230. package/types/input-group/exported-related/data-test-ids.d.ts +6 -0
  231. package/types/input-group/exported-related/index.d.ts +2 -0
  232. package/types/input-group/exported-related/theming.d.ts +6 -0
  233. package/types/input-group/styled.d.ts +4 -7
  234. package/types/text-input/config/useInputText.d.ts +4 -4
@@ -5,7 +5,7 @@ import 'core-js/modules/esnext.async-iterator.filter.js';
5
5
  import 'core-js/modules/esnext.iterator.filter.js';
6
6
  import { useContext, useCallback } from 'react';
7
7
  import { ComboBoxContext } from '../../ComboBoxCTX.js';
8
- import { getOptions, getSuggestedValueOnChange, findInCircularList, getLastValueSelected } from '../../utils/listHelper.js';
8
+ import { getOptions, scrollIfNeeded, getSuggestedValueOnChange, findInCircularList, getLastValueSelected } from '../../utils/listHelper.js';
9
9
  import { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants.js';
10
10
 
11
11
  const isOptionFocuseable = opt => !['section', 'separator'].includes(opt.type) && !opt.disabled;
@@ -26,12 +26,12 @@ const useKeyboardNavigation = () => {
26
26
  withoutPortal
27
27
  },
28
28
  inputValue,
29
- showPopover,
29
+ menuState,
30
30
  focusOptionIdx,
31
31
  listRef,
32
32
  selectAllCheckboxRef,
33
33
  toggleSelectionButtonRef,
34
- setShowPopover,
34
+ setMenuState,
35
35
  setInputValue,
36
36
  scrollOptionIntoView,
37
37
  setFocusOptionIdx
@@ -44,17 +44,12 @@ const useKeyboardNavigation = () => {
44
44
  // =============================================================================
45
45
  // CUSTOM KEYS
46
46
  // =============================================================================
47
- if (onKeyDown && (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === MENU_OPTION_TYPES.OPTION) onKeyDown(e, currentItem);
47
+ if (onKeyDown && currentItem?.type === MENU_OPTION_TYPES.OPTION) onKeyDown(e, currentItem);
48
48
 
49
- if (['ArrowDown', 'ArrowUp', 'Enter', 'Spacebar'].includes(e.key) || e.keyCode >= 48 && e.keyCode <= 90) {
50
- setShowPopover(true);
49
+ if ((['ArrowDown', 'ArrowUp', 'Enter', 'Spacebar'].includes(e.key) || e.keyCode >= 48 && e.keyCode <= 90) && !menuState) {
50
+ setMenuState(true);
51
51
  window.requestAnimationFrame(() => {
52
- if (listRef.current && window.scrollY < listRef.current.offsetHeight) {
53
- window.scrollTo({
54
- top: listRef.current.offsetHeight,
55
- behavior: 'smooth'
56
- });
57
- }
52
+ if (listRef.current) scrollIfNeeded(listRef.current);
58
53
  });
59
54
  } // =============================================================================
60
55
  // ESCAPE
@@ -69,13 +64,13 @@ const useKeyboardNavigation = () => {
69
64
  setInputValue('');
70
65
  }
71
66
 
72
- if (!inline) setShowPopover(false);
67
+ if (!inline) setMenuState(false, 'close', e);
73
68
  } // =============================================================================
74
69
  // ENTER KEY TO CREATE ELEMENTS
75
70
  // =============================================================================
76
71
 
77
72
 
78
- if (e.key === 'Enter' && (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === INTERNAL_MENU_OPTION_TYPES.CREATABLE && onCreate) {
73
+ if (e.key === 'Enter' && currentItem?.type === INTERNAL_MENU_OPTION_TYPES.CREATABLE && onCreate) {
79
74
  onCreate(inputValue); // blank active item to force search last one
80
75
 
81
76
  setFocusOptionIdx('');
@@ -91,12 +86,12 @@ const useKeyboardNavigation = () => {
91
86
  e.preventDefault();
92
87
  e.stopPropagation();
93
88
 
94
- if (focusOptionIdx !== '' && (showPopover || inline) && (currentItem === null || currentItem === void 0 ? void 0 : currentItem.type) === MENU_OPTION_TYPES.OPTION && !currentItem.disabled) {
89
+ if (focusOptionIdx !== '' && (menuState || inline) && currentItem?.type === MENU_OPTION_TYPES.OPTION && !currentItem.disabled) {
95
90
  if (onFilter) onFilter(allOptions, '');
96
91
  setInputValue('');
97
92
 
98
93
  if (!multiple) {
99
- setShowPopover(false);
94
+ setMenuState(false, 'selectOption', e);
100
95
  }
101
96
 
102
97
  onChange(getSuggestedValueOnChange(currentItem, selectedValues), currentItem, e);
@@ -104,7 +99,7 @@ const useKeyboardNavigation = () => {
104
99
  }
105
100
 
106
101
  if (e.key === 'Enter' && e.altKey) {
107
- setShowPopover(false);
102
+ setMenuState(false, 'selectOption', e);
108
103
  }
109
104
 
110
105
  if (e.key === 'a' && e.ctrlKey && multiple && onSelectAll) {
@@ -118,7 +113,7 @@ const useKeyboardNavigation = () => {
118
113
  e.preventDefault();
119
114
  e.stopPropagation();
120
115
 
121
- if ((showPopover || inline) && selectableOptions.length) {
116
+ if ((menuState || inline) && selectableOptions.length) {
122
117
  const nextItemIndexIndex = findInCircularList(filteredOptions, currentItemIndex, isOptionFocuseable);
123
118
 
124
119
  if (nextItemIndexIndex > -1) {
@@ -135,12 +130,12 @@ const useKeyboardNavigation = () => {
135
130
  const prevItemIndex = findInCircularList(filteredOptions, currentItemIndex, isOptionFocuseable, -1);
136
131
 
137
132
  if (prevItemIndex > -1) {
138
- if (showPopover || inline) {
133
+ if (menuState || inline) {
139
134
  setFocusOptionIdx(filteredOptions[prevItemIndex].dsId);
140
135
  scrollOptionIntoView(filteredOptions[prevItemIndex].dsId);
141
136
  } else {
142
137
  // open menu and search last item to focused
143
- setShowPopover(true);
138
+ setMenuState(true, 'open', e);
144
139
  const lastItemIndex = findInCircularList(filteredOptions, 0, isOptionFocuseable, -1);
145
140
  setFocusOptionIdx(filteredOptions[lastItemIndex].dsId);
146
141
  setTimeout(() => {
@@ -163,22 +158,18 @@ const useKeyboardNavigation = () => {
163
158
  if (onFilter) onFilter(allOptions, inputValue);
164
159
  }
165
160
 
166
- if (e.key === 'Tab' && !inline && !withoutPortal) {
167
- var _selectAllCheckboxRef;
168
-
169
- const element = (_selectAllCheckboxRef = selectAllCheckboxRef.current) !== null && _selectAllCheckboxRef !== void 0 ? _selectAllCheckboxRef : toggleSelectionButtonRef.current;
161
+ if (e.key === 'Tab' && !inline && menuState) {
162
+ const element = selectAllCheckboxRef.current ?? toggleSelectionButtonRef.current;
170
163
 
171
164
  if (element) {
172
165
  e.preventDefault();
173
166
  element.focus();
167
+ } else {
168
+ setMenuState(false, 'blur', e);
174
169
  }
175
170
  }
176
-
177
- if (e.key === 'Tab' && !multiple && showPopover) {
178
- setShowPopover(false);
179
- }
180
171
  }, // eslint-disable-next-line react-hooks/exhaustive-deps
181
- [onKeyDown, currentItem, onCreate, multiple, inputValue, inline, withoutPortal, setShowPopover, onCancel, onFilter, setInputValue, listRef, focusOptionIdx, showPopover, selectableOptions.length, filteredOptions, currentItemIndex, setFocusOptionIdx, selectedValues, onChange, selectAllCheckboxRef, toggleSelectionButtonRef]);
172
+ [onKeyDown, currentItem, onCreate, multiple, inputValue, inline, withoutPortal, setMenuState, onCancel, onFilter, setInputValue, listRef, focusOptionIdx, menuState, selectableOptions.length, filteredOptions, currentItemIndex, setFocusOptionIdx, selectedValues, onChange, selectAllCheckboxRef, toggleSelectionButtonRef]);
182
173
  return {
183
174
  onInputKeyDown
184
175
  };
@@ -9,31 +9,31 @@ const useMaskedOnChange = () => {
9
9
  onFilter,
10
10
  allOptions
11
11
  },
12
- setShowPopover,
12
+ setMenuState,
13
13
  setInputValue,
14
14
  setShowSelectedOptions
15
15
  } = useContext(ComboBoxContext); // default onchange when no mask provided
16
16
 
17
17
  const handleOnChange = useCallback(e => {
18
18
  setShowSelectedOptions(false);
19
- setShowPopover(true);
19
+ setMenuState(true, 'filter', e);
20
20
 
21
21
  if (onFilter) {
22
22
  onFilter(filterOptions(e.currentTarget.value, allOptions), e.currentTarget.value);
23
23
  setInputValue(e.currentTarget.value);
24
24
  }
25
- }, [allOptions, onFilter, setInputValue, setShowPopover, setShowSelectedOptions]); // onchange used when mask is provided
25
+ }, [allOptions, onFilter, setInputValue, setMenuState, setShowSelectedOptions]); // onchange used when mask is provided
26
26
 
27
- const handleOnChangeMask = useCallback((_, mask) => {
27
+ const handleOnChangeMask = useCallback((e, mask) => {
28
28
  setShowSelectedOptions(false);
29
- setShowPopover(true);
29
+ setMenuState(true, 'filter', e);
30
30
  if (mask && onFilter) onFilter(filterOptions(mask, allOptions), mask);else if (!mask && onFilter) onFilter(allOptions, '');
31
- }, [allOptions, onFilter, setShowPopover, setShowSelectedOptions]);
31
+ }, [allOptions, onFilter, setMenuState, setShowSelectedOptions]);
32
32
  const onChangeMask = useMask({
33
33
  valueSetter: setInputValue,
34
34
  onChange: handleOnChangeMask
35
35
  });
36
- return (onChangeMask === null || onChangeMask === void 0 ? void 0 : onChangeMask.onChange) || handleOnChange;
36
+ return onChangeMask?.onChange || handleOnChange;
37
37
  };
38
38
 
39
39
  export { useMaskedOnChange };
@@ -12,14 +12,14 @@ const DropdownIndicator = () => {
12
12
  props: {
13
13
  disabled
14
14
  },
15
- showPopover
15
+ menuState
16
16
  } = useContext(ComboBoxContext);
17
17
  return /*#__PURE__*/_jsx(StyledDropDownButton, {
18
18
  "data-testid": ComboboxDataTestid.DROPDOWN,
19
19
  "aria-controls": "combo-listbox",
20
20
  "aria-labelledby": "combo-label",
21
21
  disabled: disabled,
22
- "aria-expanded": showPopover,
22
+ "aria-expanded": menuState,
23
23
  "aria-haspopup": "listbox",
24
24
  "aria-hidden": true,
25
25
  buttonType: "icon",
@@ -51,7 +51,7 @@ const HeaderList = () => {
51
51
  size: BUTTON_SIZES.S,
52
52
  "data-testid": ComboboxDataTestid.MULTISELECT.SHOW_SELECTED_OPTIONS_TOGGLE,
53
53
  innerRef: toggleSelectionButtonRef
54
- }, void 0, !showSelectedOptions ? "SHOW SELECTED [".concat(multiSelectedValues.length, "]") : 'SHOW ALL') : _StyledNoOptionsSelec || (_StyledNoOptionsSelec = /*#__PURE__*/_jsx(StyledNoOptionsSelected, {}, void 0, "0 SELECTED"))));
54
+ }, void 0, !showSelectedOptions ? `SHOW SELECTED [${multiSelectedValues.length}]` : 'SHOW ALL') : _StyledNoOptionsSelec || (_StyledNoOptionsSelec = /*#__PURE__*/_jsx(StyledNoOptionsSelected, {}, void 0, "0 SELECTED"))));
55
55
  };
56
56
 
57
57
  export { HeaderList };
@@ -1,12 +1,45 @@
1
- import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
1
  import { styled } from '@elliemae/ds-system';
3
2
  import { DSButtonV2 } from '@elliemae/ds-button';
4
3
 
5
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
6
- const StyledHeaderListWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n position: fixed;\n top: 0;\n z-index: 10;\n justify-content: space-between;\n padding: 0px 12px 0px 16px;\n width: 100%;\n height: 28px;\n background-color: #fff;\n box-shadow: 0 4px 2px -4px ", ";\n overflow-x: hidden;\n\n & button {\n font-size: 13px;\n }\n"])), props => props.theme.colors.neutral[700]);
7
- const StyledButtonSelection = styled(DSButtonV2)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n border-radius: 0px;\n padding: 0 ", ";\n margin: 0;\n align-items: center;\n transition: unset;\n &:hover:not([disabled]) {\n background-color: transparent;\n color: ", ";\n }\n"])), props => props.theme.space.xxs, props => props.theme.colors.brand['700']);
8
- const StyledSelectedItems = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
9
- const StyledNoOptionsSelected = styled.div(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding: 0 ", ";\n"])), props => props.theme.space.xxs);
10
- const StyledSelectAllCheckbox = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n display: flex;\n align-items: center;\n"])));
4
+ /* eslint-disable max-len */
5
+ const StyledHeaderListWrapper = styled.div`
6
+ display: flex;
7
+ position: fixed;
8
+ top: 0;
9
+ z-index: 10;
10
+ justify-content: space-between;
11
+ padding: 0px 12px 0px 16px;
12
+ width: 100%;
13
+ height: 28px;
14
+ background-color: #fff;
15
+ box-shadow: 0 4px 2px -4px ${props => props.theme.colors.neutral[700]};
16
+ overflow-x: hidden;
17
+
18
+ & button {
19
+ font-size: 13px;
20
+ }
21
+ `;
22
+ const StyledButtonSelection = styled(DSButtonV2)`
23
+ border-radius: 0px;
24
+ padding: 0 ${props => props.theme.space.xxs};
25
+ margin: 0;
26
+ align-items: center;
27
+ transition: unset;
28
+ &:hover:not([disabled]) {
29
+ background-color: transparent;
30
+ color: ${props => props.theme.colors.brand['700']};
31
+ }
32
+ `;
33
+ const StyledSelectedItems = styled.div`
34
+ display: flex;
35
+ align-items: center;
36
+ `;
37
+ const StyledNoOptionsSelected = styled.div`
38
+ padding: 0 ${props => props.theme.space.xxs};
39
+ `;
40
+ const StyledSelectAllCheckbox = styled.div`
41
+ display: flex;
42
+ align-items: center;
43
+ `;
11
44
 
12
45
  export { StyledButtonSelection, StyledHeaderListWrapper, StyledNoOptionsSelected, StyledSelectAllCheckbox, StyledSelectedItems };
@@ -1,4 +1,3 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
1
  import 'core-js/modules/esnext.async-iterator.filter.js';
3
2
  import 'core-js/modules/esnext.iterator.constructor.js';
4
3
  import 'core-js/modules/esnext.iterator.filter.js';
@@ -16,7 +15,7 @@ const useHeaderListHandlers = () => {
16
15
  },
17
16
  showSelectedOptions,
18
17
  setShowSelectedOptions,
19
- setShowPopover
18
+ setMenuState
20
19
  } = useContext(ComboBoxContext);
21
20
  const multiSelectedValues = selectedValues;
22
21
  const selectableOptions = getSelectableOptions(filteredOptions);
@@ -25,7 +24,7 @@ const useHeaderListHandlers = () => {
25
24
  return true;
26
25
  }
27
26
 
28
- if ((multiSelectedValues === null || multiSelectedValues === void 0 ? void 0 : multiSelectedValues.length) === 0) {
27
+ if (multiSelectedValues?.length === 0) {
29
28
  return false;
30
29
  }
31
30
 
@@ -55,27 +54,21 @@ const useHeaderListHandlers = () => {
55
54
 
56
55
  const handleKeyDown = useCallback(e => {
57
56
  if (e.key === 'Escape') {
58
- var _innerRef$current;
59
-
60
- setShowPopover(false);
61
- (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
57
+ setMenuState(false, 'close', e);
58
+ innerRef.current?.focus();
62
59
  }
63
- }, [setShowPopover, innerRef]); // when hitting tab on selected values button filter we target the input again
60
+ }, [setMenuState, innerRef]); // when hitting tab on selected values button filter we target the input again
64
61
 
65
62
  const handleFilterSelectionBtnOnTab = useCallback(e => {
66
63
  if (e.key === 'Tab' && !e.shiftKey) {
67
- var _innerRef$current2;
68
-
69
64
  e.preventDefault();
70
- (_innerRef$current2 = innerRef.current) === null || _innerRef$current2 === void 0 ? void 0 : _innerRef$current2.focus();
65
+ innerRef.current?.focus();
71
66
  }
72
67
  }, [innerRef]);
73
68
  const handleCheckAllOnTab = useCallback(e => {
74
69
  if (e.key === 'Tab' && !e.shiftKey && multiSelectedValues.length === 0) {
75
- var _innerRef$current3;
76
-
77
70
  e.preventDefault();
78
- (_innerRef$current3 = innerRef.current) === null || _innerRef$current3 === void 0 ? void 0 : _innerRef$current3.focus();
71
+ innerRef.current?.focus();
79
72
  }
80
73
  }, [innerRef, multiSelectedValues]);
81
74
  useEffect(() => {
@@ -8,11 +8,14 @@ import { HeaderList } from '../header-list/HeaderList.js';
8
8
  import { useItemRenderer } from './useItemRenderer.js';
9
9
  import { jsxs, jsx } from 'react/jsx-runtime';
10
10
 
11
- var _HeaderList, _StyledNoResultsWrapp;
11
+ var _HeaderList;
12
12
  const MenuList = () => {
13
+ var _StyledNoResultsWrapp;
14
+
13
15
  const {
14
16
  props: {
15
17
  menuMinWidth,
18
+ noOptionsMessage,
16
19
  menuMaxHeight,
17
20
  onCreate,
18
21
  inline,
@@ -53,15 +56,14 @@ const MenuList = () => {
53
56
  role: "listbox",
54
57
  "data-testid": ComboboxDataTestid.LIST,
55
58
  style: {
56
- height: virtualListHelpers === null || virtualListHelpers === void 0 ? void 0 : virtualListHelpers.totalSize,
59
+ height: virtualListHelpers?.totalSize,
57
60
  margin: inline ? '0px' : '8px 0px'
58
61
  }
59
62
  }, void 0, ItemRenderer)
60
63
  }) : _StyledNoResultsWrapp || (_StyledNoResultsWrapp = /*#__PURE__*/_jsx(StyledNoResultsWrapper, {
61
- role: "alert",
62
- "aria-live": "polite"
63
- }, void 0, "No matches found"))]
64
- }, width), [wrapperListRef, inline, preventLoseInputFocus, menuMinWidth, withHeader, filteredOptions.length, onCreate, menuMaxHeight, listRef, virtualListHelpers === null || virtualListHelpers === void 0 ? void 0 : virtualListHelpers.totalSize, ItemRenderer, width]);
64
+ role: "alert"
65
+ }, void 0, noOptionsMessage))]
66
+ }, width), [wrapperListRef, inline, preventLoseInputFocus, width, menuMinWidth, withHeader, filteredOptions.length, onCreate, menuMaxHeight, listRef, virtualListHelpers?.totalSize, ItemRenderer, noOptionsMessage]);
65
67
  };
66
68
 
67
69
  export { MenuList };
@@ -1,37 +1,58 @@
1
- import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
1
  import { styled } from '@elliemae/ds-system';
3
2
 
4
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
5
- const StyledListWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n min-width: ", ";\n width: ", ";\n background-color: #ffffff;\n max-height: ", ";\n z-index: 100;\n"])), _ref => {
3
+ const StyledListWrapper = styled.div`
4
+ min-width: ${_ref => {
6
5
  let {
7
6
  inline,
8
7
  minWidth
9
8
  } = _ref;
10
- return inline ? '100%' : "".concat(minWidth, "px");
11
- }, _ref2 => {
9
+ return inline ? '100%' : `${minWidth}px`;
10
+ }};
11
+ width: ${_ref2 => {
12
12
  let {
13
13
  width
14
14
  } = _ref2;
15
- return "".concat(width, "px");
16
- }, _ref3 => {
15
+ return `${width}px`;
16
+ }};
17
+ background-color: #ffffff;
18
+ max-height: ${_ref3 => {
17
19
  let {
18
20
  maxHeight
19
21
  } = _ref3;
20
- return "".concat(maxHeight, "px");
21
- });
22
- const StyledList = styled.ul(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n position: relative;\n padding: 0;\n background-color: #ffffff;\n"])));
23
- const StyledVirtualListWrapper = styled.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n overflow-y: auto;\n margin-top: ", ";\n max-height: ", ";\n"])), _ref4 => {
22
+ return `${maxHeight}px`;
23
+ }};
24
+ z-index: 100;
25
+ `;
26
+ const StyledList = styled.ul`
27
+ position: relative;
28
+ padding: 0;
29
+ background-color: #ffffff;
30
+ overflow-x: hidden;
31
+ `;
32
+ const StyledVirtualListWrapper = styled.div`
33
+ overflow-y: auto;
34
+ margin-top: ${_ref4 => {
24
35
  let {
25
36
  withHeader
26
37
  } = _ref4;
27
38
  return withHeader ? '28px' : '';
28
- }, _ref5 => {
39
+ }};
40
+ max-height: ${_ref5 => {
29
41
  let {
30
42
  maxHeight
31
43
  } = _ref5;
32
- return maxHeight ? "".concat(maxHeight, "px") : '300px';
33
- });
34
- const StyledCreatableLabel = styled.span(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-weight: bold;\n font-style: italic;\n"])));
35
- const StyledNoResultsWrapper = styled.div(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding: 16px;\n"])));
44
+ return maxHeight ? `${maxHeight}px` : '300px';
45
+ }};
46
+ `;
47
+ const StyledCreatableLabel = styled.span`
48
+ font-weight: bold;
49
+ font-style: italic;
50
+ `;
51
+ const StyledCreatableValue = styled.span`
52
+ word-break: break-all;
53
+ `;
54
+ const StyledNoResultsWrapper = styled.div`
55
+ padding: 16px;
56
+ `;
36
57
 
37
- export { StyledCreatableLabel, StyledList, StyledListWrapper, StyledNoResultsWrapper, StyledVirtualListWrapper };
58
+ export { StyledCreatableLabel, StyledCreatableValue, StyledList, StyledListWrapper, StyledNoResultsWrapper, StyledVirtualListWrapper };
@@ -11,10 +11,10 @@ import { useContext, useCallback, useMemo } from 'react';
11
11
  import { Grid } from '@elliemae/ds-grid';
12
12
  import { Section, Separator, SingleMenuItem, MultiMenuItem } from '@elliemae/ds-form';
13
13
  import { ComboBoxContext } from '../../ComboBoxCTX.js';
14
- import { StyledCreatableLabel } from './styled.js';
14
+ import { StyledCreatableLabel, StyledCreatableValue } from './styled.js';
15
15
  import { getSuggestedValueOnChange, isSelected } from '../../utils/listHelper.js';
16
16
  import { ComboboxDataTestid } from '../../ComboboxDataTestids.js';
17
- import { INTERNAL_MENU_OPTION_TYPES, MENU_OPTION_TYPES } from '../../constants.js';
17
+ import { MENU_OPTION_TYPES, INTERNAL_MENU_OPTION_TYPES } from '../../constants.js';
18
18
  import { jsx, Fragment } from 'react/jsx-runtime';
19
19
 
20
20
  var _StyledCreatableLabel;
@@ -32,7 +32,7 @@ const useItemRenderer = () => {
32
32
  onFilter,
33
33
  allOptions
34
34
  },
35
- setShowPopover,
35
+ setMenuState,
36
36
  inputValue,
37
37
  focusOptionIdx,
38
38
  setInputValue,
@@ -40,20 +40,21 @@ const useItemRenderer = () => {
40
40
  } = useContext(ComboBoxContext);
41
41
  const multiple = Array.isArray(selectedValues);
42
42
  const CBItem = multiple ? MultiMenuItem : SingleMenuItem;
43
+ const handleOnCreateClick = useCallback(() => {
44
+ if (inputValue && onCreate) {
45
+ onCreate(inputValue);
46
+ setInputValue('');
47
+ if (onFilter) onFilter(allOptions, inputValue);
48
+ }
49
+ }, [onFilter, onCreate, inputValue, allOptions, setInputValue]);
43
50
  const handleClick = useCallback((option, e) => {
44
- if (option.type === INTERNAL_MENU_OPTION_TYPES.CREATABLE && onCreate && onFilter) {
45
- if (inputValue) {
46
- onCreate(inputValue);
47
- setInputValue('');
48
- onFilter(allOptions, inputValue);
49
- }
50
- } else if (option.type === MENU_OPTION_TYPES.OPTION) {
51
+ if (option.type === MENU_OPTION_TYPES.OPTION) {
51
52
  if (!option.disabled) {
52
53
  if (onFilter) onFilter(allOptions, inputValue);
53
54
  setInputValue('');
54
55
 
55
56
  if (!multiple) {
56
- setShowPopover(false);
57
+ setMenuState(false, 'selectOption', e);
57
58
  }
58
59
 
59
60
  onChange(getSuggestedValueOnChange(option, selectedValues), option, e);
@@ -63,7 +64,7 @@ const useItemRenderer = () => {
63
64
 
64
65
  e.stopPropagation();
65
66
  e.preventDefault();
66
- }, [onFilter, selectedValues, onChange, setShowPopover, multiple]); // prevent blur from controls input
67
+ }, [onFilter, selectedValues, allOptions, onChange, setMenuState, multiple]); // prevent blur from controls input
67
68
 
68
69
  const handleOnMouseDown = useCallback(e => {
69
70
  e.preventDefault();
@@ -81,9 +82,9 @@ const useItemRenderer = () => {
81
82
  top: 0,
82
83
  left: 0,
83
84
  width: '100%',
84
- transform: "translateY(".concat(vItem.start, "px)")
85
+ transform: `translateY(${vItem.start}px)`
85
86
  },
86
- key: "".concat(option.dsId),
87
+ key: `${option.dsId}`,
87
88
  innerRef: vItem.measureRef
88
89
  };
89
90
 
@@ -106,8 +107,8 @@ const useItemRenderer = () => {
106
107
  onClick: e => handleClick(option, e),
107
108
  onMouseDown: handleOnMouseDown,
108
109
  isActive: option.dsId === focusOptionIdx,
109
- isSelected: isSelected(selectedValues, option) //tabIndex={-1}
110
-
110
+ isSelected: isSelected(selectedValues, option),
111
+ tabIndex: -1
111
112
  }));
112
113
  }
113
114
 
@@ -121,14 +122,14 @@ const useItemRenderer = () => {
121
122
  label
122
123
  } = _ref;
123
124
  return /*#__PURE__*/_jsx(Grid, {
125
+ p: "8px",
124
126
  cols: ['min-content', 'auto'],
125
- height: "16px",
126
127
  gutter: "xxs",
127
128
  alignItems: "center"
128
- }, void 0, _StyledCreatableLabel || (_StyledCreatableLabel = /*#__PURE__*/_jsx(StyledCreatableLabel, {}, void 0, "Add:")), /*#__PURE__*/_jsx("span", {}, void 0, "\"".concat(label, "\"")));
129
+ }, void 0, _StyledCreatableLabel || (_StyledCreatableLabel = /*#__PURE__*/_jsx(StyledCreatableLabel, {}, void 0, "Add:")), /*#__PURE__*/_jsx(StyledCreatableValue, {}, void 0, `"${label}"`));
129
130
  },
130
131
  label: option.label,
131
- onClick: e => handleClick(option, e)
132
+ onClick: handleOnCreateClick
132
133
  }));
133
134
  }
134
135
 
@@ -31,7 +31,7 @@ const MultiSelectedValuesContainer = () => {
31
31
  }, pill.dsId)), multiSelectedValue.length > 0 && correctPillsToShow !== multiSelectedValue.length && /*#__PURE__*/_jsx(DSPillV2, {
32
32
  size: "s",
33
33
  labelTruncated: false,
34
- label: "+".concat(multiSelectedValue.length - correctPillsToShow),
34
+ label: `+${multiSelectedValue.length - correctPillsToShow}`,
35
35
  type: "value",
36
36
  disabled: disabled
37
37
  }, "grouped"))), [pillGroupRef, multiSelectedValue, correctPillsToShow, disabled]);
@@ -23,12 +23,10 @@ const RemovableSelectedValuePill = props => {
23
23
  type: disabled ? 'value' : 'removable',
24
24
  tabIndex: -1,
25
25
  onRemove: e => {
26
- var _innerRef$current;
27
-
28
26
  // preventing the menu to be opened
29
27
  e.stopPropagation();
30
28
  onChange(getSuggestedValueOnChange(pill, selectedValues), pill, e);
31
- (_innerRef$current = innerRef.current) === null || _innerRef$current === void 0 ? void 0 : _innerRef$current.focus();
29
+ innerRef.current?.focus();
32
30
  }
33
31
  }, pill.value);
34
32
  };
@@ -1,4 +1,3 @@
1
- import 'core-js/modules/web.dom-collections.iterator.js';
2
1
  import 'core-js/modules/esnext.async-iterator.map.js';
3
2
  import 'core-js/modules/esnext.iterator.map.js';
4
3
  import 'core-js/modules/esnext.async-iterator.for-each.js';
@@ -49,7 +48,7 @@ const useGroupPills = () => {
49
48
  let currentWidth = 0;
50
49
  const referenceWidth = selectedOptionsRef.current.offsetWidth;
51
50
  const pills = [...pillGroupRef.current.querySelectorAll(disabled ? '.ds-pill-wrapper-value' : '.ds-pill-wrapper-removable')];
52
- const pillsWidth = pills.map(pill => pill === null || pill === void 0 ? void 0 : pill.offsetWidth);
51
+ const pillsWidth = pills.map(pill => pill?.offsetWidth);
53
52
  pillsWidth.forEach((pillWidth, idx) => {
54
53
  currentWidth += pillWidth;
55
54
 
@@ -1,7 +1,10 @@
1
- import _taggedTemplateLiteral from '@babel/runtime/helpers/esm/taggedTemplateLiteral';
2
1
  import { styled } from '@elliemae/ds-system';
3
2
 
4
- var _templateObject;
5
- const StyledA11ySelectedValues = styled.span(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 1px;\n height: 1px;\n position: absolute;\n clip: rect(1px, 1px, 1px, 1px);\n"])));
3
+ const StyledA11ySelectedValues = styled.span`
4
+ width: 1px;
5
+ height: 1px;
6
+ position: absolute;
7
+ clip: rect(1px, 1px, 1px, 1px);
8
+ `;
6
9
 
7
10
  export { StyledA11ySelectedValues };
@@ -18,12 +18,13 @@ const ComboboxPropTypes = _objectSpread(_objectSpread({}, globalAttributesPropTy
18
18
  disabled: PropTypes.bool.description('wheter or not the input is disabled').defaultValue('false'),
19
19
  autoFocus: PropTypes.bool.description('Whether the combo box uses auto focus or not').defaultValue('false'),
20
20
  hasError: PropTypes.bool.description('Whether the combo box has error or not').defaultValue('false'),
21
+ noOptionsMessage: PropTypes.string.description('Custome message to be display when no matches found after filtering').defaultValue('No Matches Found'),
22
+ closeMenuOnScroll: PropTypes.oneOfType([PropTypes.func, PropTypes.bool]).description('If true, close the select menu when the user scrolls the document/body.').defaultValue(false),
21
23
  onChange: PropTypes.func.isRequired.description('function triggered when an option is selected it will send the options selected').defaultValue('() => {}'),
22
24
  onFilter: PropTypes.func.description('function triggered when user type in the combobox input').defaultValue(''),
23
25
  onCreate: PropTypes.func.description('function triggered when user select "create" a new item whenever is not a match in the all option list').defaultValue(''),
24
26
  onCancel: PropTypes.func.description('function triggered when user press ESC key').defaultValue('() => {}'),
25
- onMenuOpen: PropTypes.func.description('function triggered when user open the menu list').defaultValue('() => {}'),
26
- onMenuClose: PropTypes.func.description('function triggered when user close the menu list').defaultValue('() => {}'),
27
+ onMenuChange: PropTypes.func.description('function triggered when user open or close the menu list').defaultValue('() => {}'),
27
28
  inputMinWidth: PropTypes.any.description('Minimum width for the combo box input controller').defaultValue(undefined),
28
29
  menuMinWidth: PropTypes.any.description('Minimum width for the dropdown menu').defaultValue(undefined),
29
30
  menuMaxHeight: PropTypes.any.description('Maximum height for the dropdown menu').defaultValue(undefined),
@@ -1,6 +1,6 @@
1
1
  import { MENU_OPTION_TYPES } from './constants.js';
2
2
 
3
- const isSeparator = el => (el === null || el === void 0 ? void 0 : el.type) === MENU_OPTION_TYPES.SEPARATOR;
4
- const isOption = el => (el === null || el === void 0 ? void 0 : el.type) === MENU_OPTION_TYPES.OPTION;
3
+ const isSeparator = el => el?.type === MENU_OPTION_TYPES.SEPARATOR;
4
+ const isOption = el => el?.type === MENU_OPTION_TYPES.OPTION;
5
5
 
6
6
  export { isOption, isSeparator };