@zohodesk/components 1.0.0-alpha-239 → 1.0.0-alpha-242
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.
- package/README.md +20 -6
- package/assets/Appearance/dark/mode/darkMode.module.css +2 -2
- package/assets/Appearance/default/mode/defaultMode.module.css +3 -3
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +2 -2
- package/es/DateTime/DateTime.js +42 -21
- package/es/DateTime/DateWidget.module.css +0 -4
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +100 -75
- package/es/MultiSelect/AdvancedMultiSelect.js +75 -49
- package/es/MultiSelect/MultiSelect.js +80 -55
- package/es/MultiSelect/MultiSelect.module.css +6 -1
- package/es/MultiSelect/MultiSelectWithAvatar.js +77 -52
- package/es/PopOver/PopOver.js +10 -4
- package/es/Provider.js +5 -105
- package/es/ResponsiveDropBox/ResponsiveDropBox.js +74 -0
- package/es/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
- package/es/Select/GroupSelect.js +99 -74
- package/es/Select/Select.js +95 -68
- package/es/Select/Select.module.css +6 -0
- package/es/Select/SelectWithAvatar.js +91 -66
- package/es/Select/SelectWithIcon.js +99 -74
- package/es/Tab/Tabs.js +68 -43
- package/es/Tab/Tabs.module.css +2 -1
- package/es/Tag/Tag.js +1 -1
- package/es/Tag/Tag.module.css +6 -2
- package/es/Tooltip/Tooltip.js +1 -1
- package/es/index.js +2 -1
- package/lib/DateTime/DateTime.js +42 -22
- package/lib/DateTime/DateWidget.module.css +0 -4
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +99 -77
- package/lib/MultiSelect/AdvancedMultiSelect.js +76 -50
- package/lib/MultiSelect/MultiSelect.js +81 -56
- package/lib/MultiSelect/MultiSelect.module.css +6 -1
- package/lib/MultiSelect/MultiSelectWithAvatar.js +78 -53
- package/lib/PopOver/PopOver.js +11 -4
- package/lib/Provider.js +6 -123
- package/lib/ResponsiveDropBox/ResponsiveDropBox.js +130 -0
- package/lib/ResponsiveDropBox/ResponsiveDropBox.module.css +6 -0
- package/lib/Select/GroupSelect.js +99 -76
- package/lib/Select/Select.js +102 -75
- package/lib/Select/Select.module.css +6 -0
- package/lib/Select/SelectWithAvatar.js +96 -71
- package/lib/Select/SelectWithIcon.js +97 -74
- package/lib/Tab/Tabs.js +67 -44
- package/lib/Tab/Tabs.module.css +2 -1
- package/lib/Tag/Tag.js +1 -1
- package/lib/Tag/Tag.module.css +6 -2
- package/lib/Tooltip/Tooltip.js +1 -1
- package/lib/index.js +10 -1
- package/package.json +3 -3
package/es/Select/GroupSelect.js
CHANGED
|
@@ -4,7 +4,6 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
/**** Components ****/
|
|
5
5
|
|
|
6
6
|
import Popup from '../Popup/Popup';
|
|
7
|
-
import DropBox from '../DropBox/DropBox';
|
|
8
7
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
9
8
|
import Textbox from '../TextBox/TextBox';
|
|
10
9
|
import Card, { CardHeader, CardContent, CardFooter } from '../Card/Card';
|
|
@@ -12,8 +11,10 @@ import Suggestions from '../MultiSelect/Suggestions';
|
|
|
12
11
|
import EmptyState from '../MultiSelect/EmptyState';
|
|
13
12
|
import Icon from '@zohodesk/icons/lib/Icon';
|
|
14
13
|
import DropDownHeading from '../DropDown/DropDownHeading';
|
|
15
|
-
import { Container } from '../Layout';
|
|
14
|
+
import { Container, Box } from '../Layout';
|
|
16
15
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
16
|
+
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
17
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
17
18
|
import style from './Select.module.css';
|
|
18
19
|
/**** Methods ****/
|
|
19
20
|
|
|
@@ -533,6 +534,17 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
533
534
|
isNextOptions && getNextOptions && this.handleFetchOptions(getNextOptions, searchStr);
|
|
534
535
|
}
|
|
535
536
|
|
|
537
|
+
responsiveFunc(_ref) {
|
|
538
|
+
let {
|
|
539
|
+
mediaQueryOR
|
|
540
|
+
} = _ref;
|
|
541
|
+
return {
|
|
542
|
+
tabletMode: mediaQueryOR([{
|
|
543
|
+
maxWidth: 700
|
|
544
|
+
}])
|
|
545
|
+
};
|
|
546
|
+
}
|
|
547
|
+
|
|
536
548
|
render() {
|
|
537
549
|
let {
|
|
538
550
|
isDisabled,
|
|
@@ -671,80 +683,93 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
671
683
|
},
|
|
672
684
|
autoComplete: false,
|
|
673
685
|
isFocus: isPopupReady
|
|
674
|
-
}))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
isActive: isPopupReady,
|
|
679
|
-
isAnimate: true,
|
|
680
|
-
isArrow: false,
|
|
681
|
-
onClick: removeClose,
|
|
682
|
-
needResponsive: needResponsive,
|
|
683
|
-
isPadding: false
|
|
684
|
-
}, /*#__PURE__*/React.createElement(Card, {
|
|
685
|
-
customClass: style.box,
|
|
686
|
-
onScroll: this.handleScroll
|
|
687
|
-
}, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
688
|
-
className: `${style.search} ${style[size]}`
|
|
689
|
-
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
690
|
-
inputRef: this.searchInputRef,
|
|
691
|
-
maxLength: maxLength,
|
|
692
|
-
onChange: this.handleSearch,
|
|
693
|
-
onKeyDown: this.handleKeyDown,
|
|
694
|
-
placeHolder: searchBoxPlaceHolder,
|
|
695
|
-
size: searchBoxSize,
|
|
696
|
-
value: searchStr,
|
|
697
|
-
onClear: this.handleClearSearch,
|
|
698
|
-
a11y: {
|
|
699
|
-
ariaControls: setAriaId,
|
|
700
|
-
ariaAutocomplete: 'list',
|
|
701
|
-
ariaDescribedby: ariaErrorId
|
|
702
|
-
},
|
|
703
|
-
autoComplete: false
|
|
704
|
-
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
705
|
-
customClass: dropBoxSize ? style[dropBoxSize] : '',
|
|
706
|
-
eleRef: this.suggestionContainerRef
|
|
707
|
-
}, suggestionGroups.length ? suggestionGroups.map(group => {
|
|
686
|
+
}))), !isReadOnly && !isDisabled && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
687
|
+
query: this.responsiveFunc,
|
|
688
|
+
responsiveId: "Helmet"
|
|
689
|
+
}, _ref2 => {
|
|
708
690
|
let {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
691
|
+
tabletMode
|
|
692
|
+
} = _ref2;
|
|
693
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
694
|
+
animationStyle: animationStyle,
|
|
695
|
+
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
696
|
+
getRef: getContainerRef,
|
|
697
|
+
isActive: isPopupReady,
|
|
698
|
+
isAnimate: true,
|
|
699
|
+
isArrow: false,
|
|
700
|
+
onClick: removeClose,
|
|
701
|
+
needResponsive: needResponsive,
|
|
702
|
+
isPadding: false,
|
|
703
|
+
isResponsivePadding: getFooter ? false : true,
|
|
704
|
+
alignBox: "row"
|
|
705
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
706
|
+
flexible: true
|
|
707
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
708
|
+
customClass: style.box,
|
|
709
|
+
onScroll: this.handleScroll
|
|
710
|
+
}, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement("div", {
|
|
711
|
+
className: `${style.search} ${style[size]}`
|
|
712
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
713
|
+
inputRef: this.searchInputRef,
|
|
714
|
+
maxLength: maxLength,
|
|
715
|
+
onChange: this.handleSearch,
|
|
716
|
+
onKeyDown: this.handleKeyDown,
|
|
717
|
+
placeHolder: searchBoxPlaceHolder,
|
|
718
|
+
size: searchBoxSize,
|
|
719
|
+
value: searchStr,
|
|
720
|
+
onClear: this.handleClearSearch,
|
|
720
721
|
a11y: {
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
722
|
+
ariaControls: setAriaId,
|
|
723
|
+
ariaAutocomplete: 'list',
|
|
724
|
+
ariaDescribedby: ariaErrorId
|
|
725
|
+
},
|
|
726
|
+
autoComplete: false
|
|
727
|
+
}))) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
728
|
+
shrink: true,
|
|
729
|
+
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
730
|
+
eleRef: this.suggestionContainerRef
|
|
731
|
+
}, suggestionGroups.length ? suggestionGroups.map(group => {
|
|
732
|
+
let {
|
|
733
|
+
id: groupId,
|
|
734
|
+
name: groupName,
|
|
735
|
+
options
|
|
736
|
+
} = group;
|
|
737
|
+
let hoverId = suggestionOptionIds[hoverIndex];
|
|
738
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
739
|
+
key: groupId
|
|
740
|
+
}, groupName && /*#__PURE__*/React.createElement("div", {
|
|
741
|
+
className: style.groupTitle
|
|
742
|
+
}, /*#__PURE__*/React.createElement(DropDownHeading, {
|
|
743
|
+
text: groupName,
|
|
744
|
+
a11y: {
|
|
745
|
+
role: 'heading'
|
|
746
|
+
}
|
|
747
|
+
})), /*#__PURE__*/React.createElement(Suggestions, {
|
|
748
|
+
activeId: selectedId,
|
|
749
|
+
suggestions: options,
|
|
750
|
+
getRef: this.suggestionItemRef,
|
|
751
|
+
hoverId: hoverId,
|
|
752
|
+
onClick: this.handleChange,
|
|
753
|
+
onMouseEnter: this.handleMouseEnter,
|
|
754
|
+
selectedOptions: [selectedId],
|
|
755
|
+
needTick: needTick,
|
|
756
|
+
needBorder: false,
|
|
757
|
+
htmlId: setAriaId,
|
|
758
|
+
a11y: {
|
|
759
|
+
ariaParentRole: 'listbox',
|
|
760
|
+
role: 'option'
|
|
761
|
+
}
|
|
762
|
+
}));
|
|
763
|
+
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
764
|
+
options: revampedGroups,
|
|
765
|
+
searchString: searchStr,
|
|
766
|
+
suggestions: suggestionGroups,
|
|
767
|
+
dataId: dataIdSrchEmptyMsg,
|
|
768
|
+
isLoading: isFetchingOptions,
|
|
769
|
+
i18nKeys: i18nKeys,
|
|
770
|
+
htmlId: ariaErrorId
|
|
771
|
+
})), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
|
|
772
|
+
}) : null);
|
|
748
773
|
}
|
|
749
774
|
|
|
750
775
|
}
|
package/es/Select/Select.js
CHANGED
|
@@ -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(
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
},
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
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(
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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
|
}
|