@zohodesk/components 1.2.4 → 1.2.6

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 (202) hide show
  1. package/README.md +8 -0
  2. package/coverage/Button/Button.js.html +1 -1
  3. package/coverage/Button/css/Button.module.css.html +1 -1
  4. package/coverage/Button/css/cssJSLogic.js.html +1 -1
  5. package/coverage/Button/css/index.html +1 -1
  6. package/coverage/Button/index.html +1 -1
  7. package/coverage/Button/props/defaultProps.js.html +1 -1
  8. package/coverage/Button/props/index.html +1 -1
  9. package/coverage/Button/props/propTypes.js.html +1 -1
  10. package/coverage/Buttongroup/Buttongroup.js.html +1 -1
  11. package/coverage/Buttongroup/Buttongroup.module.css.html +1 -1
  12. package/coverage/Buttongroup/index.html +1 -1
  13. package/coverage/Buttongroup/props/defaultProps.js.html +1 -1
  14. package/coverage/Buttongroup/props/index.html +1 -1
  15. package/coverage/Buttongroup/props/propTypes.js.html +1 -1
  16. package/coverage/index.html +1 -1
  17. package/coverage/utils/dummyFunction.js.html +1 -1
  18. package/coverage/utils/index.html +1 -1
  19. package/es/AppContainer/AppContainer.js +3 -0
  20. package/es/v1/Accordion/Accordion.js +65 -0
  21. package/es/v1/Accordion/AccordionItem.js +57 -0
  22. package/es/v1/Accordion/index.js +2 -0
  23. package/es/v1/Animation/Animation.js +127 -0
  24. package/es/v1/AppContainer/AppContainer.js +137 -0
  25. package/es/v1/Avatar/Avatar.js +189 -0
  26. package/es/v1/AvatarTeam/AvatarTeam.js +70 -0
  27. package/es/v1/Button/Button.js +68 -0
  28. package/es/v1/Buttongroup/Buttongroup.js +31 -0
  29. package/es/v1/Card/Card.js +271 -0
  30. package/es/v1/CheckBox/CheckBox.js +155 -0
  31. package/es/v1/DateTime/CalendarView.js +218 -0
  32. package/es/v1/DateTime/DateTime.js +783 -0
  33. package/es/v1/DateTime/DateTimePopupFooter.js +47 -0
  34. package/es/v1/DateTime/DateTimePopupHeader.js +105 -0
  35. package/es/v1/DateTime/DateWidget.js +1098 -0
  36. package/es/v1/DateTime/DaysRow.js +31 -0
  37. package/es/v1/DateTime/Time.js +166 -0
  38. package/es/v1/DateTime/YearView.js +264 -0
  39. package/es/v1/DateTime/index.js +1 -0
  40. package/es/v1/DropBox/DropBox.js +91 -0
  41. package/es/v1/DropBox/DropBoxElement/DropBoxElement.js +132 -0
  42. package/es/v1/DropDown/DropDown.js +73 -0
  43. package/es/v1/DropDown/DropDownHeading.js +44 -0
  44. package/es/v1/DropDown/DropDownItem.js +76 -0
  45. package/es/v1/DropDown/DropDownSearch.js +63 -0
  46. package/es/v1/DropDown/DropDownSeparator.js +15 -0
  47. package/es/v1/Heading/Heading.js +32 -0
  48. package/es/v1/Label/Label.js +40 -0
  49. package/es/v1/Layout/Box.js +115 -0
  50. package/es/v1/Layout/Container.js +132 -0
  51. package/es/v1/Layout/index.js +2 -0
  52. package/es/v1/ListItem/ListContainer.js +102 -0
  53. package/es/v1/ListItem/ListItem.js +124 -0
  54. package/es/v1/ListItem/ListItemWithAvatar.js +145 -0
  55. package/es/v1/ListItem/ListItemWithCheckBox.js +104 -0
  56. package/es/v1/ListItem/ListItemWithIcon.js +127 -0
  57. package/es/v1/ListItem/ListItemWithRadio.js +105 -0
  58. package/es/v1/ListItem/index.js +6 -0
  59. package/es/v1/Modal/Modal.js +154 -0
  60. package/es/v1/MultiSelect/AdvancedGroupMultiSelect.js +1079 -0
  61. package/es/v1/MultiSelect/AdvancedMultiSelect.js +568 -0
  62. package/es/v1/MultiSelect/EmptyState.js +64 -0
  63. package/es/v1/MultiSelect/MobileHeader/MobileHeader.js +50 -0
  64. package/es/v1/MultiSelect/MultiSelect.js +1120 -0
  65. package/es/v1/MultiSelect/MultiSelectHeader.js +32 -0
  66. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +216 -0
  67. package/es/v1/MultiSelect/SelectedOptions.js +82 -0
  68. package/es/v1/MultiSelect/Suggestions.js +142 -0
  69. package/es/v1/MultiSelect/index.js +4 -0
  70. package/es/v1/PopOver/PopOver.js +211 -0
  71. package/es/v1/Popup/Popup.js +645 -0
  72. package/es/v1/Radio/Radio.js +115 -0
  73. package/es/v1/Responsive/CustomResponsive.js +195 -0
  74. package/es/v1/Responsive/RefWrapper.js +39 -0
  75. package/es/v1/Responsive/ResizeComponent.js +197 -0
  76. package/es/v1/Responsive/ResizeObserver.js +140 -0
  77. package/es/v1/Responsive/Responsive.js +194 -0
  78. package/es/v1/Responsive/index.js +9 -0
  79. package/es/v1/ResponsiveDropBox/ResponsiveDropBox.js +58 -0
  80. package/es/v1/Ribbon/Ribbon.js +33 -0
  81. package/es/v1/RippleEffect/RippleEffect.js +24 -0
  82. package/es/v1/Select/GroupSelect.js +803 -0
  83. package/es/v1/Select/Select.js +969 -0
  84. package/es/v1/Select/SelectWithAvatar.js +344 -0
  85. package/es/v1/Select/SelectWithIcon.js +535 -0
  86. package/es/v1/Select/index.js +4 -0
  87. package/es/v1/Stencils/Stencils.js +26 -0
  88. package/es/v1/Switch/Switch.js +94 -0
  89. package/es/v1/Tab/Tab.js +108 -0
  90. package/es/v1/Tab/TabContent.js +30 -0
  91. package/es/v1/Tab/TabContentWrapper.js +29 -0
  92. package/es/v1/Tab/TabWrapper.js +57 -0
  93. package/es/v1/Tab/Tabs.js +612 -0
  94. package/es/v1/Tab/index.js +5 -0
  95. package/es/v1/Tag/Tag.js +134 -0
  96. package/es/v1/TextBox/TextBox.js +154 -0
  97. package/es/v1/TextBoxIcon/TextBoxIcon.js +158 -0
  98. package/es/v1/Textarea/Textarea.js +102 -0
  99. package/es/v1/Tooltip/Tooltip.js +518 -0
  100. package/es/v1/Typography/Typography.js +38 -0
  101. package/es/v1/Typography/css/Typography.module.css +376 -0
  102. package/es/v1/Typography/css/cssJSLogic.js +46 -0
  103. package/es/v1/Typography/css/letterSpacingMap.js +12 -0
  104. package/es/v1/Typography/props/defaultProps.js +8 -0
  105. package/es/v1/Typography/props/propTypes.js +24 -0
  106. package/es/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +69 -0
  107. package/es/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +100 -0
  108. package/es/v1/semantic/Button/Button.js +53 -0
  109. package/es/v1/semantic/index.js +1 -0
  110. package/lib/AppContainer/AppContainer.js +5 -0
  111. package/lib/v1/Accordion/Accordion.js +96 -0
  112. package/lib/v1/Accordion/AccordionItem.js +68 -0
  113. package/lib/v1/Accordion/index.js +23 -0
  114. package/lib/v1/Animation/Animation.js +143 -0
  115. package/lib/v1/AppContainer/AppContainer.js +209 -0
  116. package/lib/v1/Avatar/Avatar.js +246 -0
  117. package/lib/v1/AvatarTeam/AvatarTeam.js +81 -0
  118. package/lib/v1/Button/Button.js +82 -0
  119. package/lib/v1/Buttongroup/Buttongroup.js +44 -0
  120. package/lib/v1/Card/Card.js +365 -0
  121. package/lib/v1/CheckBox/CheckBox.js +166 -0
  122. package/lib/v1/DateTime/CalendarView.js +285 -0
  123. package/lib/v1/DateTime/DateTime.js +872 -0
  124. package/lib/v1/DateTime/DateTimePopupFooter.js +96 -0
  125. package/lib/v1/DateTime/DateTimePopupHeader.js +166 -0
  126. package/lib/v1/DateTime/DateWidget.js +1125 -0
  127. package/lib/v1/DateTime/DaysRow.js +80 -0
  128. package/lib/v1/DateTime/Time.js +254 -0
  129. package/lib/v1/DateTime/YearView.js +325 -0
  130. package/lib/v1/DateTime/index.js +15 -0
  131. package/lib/v1/DropBox/DropBox.js +119 -0
  132. package/lib/v1/DropBox/DropBoxElement/DropBoxElement.js +145 -0
  133. package/lib/v1/DropDown/DropDown.js +170 -0
  134. package/lib/v1/DropDown/DropDownHeading.js +93 -0
  135. package/lib/v1/DropDown/DropDownItem.js +127 -0
  136. package/lib/v1/DropDown/DropDownSearch.js +113 -0
  137. package/lib/v1/DropDown/DropDownSeparator.js +64 -0
  138. package/lib/v1/Heading/Heading.js +49 -0
  139. package/lib/v1/Label/Label.js +51 -0
  140. package/lib/v1/Layout/Box.js +128 -0
  141. package/lib/v1/Layout/Container.js +145 -0
  142. package/lib/v1/Layout/index.js +23 -0
  143. package/lib/v1/ListItem/ListContainer.js +120 -0
  144. package/lib/v1/ListItem/ListItem.js +138 -0
  145. package/lib/v1/ListItem/ListItemWithAvatar.js +162 -0
  146. package/lib/v1/ListItem/ListItemWithCheckBox.js +125 -0
  147. package/lib/v1/ListItem/ListItemWithIcon.js +143 -0
  148. package/lib/v1/ListItem/ListItemWithRadio.js +126 -0
  149. package/lib/v1/ListItem/index.js +55 -0
  150. package/lib/v1/Modal/Modal.js +212 -0
  151. package/lib/v1/MultiSelect/AdvancedGroupMultiSelect.js +1167 -0
  152. package/lib/v1/MultiSelect/AdvancedMultiSelect.js +634 -0
  153. package/lib/v1/MultiSelect/EmptyState.js +112 -0
  154. package/lib/v1/MultiSelect/MobileHeader/MobileHeader.js +62 -0
  155. package/lib/v1/MultiSelect/MultiSelect.js +1201 -0
  156. package/lib/v1/MultiSelect/MultiSelectHeader.js +78 -0
  157. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +270 -0
  158. package/lib/v1/MultiSelect/SelectedOptions.js +126 -0
  159. package/lib/v1/MultiSelect/Suggestions.js +195 -0
  160. package/lib/v1/MultiSelect/index.js +39 -0
  161. package/lib/v1/PopOver/PopOver.js +293 -0
  162. package/lib/v1/Popup/Popup.js +715 -0
  163. package/lib/v1/Radio/Radio.js +126 -0
  164. package/lib/v1/Responsive/CustomResponsive.js +242 -0
  165. package/lib/v1/Responsive/RefWrapper.js +57 -0
  166. package/lib/v1/Responsive/ResizeComponent.js +268 -0
  167. package/lib/v1/Responsive/ResizeObserver.js +168 -0
  168. package/lib/v1/Responsive/Responsive.js +274 -0
  169. package/lib/v1/Responsive/index.js +55 -0
  170. package/lib/v1/ResponsiveDropBox/ResponsiveDropBox.js +79 -0
  171. package/lib/v1/Ribbon/Ribbon.js +44 -0
  172. package/lib/v1/RippleEffect/RippleEffect.js +39 -0
  173. package/lib/v1/Select/GroupSelect.js +877 -0
  174. package/lib/v1/Select/Select.js +1013 -0
  175. package/lib/v1/Select/SelectWithAvatar.js +394 -0
  176. package/lib/v1/Select/SelectWithIcon.js +597 -0
  177. package/lib/v1/Select/index.js +39 -0
  178. package/lib/v1/Stencils/Stencils.js +43 -0
  179. package/lib/v1/Switch/Switch.js +108 -0
  180. package/lib/v1/Tab/Tab.js +132 -0
  181. package/lib/v1/Tab/TabContent.js +42 -0
  182. package/lib/v1/Tab/TabContentWrapper.js +42 -0
  183. package/lib/v1/Tab/TabWrapper.js +89 -0
  184. package/lib/v1/Tab/Tabs.js +680 -0
  185. package/lib/v1/Tab/index.js +47 -0
  186. package/lib/v1/Tag/Tag.js +154 -0
  187. package/lib/v1/TextBox/TextBox.js +168 -0
  188. package/lib/v1/TextBoxIcon/TextBoxIcon.js +196 -0
  189. package/lib/v1/Textarea/Textarea.js +118 -0
  190. package/lib/v1/Tooltip/Tooltip.js +586 -0
  191. package/lib/v1/Typography/Typography.js +56 -0
  192. package/lib/v1/Typography/css/Typography.module.css +376 -0
  193. package/lib/v1/Typography/css/cssJSLogic.js +41 -0
  194. package/lib/v1/Typography/css/letterSpacingMap.js +20 -0
  195. package/lib/v1/Typography/props/defaultProps.js +15 -0
  196. package/lib/v1/Typography/props/propTypes.js +35 -0
  197. package/lib/v1/VelocityAnimation/VelocityAnimation/VelocityAnimation.js +90 -0
  198. package/lib/v1/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +126 -0
  199. package/lib/v1/semantic/Button/Button.js +63 -0
  200. package/lib/v1/semantic/index.js +15 -0
  201. package/package.json +1 -1
  202. package/result.json +1 -1
@@ -0,0 +1,969 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+
3
+ /**** Libraries ****/
4
+ import React, { Component } from 'react';
5
+ import { Select_defaultProps } from '../../Select/props/defaultProps';
6
+ import { Select_propTypes } from '../../Select/props/propTypes';
7
+ /**** Components ****/
8
+
9
+ import Popup from '../Popup/Popup';
10
+ import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
11
+ import { Container, Box } from '../Layout';
12
+ import Textbox from '../TextBox/TextBox';
13
+ import Card, { CardHeader, CardContent, CardFooter } from '../Card/Card';
14
+ import Suggestions from '../MultiSelect/Suggestions';
15
+ import EmptyState from '../MultiSelect/EmptyState';
16
+ import { getUniqueId } from '../../Provider/IdProvider';
17
+ import { Icon } from '@zohodesk/icons';
18
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
19
+ import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
20
+ import Loader from '@zohodesk/svg/lib/Loader/Loader';
21
+ /**** Methods ****/
22
+
23
+ import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetSelectedValueText as makeGetSelectedValue } from '../../utils/dropDownUtils';
24
+ import { debounce, scrollTo, getIsEmptyValue, getSearchString, findScrollEnd } from '../../utils/Common.js';
25
+ /**** CSS ****/
26
+
27
+ import style from '../../Select/Select.module.css';
28
+ import { getLibraryConfig } from '../../Provider/Config';
29
+ /* eslint-disable react/no-deprecated */
30
+
31
+ /* eslint-disable react/no-unused-prop-types */
32
+
33
+ let dummyArray = [];
34
+ export class SelectComponent extends Component {
35
+ constructor(props) {
36
+ super(props);
37
+ this.getNextAriaId = getUniqueId(this);
38
+ this.getFilterSuggestions = makeGetFilterSuggestions();
39
+ this.formatOptions = makeFormatOptions();
40
+ this.getSelectedValue = makeGetSelectedValue();
41
+ this.selectedFormatOptions = {};
42
+ let {
43
+ selectedValue,
44
+ searchDebounceTime = 500,
45
+ isDefaultSelectValue,
46
+ autoSelectDebouneTime = 350,
47
+ valueField,
48
+ textField
49
+ } = props;
50
+ let {
51
+ allOptions,
52
+ normalizedAllOptions,
53
+ optionsOrder,
54
+ normalizedFormatOptions
55
+ } = this.handleFormatOptions(this.props);
56
+ let {
57
+ selected,
58
+ hoverIndex,
59
+ selectedValueDetails,
60
+ selectedId,
61
+ isSelfValueChanged
62
+ } = this.getSelectedValue({
63
+ optionsOrder,
64
+ selectedValue,
65
+ normalizedFormatOptions,
66
+ selectedFormatOptions: this.selectedFormatOptions,
67
+ isDefaultSelectValue,
68
+ valueField,
69
+ textField
70
+ }); // eslint-disable-next-line
71
+
72
+ if (isSelfValueChanged) {// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
73
+ }
74
+
75
+ this.state = {
76
+ selected,
77
+ options: allOptions,
78
+ optionsNormalize: normalizedAllOptions,
79
+ hoverIndex,
80
+ searchStr: '',
81
+ isFetchingOptions: false,
82
+ selectedId,
83
+ selectedValueIndex: hoverIndex
84
+ };
85
+ this.optionsOrder = optionsOrder;
86
+ this._isMounted = false;
87
+ this.normalizedFormatOptions = normalizedFormatOptions;
88
+ this.allSelectedOptions = selectedValueDetails;
89
+ this.handleChange = this.handleChange.bind(this);
90
+ this.handleKeyDown = this.handleKeyDown.bind(this);
91
+ this.handleSearch = this.handleSearch.bind(this);
92
+ this.handleFilterSuggestions = this.handleFilterSuggestions.bind(this);
93
+ this.handleMouseEnter = this.handleMouseEnter.bind(this);
94
+ this.handleFetchOptions = this.handleFetchOptions.bind(this);
95
+ this.handleGetNextOptions = this.handleGetNextOptions.bind(this);
96
+ this.handleScroll = this.handleScroll.bind(this);
97
+ this.handleSearchOptions = debounce(this.handleSearchOptions.bind(this), searchDebounceTime);
98
+ this.suggestionContainerRef = this.suggestionContainerRef.bind(this);
99
+ this.suggestionItemRef = this.suggestionItemRef.bind(this);
100
+ this.searchInputRef = this.searchInputRef.bind(this);
101
+ this.valueInputRef = this.valueInputRef.bind(this);
102
+ this.togglePopup = this.togglePopup.bind(this);
103
+ this.handleSelectFocus = this.handleSelectFocus.bind(this);
104
+ this.handleFormatOptions = this.handleFormatOptions.bind(this);
105
+ this.handlePopupClose = this.handlePopupClose.bind(this);
106
+ this.handleClearSearch = this.handleClearSearch.bind(this);
107
+ this.handleValueInputChange = this.handleValueInputChange.bind(this);
108
+ this.handleChangeOnType = debounce(this.handleChangeOnType.bind(this), autoSelectDebouneTime);
109
+ this.handleAddNewOption = this.handleAddNewOption.bind(this);
110
+ this.handleExposePopupHandlers = this.handleExposePopupHandlers.bind(this);
111
+ this.handleGetAddNewOptionText = this.handleGetAddNewOptionText.bind(this);
112
+ this.valueInputTypeString = '';
113
+ this.valueInputSearchString = '';
114
+ this.autoSelectSuggestions = [];
115
+ this.autoSelectIndex = 0;
116
+ }
117
+
118
+ componentDidMount() {
119
+ this._isMounted = true;
120
+ this.handleExposePopupHandlers(); // let { suggestionContainer } = this;
121
+ // suggestionContainer &&
122
+ // suggestionContainer.addEventListener('scroll', this.handleScroll);
123
+ }
124
+
125
+ componentWillReceiveProps(nextProps) {
126
+ let {
127
+ selectedValue,
128
+ isDefaultSelectValue,
129
+ valueField,
130
+ textField
131
+ } = nextProps;
132
+ let {
133
+ hoverIndex: oldHoverIndex
134
+ } = this.state;
135
+ let {
136
+ allOptions,
137
+ normalizedAllOptions,
138
+ optionsOrder,
139
+ normalizedFormatOptions
140
+ } = this.handleFormatOptions(nextProps);
141
+ let {
142
+ selectedFormatOptions: oldSelectedFormatOptions
143
+ } = this;
144
+ let {
145
+ selected,
146
+ hoverIndex,
147
+ selectedValueDetails,
148
+ selectedId,
149
+ isSelfValueChanged
150
+ } = this.getSelectedValue({
151
+ optionsOrder,
152
+ selectedValue,
153
+ normalizedFormatOptions,
154
+ selectedFormatOptions: oldSelectedFormatOptions,
155
+ isDefaultSelectValue,
156
+ valueField,
157
+ textField
158
+ });
159
+ let {
160
+ selectedValue: oldSelectedValue
161
+ } = this.props; // eslint-disable-next-line
162
+
163
+ if (isSelfValueChanged && oldSelectedValue !== selectedValue) {// onChange && onChange(selectedId, normalizedAllOptions[selectedId]);
164
+ }
165
+
166
+ this.selectedFormatOptions = Object.assign(oldSelectedFormatOptions, selectedValueDetails);
167
+ this.normalizedFormatOptions = normalizedFormatOptions;
168
+ this.optionsOrder = optionsOrder;
169
+ this.setState({
170
+ options: allOptions,
171
+ optionsNormalize: normalizedAllOptions,
172
+ selected,
173
+ hoverIndex: oldHoverIndex ? oldHoverIndex : hoverIndex,
174
+ selectedId,
175
+ selectedValueIndex: hoverIndex
176
+ });
177
+ }
178
+
179
+ componentDidUpdate(prevProps) {
180
+ let {
181
+ suggestionContainer,
182
+ optionsOrder
183
+ } = this;
184
+ let {
185
+ hoverIndex,
186
+ searchStr,
187
+ selectedValueIndex
188
+ } = this.state;
189
+ let {
190
+ needLocalSearch,
191
+ onDropBoxClose,
192
+ onDropBoxOpen,
193
+ needSearch,
194
+ onSearch,
195
+ isPopupOpen,
196
+ isSearchClearOnClose
197
+ } = this.props;
198
+ let hoverId = getIsEmptyValue(optionsOrder[hoverIndex]) ? '' : optionsOrder[hoverIndex];
199
+ let selSuggestion = this[`suggestion_${hoverId}`];
200
+ isPopupOpen && scrollTo(suggestionContainer, selSuggestion);
201
+
202
+ if (prevProps.isPopupOpen !== isPopupOpen) {
203
+ if (isPopupOpen) {
204
+ onDropBoxOpen && this.handleFetchOptions(onDropBoxOpen, searchStr);
205
+ setTimeout(() => {
206
+ this.searchInput && this.searchInput.focus({
207
+ preventScroll: true
208
+ });
209
+ }, 10);
210
+ } else {
211
+ // needSearch && this.valueInput && this.valueInput.focus({preventScroll:true});
212
+ onDropBoxClose && onDropBoxClose();
213
+ isSearchClearOnClose && searchStr && onSearch && onSearch('');
214
+ this.setState({
215
+ searchStr: isSearchClearOnClose ? '' : searchStr,
216
+ hoverIndex: selectedValueIndex
217
+ });
218
+ }
219
+ } //When suggestions length less than 5, getNextOptions function call
220
+
221
+
222
+ let {
223
+ isNextOptions,
224
+ getNextOptions
225
+ } = this.props; // let { searchStr } = this.state;
226
+
227
+ let suggestions = isPopupOpen ? this.handleFilterSuggestions() : [];
228
+ let suggestionsLen = suggestions.length;
229
+
230
+ if (isPopupOpen && suggestionsLen <= 5 && isNextOptions && getNextOptions && !needLocalSearch) {
231
+ this.handleFetchOptions(getNextOptions, searchStr);
232
+ }
233
+ }
234
+
235
+ componentWillUnmount() {
236
+ this._isMounted = false;
237
+ let {
238
+ getPopupHandlers
239
+ } = this.props;
240
+ let methods = {
241
+ removeClose: null,
242
+ openPopup: null,
243
+ closePopup: null,
244
+ togglePopup: null
245
+ };
246
+ getPopupHandlers && getPopupHandlers(methods); // let { suggestionContainer } = this;
247
+ // suggestionContainer &&
248
+ // suggestionContainer.removeEventListener('scroll', this.handleScroll);
249
+ }
250
+
251
+ handleFormatOptions(props) {
252
+ let {
253
+ options,
254
+ valueField,
255
+ textField,
256
+ customProps = {}
257
+ } = props;
258
+ let {
259
+ listItemProps = {}
260
+ } = customProps;
261
+ return this.formatOptions({
262
+ options,
263
+ valueField,
264
+ textField,
265
+ listItemProps
266
+ });
267
+ }
268
+
269
+ handleChange(id, value, index, e) {
270
+ e && e.preventDefault && e.preventDefault();
271
+ let {
272
+ onChange,
273
+ isReadOnly,
274
+ needCloseOnSelect
275
+ } = this.props;
276
+ let {
277
+ optionsNormalize
278
+ } = this.state;
279
+ !isReadOnly && onChange && onChange(id, optionsNormalize[id]); // this.valueInput && this.valueInput.focus({preventScroll:true});
280
+
281
+ needCloseOnSelect && this.handlePopupClose(e);
282
+ }
283
+
284
+ responsiveFunc(_ref) {
285
+ let {
286
+ mediaQueryOR
287
+ } = _ref;
288
+ return {
289
+ tabletMode: mediaQueryOR([{
290
+ maxWidth: 700
291
+ }])
292
+ };
293
+ }
294
+
295
+ handleKeyDown(e) {
296
+ let {
297
+ onChange,
298
+ isPopupOpen,
299
+ onKeyDown,
300
+ isPopupOpenOnEnter,
301
+ needCloseOnSelect
302
+ } = this.props;
303
+ let {
304
+ hoverIndex,
305
+ optionsNormalize
306
+ } = this.state;
307
+ let options = this.handleFilterSuggestions();
308
+ let {
309
+ keyCode
310
+ } = e;
311
+
312
+ if (!isPopupOpen && !isPopupOpenOnEnter) {
313
+ onKeyDown && onKeyDown(e);
314
+ }
315
+
316
+ if (isPopupOpen && (keyCode === 38 || keyCode === 40 || keyCode === 13) && e.preventDefault) {
317
+ e.preventDefault(); //prevent body scroll and enter key prevent
318
+ } else if (!isPopupOpen && keyCode === 40) {
319
+ e.preventDefault(); //prevent body scroll
320
+
321
+ this.togglePopup(e);
322
+ }
323
+
324
+ if (keyCode === 38 && isPopupOpen && options.length) {
325
+ // eslint-disable-next-line
326
+ if (hoverIndex === 0) {// hoverIndex = options.length - 1;
327
+ } else {
328
+ hoverIndex -= 1;
329
+ }
330
+
331
+ this.setState({
332
+ hoverIndex
333
+ });
334
+ } else if (keyCode === 40 && isPopupOpen && options.length) {
335
+ // eslint-disable-next-line
336
+ if (hoverIndex === options.length - 1) {// hoverIndex = 0;
337
+ } else {
338
+ if (hoverIndex === options.length - 3) {
339
+ this.handleGetNextOptions();
340
+ }
341
+
342
+ hoverIndex += 1;
343
+ }
344
+
345
+ this.setState({
346
+ hoverIndex
347
+ });
348
+ } else if (keyCode === 13) {
349
+ let option = options[hoverIndex];
350
+ let {
351
+ id
352
+ } = option || {};
353
+
354
+ if (isPopupOpen && !getIsEmptyValue(id) && onChange) {
355
+ onChange(id, optionsNormalize[id]);
356
+ needCloseOnSelect && this.handlePopupClose(e);
357
+ }
358
+
359
+ if (!isPopupOpen && isPopupOpenOnEnter) {
360
+ this.togglePopup(e);
361
+ }
362
+ } else if (keyCode === 27) {
363
+ this.valueInput && this.valueInput.focus({
364
+ preventScroll: true
365
+ }); //this.handlePopupClose(e);
366
+ } else if (keyCode === 9) {
367
+ let option = options[hoverIndex];
368
+ let {
369
+ id
370
+ } = option || {};
371
+
372
+ if (isPopupOpen && !getIsEmptyValue(id)) {
373
+ onChange && onChange(id, optionsNormalize[id]);
374
+ needCloseOnSelect && this.handlePopupClose(e);
375
+ }
376
+
377
+ if (!isPopupOpen && isPopupOpenOnEnter) {
378
+ this.togglePopup(e);
379
+ }
380
+ }
381
+ }
382
+
383
+ handleSearchOptions() {
384
+ let {
385
+ onSearch
386
+ } = this.props;
387
+ let {
388
+ searchStr
389
+ } = this.state;
390
+ searchStr && this.handleFetchOptions(onSearch, searchStr);
391
+ }
392
+
393
+ handleSearch(value) {
394
+ // let { value = '' } = e.target;
395
+ let {
396
+ searchStr = ''
397
+ } = this.state;
398
+ let {
399
+ onSearch
400
+ } = this.props;
401
+ let searchStrRegex = getSearchString(searchStr);
402
+ let valueStrRegex = getSearchString(value);
403
+ let isSearch = searchStrRegex !== valueStrRegex ? true : false;
404
+ this.setState({
405
+ searchStr: value,
406
+ hoverIndex: 0
407
+ }, () => {
408
+ if (!value) {
409
+ onSearch && this.handleFetchOptions(onSearch, '');
410
+ } else if (isSearch && onSearch) {
411
+ this.handleSearchOptions();
412
+ }
413
+ });
414
+ }
415
+
416
+ handleMouseEnter(id
417
+ /*val, index*/
418
+ ) {
419
+ let {
420
+ hoverIndex
421
+ } = this.state;
422
+ let {
423
+ optionsOrder
424
+ } = this;
425
+ let newHoverIndex = optionsOrder.indexOf(id);
426
+ hoverIndex !== newHoverIndex && this.setState({
427
+ hoverIndex: newHoverIndex
428
+ });
429
+ }
430
+
431
+ handleFilterSuggestions() {
432
+ let {
433
+ needLocalSearch,
434
+ excludeOptions = dummyArray // needSearch
435
+
436
+ } = this.props;
437
+ let {
438
+ options = dummyArray,
439
+ searchStr = ''
440
+ } = this.state; // if (
441
+ // (needSearch && searchStr && searchStr.trim().length) ||
442
+ // (excludeOptions && excludeOptions.length)
443
+ // ) {
444
+
445
+ searchStr = getSearchString(searchStr);
446
+ let {
447
+ suggestions,
448
+ suggestionIds
449
+ } = this.getFilterSuggestions({
450
+ options,
451
+ selectedOptions: excludeOptions,
452
+ searchStr,
453
+ needSearch: needLocalSearch
454
+ });
455
+ this.optionsOrder = suggestionIds;
456
+ return suggestions; // }
457
+ // return options;
458
+ }
459
+
460
+ handleScroll(e) {
461
+ let ele = e.target;
462
+ let isScrollReachedBottom = findScrollEnd(ele);
463
+ isScrollReachedBottom && this.handleGetNextOptions();
464
+ }
465
+
466
+ handleFetchOptions(APICall) {
467
+ let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
468
+ // let funcArgs = args.slice(1, args.length);
469
+ let {
470
+ isFetchingOptions = false
471
+ } = this.state;
472
+ let {
473
+ _isMounted
474
+ } = this;
475
+
476
+ if (!isFetchingOptions && APICall) {
477
+ this.setState({
478
+ isFetchingOptions: true
479
+ });
480
+
481
+ try {
482
+ return APICall(searchStr).then(() => {
483
+ _isMounted && this.setState({
484
+ isFetchingOptions: false
485
+ });
486
+ }, () => {
487
+ _isMounted && this.setState({
488
+ isFetchingOptions: false
489
+ });
490
+ });
491
+ } catch (e) {
492
+ _isMounted && this.setState({
493
+ isFetchingOptions: false
494
+ });
495
+ }
496
+ }
497
+ }
498
+
499
+ handleGetNextOptions() {
500
+ let {
501
+ isNextOptions,
502
+ getNextOptions
503
+ } = this.props;
504
+ let {
505
+ searchStr
506
+ } = this.state;
507
+ isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
508
+ }
509
+
510
+ togglePopup(e) {
511
+ let {
512
+ togglePopup,
513
+ isReadOnly,
514
+ defaultDropBoxPosition,
515
+ onFocus,
516
+ isPopupOpen
517
+ } = this.props;
518
+ !isReadOnly && togglePopup(e, defaultDropBoxPosition ? `${defaultDropBoxPosition}` : null);
519
+ !isPopupOpen && typeof onFocus === 'function' && onFocus(e);
520
+ }
521
+
522
+ handlePopupClose(e) {
523
+ let {
524
+ closePopupOnly
525
+ } = this.props;
526
+ this.valueInput && this.valueInput.focus({
527
+ preventScroll: true
528
+ });
529
+ closePopupOnly(e);
530
+ }
531
+
532
+ suggestionContainerRef(el) {
533
+ this.suggestionContainer = el;
534
+ }
535
+
536
+ suggestionItemRef(el, index, id) {
537
+ this[`suggestion_${id}`] = el;
538
+ }
539
+
540
+ searchInputRef(el) {
541
+ this.searchInput = el;
542
+ }
543
+
544
+ valueInputRef(el) {
545
+ let {
546
+ getRef
547
+ } = this.props;
548
+ this.valueInput = el;
549
+ getRef && getRef(el);
550
+ }
551
+
552
+ handleSelectFocus() {
553
+ let {
554
+ valueInput
555
+ } = this;
556
+ valueInput && valueInput.setSelectionRange(valueInput, 0);
557
+ }
558
+
559
+ handleClearSearch() {
560
+ this.handleSearch('');
561
+ setTimeout(() => {
562
+ this.searchInput && this.searchInput.focus({
563
+ preventScroll: true
564
+ });
565
+ }, 1);
566
+ }
567
+
568
+ handleValueInputChange(e) {
569
+ let {
570
+ which
571
+ } = e;
572
+ let typeString = String.fromCharCode(which);
573
+ let {
574
+ isPopupOpen,
575
+ autoSelectOnType
576
+ } = this.props;
577
+
578
+ if (!isPopupOpen && autoSelectOnType) {
579
+ this.valueInputTypeString += (typeString || '').trim();
580
+ this.handleChangeOnType();
581
+ }
582
+ }
583
+
584
+ handleChangeOnType() {
585
+ let {
586
+ excludeOptions = dummyArray
587
+ } = this.props;
588
+ let {
589
+ options = dummyArray
590
+ } = this.state;
591
+ let {
592
+ optionsOrder
593
+ } = this;
594
+ let typeString = this.valueInputTypeString;
595
+ this.valueInputTypeString = '';
596
+
597
+ let changeValue = () => {
598
+ let optionDetails = this.autoSelectSuggestions[this.autoSelectIndex];
599
+ let {
600
+ id
601
+ } = optionDetails || {};
602
+
603
+ if (!getIsEmptyValue(id)) {
604
+ this.handleChange(id);
605
+ let hoverIndex = optionsOrder.indexOf(id);
606
+ this.setState({
607
+ hoverIndex
608
+ });
609
+ }
610
+ };
611
+
612
+ if (typeString && typeString === this.valueInputSearchString) {
613
+ if (this.autoSelectIndex < this.autoSelectSuggestions.length - 1) {
614
+ this.autoSelectIndex += 1;
615
+ } else {
616
+ this.autoSelectIndex = 0;
617
+ }
618
+
619
+ changeValue();
620
+ } else if (typeString) {
621
+ this.valueInputSearchString = typeString;
622
+ let {
623
+ suggestions = []
624
+ } = this.getFilterSuggestions({
625
+ options,
626
+ selectedOptions: excludeOptions,
627
+ searchStr: typeString,
628
+ needSearch: true,
629
+ isStartsWithSearch: true
630
+ });
631
+ this.autoSelectIndex = 0;
632
+ this.autoSelectSuggestions = suggestions;
633
+ changeValue();
634
+ }
635
+ }
636
+
637
+ handleAddNewOption() {
638
+ let {
639
+ searchStr
640
+ } = this.state;
641
+ let {
642
+ onAddNewOption,
643
+ getCustomEmptyState
644
+ } = this.props;
645
+
646
+ if (getCustomEmptyState) {
647
+ this.setState({
648
+ searchStr: ''
649
+ });
650
+ this.handleFetchOptions(onAddNewOption, searchStr);
651
+ }
652
+ }
653
+
654
+ handleExposePopupHandlers() {
655
+ let {
656
+ removeClose,
657
+ openPopupOnly,
658
+ closePopupOnly,
659
+ togglePopup,
660
+ getPopupHandlers
661
+ } = this.props;
662
+ let methods = {
663
+ removeClose,
664
+ openPopup: openPopupOnly,
665
+ closePopup: closePopupOnly,
666
+ togglePopup
667
+ };
668
+ getPopupHandlers && getPopupHandlers(methods);
669
+ }
670
+
671
+ handleGetAddNewOptionText() {
672
+ let {
673
+ searchStr
674
+ } = this.state;
675
+ let {
676
+ getCustomEmptyState
677
+ } = this.props;
678
+ return getCustomEmptyState({
679
+ searchString: searchStr,
680
+ onAddNewOption: this.handleAddNewOption
681
+ });
682
+ }
683
+
684
+ render() {
685
+ let {
686
+ needSearch,
687
+ dropBoxSize,
688
+ emptyMessage,
689
+ searchEmptyMessage,
690
+ needBorder,
691
+ needSelectDownIcon,
692
+ position,
693
+ defaultDropBoxPosition,
694
+ getTargetRef,
695
+ getContainerRef,
696
+ removeClose,
697
+ isPopupOpen,
698
+ isPopupReady,
699
+ animationStyle,
700
+ textBoxSize,
701
+ textBoxVariant,
702
+ searchBoxSize,
703
+ searchBoxPlaceHolder,
704
+ maxLength,
705
+ isDisabled,
706
+ title,
707
+ size,
708
+ placeHolder,
709
+ className,
710
+ isReadOnly,
711
+ dataId,
712
+ needResponsive,
713
+ borderColor,
714
+ needTick,
715
+ listItemSize,
716
+ boxSize,
717
+ needListBorder,
718
+ getFooter,
719
+ getChildren,
720
+ getCustomEmptyState,
721
+ isParentBased,
722
+ i18nKeys,
723
+ htmlId,
724
+ children,
725
+ iconOnHover,
726
+ customProps,
727
+ autoComplete,
728
+ ariaLabelledby,
729
+ isLoading,
730
+ dataSelectorId,
731
+ isAbsolutePositioningNeeded,
732
+ positionsOffset,
733
+ targetOffset,
734
+ isRestrictScroll,
735
+ dropBoxPortalId
736
+ } = this.props;
737
+ let {
738
+ TextBoxIcon_i18n,
739
+ TextBox_ally_label = 'click to select options'
740
+ } = i18nKeys;
741
+ i18nKeys = Object.assign({}, i18nKeys, {
742
+ emptyText: i18nKeys.emptyText || emptyMessage,
743
+ searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
744
+ });
745
+ let {
746
+ hoverIndex,
747
+ selected,
748
+ searchStr,
749
+ isFetchingOptions,
750
+ selectedId,
751
+ options
752
+ } = this.state;
753
+ let suggestions = this.handleFilterSuggestions();
754
+ let setAriaId = this.getNextAriaId();
755
+ let ariaErrorId = this.getNextAriaId();
756
+ let {
757
+ TextBoxProps = {},
758
+ DropdownSearchTextBoxProps = {},
759
+ SuggestionsProps = {}
760
+ } = customProps;
761
+ return /*#__PURE__*/React.createElement("div", {
762
+ className: `${isParentBased || isReadOnly || isDisabled ? style.container : ''} ${style[`box_${size}`]} ${isReadOnly ? style.readonly : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${iconOnHover && (isReadOnly || isDisabled) ? style.iconOnHoverReadonly : iconOnHover && !(isReadOnly || isDisabled) ? style.iconOnHoverStyle : ''}`,
763
+ "data-title": isDisabled ? title : null,
764
+ "data-selector-id": dataSelectorId
765
+ }, /*#__PURE__*/React.createElement("div", {
766
+ className: `${className ? className : ''}`,
767
+ onClick: isDisabled || isReadOnly ? null : this.togglePopup,
768
+ ref: getTargetRef,
769
+ "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
770
+ "data-test-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`
771
+ }, needSelectDownIcon ? /*#__PURE__*/React.createElement(TextBoxIcon, {
772
+ a11y: {
773
+ role: 'Menuitem',
774
+ ariaLabel: TextBox_ally_label,
775
+ ariaControls: setAriaId,
776
+ ariaExpanded: !isReadOnly && !isDisabled && isPopupOpen ? true : false,
777
+ ariaHaspopup: true,
778
+ ariaReadonly: true,
779
+ ariaActivedescendant: selectedId,
780
+ ariaOwns: setAriaId,
781
+ ariaLabelledby: ariaLabelledby
782
+ },
783
+ isDisabled: isDisabled,
784
+ iconRotated: isPopupOpen,
785
+ inputRef: this.valueInputRef,
786
+ maxLength: maxLength,
787
+ needBorder: needBorder,
788
+ onFocus: this.handleSelectFocus,
789
+ onKeyDown: this.handleKeyDown,
790
+ placeHolder: placeHolder,
791
+ isReadOnly: true,
792
+ size: textBoxSize,
793
+ value: selected,
794
+ variant: textBoxVariant,
795
+ needReadOnlyStyle: isReadOnly ? true : false,
796
+ dataId: `${dataId}_textBox`,
797
+ isClickable: isReadOnly || isDisabled ? false : true,
798
+ customClass: {
799
+ customTBoxWrap: isReadOnly || isDisabled ? '' : style.input
800
+ },
801
+ needEffect: isReadOnly || isDisabled ? false : true,
802
+ onKeyPress: this.handleValueInputChange,
803
+ borderColor: borderColor,
804
+ htmlId: htmlId,
805
+ isFocus: isPopupReady,
806
+ autoComplete: autoComplete,
807
+ customProps: {
808
+ TextBoxProps: TextBoxProps
809
+ }
810
+ }, /*#__PURE__*/React.createElement(Container, {
811
+ alignBox: "row",
812
+ align: "both"
813
+ }, children ? /*#__PURE__*/React.createElement(Box, {
814
+ className: isPopupOpen ? style.rotate : '',
815
+ dataId: `${dataId}_children`
816
+ }, children) : null, /*#__PURE__*/React.createElement(Container, {
817
+ align: "both",
818
+ dataId: `${dataId}_downIcon`,
819
+ "aria-hidden": true,
820
+ className: style.arrowIcon
821
+ }, /*#__PURE__*/React.createElement(Icon, {
822
+ name: "ZD-down",
823
+ size: "7"
824
+ })))) : /*#__PURE__*/React.createElement(Textbox, {
825
+ a11y: {
826
+ role: 'Menuitem',
827
+ ariaLabel: TextBox_ally_label,
828
+ ariaControls: setAriaId,
829
+ ariaExpanded: !isReadOnly && !isDisabled && isPopupOpen ? true : false,
830
+ ariaHaspopup: true,
831
+ ariaReadonly: true,
832
+ ariaActivedescendant: selectedId,
833
+ ariaOwns: setAriaId,
834
+ ariaLabelledby: ariaLabelledby
835
+ },
836
+ isDisabled: isDisabled,
837
+ inputRef: this.valueInputRef,
838
+ maxLength: maxLength,
839
+ needBorder: needBorder,
840
+ onFocus: this.handleSelectFocus,
841
+ onKeyDown: getChildren && this.handleKeyDown,
842
+ placeHolder: placeHolder,
843
+ isReadOnly: true,
844
+ needEffect: isReadOnly || isDisabled ? false : true,
845
+ size: textBoxSize,
846
+ value: selected,
847
+ variant: textBoxVariant,
848
+ needReadOnlyStyle: isReadOnly ? true : false,
849
+ dataId: `${dataId}_textBox`,
850
+ isClickable: isReadOnly || isDisabled ? false : true,
851
+ onKeyPress: this.handleValueInputChange,
852
+ borderColor: borderColor,
853
+ htmlId: htmlId,
854
+ autoComplete: autoComplete,
855
+ isFocus: isPopupReady,
856
+ customProps: TextBoxProps
857
+ })), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
858
+ query: this.responsiveFunc,
859
+ responsiveId: "Helmet"
860
+ }, _ref2 => {
861
+ let {
862
+ tabletMode
863
+ } = _ref2;
864
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
865
+ animationStyle: animationStyle,
866
+ boxPosition: position || `${defaultDropBoxPosition}`,
867
+ getRef: getContainerRef,
868
+ isActive: isPopupReady,
869
+ isAnimate: true,
870
+ isArrow: false,
871
+ onClick: removeClose,
872
+ needResponsive: needResponsive,
873
+ dataId: `${dataId}_suggestions`,
874
+ size: boxSize,
875
+ isPadding: false,
876
+ isResponsivePadding: getFooter ? false : true,
877
+ alignBox: "row",
878
+ isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
879
+ positionsOffset: positionsOffset,
880
+ targetOffset: targetOffset,
881
+ isRestrictScroll: isRestrictScroll,
882
+ portalId: dropBoxPortalId
883
+ }, isLoading ? /*#__PURE__*/React.createElement(Container, {
884
+ align: "both",
885
+ className: style.loader
886
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, !getChildren ? /*#__PURE__*/React.createElement(Box, {
887
+ flexible: true
888
+ }, /*#__PURE__*/React.createElement(Card, {
889
+ onScroll: this.handleScroll
890
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
891
+ className: `${style.search} ${style[size]}`
892
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
893
+ a11y: {
894
+ ariaControls: setAriaId,
895
+ ariaAutocomplete: 'list',
896
+ ariaDescribedby: ariaErrorId
897
+ },
898
+ inputRef: this.searchInputRef,
899
+ maxLength: maxLength,
900
+ onChange: this.handleSearch,
901
+ onKeyDown: this.handleKeyDown,
902
+ placeHolder: searchBoxPlaceHolder,
903
+ size: searchBoxSize,
904
+ value: searchStr,
905
+ onClear: this.handleClearSearch,
906
+ dataId: `${dataId}_search`,
907
+ i18nKeys: TextBoxIcon_i18n,
908
+ autoComplete: autoComplete,
909
+ customProps: {
910
+ TextBoxProps: DropdownSearchTextBoxProps
911
+ }
912
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
913
+ shrink: true,
914
+ customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
915
+ eleRef: this.suggestionContainerRef
916
+ }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
917
+ activeId: selectedId,
918
+ suggestions: suggestions,
919
+ getRef: this.suggestionItemRef,
920
+ hoverOption: hoverIndex,
921
+ onClick: this.handleChange,
922
+ onMouseEnter: this.handleMouseEnter,
923
+ dataId: `${dataId}_Options`,
924
+ needTick: needTick,
925
+ needBorder: needListBorder,
926
+ selectedOptions: [selectedId],
927
+ className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
928
+ listItemSize: listItemSize,
929
+ htmlId: setAriaId,
930
+ a11y: {
931
+ ariaParentRole: 'listbox',
932
+ role: 'option'
933
+ }
934
+ }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
935
+ isLoading: isFetchingOptions,
936
+ options: options,
937
+ searchString: searchStr,
938
+ suggestions: suggestions,
939
+ dataId: dataId,
940
+ getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
941
+ i18nKeys: i18nKeys,
942
+ htmlId: ariaErrorId
943
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
944
+ isCover: false,
945
+ align: "both"
946
+ }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)) : /*#__PURE__*/React.createElement(Box, {
947
+ flexible: true
948
+ }, getChildren())));
949
+ }) : null);
950
+ }
951
+
952
+ }
953
+ SelectComponent.propTypes = Select_propTypes;
954
+ SelectComponent.defaultProps = Select_defaultProps;
955
+ SelectComponent.displayName = 'Select';
956
+ let Select = Popup(SelectComponent);
957
+ Select.defaultProps = SelectComponent.defaultProps;
958
+ Select.propTypes = Select_propTypes;
959
+ Select.displayName = 'Select';
960
+ export default Select; // if (__DOCS__) {
961
+ // Select.docs = {
962
+ // componentGroup: 'Form Elements',
963
+ // folderName: 'Style Guide',
964
+ // external: true,
965
+ // description: ' '
966
+ // };
967
+ // // eslint-disable-next-line react/forbid-foreign-prop-types
968
+ // Select.propTypes = SelectComponent.propTypes;
969
+ // }