@zohodesk/components 1.0.0-alpha-239 → 1.0.0-alpha-240

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 (41) hide show
  1. package/README.md +5 -0
  2. package/assets/Appearance/dark/mode/darkMode.module.css +0 -2
  3. package/assets/Appearance/default/mode/defaultMode.module.css +1 -3
  4. package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +0 -2
  5. package/es/DateTime/DateTime.js +42 -21
  6. package/es/DateTime/DateWidget.module.css +0 -4
  7. package/es/MultiSelect/AdvancedGroupMultiSelect.js +100 -75
  8. package/es/MultiSelect/AdvancedMultiSelect.js +75 -49
  9. package/es/MultiSelect/MultiSelect.js +80 -55
  10. package/es/MultiSelect/MultiSelect.module.css +6 -1
  11. package/es/MultiSelect/MultiSelectWithAvatar.js +77 -52
  12. package/es/PopOver/PopOver.js +10 -4
  13. package/es/ResponsiveDropBox/ResponsiveDropBox.js +74 -0
  14. package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
  15. package/es/Select/GroupSelect.js +99 -74
  16. package/es/Select/Select.js +95 -68
  17. package/es/Select/Select.module.css +6 -0
  18. package/es/Select/SelectWithAvatar.js +91 -66
  19. package/es/Select/SelectWithIcon.js +99 -74
  20. package/es/Tab/Tabs.js +68 -43
  21. package/es/Tab/Tabs.module.css +2 -1
  22. package/es/index.js +2 -1
  23. package/lib/DateTime/DateTime.js +42 -22
  24. package/lib/DateTime/DateWidget.module.css +0 -4
  25. package/lib/MultiSelect/AdvancedGroupMultiSelect.js +99 -77
  26. package/lib/MultiSelect/AdvancedMultiSelect.js +76 -50
  27. package/lib/MultiSelect/MultiSelect.js +81 -56
  28. package/lib/MultiSelect/MultiSelect.module.css +6 -1
  29. package/lib/MultiSelect/MultiSelectWithAvatar.js +78 -53
  30. package/lib/PopOver/PopOver.js +11 -4
  31. package/lib/ResponsiveDropBox/ResponsiveDropBox.js +130 -0
  32. package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
  33. package/lib/Select/GroupSelect.js +99 -76
  34. package/lib/Select/Select.js +102 -75
  35. package/lib/Select/Select.module.css +6 -0
  36. package/lib/Select/SelectWithAvatar.js +96 -71
  37. package/lib/Select/SelectWithIcon.js +97 -74
  38. package/lib/Tab/Tabs.js +67 -44
  39. package/lib/Tab/Tabs.module.css +2 -1
  40. package/lib/index.js +10 -1
  41. package/package.json +3 -3
@@ -6,7 +6,6 @@ import PropTypes from 'prop-types';
6
6
  /**** Components ****/
7
7
 
8
8
  import Popup from '../Popup/Popup';
9
- import DropBox from '../DropBox/DropBox';
10
9
  import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
11
10
  import { Container, Box } from '../Layout';
12
11
  import Textbox from '../TextBox/TextBox';
@@ -15,6 +14,8 @@ import Suggestions from '../MultiSelect/Suggestions';
15
14
  import EmptyState from '../MultiSelect/EmptyState';
16
15
  import { getUniqueId } from '../Provider/IdProvider';
17
16
  import Icon from '@zohodesk/icons/lib/Icon';
17
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
18
+ import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
18
19
  /**** Methods ****/
19
20
 
20
21
  import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetSelectedValueText as makeGetSelectedValue } from '../utils/dropDownUtils';
@@ -278,6 +279,17 @@ export class SelectComponent extends Component {
278
279
  needCloseOnSelect && this.handlePopupClose(e);
279
280
  }
280
281
 
282
+ responsiveFunc(_ref) {
283
+ let {
284
+ mediaQueryOR
285
+ } = _ref;
286
+ return {
287
+ tabletMode: mediaQueryOR([{
288
+ maxWidth: 700
289
+ }])
290
+ };
291
+ }
292
+
281
293
  handleKeyDown(e) {
282
294
  let {
283
295
  onChange,
@@ -835,73 +847,88 @@ export class SelectComponent extends Component {
835
847
  autoComplete: autoComplete,
836
848
  isFocus: isPopupReady,
837
849
  customProps: TextBoxProps
838
- })), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
839
- animationStyle: animationStyle,
840
- boxPosition: position || `${defaultDropBoxPosition}`,
841
- getRef: getContainerRef,
842
- isActive: isPopupReady,
843
- isAnimate: true,
844
- isArrow: false,
845
- onClick: removeClose,
846
- needResponsive: needResponsive,
847
- dataId: `${dataId}_suggestions`,
848
- size: boxSize,
849
- isPadding: false
850
- }, !getChildren ? /*#__PURE__*/React.createElement(Card, {
851
- onScroll: this.handleScroll
852
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
853
- className: `${style.search} ${style[size]}`
854
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
855
- a11y: {
856
- ariaControls: setAriaId,
857
- ariaAutocomplete: 'list',
858
- ariaDescribedby: ariaErrorId
859
- },
860
- inputRef: this.searchInputRef,
861
- maxLength: maxLength,
862
- onChange: this.handleSearch,
863
- onKeyDown: this.handleKeyDown,
864
- placeHolder: searchBoxPlaceHolder,
865
- size: searchBoxSize,
866
- value: searchStr,
867
- onClear: this.handleClearSearch,
868
- dataId: `${dataId}_search`,
869
- i18nKeys: TextBoxIcon_i18n,
870
- autoComplete: autoComplete,
871
- customProps: {
872
- TextBoxProps: DropdownSearchTextBoxProps
873
- }
874
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
875
- customClass: dropBoxSize ? style[dropBoxSize] : '',
876
- eleRef: this.suggestionContainerRef
877
- }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
878
- activeId: selectedId,
879
- suggestions: suggestions,
880
- getRef: this.suggestionItemRef,
881
- hoverOption: hoverIndex,
882
- onClick: this.handleChange,
883
- onMouseEnter: this.handleMouseEnter,
884
- dataId: `${dataId}_Options`,
885
- needTick: needTick,
886
- needBorder: needListBorder,
887
- selectedOptions: [selectedId],
888
- className: style.listItemContainer,
889
- listItemSize: listItemSize,
890
- htmlId: setAriaId,
891
- a11y: {
892
- ariaParentRole: 'listbox',
893
- role: 'option'
894
- }
895
- }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
896
- isLoading: isFetchingOptions,
897
- options: options,
898
- searchString: searchStr,
899
- suggestions: suggestions,
900
- dataId: dataId,
901
- getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
902
- i18nKeys: i18nKeys,
903
- htmlId: ariaErrorId
904
- })), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null) : getChildren()) : null);
850
+ })), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
851
+ query: this.responsiveFunc,
852
+ responsiveId: "Helmet"
853
+ }, _ref2 => {
854
+ let {
855
+ tabletMode
856
+ } = _ref2;
857
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
858
+ animationStyle: animationStyle,
859
+ boxPosition: position || `${defaultDropBoxPosition}`,
860
+ getRef: getContainerRef,
861
+ isActive: isPopupReady,
862
+ isAnimate: true,
863
+ isArrow: false,
864
+ onClick: removeClose,
865
+ needResponsive: needResponsive,
866
+ dataId: `${dataId}_suggestions`,
867
+ size: boxSize,
868
+ isPadding: false,
869
+ isResponsivePadding: getFooter ? false : true,
870
+ alignBox: "row"
871
+ }, !getChildren ? /*#__PURE__*/React.createElement(Box, {
872
+ flexible: true
873
+ }, /*#__PURE__*/React.createElement(Card, {
874
+ onScroll: this.handleScroll
875
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
876
+ className: `${style.search} ${style[size]}`
877
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
878
+ a11y: {
879
+ ariaControls: setAriaId,
880
+ ariaAutocomplete: 'list',
881
+ ariaDescribedby: ariaErrorId
882
+ },
883
+ inputRef: this.searchInputRef,
884
+ maxLength: maxLength,
885
+ onChange: this.handleSearch,
886
+ onKeyDown: this.handleKeyDown,
887
+ placeHolder: searchBoxPlaceHolder,
888
+ size: searchBoxSize,
889
+ value: searchStr,
890
+ onClear: this.handleClearSearch,
891
+ dataId: `${dataId}_search`,
892
+ i18nKeys: TextBoxIcon_i18n,
893
+ autoComplete: autoComplete,
894
+ customProps: {
895
+ TextBoxProps: DropdownSearchTextBoxProps
896
+ }
897
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
898
+ shrink: true,
899
+ customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
900
+ eleRef: this.suggestionContainerRef
901
+ }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
902
+ activeId: selectedId,
903
+ suggestions: suggestions,
904
+ getRef: this.suggestionItemRef,
905
+ hoverOption: hoverIndex,
906
+ onClick: this.handleChange,
907
+ onMouseEnter: this.handleMouseEnter,
908
+ dataId: `${dataId}_Options`,
909
+ needTick: needTick,
910
+ needBorder: needListBorder,
911
+ selectedOptions: [selectedId],
912
+ className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
913
+ listItemSize: listItemSize,
914
+ htmlId: setAriaId,
915
+ a11y: {
916
+ ariaParentRole: 'listbox',
917
+ role: 'option'
918
+ }
919
+ }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
920
+ isLoading: isFetchingOptions,
921
+ options: options,
922
+ searchString: searchStr,
923
+ suggestions: suggestions,
924
+ dataId: dataId,
925
+ getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
926
+ i18nKeys: i18nKeys,
927
+ htmlId: ariaErrorId
928
+ })), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)) : /*#__PURE__*/React.createElement(Box, {
929
+ flexible: true
930
+ }, getChildren()));
931
+ }) : null);
905
932
  }
906
933
 
907
934
  }
@@ -46,6 +46,9 @@
46
46
  .listItemContainer {
47
47
  padding: var(--zd_size10) 0;
48
48
  }
49
+ .responsivelistItemContainer {
50
+ padding: var(--zd_size10) 0 0;
51
+ }
49
52
  .readonly {
50
53
  --textboxicon_icon_cursor: not-allowed;
51
54
  }
@@ -85,6 +88,9 @@
85
88
  .dropBoxList {
86
89
  padding: var(--zd_size10) 0;
87
90
  }
91
+ .responsivedropBoxList{
92
+ padding: var(--zd_size10) 0 0 0;
93
+ }
88
94
  .rotate {
89
95
  transform: rotateX(180deg);
90
96
  }
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
5
5
 
6
6
  import { SelectComponent } from './Select';
7
7
  import Popup from '../Popup/Popup';
8
- import DropBox from '../DropBox/DropBox';
9
8
  import Tag from '../Tag/Tag';
10
9
  import Textbox from '../TextBox/TextBox';
11
10
  import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
@@ -15,6 +14,8 @@ import Suggestions from '../MultiSelect/Suggestions';
15
14
  import EmptyState from '../MultiSelect/EmptyState';
16
15
  import DropDownHeading from '../DropDown/DropDownHeading';
17
16
  import { getUniqueId } from '../Provider/IdProvider';
17
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
18
+ import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
18
19
  /**** CSS ****/
19
20
 
20
21
  import style from '../MultiSelect/MultiSelect.module.css';
@@ -107,6 +108,17 @@ class SelectWithAvatarComponent extends SelectComponent {
107
108
  }
108
109
  }
109
110
 
111
+ responsiveFunc(_ref) {
112
+ let {
113
+ mediaQueryOR
114
+ } = _ref;
115
+ return {
116
+ tabletMode: mediaQueryOR([{
117
+ maxWidth: 700
118
+ }])
119
+ };
120
+ }
121
+
110
122
  render() {
111
123
  let {
112
124
  dropBoxSize,
@@ -220,71 +232,84 @@ class SelectWithAvatarComponent extends SelectComponent {
220
232
  borderColor: borderColor,
221
233
  htmlId: htmlId,
222
234
  autoComplete: false
223
- }))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
224
- animationStyle: animationStyle,
225
- boxPosition: position || `${defaultDropBoxPosition}Center`,
226
- getRef: getContainerRef,
227
- isActive: isPopupReady,
228
- isAnimate: true,
229
- isArrow: false,
230
- onClick: removeClose,
231
- needResponsive: needResponsive,
232
- isPadding: false
233
- }, /*#__PURE__*/React.createElement(Card, {
234
- onScroll: this.handleScroll
235
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
236
- className: `${selectStyle.search} ${selectStyle[size]}`
237
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
238
- inputRef: this.searchInputRef,
239
- maxLength: maxLength,
240
- onChange: this.handleSearch,
241
- onKeyDown: this.handleKeyDown,
242
- placeHolder: searchBoxPlaceHolder,
243
- size: searchBoxSize,
244
- value: searchStr,
245
- onClear: this.handleClearSearch,
246
- dataId: `${dataId}_search`,
247
- a11y: {
248
- ariaAutocomplete: 'list',
249
- ariaControls: setAriaId,
250
- ariaDescribedby: ariaErrorId
251
- },
252
- autoComplete: false
253
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
254
- customClass: dropBoxSize ? style[dropBoxSize] : '',
255
- eleRef: this.suggestionContainerRef
256
- }, groupName ? /*#__PURE__*/React.createElement("div", {
257
- className: style.title
258
- }, /*#__PURE__*/React.createElement(DropDownHeading, {
259
- text: groupName,
260
- a11y: {
261
- role: 'heading'
262
- }
263
- })) : null, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
264
- activeId: selectedId,
265
- suggestions: suggestions,
266
- getRef: this.suggestionItemRef,
267
- hoverOption: hoverIndex,
268
- onClick: this.handleChange,
269
- onMouseEnter: this.handleMouseEnter,
270
- needTick: true,
271
- needBorder: false,
272
- selectedOptions: [selectedId],
273
- className: selectStyle.listItemContainer,
274
- htmlId: setAriaId,
275
- a11y: {
276
- ariaParentRole: 'listbox',
277
- role: 'option'
278
- }
279
- }) : /*#__PURE__*/React.createElement(EmptyState, {
280
- isLoading: isFetchingOptions,
281
- options: options,
282
- searchString: searchStr,
283
- suggestions: suggestions,
284
- dataId: dataId,
285
- i18nKeys: i18nKeys,
286
- htmlId: ariaErrorId
287
- })))) : null);
235
+ }))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
236
+ query: this.responsiveFunc,
237
+ responsiveId: "Helmet"
238
+ }, _ref2 => {
239
+ let {
240
+ tabletMode
241
+ } = _ref2;
242
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
243
+ animationStyle: animationStyle,
244
+ boxPosition: position || `${defaultDropBoxPosition}Center`,
245
+ getRef: getContainerRef,
246
+ isActive: isPopupReady,
247
+ isAnimate: true,
248
+ isArrow: false,
249
+ onClick: removeClose,
250
+ needResponsive: needResponsive,
251
+ isPadding: false,
252
+ isResponsivePadding: true,
253
+ alignBox: "row"
254
+ }, /*#__PURE__*/React.createElement(Box, {
255
+ flexible: true
256
+ }, /*#__PURE__*/React.createElement(Card, {
257
+ onScroll: this.handleScroll
258
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
259
+ className: `${selectStyle.search} ${selectStyle[size]}`
260
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
261
+ inputRef: this.searchInputRef,
262
+ maxLength: maxLength,
263
+ onChange: this.handleSearch,
264
+ onKeyDown: this.handleKeyDown,
265
+ placeHolder: searchBoxPlaceHolder,
266
+ size: searchBoxSize,
267
+ value: searchStr,
268
+ onClear: this.handleClearSearch,
269
+ dataId: `${dataId}_search`,
270
+ a11y: {
271
+ ariaAutocomplete: 'list',
272
+ ariaControls: setAriaId,
273
+ ariaDescribedby: ariaErrorId
274
+ },
275
+ autoComplete: false
276
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
277
+ shrink: true,
278
+ customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
279
+ eleRef: this.suggestionContainerRef
280
+ }, groupName ? /*#__PURE__*/React.createElement("div", {
281
+ className: style.title
282
+ }, /*#__PURE__*/React.createElement(DropDownHeading, {
283
+ text: groupName,
284
+ a11y: {
285
+ role: 'heading'
286
+ }
287
+ })) : null, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
288
+ activeId: selectedId,
289
+ suggestions: suggestions,
290
+ getRef: this.suggestionItemRef,
291
+ hoverOption: hoverIndex,
292
+ onClick: this.handleChange,
293
+ onMouseEnter: this.handleMouseEnter,
294
+ needTick: true,
295
+ needBorder: false,
296
+ selectedOptions: [selectedId],
297
+ className: selectStyle.listItemContainer,
298
+ htmlId: setAriaId,
299
+ a11y: {
300
+ ariaParentRole: 'listbox',
301
+ role: 'option'
302
+ }
303
+ }) : /*#__PURE__*/React.createElement(EmptyState, {
304
+ isLoading: isFetchingOptions,
305
+ options: options,
306
+ searchString: searchStr,
307
+ suggestions: suggestions,
308
+ dataId: dataId,
309
+ i18nKeys: i18nKeys,
310
+ htmlId: ariaErrorId
311
+ })))));
312
+ }) : null);
288
313
  }
289
314
 
290
315
  }
@@ -6,12 +6,13 @@ import PropTypes from 'prop-types';
6
6
  import Popup from '../Popup/Popup';
7
7
  import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
8
8
  import Icon from '@zohodesk/icons/lib/Icon';
9
- import DropBox from '../DropBox/DropBox';
10
9
  import ListItemWithIcon from '../ListItem/ListItemWithIcon';
11
10
  import Card, { CardHeader, CardContent } from '../Card/Card';
12
11
  import EmptyState from '../MultiSelect/EmptyState';
13
12
  import { Container, Box } from '../Layout';
14
13
  import { getUniqueId } from '../Provider/IdProvider';
14
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
15
+ import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
15
16
  /**** Methods ****/
16
17
 
17
18
  import { scrollTo } from '../utils/Common.js';
@@ -234,6 +235,17 @@ class SelectWithIcon extends Component {
234
235
  }
235
236
  }
236
237
 
238
+ responsiveFunc(_ref) {
239
+ let {
240
+ mediaQueryOR
241
+ } = _ref;
242
+ return {
243
+ tabletMode: mediaQueryOR([{
244
+ maxWidth: 700
245
+ }])
246
+ };
247
+ }
248
+
237
249
  render() {
238
250
  let {
239
251
  animationStyle,
@@ -346,82 +358,95 @@ class SelectWithIcon extends Component {
346
358
  }, /*#__PURE__*/React.createElement(Icon, {
347
359
  name: "ZD-down",
348
360
  size: "7"
349
- })))))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(DropBox, {
350
- animationStyle: animationStyle,
351
- boxPosition: position,
352
- isActive: isPopupReady,
353
- isAnimate: true,
354
- isArrow: false,
355
- onClick: removeClose,
356
- getRef: getContainerRef,
357
- needResponsive: needResponsive,
358
- dataId: `${dataId}_suggestions`,
359
- size: boxSize,
360
- isPadding: false
361
- }, /*#__PURE__*/React.createElement(Card, {
362
- onScroll: this.handleScroll,
363
- htmlId: setAriaId,
364
- a11y: {
365
- role: 'listbox'
366
- }
367
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
368
- className: `${style.search} ${style[size]}`
369
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
370
- onClear: this.onSearchClear,
371
- onChange: this.onSearch,
372
- placeHolder: searchBoxPlaceHolder,
373
- value: searchValue,
374
- maxLength: maxLength,
375
- onKeyDown: this.handleKeyDown,
376
- inputRef: this.searchInputRef,
377
- size: searchBoxSize,
378
- dataId: `${dataId}_search`,
379
- a11y: {
380
- ariaDescribedby: ariaErrorId
381
- },
382
- autoComplete: false
383
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
384
- customClass: `${style.dropBoxList} ${dropBoxSize ? style[dropBoxSize] : ''}`,
385
- eleRef: this.scrollContentRef
386
- }, options.length ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((options, i) => {
361
+ })))))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
362
+ query: this.responsiveFunc,
363
+ responsiveId: "Helmet"
364
+ }, _ref2 => {
387
365
  let {
388
- iconName,
389
- iconSize,
390
- iconColor
391
- } = options;
392
- return /*#__PURE__*/React.createElement(ListItemWithIcon, {
393
- key: options[idKey],
394
- value: options[valueKey],
395
- size: "medium",
396
- onClick: this.handleChange,
397
- id: options[idKey],
398
- index: i,
399
- title: options[valueKey],
400
- palette: "default",
401
- dataId: options[idKey],
402
- iconName: iconName,
403
- iconSize: iconSize,
404
- iconClass: iconColor,
405
- active: selectedId === options[idKey],
406
- needBorder: needListBorder,
407
- needTick: needTick,
408
- onMouseEnter: this.handleMouseEnter,
409
- highlight: selectedIndex === i,
410
- getRef: this.itemRef,
366
+ tabletMode
367
+ } = _ref2;
368
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
369
+ animationStyle: animationStyle,
370
+ boxPosition: position,
371
+ isActive: isPopupReady,
372
+ isAnimate: true,
373
+ isArrow: false,
374
+ onClick: removeClose,
375
+ getRef: getContainerRef,
376
+ needResponsive: needResponsive,
377
+ dataId: `${dataId}_suggestions`,
378
+ size: boxSize,
379
+ isPadding: false,
380
+ isResponsivePadding: true,
381
+ alignBox: "row"
382
+ }, /*#__PURE__*/React.createElement(Box, {
383
+ flexible: true
384
+ }, /*#__PURE__*/React.createElement(Card, {
385
+ onScroll: this.handleScroll,
386
+ htmlId: setAriaId,
411
387
  a11y: {
412
- role: 'option',
413
- ariaSelected: selectedId === options[idKey]
388
+ role: 'listbox'
414
389
  }
415
- });
416
- })) : /*#__PURE__*/React.createElement(EmptyState, {
417
- isLoading: isFetchingOptions,
418
- options: options,
419
- searchString: searchValue,
420
- suggestions: options,
421
- dataId: dataId,
422
- i18nKeys: i18nKeys,
423
- htmlId: ariaErrorId
424
- })))) : null);
390
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
391
+ className: `${style.search} ${style[size]}`
392
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
393
+ onClear: this.onSearchClear,
394
+ onChange: this.onSearch,
395
+ placeHolder: searchBoxPlaceHolder,
396
+ value: searchValue,
397
+ maxLength: maxLength,
398
+ onKeyDown: this.handleKeyDown,
399
+ inputRef: this.searchInputRef,
400
+ size: searchBoxSize,
401
+ dataId: `${dataId}_search`,
402
+ a11y: {
403
+ ariaDescribedby: ariaErrorId
404
+ },
405
+ autoComplete: false
406
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
407
+ customClass: `${tabletMode ? style.responsivedropBoxList : style.dropBoxList} ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''}`,
408
+ shrink: true,
409
+ eleRef: this.scrollContentRef
410
+ }, options.length ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((options, i) => {
411
+ let {
412
+ iconName,
413
+ iconSize,
414
+ iconColor
415
+ } = options;
416
+ return /*#__PURE__*/React.createElement(ListItemWithIcon, {
417
+ key: options[idKey],
418
+ value: options[valueKey],
419
+ size: "medium",
420
+ onClick: this.handleChange,
421
+ id: options[idKey],
422
+ index: i,
423
+ title: options[valueKey],
424
+ palette: "default",
425
+ dataId: options[idKey],
426
+ iconName: iconName,
427
+ iconSize: iconSize,
428
+ iconClass: iconColor,
429
+ active: selectedId === options[idKey],
430
+ needBorder: needListBorder,
431
+ needTick: needTick,
432
+ onMouseEnter: this.handleMouseEnter,
433
+ highlight: selectedIndex === i,
434
+ getRef: this.itemRef,
435
+ a11y: {
436
+ role: 'option',
437
+ ariaSelected: selectedId === options[idKey]
438
+ }
439
+ });
440
+ })) : /*#__PURE__*/React.createElement(EmptyState, {
441
+ isLoading: isFetchingOptions,
442
+ options: options,
443
+ searchString: searchValue,
444
+ suggestions: options,
445
+ dataId: dataId,
446
+ i18nKeys: i18nKeys,
447
+ htmlId: ariaErrorId
448
+ })))));
449
+ }) : null);
425
450
  }
426
451
 
427
452
  }