@zohodesk/components 1.0.0-alpha-239 → 1.0.0-alpha-240
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/assets/Appearance/dark/mode/darkMode.module.css +0 -2
- package/assets/Appearance/default/mode/defaultMode.module.css +1 -3
- package/assets/Appearance/pureDark/mode/pureDarkMode.module.css +0 -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/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/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/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/index.js +10 -1
- package/package.json +3 -3
|
@@ -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 { Container, Box } from '../Layout';
|
|
10
9
|
import Card, { CardContent, CardHeader, CardFooter } from '../Card/Card';
|
|
@@ -14,6 +13,8 @@ import EmptyState from './EmptyState';
|
|
|
14
13
|
import MultiSelectHeader from './MultiSelectHeader';
|
|
15
14
|
import CssProvider from '../Provider/CssProvider';
|
|
16
15
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
16
|
+
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
17
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
17
18
|
/**** Icons ****/
|
|
18
19
|
|
|
19
20
|
import Icon from '@zohodesk/icons/lib/Icon';
|
|
@@ -829,6 +830,17 @@ export class MultiSelectComponent extends React.Component {
|
|
|
829
830
|
});
|
|
830
831
|
}
|
|
831
832
|
|
|
833
|
+
responsiveFunc(_ref) {
|
|
834
|
+
let {
|
|
835
|
+
mediaQueryOR
|
|
836
|
+
} = _ref;
|
|
837
|
+
return {
|
|
838
|
+
tabletMode: mediaQueryOR([{
|
|
839
|
+
maxWidth: 700
|
|
840
|
+
}])
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
|
|
832
844
|
render() {
|
|
833
845
|
let {
|
|
834
846
|
isReadOnly,
|
|
@@ -978,60 +990,73 @@ export class MultiSelectComponent extends React.Component {
|
|
|
978
990
|
size: "15"
|
|
979
991
|
})) : null, children ? /*#__PURE__*/React.createElement(Box, {
|
|
980
992
|
dataId: `${dataId}_children`
|
|
981
|
-
}, children) : null)))), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
993
|
+
}, children) : null)))), !isReadOnly && !isDisabled && !disableAction && isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
994
|
+
query: this.responsiveFunc,
|
|
995
|
+
responsiveId: "Helmet"
|
|
996
|
+
}, _ref2 => {
|
|
997
|
+
let {
|
|
998
|
+
tabletMode
|
|
999
|
+
} = _ref2;
|
|
1000
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
1001
|
+
animationStyle: animationStyle,
|
|
1002
|
+
boxPosition: position || `${defaultDropBoxPosition}`,
|
|
1003
|
+
getRef: getContainerRef,
|
|
1004
|
+
isActive: isPopupReady,
|
|
1005
|
+
isAnimate: isAnimate,
|
|
1006
|
+
isArrow: false,
|
|
1007
|
+
onClick: removeClose,
|
|
1008
|
+
needResponsive: needResponsive,
|
|
1009
|
+
isPadding: false,
|
|
1010
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
1011
|
+
palette: palette,
|
|
1012
|
+
htmlId: setAriaId,
|
|
1013
|
+
a11y: {
|
|
1014
|
+
role: 'listbox',
|
|
1015
|
+
ariaMultiselectable: true
|
|
1016
|
+
},
|
|
1017
|
+
size: boxSize,
|
|
1018
|
+
alignBox: "row",
|
|
1019
|
+
isResponsivePadding: getFooter ? false : true
|
|
1020
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
1021
|
+
flexible: true
|
|
1022
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
1023
|
+
customClass: `${style.box} ${style[`${palette}Box`]}`,
|
|
1024
|
+
onScroll: this.handleScroll
|
|
1025
|
+
}, /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
1026
|
+
needSelectAll: needSelectAll,
|
|
1027
|
+
onSelect: this.handleSelectAll,
|
|
1028
|
+
selectAllText: selectAllText,
|
|
1029
|
+
suggestions: suggestions,
|
|
1030
|
+
dataId: dataId
|
|
1031
|
+
})), /*#__PURE__*/React.createElement(CardContent, {
|
|
1032
|
+
shrink: true,
|
|
1033
|
+
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
1034
|
+
eleRef: this.suggestionContainerRef
|
|
1035
|
+
}, isSearching ? /*#__PURE__*/React.createElement("div", {
|
|
1036
|
+
className: style[palette]
|
|
1037
|
+
}, searchText) : suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
1038
|
+
suggestions: suggestions,
|
|
1039
|
+
getRef: this.suggestionItemRef,
|
|
1040
|
+
hoverOption: hoverOption,
|
|
1041
|
+
onClick: this.handleSelectOption,
|
|
1042
|
+
onMouseEnter: this.handleMouseEnter,
|
|
1043
|
+
needBorder: false,
|
|
1044
|
+
dataId: `${dataId}_Options`,
|
|
1045
|
+
palette: palette,
|
|
1046
|
+
a11y: {
|
|
1047
|
+
role: 'option'
|
|
1048
|
+
}
|
|
1049
|
+
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
1050
|
+
isLoading: isFetchingOptions,
|
|
1051
|
+
options: options,
|
|
1052
|
+
searchString: searchStr,
|
|
1053
|
+
suggestions: suggestions,
|
|
1054
|
+
dataId: dataId,
|
|
1055
|
+
palette: palette,
|
|
1056
|
+
i18nKeys: i18nKeys,
|
|
1057
|
+
htmlId: ariaErrorId
|
|
1058
|
+
})), getFooter ? /*#__PURE__*/React.createElement(CardFooter, null, getFooter()) : null)));
|
|
1059
|
+
}) : null);
|
|
1035
1060
|
}
|
|
1036
1061
|
|
|
1037
1062
|
}
|
|
@@ -101,7 +101,9 @@
|
|
|
101
101
|
[dir=rtl] .container.medium .tag {
|
|
102
102
|
margin: var(--zd_size5) 0 0 var(--zd_size10);
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
.responsiveParent{
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
105
107
|
.box {
|
|
106
108
|
background: var(--zdt_multiselect_box_bg);
|
|
107
109
|
}
|
|
@@ -191,3 +193,6 @@
|
|
|
191
193
|
[dir=rtl] .clearIconSpace {
|
|
192
194
|
padding-left: var(--zd_size37)
|
|
193
195
|
}
|
|
196
|
+
.search{
|
|
197
|
+
padding: 0px 20px;
|
|
198
|
+
}
|
|
@@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
|
|
6
6
|
import { MultiSelectComponent } from './MultiSelect';
|
|
7
7
|
import Popup from '../Popup/Popup';
|
|
8
|
-
import DropBox from '../DropBox/DropBox';
|
|
9
8
|
import TextBoxIcon from '../TextBoxIcon/TextBoxIcon';
|
|
10
9
|
import { Container, Box } from '../Layout';
|
|
11
10
|
import Card, { CardContent, CardHeader } from '../Card/Card';
|
|
@@ -15,6 +14,8 @@ import EmptyState from './EmptyState';
|
|
|
15
14
|
import MultiSelectHeader from './MultiSelectHeader';
|
|
16
15
|
import CssProvider from '../Provider/CssProvider';
|
|
17
16
|
import { getUniqueId } from '../Provider/IdProvider';
|
|
17
|
+
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
18
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
18
19
|
/**** Icons ****/
|
|
19
20
|
|
|
20
21
|
import Icon from '@zohodesk/icons/lib/Icon';
|
|
@@ -52,6 +53,17 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
responsiveFunc(_ref) {
|
|
57
|
+
let {
|
|
58
|
+
mediaQueryOR
|
|
59
|
+
} = _ref;
|
|
60
|
+
return {
|
|
61
|
+
tabletMode: mediaQueryOR([{
|
|
62
|
+
maxWidth: 700
|
|
63
|
+
}])
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
55
67
|
render() {
|
|
56
68
|
let {
|
|
57
69
|
isReadOnly,
|
|
@@ -189,57 +201,70 @@ class MultiSelectWithAvatarComponent extends MultiSelectComponent {
|
|
|
189
201
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
190
202
|
name: "ZD-delete",
|
|
191
203
|
size: "15"
|
|
192
|
-
})) : null)))), popUpState ? /*#__PURE__*/React.createElement(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
204
|
+
})) : null)))), popUpState ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
205
|
+
query: this.responsiveFunc,
|
|
206
|
+
responsiveId: "Helmet"
|
|
207
|
+
}, _ref2 => {
|
|
208
|
+
let {
|
|
209
|
+
tabletMode
|
|
210
|
+
} = _ref2;
|
|
211
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
212
|
+
animationStyle: animationStyle,
|
|
213
|
+
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
214
|
+
getRef: getContainerRef,
|
|
215
|
+
isActive: isPopupReady,
|
|
216
|
+
isAnimate: isAnimate,
|
|
217
|
+
isArrow: false,
|
|
218
|
+
onClick: removeClose,
|
|
219
|
+
needResponsive: needResponsive,
|
|
220
|
+
isPadding: false,
|
|
221
|
+
isBoxPaddingNeed: isBoxPaddingNeed,
|
|
222
|
+
palette: palette,
|
|
223
|
+
htmlId: setAriaId,
|
|
224
|
+
a11y: {
|
|
225
|
+
ariaMultiselectable: true,
|
|
226
|
+
role: 'listbox'
|
|
227
|
+
},
|
|
228
|
+
isResponsivePadding: true,
|
|
229
|
+
alignBox: "row"
|
|
230
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
231
|
+
flexible: true
|
|
232
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
233
|
+
customClass: `${style.box} ${style[`${palette}Box`]}`,
|
|
234
|
+
onScroll: this.handleScroll
|
|
235
|
+
}, /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(MultiSelectHeader, {
|
|
236
|
+
needSelectAll: needSelectAll,
|
|
237
|
+
onSelect: this.handleSelectAll,
|
|
238
|
+
selectAllText: selectAllText,
|
|
239
|
+
suggestions: suggestions,
|
|
240
|
+
dataId: dataId
|
|
241
|
+
})), /*#__PURE__*/React.createElement(CardContent, {
|
|
242
|
+
shrink: true,
|
|
243
|
+
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : '',
|
|
244
|
+
eleRef: this.suggestionContainerRef
|
|
245
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement(Suggestions, {
|
|
246
|
+
suggestions: suggestions,
|
|
247
|
+
getRef: this.suggestionItemRef,
|
|
248
|
+
hoverOption: hoverOption,
|
|
249
|
+
onClick: this.handleSelectOption,
|
|
250
|
+
onMouseEnter: this.handleMouseEnter,
|
|
251
|
+
needBorder: false,
|
|
252
|
+
dataId: `${dataId}_Options`,
|
|
253
|
+
palette: palette,
|
|
254
|
+
a11y: {
|
|
255
|
+
role: 'option'
|
|
256
|
+
}
|
|
257
|
+
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
258
|
+
isLoading: isFetchingOptions,
|
|
259
|
+
options: options,
|
|
260
|
+
searchString: searchStr,
|
|
261
|
+
suggestions: suggestions,
|
|
262
|
+
dataId: dataId,
|
|
263
|
+
palette: palette,
|
|
264
|
+
i18nKeys: i18nKeys,
|
|
265
|
+
htmlId: ariaErrorId
|
|
266
|
+
})))));
|
|
267
|
+
}) : null);
|
|
243
268
|
}
|
|
244
269
|
|
|
245
270
|
}
|
package/es/PopOver/PopOver.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import Popup from '../Popup/Popup';
|
|
4
|
-
import
|
|
4
|
+
import { Box } from '../Layout';
|
|
5
|
+
import ResponsiveDropBox from '../ResponsiveDropBox/ResponsiveDropBox';
|
|
5
6
|
import style from './PopOver.module.css';
|
|
6
7
|
|
|
7
8
|
class PopOver extends React.Component {
|
|
@@ -239,7 +240,7 @@ export class PopOverContainer extends React.Component {
|
|
|
239
240
|
animationStyle,
|
|
240
241
|
getRef
|
|
241
242
|
} = this.props;
|
|
242
|
-
return /*#__PURE__*/React.createElement(
|
|
243
|
+
return /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
243
244
|
animationStyle: animationStyle,
|
|
244
245
|
arrowBottom: arrowBottom,
|
|
245
246
|
arrowLeft: arrowLeft,
|
|
@@ -255,8 +256,13 @@ export class PopOverContainer extends React.Component {
|
|
|
255
256
|
left: left,
|
|
256
257
|
right: right,
|
|
257
258
|
size: size,
|
|
258
|
-
top: top
|
|
259
|
-
|
|
259
|
+
top: top,
|
|
260
|
+
alignBox: "row"
|
|
261
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
262
|
+
flexible: true,
|
|
263
|
+
shrink: true,
|
|
264
|
+
scroll: "vertical"
|
|
265
|
+
}, children));
|
|
260
266
|
}
|
|
261
267
|
|
|
262
268
|
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign || 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
|
+
|
|
3
|
+
import React, { Component } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import DropBox from '../DropBox/DropBox';
|
|
6
|
+
import { Container } from '../Layout';
|
|
7
|
+
import { ResponsiveReceiver } from '../Responsive/CustomResponsive';
|
|
8
|
+
import style from './ResponsiveDropBox.module.css';
|
|
9
|
+
export default class ResponsiveDropBox extends Component {
|
|
10
|
+
constructor(props) {
|
|
11
|
+
super(props);
|
|
12
|
+
this.responsiveFunc = this.responsiveFunc.bind(this);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
responsiveFunc(_ref) {
|
|
16
|
+
let {
|
|
17
|
+
mediaQueryOR
|
|
18
|
+
} = _ref;
|
|
19
|
+
return {
|
|
20
|
+
tabletMode: mediaQueryOR([{
|
|
21
|
+
maxWidth: 700
|
|
22
|
+
}])
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
render() {
|
|
27
|
+
const {
|
|
28
|
+
children,
|
|
29
|
+
customClass = {},
|
|
30
|
+
isResponsivePadding,
|
|
31
|
+
alignBox
|
|
32
|
+
} = this.props;
|
|
33
|
+
const {
|
|
34
|
+
customDropBox = '',
|
|
35
|
+
customMobileDropBox = '',
|
|
36
|
+
customDropBoxWrap = '',
|
|
37
|
+
customMobileDropBoxWrap = '',
|
|
38
|
+
customResponsiveContainer = ''
|
|
39
|
+
} = customClass;
|
|
40
|
+
const dropBoxClasses = {
|
|
41
|
+
customDropBox: `${customDropBox}`,
|
|
42
|
+
customMobileDropBox: `${customMobileDropBox}`,
|
|
43
|
+
customDropBoxWrap: `${customDropBoxWrap}`,
|
|
44
|
+
customMobileDropBoxWrap: `${customMobileDropBoxWrap}`,
|
|
45
|
+
customResponsiveContainer: `${customResponsiveContainer}`
|
|
46
|
+
};
|
|
47
|
+
return /*#__PURE__*/React.createElement(DropBox, _extends({}, this.props, {
|
|
48
|
+
customClass: dropBoxClasses
|
|
49
|
+
}), /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
50
|
+
query: this.responsiveFunc,
|
|
51
|
+
responsiveId: "Helmet"
|
|
52
|
+
}, _ref2 => {
|
|
53
|
+
let {
|
|
54
|
+
tabletMode
|
|
55
|
+
} = _ref2;
|
|
56
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
57
|
+
alignBox: alignBox,
|
|
58
|
+
isCover: false,
|
|
59
|
+
className: `${tabletMode ? style.dropBoxContainer : ''} ${tabletMode && isResponsivePadding ? style.boxPadding : ''} ${customResponsiveContainer}`
|
|
60
|
+
}, children);
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
}
|
|
65
|
+
ResponsiveDropBox.propTypes = {
|
|
66
|
+
children: PropTypes.element,
|
|
67
|
+
customClass: PropTypes.object,
|
|
68
|
+
isResponsivePadding: PropTypes.bool,
|
|
69
|
+
alignBox: PropTypes.oneOf(['column', 'row'])
|
|
70
|
+
};
|
|
71
|
+
ResponsiveDropBox.defaultProps = {
|
|
72
|
+
isResponsivePadding: false,
|
|
73
|
+
alignBox: 'column'
|
|
74
|
+
};
|
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
|
}
|