@zohodesk/components 1.0.0-temp-189.1 → 1.0.0-temp-189.2

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 (54) hide show
  1. package/.cli/UnValidatedFiles.html +101 -0
  2. package/.cli/propValidation_report.html +1 -1
  3. package/README.md +15 -0
  4. package/es/CheckBox/CheckBox.js +10 -0
  5. package/es/CheckBox/props/propTypes.js +1 -0
  6. package/es/DateTime/DateWidget.js +13 -4
  7. package/es/DropBox/DropBox.js +5 -15
  8. package/es/DropBox/utils/isMobilePopover.js +17 -0
  9. package/es/MultiSelect/MultiSelect.js +75 -92
  10. package/es/MultiSelect/MultiSelectWithAvatar.js +73 -90
  11. package/es/Radio/Radio.js +26 -7
  12. package/es/Radio/Radio.module.css +3 -0
  13. package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  14. package/es/Radio/props/defaultProps.js +1 -0
  15. package/es/Radio/props/propTypes.js +7 -0
  16. package/es/Tag/Tag.js +1 -1
  17. package/es/v1/CheckBox/CheckBox.js +6 -0
  18. package/es/v1/CheckBox/props/propTypes.js +1 -0
  19. package/es/v1/DateTime/DateWidget.js +13 -4
  20. package/es/v1/DropBox/DropBox.js +3 -14
  21. package/es/v1/DropBox/utils/isMobilePopover.js +17 -0
  22. package/es/v1/MultiSelect/MultiSelect.js +75 -93
  23. package/es/v1/MultiSelect/MultiSelectWithAvatar.js +74 -91
  24. package/es/v1/Radio/Radio.js +22 -7
  25. package/es/v1/Radio/props/defaultProps.js +1 -0
  26. package/es/v1/Radio/props/propTypes.js +7 -0
  27. package/es/v1/Tag/Tag.js +1 -1
  28. package/lib/CheckBox/CheckBox.js +34 -24
  29. package/lib/CheckBox/props/propTypes.js +1 -0
  30. package/lib/DateTime/DateWidget.js +21 -11
  31. package/lib/DropBox/DropBox.js +3 -13
  32. package/lib/DropBox/utils/isMobilePopover.js +25 -0
  33. package/lib/MultiSelect/MultiSelect.js +74 -91
  34. package/lib/MultiSelect/MultiSelectWithAvatar.js +72 -89
  35. package/lib/Radio/Radio.js +45 -26
  36. package/lib/Radio/Radio.module.css +3 -0
  37. package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
  38. package/lib/Radio/props/defaultProps.js +1 -0
  39. package/lib/Radio/props/propTypes.js +7 -0
  40. package/lib/Tag/Tag.js +1 -1
  41. package/lib/v1/CheckBox/CheckBox.js +6 -0
  42. package/lib/v1/CheckBox/props/propTypes.js +1 -0
  43. package/lib/v1/DateTime/DateWidget.js +21 -11
  44. package/lib/v1/DropBox/DropBox.js +3 -13
  45. package/lib/v1/DropBox/utils/isMobilePopover.js +25 -0
  46. package/lib/v1/MultiSelect/MultiSelect.js +76 -93
  47. package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +71 -90
  48. package/lib/v1/Radio/Radio.js +22 -7
  49. package/lib/v1/Radio/props/defaultProps.js +1 -0
  50. package/lib/v1/Radio/props/propTypes.js +7 -0
  51. package/lib/v1/Tag/Tag.js +1 -1
  52. package/package.json +6 -6
  53. package/propValidationArg.json +8 -4
  54. package/result.json +1 -1
@@ -1145,7 +1145,7 @@ exports[`Radio rendering the accessMode when disabled 1`] = `
1145
1145
  data-test-id="boxComponent"
1146
1146
  >
1147
1147
  <label
1148
- class="label title medium disable font_default
1148
+ class="label title medium default font_default
1149
1149
  dotted cursor
1150
1150
  primaryLabel disabled "
1151
1151
  data-id="RadioText_label"
@@ -1505,7 +1505,7 @@ exports[`Radio rendering the disabled is true 1`] = `
1505
1505
  data-test-id="boxComponent"
1506
1506
  >
1507
1507
  <label
1508
- class="label title medium disable font_default
1508
+ class="label title medium default font_default
1509
1509
  dotted cursor
1510
1510
  undefined disabled "
1511
1511
  data-id="RadioText_label"
@@ -1567,7 +1567,7 @@ exports[`Radio rendering the disabledTitle 1`] = `
1567
1567
  data-test-id="boxComponent"
1568
1568
  >
1569
1569
  <label
1570
- class="label title medium disable font_default
1570
+ class="label title medium default font_default
1571
1571
  dotted cursor
1572
1572
  primaryLabel disabled "
1573
1573
  data-id="RadioText_label"
@@ -10,5 +10,6 @@ export const defaultProps = {
10
10
  variant: 'default',
11
11
  isFilled: true,
12
12
  customClass: {},
13
+ customProps: {},
13
14
  a11y: {}
14
15
  };
@@ -4,6 +4,7 @@ export const propTypes = {
4
4
  checked: PropTypes.bool,
5
5
  disabled: PropTypes.bool,
6
6
  disabledTitle: PropTypes.string,
7
+ getRef: PropTypes.func,
7
8
  id: PropTypes.string,
8
9
  isFilled: PropTypes.bool,
9
10
  isReadOnly: PropTypes.bool,
@@ -20,14 +21,20 @@ export const propTypes = {
20
21
  customRadio: PropTypes.string,
21
22
  customLabel: PropTypes.string
22
23
  }),
24
+ customProps: PropTypes.exact({
25
+ ContainerProps: PropTypes.object,
26
+ LabelProps: PropTypes.object
27
+ }),
23
28
  a11y: PropTypes.shape({
24
29
  ariaChecked: PropTypes.bool,
25
30
  ariaHidden: PropTypes.bool,
26
31
  role: PropTypes.string,
32
+ tabIndex: PropTypes.oneOfType(PropTypes.string, PropTypes.number),
27
33
  ariaLabelledby: PropTypes.string,
28
34
  ariaLabel: PropTypes.string,
29
35
  ariaReadonly: PropTypes.bool
30
36
  }),
37
+ children: PropTypes.node,
31
38
  onChange: PropTypes.func,
32
39
  text: PropTypes.string
33
40
  };
package/es/Tag/Tag.js CHANGED
@@ -130,7 +130,7 @@ export default class Tag extends PureComponent {
130
130
  ${rounded ? style.lgRadiusClose : style.smRadiusClose} ${isDarkPalette ? style.darkTagClose : ''}
131
131
  ${customTagClose} ${style[`close${closePalette}`]}`,
132
132
  dataId: `${dataId}_RemoveTag`,
133
- "data-title": closeTitle,
133
+ title: closeTitle,
134
134
  onClick: this.handleRemove,
135
135
  a11y: {
136
136
  ariaLabel: clearLabel
@@ -24,6 +24,7 @@ const CheckBox = props => {
24
24
  isFilled,
25
25
  isClipped,
26
26
  getRef,
27
+ getContainerRef,
27
28
  variant,
28
29
  active,
29
30
  dataId,
@@ -42,6 +43,10 @@ const CheckBox = props => {
42
43
  onChange && onChange(!checked, e);
43
44
  }
44
45
 
46
+ function handleGetContainerRef(ele) {
47
+ getContainerRef && getContainerRef(ele, id);
48
+ }
49
+
45
50
  let {
46
51
  CheckBoxProps = {},
47
52
  LabelProps = {}
@@ -73,6 +78,7 @@ const CheckBox = props => {
73
78
  onClick: isReadOnly || disabled ? null : onChange,
74
79
  tabIndex: isReadOnly || disabled || ariaHidden ? '-1' : '0',
75
80
  "aria-checked": ariaChecked,
81
+ eleRef: handleGetContainerRef,
76
82
  role: role,
77
83
  "aria-label": ariaLabel,
78
84
  "aria-labelledby": ariaLabelledby,
@@ -8,6 +8,7 @@ export const propTypes = {
8
8
  disabled: PropTypes.bool,
9
9
  disabledTitle: PropTypes.string,
10
10
  getRef: PropTypes.func,
11
+ getContainerRef: PropTypes.func,
11
12
  id: PropTypes.string,
12
13
  isFilled: PropTypes.bool,
13
14
  isClipped: PropTypes.bool,
@@ -909,7 +909,8 @@ class DateWidgetComponent extends React.Component {
909
909
  if (isAllowedDateType) {
910
910
  // if (focusOrder !== oldFocusOrder) {
911
911
  const {
912
- dateFormatSelection = {}
912
+ dateFormatSelection = {},
913
+ isFocused
913
914
  } = this.state;
914
915
  const {
915
916
  order = []
@@ -931,9 +932,17 @@ class DateWidgetComponent extends React.Component {
931
932
 
932
933
  if (isPopupOpen) {
933
934
  if (yearViewTypes.indexOf(focusedType) >= 0 && (!isYearView || isMonthOpen !== oldIsMonthOpen)) {
934
- this.DateTimeYearViewToggle(true, isMonthOpen);
935
- } else if (yearViewTypes.indexOf(focusedType) === -1 && isYearView) {
936
- this.DateTimeYearViewToggle(false, false);
935
+ if (!isFocused && isYearView) {
936
+ this.DateTimeYearViewToggle(true, oldIsMonthOpen);
937
+ } else {
938
+ this.DateTimeYearViewToggle(true, isMonthOpen);
939
+ }
940
+ } else if (yearViewTypes.indexOf(focusedType) === -1) {
941
+ if (!isFocused && isYearView) {
942
+ this.DateTimeYearViewToggle(isYearView, oldIsMonthOpen);
943
+ } else {
944
+ this.DateTimeYearViewToggle(false, false);
945
+ }
937
946
  }
938
947
  } // }
939
948
 
@@ -1,15 +1,15 @@
1
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
2
 
3
- import React, { useRef, Fragment, useContext } from 'react';
3
+ import React, { useRef, useContext } from 'react';
4
4
  import FocusScope from '@zohodesk/a11y/es/FocusScope/FocusScope';
5
5
  import Modal from '../Modal/Modal';
6
- import { getLibraryConfig } from '../../Provider/Config';
7
6
  import LibraryContext from '../../Provider/LibraryContextInit';
8
7
  import cssJSLogic from '../../DropBox/css/cssJSLogic';
9
8
  import DropBoxElement from './DropBoxElement/DropBoxElement';
10
9
  import { DropBoxDefaultProps } from './props/defaultProps';
11
10
  import { DropBoxPropTypes } from './props/propTypes';
12
11
  import { stopPropagation } from '../../utils/Common';
12
+ import isMobilePopover from './utils/isMobilePopover';
13
13
  import style from '../../DropBox/css/DropBox.module.css';
14
14
  export default function DropBox(props) {
15
15
  const dropBoxRef = useRef(null);
@@ -37,18 +37,7 @@ export default function DropBox(props) {
37
37
  const {
38
38
  direction
39
39
  } = DropBoxContext || {};
40
- let windowWidth,
41
- mobileWidth = getLibraryConfig('mobileWidth'),
42
- isModel = false;
43
-
44
- if (needResponsive) {
45
- windowWidth = window.innerWidth;
46
-
47
- if (windowWidth <= mobileWidth) {
48
- isModel = true;
49
- }
50
- }
51
-
40
+ let isModel = isMobilePopover(needResponsive);
52
41
  const {
53
42
  zIndexStyle
54
43
  } = cssJSLogic(props);
@@ -0,0 +1,17 @@
1
+ import { getLibraryConfig } from '../../Provider/Config';
2
+ export default function isMobilePopover(needResponsive) {
3
+ // let { needResponsive } = props;
4
+ let windowWidth,
5
+ mobileWidth = getLibraryConfig('mobileWidth'),
6
+ isModel = false;
7
+
8
+ if (needResponsive) {
9
+ windowWidth = window.innerWidth;
10
+
11
+ if (windowWidth <= mobileWidth) {
12
+ isModel = true;
13
+ }
14
+ }
15
+
16
+ return isModel ? true : false;
17
+ }
@@ -17,8 +17,8 @@ import MultiSelectHeader from './MultiSelectHeader';
17
17
  import CssProvider from '../../Provider/CssProvider';
18
18
  import { getUniqueId } from '../../Provider/IdProvider';
19
19
  import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
20
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
21
20
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
21
+ import isMobilePopover from '../DropBox/utils/isMobilePopover';
22
22
  /**** Icons ****/
23
23
 
24
24
  import { Icon } from '@zohodesk/icons';
@@ -28,8 +28,8 @@ import style from '../../MultiSelect/MultiSelect.module.css';
28
28
  /**** Methods ****/
29
29
 
30
30
  import { debounce, scrollTo, bind, getIsEmptyValue, getSearchString, findScrollEnd } from '../../utils/Common.js';
31
- import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../../utils/dropDownUtils';
32
- import { getLibraryConfig } from '../../Provider/Config';
31
+ import { makeFormatOptions, makeGetMultiSelectFilterSuggestions as makeGetFilterSuggestions, makeGetMultiSelectSelectedOptions as makeGetSelectedOptions, makeObjectConcat, filterSelectedOptions, makeGetIsShowClearIcon } from '../../utils/dropDownUtils'; // import { getLibraryConfig } from '../../Provider/Config';
32
+
33
33
  /* eslint-disable react/forbid-component-props */
34
34
 
35
35
  /* eslint-disable react/no-unused-prop-types */
@@ -840,17 +840,6 @@ export class MultiSelectComponent extends React.Component {
840
840
  });
841
841
  }
842
842
 
843
- responsiveFunc(_ref) {
844
- let {
845
- mediaQueryOR
846
- } = _ref;
847
- return {
848
- tabletMode: mediaQueryOR([{
849
- maxWidth: 700
850
- }])
851
- };
852
- }
853
-
854
843
  getSelectionUI() {
855
844
  let isResponsive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
856
845
  let {
@@ -1023,6 +1012,7 @@ export class MultiSelectComponent extends React.Component {
1023
1012
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
1024
1013
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
1025
1014
  });
1015
+ let isModel = isMobilePopover(needResponsive);
1026
1016
  return /*#__PURE__*/React.createElement("div", {
1027
1017
  className: `${style.wrapper} ${isDisabled ? style.disabled : ''} ${isReadOnly ? style.readOnly : ''} ${disableAction ? CssProvider('isBlock') : ''} ${borderColor === 'transparent' ? style.transparentContainer : ''} ${needEffect && !(isDisabled || isReadOnly) ? style.effect : ''}`,
1028
1018
  "data-id": `${isDisabled ? `${dataId}_disabled` : isReadOnly ? `${dataId}_readOnly` : dataId}`,
@@ -1030,85 +1020,77 @@ export class MultiSelectComponent extends React.Component {
1030
1020
  "data-title": isDisabled ? title : null,
1031
1021
  onClick: this.handleInputFocus,
1032
1022
  "data-selector-id": dataSelectorId
1033
- }, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
1034
- query: this.responsiveFunc,
1035
- responsiveId: "Helmet"
1036
- }, _ref2 => {
1037
- let {
1038
- tabletMode
1039
- } = _ref2;
1040
- return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
1041
- animationStyle: animationStyle,
1042
- boxPosition: position || `${defaultDropBoxPosition}`,
1043
- getRef: getContainerRef,
1044
- isActive: isPopupReady,
1045
- isAnimate: isAnimate,
1046
- isArrow: false,
1047
- onClick: removeClose,
1048
- needResponsive: needResponsive,
1049
- isPadding: false,
1050
- isBoxPaddingNeed: isBoxPaddingNeed,
1051
- palette: palette,
1052
- htmlId: setAriaId,
1053
- a11y: {
1054
- role: 'listbox',
1055
- ariaMultiselectable: true
1056
- },
1057
- size: boxSize,
1058
- alignBox: "row",
1059
- isResponsivePadding: getFooter ? false : true
1060
- }, /*#__PURE__*/React.createElement(Box, {
1061
- flexible: true
1062
- }, /*#__PURE__*/React.createElement(Card, {
1063
- customClass: `${style.box} ${style[`${palette}Box`]}`,
1064
- onScroll: this.handleScroll
1065
- }, tabletMode && /*#__PURE__*/React.createElement(MobileHeader, {
1066
- selectedOptions: selectedOptions,
1067
- i18nKeys: i18nKeys,
1068
- onClick: this.handlePopupClose
1069
- }, /*#__PURE__*/React.createElement("div", {
1070
- className: style.effect
1071
- }, this.getSelectionUI(true))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
1072
- onSelect: this.handleSelectAll,
1073
- selectAllText: selectAllText,
1074
- suggestions: suggestions,
1075
- dataId: dataId
1076
- })) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
1077
- align: "both",
1078
- className: style.loader
1079
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
1080
- shrink: true,
1081
- customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
1082
- eleRef: this.suggestionContainerRef
1083
- }, isSearching ? /*#__PURE__*/React.createElement("div", {
1084
- className: style[palette]
1085
- }, searchText) : suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
1086
- suggestions: suggestions,
1087
- getRef: this.suggestionItemRef,
1088
- hoverOption: hoverOption,
1089
- onClick: this.handleSelectOption,
1090
- onMouseEnter: this.handleMouseEnter,
1091
- needBorder: false,
1092
- dataId: `${dataId}_Options`,
1093
- palette: palette,
1094
- selectedOptions: selectedOptionIds,
1095
- a11y: {
1096
- role: 'option'
1097
- }
1098
- }) : /*#__PURE__*/React.createElement(EmptyState, {
1099
- isLoading: isFetchingOptions,
1100
- options: options,
1101
- searchString: searchStr,
1102
- suggestions: suggestions,
1103
- dataId: dataId,
1104
- palette: palette,
1105
- i18nKeys: i18nKeys,
1106
- htmlId: ariaErrorId
1107
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1108
- isCover: false,
1109
- align: "both"
1110
- }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
1111
- }) : null);
1023
+ }, this.getSelectionUI(), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveDropBox, {
1024
+ animationStyle: animationStyle,
1025
+ boxPosition: position || `${defaultDropBoxPosition}`,
1026
+ getRef: getContainerRef,
1027
+ isActive: isPopupReady,
1028
+ isAnimate: isAnimate,
1029
+ isArrow: false,
1030
+ onClick: removeClose,
1031
+ needResponsive: needResponsive,
1032
+ isPadding: false,
1033
+ isBoxPaddingNeed: isBoxPaddingNeed,
1034
+ palette: palette,
1035
+ htmlId: setAriaId,
1036
+ a11y: {
1037
+ role: 'listbox',
1038
+ ariaMultiselectable: true
1039
+ },
1040
+ size: boxSize,
1041
+ alignBox: "row",
1042
+ isResponsivePadding: getFooter ? false : true
1043
+ }, /*#__PURE__*/React.createElement(Box, {
1044
+ flexible: true
1045
+ }, /*#__PURE__*/React.createElement(Card, {
1046
+ customClass: `${style.box} ${style[`${palette}Box`]}`,
1047
+ onScroll: this.handleScroll
1048
+ }, isModel && /*#__PURE__*/React.createElement(MobileHeader, {
1049
+ selectedOptions: selectedOptions,
1050
+ i18nKeys: i18nKeys,
1051
+ onClick: this.handlePopupClose
1052
+ }, /*#__PURE__*/React.createElement("div", {
1053
+ className: style.effect
1054
+ }, this.getSelectionUI(true))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
1055
+ onSelect: this.handleSelectAll,
1056
+ selectAllText: selectAllText,
1057
+ suggestions: suggestions,
1058
+ dataId: dataId
1059
+ })) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
1060
+ align: "both",
1061
+ className: style.loader
1062
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
1063
+ shrink: true,
1064
+ customClass: !isModel && dropBoxSize ? style[dropBoxSize] : '',
1065
+ eleRef: this.suggestionContainerRef
1066
+ }, isSearching ? /*#__PURE__*/React.createElement("div", {
1067
+ className: style[palette]
1068
+ }, searchText) : suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
1069
+ suggestions: suggestions,
1070
+ getRef: this.suggestionItemRef,
1071
+ hoverOption: hoverOption,
1072
+ onClick: this.handleSelectOption,
1073
+ onMouseEnter: this.handleMouseEnter,
1074
+ needBorder: false,
1075
+ dataId: `${dataId}_Options`,
1076
+ palette: palette,
1077
+ selectedOptions: selectedOptionIds,
1078
+ a11y: {
1079
+ role: 'option'
1080
+ }
1081
+ }) : /*#__PURE__*/React.createElement(EmptyState, {
1082
+ isLoading: isFetchingOptions,
1083
+ options: options,
1084
+ searchString: searchStr,
1085
+ suggestions: suggestions,
1086
+ dataId: dataId,
1087
+ palette: palette,
1088
+ i18nKeys: i18nKeys,
1089
+ htmlId: ariaErrorId
1090
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1091
+ isCover: false,
1092
+ align: "both"
1093
+ }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null))) : null);
1112
1094
  }
1113
1095
 
1114
1096
  }
@@ -17,12 +17,13 @@ import MobileHeader from './MobileHeader/MobileHeader';
17
17
  import MultiSelectHeader from './MultiSelectHeader';
18
18
  import CssProvider from '../../Provider/CssProvider';
19
19
  import { getUniqueId } from '../../Provider/IdProvider';
20
- import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
21
- import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
20
+ import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox'; // import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
21
+
22
22
  import Loader from '@zohodesk/svg/lib/Loader/Loader';
23
+ import isMobilePopover from '../DropBox/utils/isMobilePopover';
23
24
  /**** Icons ****/
25
+ // import { Icon } from '@zohodesk/icons';
24
26
 
25
- import { Icon } from '@zohodesk/icons';
26
27
  /**** CSS ****/
27
28
 
28
29
  import style from '../../MultiSelect/MultiSelect.module.css';
@@ -57,17 +58,6 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
57
58
  });
58
59
  }
59
60
 
60
- responsiveFunc(_ref) {
61
- let {
62
- mediaQueryOR
63
- } = _ref;
64
- return {
65
- tabletMode: mediaQueryOR([{
66
- maxWidth: 700
67
- }])
68
- };
69
- }
70
-
71
61
  render() {
72
62
  let {
73
63
  isReadOnly,
@@ -108,6 +98,7 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
108
98
  searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage,
109
99
  noMoreText: i18nKeys.noMoreText || noMoreOptionsMessage
110
100
  });
101
+ let isModel = isMobilePopover(needResponsive);
111
102
  const {
112
103
  selectedOptions,
113
104
  searchStr,
@@ -127,83 +118,75 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
127
118
  "data-title": isDisabled ? title : null,
128
119
  onClick: this.handleInputFocus,
129
120
  "data-selector-id": dataSelectorId
130
- }, this.getSelectionUI(), popUpState ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
131
- query: this.responsiveFunc,
132
- responsiveId: "Helmet"
133
- }, _ref2 => {
134
- let {
135
- tabletMode
136
- } = _ref2;
137
- return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
138
- animationStyle: animationStyle,
139
- boxPosition: position || `${defaultDropBoxPosition}Center`,
140
- getRef: getContainerRef,
141
- isActive: isPopupReady,
142
- isAnimate: isAnimate,
143
- isArrow: false,
144
- onClick: removeClose,
145
- needResponsive: needResponsive,
146
- isPadding: false,
147
- isBoxPaddingNeed: isBoxPaddingNeed,
148
- palette: palette,
149
- htmlId: setAriaId,
150
- a11y: {
151
- ariaMultiselectable: true,
152
- role: 'listbox'
153
- },
154
- isResponsivePadding: true,
155
- alignBox: "row"
156
- }, /*#__PURE__*/React.createElement(Box, {
157
- flexible: true
158
- }, /*#__PURE__*/React.createElement(Card, {
159
- customClass: `${style.box} ${style[`${palette}Box`]}`,
160
- onScroll: this.handleScroll
161
- }, tabletMode && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileHeader, {
162
- selectedOptions: selectedOptions,
163
- i18nKeys: i18nKeys,
164
- onClick: this.handlePopupClose
165
- }, /*#__PURE__*/React.createElement("div", {
166
- className: style.effect
167
- }, this.getSelectionUI(true)))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
168
- onSelect: this.handleSelectAll,
169
- selectAllText: selectAllText,
170
- suggestions: suggestions,
171
- dataId: dataId
172
- })) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
173
- align: "both",
174
- className: style.loader
175
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
176
- shrink: true,
177
- customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
178
- eleRef: this.suggestionContainerRef
179
- }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
180
- needTick: keepSelectedOptions,
181
- suggestions: suggestions,
182
- getRef: this.suggestionItemRef,
183
- hoverOption: hoverOption,
184
- onClick: this.handleSelectOption,
185
- onMouseEnter: this.handleMouseEnter,
186
- needBorder: false,
187
- dataId: `${dataId}_Options`,
188
- palette: palette,
189
- selectedOptions: selectedOptionIds,
190
- a11y: {
191
- role: 'option'
192
- }
193
- }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
194
- isLoading: isFetchingOptions,
195
- options: options,
196
- searchString: searchStr,
197
- suggestions: suggestions,
198
- dataId: dataId,
199
- palette: palette,
200
- i18nKeys: i18nKeys,
201
- htmlId: ariaErrorId
202
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
203
- isCover: false,
204
- align: "both"
205
- }, /*#__PURE__*/React.createElement(Loader, null))))));
206
- }) : null);
121
+ }, this.getSelectionUI(), popUpState ? /*#__PURE__*/React.createElement(ResponsiveDropBox, {
122
+ animationStyle: animationStyle,
123
+ boxPosition: position || `${defaultDropBoxPosition}Center`,
124
+ getRef: getContainerRef,
125
+ isActive: isPopupReady,
126
+ isAnimate: isAnimate,
127
+ isArrow: false,
128
+ onClick: removeClose,
129
+ needResponsive: needResponsive,
130
+ isPadding: false,
131
+ isBoxPaddingNeed: isBoxPaddingNeed,
132
+ palette: palette,
133
+ htmlId: setAriaId,
134
+ a11y: {
135
+ ariaMultiselectable: true,
136
+ role: 'listbox'
137
+ },
138
+ isResponsivePadding: true,
139
+ alignBox: "row"
140
+ }, /*#__PURE__*/React.createElement(Box, {
141
+ flexible: true
142
+ }, /*#__PURE__*/React.createElement(Card, {
143
+ customClass: `${style.box} ${style[`${palette}Box`]}`,
144
+ onScroll: this.handleScroll
145
+ }, isModel && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(MobileHeader, {
146
+ selectedOptions: selectedOptions,
147
+ i18nKeys: i18nKeys,
148
+ onClick: this.handlePopupClose
149
+ }, /*#__PURE__*/React.createElement("div", {
150
+ className: style.effect
151
+ }, this.getSelectionUI(true)))), needSelectAll ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
152
+ onSelect: this.handleSelectAll,
153
+ selectAllText: selectAllText,
154
+ suggestions: suggestions,
155
+ dataId: dataId
156
+ })) : null, isLoading ? /*#__PURE__*/React.createElement(Container, {
157
+ align: "both",
158
+ className: style.loader
159
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(CardContent, {
160
+ shrink: true,
161
+ customClass: !isModel && dropBoxSize ? style[dropBoxSize] : '',
162
+ eleRef: this.suggestionContainerRef
163
+ }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
164
+ needTick: keepSelectedOptions,
165
+ suggestions: suggestions,
166
+ getRef: this.suggestionItemRef,
167
+ hoverOption: hoverOption,
168
+ onClick: this.handleSelectOption,
169
+ onMouseEnter: this.handleMouseEnter,
170
+ needBorder: false,
171
+ dataId: `${dataId}_Options`,
172
+ palette: palette,
173
+ selectedOptions: selectedOptionIds,
174
+ a11y: {
175
+ role: 'option'
176
+ }
177
+ }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
178
+ isLoading: isFetchingOptions,
179
+ options: options,
180
+ searchString: searchStr,
181
+ suggestions: suggestions,
182
+ dataId: dataId,
183
+ palette: palette,
184
+ i18nKeys: i18nKeys,
185
+ htmlId: ariaErrorId
186
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
187
+ isCover: false,
188
+ align: "both"
189
+ }, /*#__PURE__*/React.createElement(Loader, null)))))) : null);
207
190
  }
208
191
 
209
192
  }