@zohodesk/components 1.0.0-temp-199.16 → 1.0.0-temp-220.5
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/propValidation_report.html +1 -1
- package/es/ListItem/ListContainer.js +2 -3
- package/es/ListItem/ListItem.js +2 -2
- package/es/ListItem/ListItem.module.css +2 -39
- package/es/ListItem/ListItemWithAvatar.js +4 -6
- package/es/ListItem/ListItemWithCheckBox.js +3 -6
- package/es/ListItem/ListItemWithIcon.js +4 -8
- package/es/ListItem/ListItemWithRadio.js +3 -6
- package/es/ListItem/props/defaultProps.js +5 -13
- package/es/ListItem/props/propTypes.js +1 -9
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +2 -7
- package/es/MultiSelect/MultiSelect.js +2 -7
- package/es/MultiSelect/Suggestions.js +2 -9
- package/es/MultiSelect/props/defaultProps.js +1 -4
- package/es/MultiSelect/props/propTypes.js +3 -11
- package/es/Popup/Popup.js +56 -22
- package/es/Select/GroupSelect.js +1 -5
- package/es/Select/SelectWithAvatar.js +2 -7
- package/es/Select/SelectWithIcon.js +4 -13
- package/es/Select/props/defaultProps.js +2 -4
- package/es/Select/props/propTypes.js +3 -11
- package/es/common/common.module.css +0 -11
- package/lib/ListItem/ListContainer.js +2 -3
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItem.module.css +2 -39
- package/lib/ListItem/ListItemWithAvatar.js +4 -6
- package/lib/ListItem/ListItemWithCheckBox.js +3 -6
- package/lib/ListItem/ListItemWithIcon.js +4 -8
- package/lib/ListItem/ListItemWithRadio.js +3 -6
- package/lib/ListItem/props/defaultProps.js +5 -13
- package/lib/ListItem/props/propTypes.js +2 -9
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +3 -8
- package/lib/MultiSelect/MultiSelect.js +3 -6
- package/lib/MultiSelect/Suggestions.js +3 -9
- package/lib/MultiSelect/props/defaultProps.js +1 -4
- package/lib/MultiSelect/props/propTypes.js +3 -10
- package/lib/Popup/Popup.js +96 -60
- package/lib/Select/GroupSelect.js +2 -4
- package/lib/Select/SelectWithAvatar.js +3 -8
- package/lib/Select/SelectWithIcon.js +5 -13
- package/lib/Select/props/defaultProps.js +2 -3
- package/lib/Select/props/propTypes.js +3 -11
- package/lib/common/common.module.css +0 -11
- package/package.json +1 -1
- package/result.json +1 -1
|
@@ -31,8 +31,7 @@ const ListContainer = props => {
|
|
|
31
31
|
onClick,
|
|
32
32
|
onMouseEnter,
|
|
33
33
|
onMouseOver,
|
|
34
|
-
eleRef
|
|
35
|
-
align
|
|
34
|
+
eleRef
|
|
36
35
|
} = props;
|
|
37
36
|
const responsiveFunc = useCallback(_ref => {
|
|
38
37
|
let {
|
|
@@ -78,7 +77,7 @@ const ListContainer = props => {
|
|
|
78
77
|
"aria-selected": ariaSelected,
|
|
79
78
|
"aria-label": ariaLabel,
|
|
80
79
|
isCover: false,
|
|
81
|
-
align:
|
|
80
|
+
align: "vertical",
|
|
82
81
|
alignBox: "row",
|
|
83
82
|
className: `${style.list} ${style[size]} ${mobileToTab && isTouchDevice ? style.responsiveHeight : ''} ${style[palette]} ${active ? style[`active${palette}`] : highlight && !isDisabled ? style[`${palette}Hover`] : ''} ${autoHover && !isDisabled ? style[`${palette}Effect`] : ''} ${needTick ? style[`${size}withTick`] : ''} ${isDisabled ? CssProvider('isDisable') : ''} ${needBorder ? active ? style.activewithBorder : style.withBorder : ''} ${customClass}`,
|
|
84
83
|
dataId: dataId,
|
package/es/ListItem/ListItem.js
CHANGED
|
@@ -100,7 +100,7 @@ export default class ListItem extends React.Component {
|
|
|
100
100
|
autoHover: autoHover,
|
|
101
101
|
needTick: needTick,
|
|
102
102
|
needBorder: needBorder,
|
|
103
|
-
customClass:
|
|
103
|
+
customClass: customListItem,
|
|
104
104
|
dataId: dataIdString,
|
|
105
105
|
dataSelectorId: `${dataSelectorId}`,
|
|
106
106
|
isLink: isLink,
|
|
@@ -122,7 +122,7 @@ export default class ListItem extends React.Component {
|
|
|
122
122
|
adjust: true,
|
|
123
123
|
className: style.children
|
|
124
124
|
}, children) : null, needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
125
|
-
className: `${style.tickIcon} ${tickIconPalette} ${
|
|
125
|
+
className: `${style.tickIcon} ${tickIconPalette} ${customTickIcon}`,
|
|
126
126
|
"aria-hidden": ariaHidden,
|
|
127
127
|
dataId: `${dataIdString}_tickIcon`,
|
|
128
128
|
dataSelectorId: `${dataSelectorId}_tickIcon`
|
|
@@ -73,7 +73,8 @@
|
|
|
73
73
|
line-height: 1.5385;
|
|
74
74
|
}
|
|
75
75
|
.multiLineValue{
|
|
76
|
-
|
|
76
|
+
word-break: break-word;
|
|
77
|
+
composes: clamp from '../common/common.module.css'
|
|
77
78
|
}
|
|
78
79
|
.iconBox {
|
|
79
80
|
width: var(--zd_size20) ;
|
|
@@ -93,36 +94,6 @@
|
|
|
93
94
|
margin: var(--listitem_avatar_margin);
|
|
94
95
|
}
|
|
95
96
|
|
|
96
|
-
.lhsAvatarBox,
|
|
97
|
-
.lhsJustifyContent_start,
|
|
98
|
-
.lhsJustifyContent_center,
|
|
99
|
-
.lhsJustifyContent_end {
|
|
100
|
-
composes: dflex alignVertical from '../common/common.module.css';
|
|
101
|
-
}
|
|
102
|
-
.lhsJustifyContent_start {
|
|
103
|
-
composes: justifyFStart from '../common/common.module.css';
|
|
104
|
-
}
|
|
105
|
-
.lhsJustifyContent_center {
|
|
106
|
-
composes: alignHorizontal from '../common/common.module.css';
|
|
107
|
-
}
|
|
108
|
-
.lhsJustifyContent_end {
|
|
109
|
-
composes: justifyFend from '../common/common.module.css';
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.lhsBox_small,
|
|
113
|
-
.lhsBox_medium,
|
|
114
|
-
.lhsBox_large{
|
|
115
|
-
height: 1em ;
|
|
116
|
-
}
|
|
117
|
-
.lhsBox_small {
|
|
118
|
-
font-size: var(--zd_font_size20) ;
|
|
119
|
-
}
|
|
120
|
-
.lhsBox_medium {
|
|
121
|
-
font-size: var(--zd_font_size21) ;
|
|
122
|
-
}
|
|
123
|
-
.lhsBox_large {
|
|
124
|
-
font-size: var(--zd_font_size28) ;
|
|
125
|
-
}
|
|
126
97
|
.defaultHover, .primaryHover, .secondaryHover, .darkHover {
|
|
127
98
|
background-color: var(--listitem_highlight_bg_color);
|
|
128
99
|
}
|
|
@@ -226,17 +197,9 @@
|
|
|
226
197
|
[dir=rtl] .largewithTick {
|
|
227
198
|
--listitem_padding: var(--zd_size10) var(--zd_size25) var(--zd_size10) var(--zd_size39);
|
|
228
199
|
}
|
|
229
|
-
.largeSizeContainer{
|
|
230
|
-
--listitem_height: auto;
|
|
231
|
-
--listitem_min_height: var(--zd_size48);
|
|
232
|
-
}
|
|
233
200
|
.responsiveHeight {
|
|
234
201
|
--listitem_min_height: var(--zd_size45);
|
|
235
202
|
font-size: var(--zd_font_size15) ;
|
|
236
203
|
padding-top: var(--zd_size10) ;
|
|
237
204
|
padding-bottom: var(--zd_size10) ;
|
|
238
205
|
}
|
|
239
|
-
.tickIconCenter {
|
|
240
|
-
top: 50% ;
|
|
241
|
-
transform: translateY(-50%);
|
|
242
|
-
}
|
|
@@ -74,8 +74,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
74
74
|
a11y,
|
|
75
75
|
customClass,
|
|
76
76
|
customProps,
|
|
77
|
-
needMultiLineText
|
|
78
|
-
lhsAlignContent
|
|
77
|
+
needMultiLineText
|
|
79
78
|
} = this.props;
|
|
80
79
|
let {
|
|
81
80
|
ListItemProps = {},
|
|
@@ -108,7 +107,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
108
107
|
autoHover: autoHover,
|
|
109
108
|
needTick: needTick,
|
|
110
109
|
needBorder: needBorder,
|
|
111
|
-
customClass:
|
|
110
|
+
customClass: customListItem,
|
|
112
111
|
dataId: `${dataIdString}_ListItemWithAvatar`,
|
|
113
112
|
dataSelectorId: `${dataSelectorId}`,
|
|
114
113
|
onClick: this.handleClick,
|
|
@@ -119,8 +118,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
119
118
|
customProps: ListItemProps,
|
|
120
119
|
...ContainerProps
|
|
121
120
|
}, name || imgSrc ? /*#__PURE__*/React.createElement(Box, {
|
|
122
|
-
|
|
123
|
-
className: `${style.leftAvatar} ${lhsAlignContent !== 'center' ? `${style.lhsAvatarBox} ${style[`lhsBox_${size}`]}` : ''}`
|
|
121
|
+
className: style.leftAvatar
|
|
124
122
|
}, isTeam ? /*#__PURE__*/React.createElement(AvatarTeam, {
|
|
125
123
|
name: name,
|
|
126
124
|
size: "small",
|
|
@@ -149,7 +147,7 @@ export default class ListItemWithAvatar extends React.PureComponent {
|
|
|
149
147
|
"data-title": isDisabled ? null : title,
|
|
150
148
|
className: needMultiLineText ? style.multiLineValue : style.value
|
|
151
149
|
}, value) : null, needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
152
|
-
className:
|
|
150
|
+
className: style.tickIcon,
|
|
153
151
|
"aria-hidden": ariaHidden,
|
|
154
152
|
dataId: `${dataIdString}_tickIcon`,
|
|
155
153
|
dataSelectorId: `${dataSelectorId}_tickIcon`
|
|
@@ -59,9 +59,7 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
59
59
|
a11y,
|
|
60
60
|
customClass,
|
|
61
61
|
customProps,
|
|
62
|
-
needMultiLineText
|
|
63
|
-
lhsAlignContent,
|
|
64
|
-
lhsJustifyContent
|
|
62
|
+
needMultiLineText
|
|
65
63
|
} = this.props;
|
|
66
64
|
const listA11y = {
|
|
67
65
|
role: 'option',
|
|
@@ -84,7 +82,7 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
84
82
|
isDisabled: isDisabled,
|
|
85
83
|
active: active,
|
|
86
84
|
autoHover: autoHover,
|
|
87
|
-
customClass:
|
|
85
|
+
customClass: customListItem,
|
|
88
86
|
dataId: `${dataId ? dataId : value}_ListItemWithCheckBox`,
|
|
89
87
|
dataSelectorId: dataSelectorId,
|
|
90
88
|
onClick: this.onClick,
|
|
@@ -95,8 +93,7 @@ export default class ListItemWithCheckBox extends React.Component {
|
|
|
95
93
|
customProps: ListItemProps,
|
|
96
94
|
...ContainerProps
|
|
97
95
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
98
|
-
|
|
99
|
-
className: `${style.iconBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]} ${lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''}`,
|
|
96
|
+
className: style.iconBox,
|
|
100
97
|
dataId: `${dataId ? dataId : value}_checkBox`
|
|
101
98
|
}, /*#__PURE__*/React.createElement(CheckBox, {
|
|
102
99
|
checked: checked,
|
|
@@ -70,9 +70,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
70
70
|
a11y,
|
|
71
71
|
customClass,
|
|
72
72
|
customProps,
|
|
73
|
-
needMultiLineText
|
|
74
|
-
lhsAlignContent,
|
|
75
|
-
lhsJustifyContent
|
|
73
|
+
needMultiLineText
|
|
76
74
|
} = this.props;
|
|
77
75
|
let {
|
|
78
76
|
ListItemProps = {},
|
|
@@ -97,8 +95,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
97
95
|
autoHover: autoHover,
|
|
98
96
|
needTick: needTick,
|
|
99
97
|
needBorder: needBorder,
|
|
100
|
-
customClass:
|
|
101
|
-
align: needMultiLineText && iconClass && !iconName ? 'baseline' : 'vertical',
|
|
98
|
+
customClass: customClass,
|
|
102
99
|
dataId: dataIdString,
|
|
103
100
|
dataSelectorId: dataSelectorId,
|
|
104
101
|
isLink: isLink,
|
|
@@ -113,8 +110,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
113
110
|
...ContainerProps
|
|
114
111
|
}, iconName && /*#__PURE__*/React.createElement(Box, {
|
|
115
112
|
"aria-hidden": true,
|
|
116
|
-
|
|
117
|
-
className: `${style.iconBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]} ${lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''}`,
|
|
113
|
+
className: style.iconBox,
|
|
118
114
|
dataId: dataId ? `${dataId}_Icon` : `${value.toLowerCase().replace("'", '_')}_Icon`
|
|
119
115
|
}, /*#__PURE__*/React.createElement(Icon, {
|
|
120
116
|
iconClass: iconClass,
|
|
@@ -129,7 +125,7 @@ export default class ListItemWithIcon extends React.Component {
|
|
|
129
125
|
"data-title": isDisabled ? null : title,
|
|
130
126
|
dataId: `${dataIdString}_Text`
|
|
131
127
|
}, value), needTick && active ? /*#__PURE__*/React.createElement(Box, {
|
|
132
|
-
className:
|
|
128
|
+
className: style.tickIcon,
|
|
133
129
|
"aria-hidden": ariaHidden,
|
|
134
130
|
dataId: `${dataIdString}_tickIcon`,
|
|
135
131
|
dataSelectorId: `${dataSelectorId}_tickIcon`
|
|
@@ -60,9 +60,7 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
60
60
|
a11y,
|
|
61
61
|
customClass,
|
|
62
62
|
customProps,
|
|
63
|
-
needMultiLineText
|
|
64
|
-
lhsAlignContent,
|
|
65
|
-
lhsJustifyContent
|
|
63
|
+
needMultiLineText
|
|
66
64
|
} = this.props;
|
|
67
65
|
let {
|
|
68
66
|
ListItemProps = {},
|
|
@@ -85,7 +83,7 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
85
83
|
isDisabled: isDisabled,
|
|
86
84
|
active: active,
|
|
87
85
|
autoHover: autoHover,
|
|
88
|
-
customClass:
|
|
86
|
+
customClass: customListItem,
|
|
89
87
|
dataId: dataId,
|
|
90
88
|
dataSelectorId: dataSelectorId,
|
|
91
89
|
onClick: this.onClick,
|
|
@@ -96,8 +94,7 @@ export default class ListItemWithRadio extends React.Component {
|
|
|
96
94
|
customProps: ListItemProps,
|
|
97
95
|
...ContainerProps
|
|
98
96
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
99
|
-
|
|
100
|
-
className: `${style.iconBox} ${style[`lhsJustifyContent_${lhsJustifyContent}`]} ${lhsAlignContent !== 'center' ? style[`lhsBox_${size}`] : ''}`,
|
|
97
|
+
className: style.iconBox,
|
|
101
98
|
dataId: `${dataId}_radio`
|
|
102
99
|
}, /*#__PURE__*/React.createElement(Radio, {
|
|
103
100
|
checked: checked,
|
|
@@ -12,8 +12,7 @@ export const ListContainerDefaultProps = {
|
|
|
12
12
|
customClass: '',
|
|
13
13
|
customProps: {},
|
|
14
14
|
dataSelectorId: 'listContainer',
|
|
15
|
-
needMultiLineText: false
|
|
16
|
-
align: 'vertical'
|
|
15
|
+
needMultiLineText: false
|
|
17
16
|
};
|
|
18
17
|
export const ListItemDefaultProps = {
|
|
19
18
|
active: false,
|
|
@@ -48,8 +47,7 @@ export const ListItemWithAvatarDefaultProps = {
|
|
|
48
47
|
customClass: {},
|
|
49
48
|
customProps: {},
|
|
50
49
|
dataSelectorId: 'listItemWithAvatar',
|
|
51
|
-
needMultiLineText: false
|
|
52
|
-
lhsAlignContent: 'start'
|
|
50
|
+
needMultiLineText: false
|
|
53
51
|
};
|
|
54
52
|
export const ListItemWithCheckBoxDefaultProps = {
|
|
55
53
|
active: false,
|
|
@@ -63,9 +61,7 @@ export const ListItemWithCheckBoxDefaultProps = {
|
|
|
63
61
|
customClass: {},
|
|
64
62
|
customProps: {},
|
|
65
63
|
dataSelectorId: 'listItemWithCheckBox',
|
|
66
|
-
needMultiLineText: false
|
|
67
|
-
lhsAlignContent: 'start',
|
|
68
|
-
lhsJustifyContent: 'center'
|
|
64
|
+
needMultiLineText: false
|
|
69
65
|
};
|
|
70
66
|
export const ListItemWithIconDefaultProps = {
|
|
71
67
|
active: false,
|
|
@@ -82,9 +78,7 @@ export const ListItemWithIconDefaultProps = {
|
|
|
82
78
|
customClass: '',
|
|
83
79
|
customProps: {},
|
|
84
80
|
dataSelectorId: 'listItemWithIcon',
|
|
85
|
-
needMultiLineText: false
|
|
86
|
-
lhsAlignContent: 'start',
|
|
87
|
-
lhsJustifyContent: 'center'
|
|
81
|
+
needMultiLineText: false
|
|
88
82
|
};
|
|
89
83
|
export const ListItemWithRadioDefaultProps = {
|
|
90
84
|
active: false,
|
|
@@ -99,7 +93,5 @@ export const ListItemWithRadioDefaultProps = {
|
|
|
99
93
|
customClass: {},
|
|
100
94
|
customProps: {},
|
|
101
95
|
dataSelectorId: 'listItemWithRadio',
|
|
102
|
-
needMultiLineText: false
|
|
103
|
-
lhsAlignContent: 'start',
|
|
104
|
-
lhsJustifyContent: 'center'
|
|
96
|
+
needMultiLineText: false
|
|
105
97
|
};
|
|
@@ -27,8 +27,7 @@ export const ListContainer_Props = {
|
|
|
27
27
|
}),
|
|
28
28
|
customClass: PropTypes.string,
|
|
29
29
|
customProps: PropTypes.object,
|
|
30
|
-
eleRef: PropTypes.func
|
|
31
|
-
align: PropTypes.string
|
|
30
|
+
eleRef: PropTypes.func
|
|
32
31
|
};
|
|
33
32
|
export const ListItem_Props = {
|
|
34
33
|
active: PropTypes.bool,
|
|
@@ -103,7 +102,6 @@ export const ListItemWithAvatar_Props = {
|
|
|
103
102
|
customAvatarTeam: PropTypes.string
|
|
104
103
|
}),
|
|
105
104
|
needMultiLineText: PropTypes.bool,
|
|
106
|
-
lhsAlignContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
107
105
|
customProps: PropTypes.shape({
|
|
108
106
|
ListItemProps: PropTypes.object,
|
|
109
107
|
ContainerProps: PropTypes.object,
|
|
@@ -134,8 +132,6 @@ export const ListItemWithCheckBox_Props = {
|
|
|
134
132
|
ariaSelected: PropTypes.bool
|
|
135
133
|
}),
|
|
136
134
|
needMultiLineText: PropTypes.bool,
|
|
137
|
-
lhsAlignContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
138
|
-
lhsJustifyContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
139
135
|
customClass: PropTypes.shape({
|
|
140
136
|
customListItem: PropTypes.string,
|
|
141
137
|
customCheckBox: PropTypes.string,
|
|
@@ -171,8 +167,6 @@ export const ListItemWithIcon_Props = {
|
|
|
171
167
|
ariaHidden: PropTypes.bool
|
|
172
168
|
}),
|
|
173
169
|
needMultiLineText: PropTypes.bool,
|
|
174
|
-
lhsAlignContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
175
|
-
lhsJustifyContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
176
170
|
customClass: PropTypes.string,
|
|
177
171
|
customProps: PropTypes.shape({
|
|
178
172
|
ListItemProps: PropTypes.object
|
|
@@ -204,8 +198,6 @@ export const ListItemWithRadio_Props = {
|
|
|
204
198
|
ariaSelected: PropTypes.bool
|
|
205
199
|
}),
|
|
206
200
|
needMultiLineText: PropTypes.bool,
|
|
207
|
-
lhsAlignContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
208
|
-
lhsJustifyContent: PropTypes.oneOf(['start', 'center', 'end']),
|
|
209
201
|
customClass: PropTypes.shape({
|
|
210
202
|
customListItem: PropTypes.string,
|
|
211
203
|
customRadio: PropTypes.string,
|
|
@@ -884,12 +884,8 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
884
884
|
needEffect,
|
|
885
885
|
autoComplete,
|
|
886
886
|
getTargetRef,
|
|
887
|
-
isFocus
|
|
888
|
-
customProps
|
|
887
|
+
isFocus
|
|
889
888
|
} = this.props;
|
|
890
|
-
const {
|
|
891
|
-
SuggestionsProps = {}
|
|
892
|
-
} = customProps;
|
|
893
889
|
let {
|
|
894
890
|
clearText = 'Clear all'
|
|
895
891
|
} = i18nKeys;
|
|
@@ -1069,8 +1065,7 @@ class AdvancedGroupMultiSelect extends React.Component {
|
|
|
1069
1065
|
a11y: {
|
|
1070
1066
|
role: 'option'
|
|
1071
1067
|
},
|
|
1072
|
-
dataId: `${dataId}_Options
|
|
1073
|
-
...SuggestionsProps
|
|
1068
|
+
dataId: `${dataId}_Options`
|
|
1074
1069
|
}));
|
|
1075
1070
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
1076
1071
|
options: revampedGroups,
|
|
@@ -1017,12 +1017,8 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1017
1017
|
boxSize,
|
|
1018
1018
|
isLoading,
|
|
1019
1019
|
selectAllText,
|
|
1020
|
-
needSelectAll
|
|
1021
|
-
customProps
|
|
1020
|
+
needSelectAll
|
|
1022
1021
|
} = this.props;
|
|
1023
|
-
const {
|
|
1024
|
-
SuggestionsProps = {}
|
|
1025
|
-
} = customProps;
|
|
1026
1022
|
const {
|
|
1027
1023
|
selectedOptions,
|
|
1028
1024
|
searchStr,
|
|
@@ -1112,8 +1108,7 @@ export class MultiSelectComponent extends React.Component {
|
|
|
1112
1108
|
selectedOptions: selectedOptionIds,
|
|
1113
1109
|
a11y: {
|
|
1114
1110
|
role: 'option'
|
|
1115
|
-
}
|
|
1116
|
-
...SuggestionsProps
|
|
1111
|
+
}
|
|
1117
1112
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
1118
1113
|
isLoading: isFetchingOptions,
|
|
1119
1114
|
options: options,
|
|
@@ -27,24 +27,18 @@ export default class Suggestions extends React.PureComponent {
|
|
|
27
27
|
avatarPalette,
|
|
28
28
|
palette,
|
|
29
29
|
htmlId,
|
|
30
|
-
a11y
|
|
31
|
-
customClass,
|
|
32
|
-
needMultiLineText
|
|
30
|
+
a11y
|
|
33
31
|
} = this.props;
|
|
34
32
|
const {
|
|
35
33
|
ariaParentRole,
|
|
36
34
|
ariaMultiselectable
|
|
37
35
|
} = a11y;
|
|
38
|
-
const {
|
|
39
|
-
containerClass = ''
|
|
40
|
-
} = customClass;
|
|
41
36
|
return /*#__PURE__*/React.createElement(Container, {
|
|
42
37
|
isCover: false,
|
|
43
38
|
role: ariaParentRole,
|
|
44
39
|
id: htmlId,
|
|
45
40
|
tabindex: "0",
|
|
46
|
-
"aria-multiselectable": ariaMultiselectable
|
|
47
|
-
className: containerClass
|
|
41
|
+
"aria-multiselectable": ariaMultiselectable
|
|
48
42
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
49
43
|
dataId: `${dataId}`,
|
|
50
44
|
className: className ? className : ''
|
|
@@ -69,7 +63,6 @@ export default class Suggestions extends React.PureComponent {
|
|
|
69
63
|
});
|
|
70
64
|
const commonProps = {
|
|
71
65
|
isDisabled,
|
|
72
|
-
needMultiLineText,
|
|
73
66
|
...listItemCustomProps
|
|
74
67
|
};
|
|
75
68
|
|
|
@@ -38,7 +38,6 @@ export const AdvancedGroupMultiSelect_defaultProps = {
|
|
|
38
38
|
palette: 'default',
|
|
39
39
|
isLoading: false,
|
|
40
40
|
dataSelectorId: 'advancedGroupMultiSelect',
|
|
41
|
-
customProps: {},
|
|
42
41
|
allowValueFallback: true
|
|
43
42
|
};
|
|
44
43
|
export const AdvancedMultiSelect_defaultProps = {
|
|
@@ -167,7 +166,5 @@ export const SelectedOptions_defaultProps = {
|
|
|
167
166
|
dataId: 'selectedOptions'
|
|
168
167
|
};
|
|
169
168
|
export const Suggestions_defaultProps = {
|
|
170
|
-
a11y: {}
|
|
171
|
-
customClass: {},
|
|
172
|
-
needMultiLineText: false
|
|
169
|
+
a11y: {}
|
|
173
170
|
};
|
|
@@ -110,8 +110,7 @@ export const MultiSelect_propTypes = {
|
|
|
110
110
|
setAriaId: PropTypes.string,
|
|
111
111
|
ariaErrorId: PropTypes.string,
|
|
112
112
|
customProps: PropTypes.shape({
|
|
113
|
-
TextBoxIconProps: PropTypes.object
|
|
114
|
-
SuggestionsProps: PropTypes.object
|
|
113
|
+
TextBoxIconProps: PropTypes.object
|
|
115
114
|
}),
|
|
116
115
|
isFocus: PropTypes.bool,
|
|
117
116
|
allowValueFallback: PropTypes.bool
|
|
@@ -179,11 +178,7 @@ export const Suggestions_propTypes = {
|
|
|
179
178
|
logo: PropTypes.string,
|
|
180
179
|
optionType: PropTypes.string,
|
|
181
180
|
listItemProps: PropTypes.object
|
|
182
|
-
}))
|
|
183
|
-
customClass: PropTypes.shape({
|
|
184
|
-
containerClass: PropTypes.string
|
|
185
|
-
}),
|
|
186
|
-
needMultiLineText: PropTypes.bool
|
|
181
|
+
}))
|
|
187
182
|
};
|
|
188
183
|
export const AdvancedGroupMultiSelect_propTypes = {
|
|
189
184
|
animationStyle: PropTypes.string,
|
|
@@ -255,10 +250,7 @@ export const AdvancedGroupMultiSelect_propTypes = {
|
|
|
255
250
|
children: PropTypes.node,
|
|
256
251
|
dataSelectorId: PropTypes.string,
|
|
257
252
|
isFocus: PropTypes.bool,
|
|
258
|
-
allowValueFallback: PropTypes.bool
|
|
259
|
-
customProps: PropTypes.shape({
|
|
260
|
-
SuggestionsProps: PropTypes.object
|
|
261
|
-
})
|
|
253
|
+
allowValueFallback: PropTypes.bool
|
|
262
254
|
};
|
|
263
255
|
export const AdvancedMultiSelect_propTypes = { ...MultiSelect_propTypes,
|
|
264
256
|
selectedOptionDetails: PropTypes.string,
|
package/es/Popup/Popup.js
CHANGED
|
@@ -74,8 +74,9 @@ const Popup = function (Component) {
|
|
|
74
74
|
isMobile: false
|
|
75
75
|
};
|
|
76
76
|
this.togglePopup = this.togglePopup.bind(this);
|
|
77
|
+
this.closePopups = this.closePopups.bind(this);
|
|
78
|
+
this.handleDocumentInteraction = this.handleDocumentInteraction.bind(this);
|
|
77
79
|
this.documentClickHandler = this.documentClickHandler.bind(this);
|
|
78
|
-
this.documentClickHandler1 = this.documentClickHandler1.bind(this);
|
|
79
80
|
this.removeClose = this.removeClose.bind(this);
|
|
80
81
|
this.documentKeyupHandler = this.documentKeyupHandler.bind(this);
|
|
81
82
|
this.openPopupOnly = this.openPopupOnly.bind(this);
|
|
@@ -133,11 +134,11 @@ const Popup = function (Component) {
|
|
|
133
134
|
popups[group] = groupPopups;
|
|
134
135
|
|
|
135
136
|
if (Object.keys(popups).length === 1 && groupPopups.length === 1) {
|
|
137
|
+
document.addEventListener('click', this.handleDocumentInteraction, true);
|
|
136
138
|
document.addEventListener('click', this.documentClickHandler, false);
|
|
137
139
|
document.addEventListener('keyup', this.documentKeyupHandler, false); // document.addEventListener('scroll', this.handleScroll, true);
|
|
138
140
|
|
|
139
141
|
window.addEventListener('resize', this.handleResize);
|
|
140
|
-
document.addEventListener('click', this.documentClickHandler1, true);
|
|
141
142
|
document.addEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
142
143
|
document.addEventListener('focus', this.handleDocumentFocus, true);
|
|
143
144
|
}
|
|
@@ -224,11 +225,11 @@ const Popup = function (Component) {
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
if (noPopups) {
|
|
227
|
-
document.removeEventListener('click', this.
|
|
228
|
+
document.removeEventListener('click', this.handleDocumentInteraction, true);
|
|
229
|
+
document.removeEventListener('click', this.documentClickHandler, false);
|
|
228
230
|
document.removeEventListener('keyup', this.documentKeyupHandler); // document.removeEventListener('scroll', this.handleScroll);
|
|
229
231
|
|
|
230
232
|
window.removeEventListener('resize', this.handleResize);
|
|
231
|
-
document.removeEventListener('click', this.documentClickHandler1, true);
|
|
232
233
|
document.removeEventListener('mousedown', this.handleDocumentMouseDown, true);
|
|
233
234
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
234
235
|
}
|
|
@@ -617,29 +618,62 @@ const Popup = function (Component) {
|
|
|
617
618
|
return needPrevent;
|
|
618
619
|
}
|
|
619
620
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
if (needPrevent) {
|
|
624
|
-
this.removeClose(e);
|
|
625
|
-
this.handleCloseLastOpenedGroup();
|
|
626
|
-
}
|
|
627
|
-
}
|
|
621
|
+
closePopups(e) {
|
|
622
|
+
let checkTarget = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
628
623
|
|
|
629
|
-
documentClickHandler() {
|
|
630
624
|
try {
|
|
631
625
|
Object.keys(popups).forEach(groupName => {
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
}
|
|
626
|
+
const openGroupPopups = (popups[groupName] || []).filter(popup => popup.state.isPopupOpen);
|
|
627
|
+
openGroupPopups.forEach(popup => {
|
|
628
|
+
const {
|
|
629
|
+
dropElement,
|
|
630
|
+
placeHolderElement
|
|
631
|
+
} = popup;
|
|
632
|
+
const {
|
|
633
|
+
target
|
|
634
|
+
} = e || {};
|
|
635
|
+
const canClosePopup = !popup.props.checkBeforeClose || popup.props.checkBeforeClose && popup.props.checkBeforeClose() && !isTextSelected();
|
|
636
|
+
const isOutsideClick = checkTarget && placeHolderElement && dropElement && placeHolderElement !== target && !placeHolderElement.contains(target) && dropElement !== target && !dropElement.contains(target);
|
|
637
|
+
|
|
638
|
+
if (canClosePopup && (!checkTarget || isOutsideClick)) {
|
|
639
|
+
popup.setState({
|
|
640
|
+
isPopupOpen: false,
|
|
641
|
+
isPopupReady: false
|
|
642
|
+
});
|
|
643
|
+
}
|
|
638
644
|
});
|
|
639
645
|
});
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
646
|
+
|
|
647
|
+
if (!checkTarget) {
|
|
648
|
+
lastOpenedGroup = [];
|
|
649
|
+
}
|
|
650
|
+
} catch (error) {// eslint-disable-next-line no-console
|
|
651
|
+
//console.error('popup component not unmounted properly', error);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
documentClickHandler(e) {
|
|
656
|
+
// Handles document click events to close all popups.
|
|
657
|
+
// This function closes all popups without checking if the click occurred outside the popup.
|
|
658
|
+
this.closePopups(e, false);
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
handleDocumentInteraction(e) {
|
|
662
|
+
// Handles interactions with the document to determine whether to close the popup.
|
|
663
|
+
// This function is specifically designed to close the popup when clicking outside of it.
|
|
664
|
+
// Check if the click event should prevent popup closure.
|
|
665
|
+
const needPrevent = this.handleGetNeedPrevent(e);
|
|
666
|
+
|
|
667
|
+
if (needPrevent) {
|
|
668
|
+
// If the click event should prevent popup closure:
|
|
669
|
+
// - Stop the event propagation.
|
|
670
|
+
// - Close the last opened group of popups.
|
|
671
|
+
this.removeClose(e);
|
|
672
|
+
this.handleCloseLastOpenedGroup();
|
|
673
|
+
} else {
|
|
674
|
+
// If the click event does not need to prevent popup closure:
|
|
675
|
+
// - Close all popups, but only if the click occurred outside the popup elements.
|
|
676
|
+
this.closePopups(e, true);
|
|
643
677
|
}
|
|
644
678
|
}
|
|
645
679
|
|
package/es/Select/GroupSelect.js
CHANGED
|
@@ -593,9 +593,6 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
593
593
|
dataSelectorId,
|
|
594
594
|
customProps
|
|
595
595
|
} = this.props;
|
|
596
|
-
const {
|
|
597
|
-
SuggestionsProps = {}
|
|
598
|
-
} = customProps;
|
|
599
596
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
600
597
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
601
598
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -794,8 +791,7 @@ export class GroupSelectComponent extends PureComponent {
|
|
|
794
791
|
ariaParentRole: 'listbox',
|
|
795
792
|
role: 'option'
|
|
796
793
|
},
|
|
797
|
-
dataId: `${dataId}_Options
|
|
798
|
-
...SuggestionsProps
|
|
794
|
+
dataId: `${dataId}_Options`
|
|
799
795
|
}));
|
|
800
796
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
801
797
|
options: revampedGroups,
|
|
@@ -165,12 +165,8 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
165
165
|
needEffect,
|
|
166
166
|
isLoading,
|
|
167
167
|
dataSelectorId,
|
|
168
|
-
getTargetRef
|
|
169
|
-
customProps
|
|
168
|
+
getTargetRef
|
|
170
169
|
} = this.props;
|
|
171
|
-
const {
|
|
172
|
-
SuggestionsProps = {}
|
|
173
|
-
} = customProps;
|
|
174
170
|
i18nKeys = Object.assign({}, i18nKeys, {
|
|
175
171
|
emptyText: i18nKeys.emptyText || emptyMessage,
|
|
176
172
|
searchEmptyText: i18nKeys.searchEmptyText || searchEmptyMessage
|
|
@@ -327,8 +323,7 @@ class SelectWithAvatarComponent extends SelectComponent {
|
|
|
327
323
|
a11y: {
|
|
328
324
|
ariaParentRole: 'listbox',
|
|
329
325
|
role: 'option'
|
|
330
|
-
}
|
|
331
|
-
...SuggestionsProps
|
|
326
|
+
}
|
|
332
327
|
}) : /*#__PURE__*/React.createElement(EmptyState, {
|
|
333
328
|
isLoading: isFetchingOptions,
|
|
334
329
|
options: options,
|