@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.
- package/.cli/UnValidatedFiles.html +101 -0
- package/.cli/propValidation_report.html +1 -1
- package/README.md +15 -0
- package/es/CheckBox/CheckBox.js +10 -0
- package/es/CheckBox/props/propTypes.js +1 -0
- package/es/DateTime/DateWidget.js +13 -4
- package/es/DropBox/DropBox.js +5 -15
- package/es/DropBox/utils/isMobilePopover.js +17 -0
- package/es/MultiSelect/MultiSelect.js +75 -92
- package/es/MultiSelect/MultiSelectWithAvatar.js +73 -90
- package/es/Radio/Radio.js +26 -7
- package/es/Radio/Radio.module.css +3 -0
- package/es/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/es/Radio/props/defaultProps.js +1 -0
- package/es/Radio/props/propTypes.js +7 -0
- package/es/Tag/Tag.js +1 -1
- package/es/v1/CheckBox/CheckBox.js +6 -0
- package/es/v1/CheckBox/props/propTypes.js +1 -0
- package/es/v1/DateTime/DateWidget.js +13 -4
- package/es/v1/DropBox/DropBox.js +3 -14
- package/es/v1/DropBox/utils/isMobilePopover.js +17 -0
- package/es/v1/MultiSelect/MultiSelect.js +75 -93
- package/es/v1/MultiSelect/MultiSelectWithAvatar.js +74 -91
- package/es/v1/Radio/Radio.js +22 -7
- package/es/v1/Radio/props/defaultProps.js +1 -0
- package/es/v1/Radio/props/propTypes.js +7 -0
- package/es/v1/Tag/Tag.js +1 -1
- package/lib/CheckBox/CheckBox.js +34 -24
- package/lib/CheckBox/props/propTypes.js +1 -0
- package/lib/DateTime/DateWidget.js +21 -11
- package/lib/DropBox/DropBox.js +3 -13
- package/lib/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/MultiSelect/MultiSelect.js +74 -91
- package/lib/MultiSelect/MultiSelectWithAvatar.js +72 -89
- package/lib/Radio/Radio.js +45 -26
- package/lib/Radio/Radio.module.css +3 -0
- package/lib/Radio/__tests__/__snapshots__/Radio.spec.js.snap +3 -3
- package/lib/Radio/props/defaultProps.js +1 -0
- package/lib/Radio/props/propTypes.js +7 -0
- package/lib/Tag/Tag.js +1 -1
- package/lib/v1/CheckBox/CheckBox.js +6 -0
- package/lib/v1/CheckBox/props/propTypes.js +1 -0
- package/lib/v1/DateTime/DateWidget.js +21 -11
- package/lib/v1/DropBox/DropBox.js +3 -13
- package/lib/v1/DropBox/utils/isMobilePopover.js +25 -0
- package/lib/v1/MultiSelect/MultiSelect.js +76 -93
- package/lib/v1/MultiSelect/MultiSelectWithAvatar.js +71 -90
- package/lib/v1/Radio/Radio.js +22 -7
- package/lib/v1/Radio/props/defaultProps.js +1 -0
- package/lib/v1/Radio/props/propTypes.js +7 -0
- package/lib/v1/Tag/Tag.js +1 -1
- package/package.json +6 -6
- package/propValidationArg.json +8 -4
- 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
|
|
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
|
|
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
|
|
1570
|
+
class="label title medium default font_default
|
|
1571
1571
|
dotted cursor
|
|
1572
1572
|
primaryLabel disabled "
|
|
1573
1573
|
data-id="RadioText_label"
|
|
@@ -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
|
-
|
|
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,
|
|
@@ -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
|
-
|
|
935
|
-
|
|
936
|
-
|
|
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
|
|
package/es/v1/DropBox/DropBox.js
CHANGED
|
@@ -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,
|
|
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
|
|
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
|
-
|
|
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(
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
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
|
-
|
|
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(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
}
|