@zohodesk/components 1.0.0-temp-255 → 1.0.0-temp-252.4

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 (52) hide show
  1. package/es/AppContainer/AppContainer.js +2 -0
  2. package/es/Avatar/Avatar.js +2 -1
  3. package/es/Button/css/cssJSLogic.js +5 -4
  4. package/es/DateTime/DateTime.js +6 -3
  5. package/es/DateTime/DateWidget.js +5 -2
  6. package/es/DateTime/YearView.js +6 -5
  7. package/es/DateTime/common.js +9 -2
  8. package/es/DateTime/dateFormatUtils/dateFormat.js +76 -55
  9. package/es/DateTime/dateFormatUtils/index.js +12 -7
  10. package/es/DateTime/dateFormatUtils/timeChange.js +4 -3
  11. package/es/DateTime/dateFormatUtils/yearChange.js +4 -3
  12. package/es/DropBox/DropBoxElement/css/cssJSLogic.js +6 -5
  13. package/es/Layout/utils.js +2 -1
  14. package/es/ListItem/ListContainer.js +5 -4
  15. package/es/Modal/Portal/Portal.js +5 -4
  16. package/es/MultiSelect/AdvancedGroupMultiSelect.js +103 -91
  17. package/es/MultiSelect/AdvancedMultiSelect.js +80 -74
  18. package/es/MultiSelect/MultiSelect.js +13 -4
  19. package/es/MultiSelect/Suggestions.js +17 -14
  20. package/es/Popup/Popup.js +4 -1
  21. package/es/Provider/IdProvider.js +5 -4
  22. package/es/Provider/LibraryContext.js +12 -11
  23. package/es/Provider/NumberGenerator/NumberGenerator.js +17 -15
  24. package/es/Provider/ZindexProvider.js +5 -4
  25. package/es/Responsive/CustomResponsive.js +11 -8
  26. package/es/Responsive/ResizeComponent.js +3 -1
  27. package/es/Responsive/Responsive.js +12 -9
  28. package/es/Responsive/sizeObservers.js +5 -1
  29. package/es/ResponsiveDropBox/ResponsiveDropBox.js +14 -10
  30. package/es/Select/GroupSelect.js +103 -98
  31. package/es/Select/Select.js +116 -108
  32. package/es/Select/SelectWithAvatar.js +95 -91
  33. package/es/Select/SelectWithIcon.js +109 -104
  34. package/es/Select/__tests__/Select.spec.js +9 -6
  35. package/es/Tab/Tab.js +30 -29
  36. package/es/Tab/TabContent.js +19 -16
  37. package/es/Tab/TabContentWrapper.js +22 -19
  38. package/es/Tab/TabWrapper.js +16 -15
  39. package/es/Tab/Tabs.js +87 -80
  40. package/es/Typography/css/cssJSLogic.js +5 -4
  41. package/es/VelocityAnimation/VelocityAnimationGroup/VelocityAnimationGroup.js +2 -1
  42. package/es/utils/Common.js +31 -10
  43. package/es/utils/datetime/common.js +6 -2
  44. package/es/utils/dropDownUtils.js +11 -7
  45. package/es/utils/getInitial.js +3 -1
  46. package/es/v1/Button/css/cssJSLogic.js +8 -4
  47. package/es/v1/Label/css/cssJSLogic.js +5 -4
  48. package/es/v1/Switch/css/cssJSLogic.js +5 -4
  49. package/es/v1/helpers/colorHelpers/colorHelper.js +39 -28
  50. package/lib/AppContainer/AppContainer.js +4 -0
  51. package/lib/Select/Select.js +3 -1
  52. package/package.json +2 -2
@@ -163,7 +163,9 @@ export default class ResizeComponent extends React.Component {
163
163
  }
164
164
  }
165
165
 
166
- constructChildren(dataCount = 0, responsive) {
166
+ constructChildren() {
167
+ let dataCount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
168
+ let responsive = arguments.length > 1 ? arguments[1] : undefined;
167
169
  const {
168
170
  childrenList,
169
171
  getData
@@ -96,7 +96,8 @@ ResponsiveSender.defaultProps = { ...ResponsiveSender_defaultProps,
96
96
  };
97
97
  ResponsiveSender.contextType = ResponsiveContext;
98
98
  ResponsiveSender.propTypes = ResponsiveSender_propTypes;
99
- export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
99
+ export function useResponsiveReceiver() {
100
+ let responsiveId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultResponsiveId;
100
101
  const [_, forceUpdate] = useState();
101
102
  let totalContextData = useContext(ResponsiveContext);
102
103
  let contextData = totalContextData[responsiveId] || totalContextData[defaultResponsiveId]; // NOTE: this for fallback of if responsive receiver id wrong
@@ -143,7 +144,8 @@ export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
143
144
  return value1 <= width && value2 >= width || breakPoint1 === breakPoint || breakPoint2 === breakPoint;
144
145
  },
145
146
 
146
- deviceOnly(breakPoints = []) {
147
+ deviceOnly() {
148
+ let breakPoints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
147
149
  return breakPoints.includes(breakPoint);
148
150
  },
149
151
 
@@ -168,13 +170,14 @@ export function useResponsiveReceiver(responsiveId = defaultResponsiveId) {
168
170
  // ) : null;
169
171
  // }
170
172
 
171
- export function ResponsiveReceiver({
172
- children,
173
- responsiveId,
174
- hiddenSizes,
175
- eleRef,
176
- domRefKey
177
- }) {
173
+ export function ResponsiveReceiver(_ref) {
174
+ let {
175
+ children,
176
+ responsiveId,
177
+ hiddenSizes,
178
+ eleRef,
179
+ domRefKey
180
+ } = _ref;
178
181
  const data = useResponsiveReceiver(responsiveId);
179
182
  const {
180
183
  breakPoint
@@ -75,7 +75,11 @@ export class Subscribale {
75
75
  this.subscribers.length && this.disconnect();
76
76
  }
77
77
 
78
- dispatch(...args) {
78
+ dispatch() {
79
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
80
+ args[_key] = arguments[_key];
81
+ }
82
+
79
83
  this.subscribers.forEach(subscriber => {
80
84
  subscriber(...args);
81
85
  });
@@ -13,9 +13,10 @@ export default class ResponsiveDropBox extends Component {
13
13
  this.responsiveFunc = this.responsiveFunc.bind(this);
14
14
  }
15
15
 
16
- responsiveFunc({
17
- mediaQueryOR
18
- }) {
16
+ responsiveFunc(_ref) {
17
+ let {
18
+ mediaQueryOR
19
+ } = _ref;
19
20
  return {
20
21
  tabletMode: mediaQueryOR([{
21
22
  maxWidth: 700
@@ -49,13 +50,16 @@ export default class ResponsiveDropBox extends Component {
49
50
  }), /*#__PURE__*/React.createElement(ResponsiveReceiver, {
50
51
  query: this.responsiveFunc,
51
52
  responsiveId: "Helmet"
52
- }, ({
53
- tabletMode
54
- }) => /*#__PURE__*/React.createElement(Container, {
55
- alignBox: alignBox,
56
- isCover: false,
57
- className: `${tabletMode ? style.dropBoxContainer : ''} ${tabletMode && isResponsivePadding ? style.boxPadding : ''} ${customResponsiveContainer}`
58
- }, children)));
53
+ }, _ref2 => {
54
+ let {
55
+ tabletMode
56
+ } = _ref2;
57
+ return /*#__PURE__*/React.createElement(Container, {
58
+ alignBox: alignBox,
59
+ isCover: false,
60
+ className: `${tabletMode ? style.dropBoxContainer : ''} ${tabletMode && isResponsivePadding ? style.boxPadding : ''} ${customResponsiveContainer}`
61
+ }, children);
62
+ }));
59
63
  }
60
64
 
61
65
  }
@@ -493,7 +493,8 @@ export class GroupSelectComponent extends PureComponent {
493
493
  isScrollReachedBottom && this.handleGetNextOptions();
494
494
  }
495
495
 
496
- handleFetchOptions(APICall, searchStr = '') {
496
+ handleFetchOptions(APICall) {
497
+ let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
497
498
  // let funcArgs = args.slice(1, args.length);
498
499
  let {
499
500
  isFetchingOptions = false
@@ -536,9 +537,10 @@ export class GroupSelectComponent extends PureComponent {
536
537
  isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
537
538
  }
538
539
 
539
- responsiveFunc({
540
- mediaQueryOR
541
- }) {
540
+ responsiveFunc(_ref) {
541
+ let {
542
+ mediaQueryOR
543
+ } = _ref;
542
544
  return {
543
545
  tabletMode: mediaQueryOR([{
544
546
  maxWidth: 700
@@ -714,104 +716,107 @@ export class GroupSelectComponent extends PureComponent {
714
716
  }, TextBoxProps)))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
715
717
  query: this.responsiveFunc,
716
718
  responsiveId: "Helmet"
717
- }, ({
718
- tabletMode
719
- }) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
720
- animationStyle: animationStyle,
721
- boxPosition: position || `${defaultDropBoxPosition}Center`,
722
- getRef: getContainerRef,
723
- isActive: isPopupReady,
724
- isAnimate: true,
725
- isArrow: false,
726
- onClick: removeClose,
727
- needResponsive: needResponsive,
728
- isPadding: false,
729
- isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
730
- positionsOffset: positionsOffset,
731
- targetOffset: targetOffset,
732
- isRestrictScroll: isRestrictScroll,
733
- isResponsivePadding: getFooter ? false : true,
734
- alignBox: "row",
735
- dataId: `${dataId}_suggestionBox`,
736
- customClass: {
737
- customDropBox: dropBoxClass
738
- }
739
- }, isLoading ? /*#__PURE__*/React.createElement(Container, {
740
- align: "both",
741
- className: style.loader
742
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
743
- flexible: true
744
- }, /*#__PURE__*/React.createElement(Card, {
745
- customClass: style.box,
746
- onScroll: this.handleScroll
747
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
748
- className: `${style.search} ${style[size]}`
749
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
750
- inputRef: this.searchInputRef,
751
- maxLength: maxLength,
752
- onChange: this.handleSearch,
753
- onKeyDown: this.handleKeyDown,
754
- placeHolder: searchBoxPlaceHolder,
755
- size: searchBoxSize,
756
- value: searchStr,
757
- onClear: this.handleClearSearch,
758
- a11y: {
759
- ariaControls: setAriaId,
760
- ariaAutocomplete: 'list',
761
- ariaDescribedby: ariaErrorId
762
- },
763
- autoComplete: false,
764
- dataId: `${dataId}_search`
765
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
766
- shrink: true,
767
- customClass: `${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
768
- eleRef: this.suggestionContainerRef
769
- }, suggestionGroups.length ? suggestionGroups.map(group => {
719
+ }, _ref2 => {
770
720
  let {
771
- id: groupId,
772
- name: groupName,
773
- options
774
- } = group;
775
- let hoverId = suggestionOptionIds[hoverIndex];
776
- return /*#__PURE__*/React.createElement(React.Fragment, {
777
- key: groupId
778
- }, groupName && /*#__PURE__*/React.createElement("div", {
779
- className: style.groupTitle
780
- }, /*#__PURE__*/React.createElement(DropDownHeading, {
781
- text: groupName,
782
- a11y: {
783
- role: 'heading'
721
+ tabletMode
722
+ } = _ref2;
723
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
724
+ animationStyle: animationStyle,
725
+ boxPosition: position || `${defaultDropBoxPosition}Center`,
726
+ getRef: getContainerRef,
727
+ isActive: isPopupReady,
728
+ isAnimate: true,
729
+ isArrow: false,
730
+ onClick: removeClose,
731
+ needResponsive: needResponsive,
732
+ isPadding: false,
733
+ isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
734
+ positionsOffset: positionsOffset,
735
+ targetOffset: targetOffset,
736
+ isRestrictScroll: isRestrictScroll,
737
+ isResponsivePadding: getFooter ? false : true,
738
+ alignBox: "row",
739
+ dataId: `${dataId}_suggestionBox`,
740
+ customClass: {
741
+ customDropBox: dropBoxClass
784
742
  }
785
- })), /*#__PURE__*/React.createElement(Suggestions, _extends({
786
- activeId: selectedId,
787
- suggestions: options,
788
- getRef: this.suggestionItemRef,
789
- hoverId: hoverId,
790
- onClick: this.handleChange,
791
- onMouseEnter: this.handleMouseEnter,
792
- selectedOptions: [selectedId],
793
- needTick: needTick,
794
- needBorder: false,
795
- htmlId: setAriaId,
743
+ }, isLoading ? /*#__PURE__*/React.createElement(Container, {
744
+ align: "both",
745
+ className: style.loader
746
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(Box, {
747
+ flexible: true
748
+ }, /*#__PURE__*/React.createElement(Card, {
749
+ customClass: style.box,
750
+ onScroll: this.handleScroll
751
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
752
+ className: `${style.search} ${style[size]}`
753
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
754
+ inputRef: this.searchInputRef,
755
+ maxLength: maxLength,
756
+ onChange: this.handleSearch,
757
+ onKeyDown: this.handleKeyDown,
758
+ placeHolder: searchBoxPlaceHolder,
759
+ size: searchBoxSize,
760
+ value: searchStr,
761
+ onClear: this.handleClearSearch,
796
762
  a11y: {
797
- ariaParentRole: 'listbox',
798
- role: 'option'
763
+ ariaControls: setAriaId,
764
+ ariaAutocomplete: 'list',
765
+ ariaDescribedby: ariaErrorId
799
766
  },
800
- dataId: `${dataId}_Options`
801
- }, SuggestionsProps)));
802
- }) : /*#__PURE__*/React.createElement(EmptyState, {
803
- options: revampedGroups,
804
- searchString: searchStr,
805
- suggestions: suggestionGroups,
806
- renderCustomEmptyState: renderCustomEmptyState,
807
- dataId: dataIdSrchEmptyMsg,
808
- isLoading: isFetchingOptions,
809
- i18nKeys: i18nKeys,
810
- htmlId: ariaErrorId
811
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
812
- isCover: false,
813
- align: "both"
814
- }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)))) : null);
767
+ autoComplete: false,
768
+ dataId: `${dataId}_search`
769
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
770
+ shrink: true,
771
+ customClass: `${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
772
+ eleRef: this.suggestionContainerRef
773
+ }, suggestionGroups.length ? suggestionGroups.map(group => {
774
+ let {
775
+ id: groupId,
776
+ name: groupName,
777
+ options
778
+ } = group;
779
+ let hoverId = suggestionOptionIds[hoverIndex];
780
+ return /*#__PURE__*/React.createElement(React.Fragment, {
781
+ key: groupId
782
+ }, groupName && /*#__PURE__*/React.createElement("div", {
783
+ className: style.groupTitle
784
+ }, /*#__PURE__*/React.createElement(DropDownHeading, {
785
+ text: groupName,
786
+ a11y: {
787
+ role: 'heading'
788
+ }
789
+ })), /*#__PURE__*/React.createElement(Suggestions, _extends({
790
+ activeId: selectedId,
791
+ suggestions: options,
792
+ getRef: this.suggestionItemRef,
793
+ hoverId: hoverId,
794
+ onClick: this.handleChange,
795
+ onMouseEnter: this.handleMouseEnter,
796
+ selectedOptions: [selectedId],
797
+ needTick: needTick,
798
+ needBorder: false,
799
+ htmlId: setAriaId,
800
+ a11y: {
801
+ ariaParentRole: 'listbox',
802
+ role: 'option'
803
+ },
804
+ dataId: `${dataId}_Options`
805
+ }, SuggestionsProps)));
806
+ }) : /*#__PURE__*/React.createElement(EmptyState, {
807
+ options: revampedGroups,
808
+ searchString: searchStr,
809
+ suggestions: suggestionGroups,
810
+ renderCustomEmptyState: renderCustomEmptyState,
811
+ dataId: dataIdSrchEmptyMsg,
812
+ isLoading: isFetchingOptions,
813
+ i18nKeys: i18nKeys,
814
+ htmlId: ariaErrorId
815
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
816
+ isCover: false,
817
+ align: "both"
818
+ }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
819
+ }) : null);
815
820
  }
816
821
 
817
822
  }
@@ -325,9 +325,10 @@ export class SelectComponent extends Component {
325
325
  needCloseOnSelect && this.handlePopupClose(e);
326
326
  }
327
327
 
328
- responsiveFunc({
329
- mediaQueryOR
330
- }) {
328
+ responsiveFunc(_ref) {
329
+ let {
330
+ mediaQueryOR
331
+ } = _ref;
331
332
  return {
332
333
  tabletMode: mediaQueryOR([{
333
334
  maxWidth: 700
@@ -507,7 +508,8 @@ export class SelectComponent extends Component {
507
508
  isScrollReachedBottom && this.handleGetNextOptions();
508
509
  }
509
510
 
510
- handleFetchOptions(APICall, searchStr = '') {
511
+ handleFetchOptions(APICall) {
512
+ let searchStr = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
511
513
  // let funcArgs = args.slice(1, args.length);
512
514
  let {
513
515
  isFetchingOptions = false
@@ -722,13 +724,14 @@ export class SelectComponent extends Component {
722
724
  });
723
725
  }
724
726
 
725
- getInputFieldLineA11y({
726
- setAriaId,
727
- isReadOnly,
728
- isDisabled,
729
- isPopupOpen,
730
- inputFieldLineA11y
731
- }) {
727
+ getInputFieldLineA11y(_ref2) {
728
+ let {
729
+ setAriaId,
730
+ isReadOnly,
731
+ isDisabled,
732
+ isPopupOpen,
733
+ inputFieldLineA11y
734
+ } = _ref2;
732
735
  return {
733
736
  tabIndex: 0,
734
737
  role: 'button',
@@ -993,104 +996,109 @@ export class SelectComponent extends Component {
993
996
  })), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
994
997
  query: this.responsiveFunc,
995
998
  responsiveId: "Helmet"
996
- }, ({
997
- tabletMode
998
- }) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
999
- animationStyle: animationStyle,
1000
- boxPosition: position || `${defaultDropBoxPosition}`,
1001
- getRef: getContainerRef,
1002
- isActive: isPopupReady,
1003
- isAnimate: isAnimate && !isVirtualizerEnabled // Note: Virtualizer gets element height at mount itself which causes issue with options height
1004
- ,
1005
- isArrow: false,
1006
- onClick: removeClose,
1007
- needResponsive: needResponsive,
1008
- dataId: `${dataId}_suggestions`,
1009
- size: boxSize,
1010
- isPadding: false,
1011
- isResponsivePadding: getFooter ? false : true,
1012
- alignBox: "row",
1013
- isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
1014
- positionsOffset: positionsOffset,
1015
- targetOffset: targetOffset,
1016
- isRestrictScroll: isRestrictScroll,
1017
- portalId: dropBoxPortalId,
1018
- customClass: {
1019
- customDropBox: dropBoxClass
1020
- }
1021
- }, isLoading ? /*#__PURE__*/React.createElement(Container, {
1022
- align: "both",
1023
- className: style.loader
1024
- }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, !getChildren ? /*#__PURE__*/React.createElement(Box, {
1025
- flexible: true
1026
- }, /*#__PURE__*/React.createElement(Card, {
1027
- onScroll: this.handleScroll
1028
- }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
1029
- className: `${style.search} ${style[size]}`
1030
- }, /*#__PURE__*/React.createElement(TextBoxIcon, {
1031
- a11y: {
1032
- ariaControls: setAriaId,
1033
- ariaAutocomplete: 'list',
1034
- ariaDescribedby: ariaErrorId
1035
- },
1036
- inputRef: this.searchInputRef,
1037
- maxLength: maxLength,
1038
- onChange: this.handleSearch,
1039
- onKeyDown: this.handleKeyDown,
1040
- placeHolder: searchBoxPlaceHolder,
1041
- size: searchBoxSize,
1042
- value: searchStr,
1043
- onClear: this.handleClearSearch,
1044
- dataId: `${dataId}_search`,
1045
- i18nKeys: TextBoxIcon_i18n,
1046
- autoComplete: autoComplete,
1047
- customProps: {
1048
- TextBoxProps: DropdownSearchTextBoxProps
1049
- },
1050
- renderCustomClearComponent: renderCustomSearchClearComponent
1051
- }))) : null, /*#__PURE__*/React.createElement(CardContent, {
1052
- shrink: true,
1053
- customClass: `
999
+ }, _ref3 => {
1000
+ let {
1001
+ tabletMode
1002
+ } = _ref3;
1003
+ return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
1004
+ animationStyle: animationStyle,
1005
+ boxPosition: position || `${defaultDropBoxPosition}`,
1006
+ getRef: getContainerRef,
1007
+ isActive: isPopupReady,
1008
+ isAnimate: isAnimate && !isVirtualizerEnabled // Note: Virtualizer gets element height at mount itself which causes issue with options height
1009
+ ,
1010
+ isArrow: false,
1011
+ onClick: removeClose,
1012
+ needResponsive: needResponsive,
1013
+ dataId: `${dataId}_suggestions`,
1014
+ size: boxSize,
1015
+ isPadding: false,
1016
+ isResponsivePadding: getFooter ? false : true,
1017
+ alignBox: "row",
1018
+ isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
1019
+ positionsOffset: positionsOffset,
1020
+ targetOffset: targetOffset,
1021
+ isRestrictScroll: isRestrictScroll,
1022
+ portalId: dropBoxPortalId,
1023
+ customClass: {
1024
+ customDropBox: dropBoxClass
1025
+ }
1026
+ }, isLoading ? /*#__PURE__*/React.createElement(Container, {
1027
+ align: "both",
1028
+ className: style.loader
1029
+ }, /*#__PURE__*/React.createElement(Loader, null)) : /*#__PURE__*/React.createElement(React.Fragment, null, !getChildren ? /*#__PURE__*/React.createElement(Box, {
1030
+ flexible: true
1031
+ }, /*#__PURE__*/React.createElement(Card, {
1032
+ onScroll: this.handleScroll
1033
+ }, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
1034
+ className: `${style.search} ${style[size]}`
1035
+ }, /*#__PURE__*/React.createElement(TextBoxIcon, {
1036
+ a11y: {
1037
+ ariaControls: setAriaId,
1038
+ ariaAutocomplete: 'list',
1039
+ ariaDescribedby: ariaErrorId
1040
+ },
1041
+ inputRef: this.searchInputRef,
1042
+ maxLength: maxLength,
1043
+ onChange: this.handleSearch,
1044
+ onKeyDown: this.handleKeyDown,
1045
+ placeHolder: searchBoxPlaceHolder,
1046
+ size: searchBoxSize,
1047
+ value: searchStr,
1048
+ onClear: this.handleClearSearch,
1049
+ dataId: `${dataId}_search`,
1050
+ i18nKeys: TextBoxIcon_i18n,
1051
+ autoComplete: autoComplete,
1052
+ customProps: {
1053
+ TextBoxProps: DropdownSearchTextBoxProps
1054
+ },
1055
+ renderCustomClearComponent: renderCustomSearchClearComponent
1056
+ }))) : null, /*#__PURE__*/React.createElement(CardContent, {
1057
+ shrink: true,
1058
+ customClass: `
1054
1059
  ${!tabletMode && dropBoxSize ? style[dropBoxSize] : ''} ${cardContentClass}`,
1055
- eleRef: this.suggestionContainerRef
1056
- }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
1057
- key: searchStr.trim(),
1058
- activeId: selectedId,
1059
- isVirtualizerEnabled: isVirtualizerEnabled,
1060
- getVirtualizerPublicMethods: this.getVirtualizerPublicMethods,
1061
- setVirtualizerContainerRefFunction: this.setSuggestionsVirtualizerContainerRefFunction,
1062
- suggestions: suggestions,
1063
- getRef: this.suggestionItemRef,
1064
- hoverOption: hoverIndex,
1065
- onClick: this.handleChange,
1066
- onMouseEnter: this.handleMouseEnter,
1067
- dataId: `${dataId}_Options`,
1068
- needTick: needTick,
1069
- needBorder: needListBorder,
1070
- selectedOptions: [selectedId],
1071
- className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
1072
- listItemSize: listItemSize,
1073
- htmlId: setAriaId,
1074
- a11y: {
1075
- ariaParentRole: 'listbox',
1076
- role: 'option'
1077
- }
1078
- }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
1079
- isLoading: isFetchingOptions,
1080
- options: options,
1081
- searchString: searchStr,
1082
- suggestions: suggestions,
1083
- dataId: dataId,
1084
- renderCustomEmptyState: renderCustomEmptyState,
1085
- getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
1086
- i18nKeys: i18nKeys,
1087
- htmlId: ariaErrorId
1088
- }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1089
- isCover: false,
1090
- align: "both"
1091
- }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)) : /*#__PURE__*/React.createElement(Box, {
1092
- flexible: true
1093
- }, getChildren())))) : null);
1060
+ eleRef: this.suggestionContainerRef
1061
+ }, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, _extends({
1062
+ key: searchStr.trim(),
1063
+ activeId: selectedId,
1064
+ isVirtualizerEnabled: isVirtualizerEnabled,
1065
+ getVirtualizerPublicMethods: this.getVirtualizerPublicMethods,
1066
+ setVirtualizerContainerRefFunction: this.setSuggestionsVirtualizerContainerRefFunction,
1067
+ suggestions: suggestions,
1068
+ getRef: this.suggestionItemRef,
1069
+ hoverOption: hoverIndex,
1070
+ onClick: this.handleChange,
1071
+ onMouseEnter: this.handleMouseEnter,
1072
+ dataId: `${dataId}_Options`,
1073
+ needTick: needTick,
1074
+ needBorder: needListBorder,
1075
+ selectedOptions: [selectedId],
1076
+ className: `${tabletMode ? style.responsivelistItemContainer : style.listItemContainer}`,
1077
+ listItemSize: listItemSize,
1078
+ htmlId: setAriaId,
1079
+ a11y: {
1080
+ ariaParentRole: 'listbox',
1081
+ role: 'option'
1082
+ }
1083
+ }, SuggestionsProps)) : /*#__PURE__*/React.createElement(EmptyState, {
1084
+ isLoading: isFetchingOptions,
1085
+ options: options,
1086
+ searchString: searchStr,
1087
+ suggestions: suggestions,
1088
+ dataId: dataId,
1089
+ renderCustomEmptyState: renderCustomEmptyState,
1090
+ getCustomEmptyState: getCustomEmptyState ? this.handleGetAddNewOptionText : null,
1091
+ i18nKeys: i18nKeys,
1092
+ htmlId: ariaErrorId
1093
+ }), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
1094
+ isCover: false,
1095
+ align: "both"
1096
+ }, /*#__PURE__*/React.createElement(Loader, null))), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter({
1097
+ closePopup: this.handlePopupClose
1098
+ })) : null)) : /*#__PURE__*/React.createElement(Box, {
1099
+ flexible: true
1100
+ }, getChildren())));
1101
+ }) : null);
1094
1102
  }
1095
1103
 
1096
1104
  }