@zohodesk/components 1.0.0-temp-199.16 → 1.0.0-temp-220.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +104 -30
- 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 +168 -83
- 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 +3 -3
- 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
|
@@ -38,6 +38,52 @@ const defaultState = {
|
|
|
38
38
|
//{height: ‘’, width: ‘’,}
|
|
39
39
|
isAbsolutePositioningNeeded: true
|
|
40
40
|
};
|
|
41
|
+
const SCROLL_BLOCK_EVENTS = Object.freeze([{
|
|
42
|
+
name: 'wheel',
|
|
43
|
+
handlerName: 'handleBlockScroll',
|
|
44
|
+
options: {
|
|
45
|
+
capture: true,
|
|
46
|
+
passive: false
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
name: 'touchmove',
|
|
50
|
+
handlerName: 'handleBlockScroll',
|
|
51
|
+
options: {
|
|
52
|
+
capture: true,
|
|
53
|
+
passive: false
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
name: 'scroll',
|
|
57
|
+
handlerName: 'handlePositionChange',
|
|
58
|
+
options: {
|
|
59
|
+
capture: true,
|
|
60
|
+
passive: false
|
|
61
|
+
}
|
|
62
|
+
}, {
|
|
63
|
+
name: 'keydown',
|
|
64
|
+
handlerName: 'preventKeyboardScroll',
|
|
65
|
+
options: {
|
|
66
|
+
capture: true,
|
|
67
|
+
passive: false
|
|
68
|
+
}
|
|
69
|
+
}]);
|
|
70
|
+
const IFRAME_SCROLL_BLOCK_EVENTS = Object.freeze(SCROLL_BLOCK_EVENTS.filter(event => event.name !== 'keydown'));
|
|
71
|
+
const CLICK_EVENTS = Object.freeze([{
|
|
72
|
+
name: 'click',
|
|
73
|
+
handlerName: 'documentClickHandler',
|
|
74
|
+
options: {
|
|
75
|
+
capture: false,
|
|
76
|
+
passive: false
|
|
77
|
+
}
|
|
78
|
+
}, {
|
|
79
|
+
name: 'click',
|
|
80
|
+
handlerName: 'documentClickHandler1',
|
|
81
|
+
options: {
|
|
82
|
+
capture: true,
|
|
83
|
+
passive: false
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
const iframeSelector = '[data-scroll=true] iframe';
|
|
41
87
|
/* eslint-disable react/no-deprecated */
|
|
42
88
|
|
|
43
89
|
/* eslint-disable react/prop-types */
|
|
@@ -99,6 +145,7 @@ const Popup = function (Component) {
|
|
|
99
145
|
this.handleBlockScroll = this.handleBlockScroll.bind(this);
|
|
100
146
|
this.handlePositionChange = this.handlePositionChange.bind(this);
|
|
101
147
|
this.preventKeyboardScroll = this.preventKeyboardScroll.bind(this);
|
|
148
|
+
this.updateListeners = this.updateListeners.bind(this);
|
|
102
149
|
this.addScrollBlockListeners = this.addScrollBlockListeners.bind(this);
|
|
103
150
|
this.removeScrollBlockListeners = this.removeScrollBlockListeners.bind(this);
|
|
104
151
|
this.handleAddingScrollBlock = this.handleAddingScrollBlock.bind(this);
|
|
@@ -111,6 +158,7 @@ const Popup = function (Component) {
|
|
|
111
158
|
this.setContainerDynamicPositioning = this.setContainerDynamicPositioning.bind(this);
|
|
112
159
|
this.updatePopupState = this.updatePopupState.bind(this);
|
|
113
160
|
this.handleScrollAndBlockEvents = this.handleScrollAndBlockEvents.bind(this);
|
|
161
|
+
this.handleIframeClickEvents = this.handleIframeClickEvents.bind(this);
|
|
114
162
|
this.handleDropElementStyleUpdate = this.handleDropElementStyleUpdate.bind(this);
|
|
115
163
|
this.positionRef = /*#__PURE__*/React.createRef();
|
|
116
164
|
this.popupObserver = new ResizeObserver(this.handlePopupResize); //dropBoxSize
|
|
@@ -166,6 +214,21 @@ const Popup = function (Component) {
|
|
|
166
214
|
}
|
|
167
215
|
}
|
|
168
216
|
|
|
217
|
+
handleIframeClickEvents(isPopupReady, isMobile) {
|
|
218
|
+
const toggleListeners = add => {
|
|
219
|
+
this.updateListeners(add, CLICK_EVENTS, document);
|
|
220
|
+
document.querySelectorAll(iframeSelector).forEach(frame => {
|
|
221
|
+
const frameDocument = frame.contentDocument;
|
|
222
|
+
|
|
223
|
+
if (frameDocument) {
|
|
224
|
+
this.updateListeners(add, CLICK_EVENTS, frameDocument);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
toggleListeners(isPopupReady && !isMobile);
|
|
230
|
+
}
|
|
231
|
+
|
|
169
232
|
componentDidUpdate(prevProps, prevState) {
|
|
170
233
|
const {
|
|
171
234
|
isPopupReady,
|
|
@@ -193,6 +256,7 @@ const Popup = function (Component) {
|
|
|
193
256
|
|
|
194
257
|
if (oldStateOpen !== isPopupReady && !isMobile || oldIsMobileState !== isMobile) {
|
|
195
258
|
this.handleScrollAndBlockEvents(isPopupReady, isMobile);
|
|
259
|
+
this.handleIframeClickEvents(isPopupReady, isMobile);
|
|
196
260
|
}
|
|
197
261
|
}
|
|
198
262
|
|
|
@@ -346,41 +410,51 @@ const Popup = function (Component) {
|
|
|
346
410
|
}
|
|
347
411
|
}
|
|
348
412
|
|
|
413
|
+
updateListeners() {
|
|
414
|
+
let add = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
415
|
+
let eventList = arguments.length > 1 ? arguments[1] : undefined;
|
|
416
|
+
let element = arguments.length > 2 ? arguments[2] : undefined;
|
|
417
|
+
const method = add ? 'addEventListener' : 'removeEventListener';
|
|
418
|
+
|
|
419
|
+
const applyListeners = target => {
|
|
420
|
+
eventList.forEach(_ref2 => {
|
|
421
|
+
let {
|
|
422
|
+
name,
|
|
423
|
+
handlerName,
|
|
424
|
+
options
|
|
425
|
+
} = _ref2;
|
|
426
|
+
const handler = this[handlerName];
|
|
427
|
+
|
|
428
|
+
if (handler) {
|
|
429
|
+
target[method](name, handler, options);
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
};
|
|
433
|
+
|
|
434
|
+
applyListeners(element);
|
|
435
|
+
}
|
|
436
|
+
|
|
349
437
|
addScrollBlockListeners() {
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
capture: true,
|
|
360
|
-
passive: false
|
|
361
|
-
});
|
|
362
|
-
document.addEventListener('keydown', this.preventKeyboardScroll, {
|
|
363
|
-
capture: true,
|
|
364
|
-
passive: false
|
|
438
|
+
// Main document
|
|
439
|
+
this.updateListeners(true, SCROLL_BLOCK_EVENTS, document); // Attach event listeners to all iframes within elements that have the attribute data-scroll=true
|
|
440
|
+
|
|
441
|
+
document.querySelectorAll(iframeSelector).forEach(frame => {
|
|
442
|
+
const frameDocument = frame.contentDocument;
|
|
443
|
+
|
|
444
|
+
if (frameDocument) {
|
|
445
|
+
this.updateListeners(true, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
|
|
446
|
+
}
|
|
365
447
|
});
|
|
366
448
|
}
|
|
367
449
|
|
|
368
450
|
removeScrollBlockListeners() {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
});
|
|
377
|
-
document.removeEventListener('scroll', this.handlePositionChange, {
|
|
378
|
-
capture: true,
|
|
379
|
-
passive: false
|
|
380
|
-
});
|
|
381
|
-
document.removeEventListener('keydown', this.preventKeyboardScroll, {
|
|
382
|
-
capture: true,
|
|
383
|
-
passive: false
|
|
451
|
+
this.updateListeners(false, SCROLL_BLOCK_EVENTS, document);
|
|
452
|
+
document.querySelectorAll(iframeSelector).forEach(frame => {
|
|
453
|
+
const frameDocument = frame.contentDocument;
|
|
454
|
+
|
|
455
|
+
if (frameDocument) {
|
|
456
|
+
this.updateListeners(false, IFRAME_SCROLL_BLOCK_EVENTS, frameDocument);
|
|
457
|
+
}
|
|
384
458
|
});
|
|
385
459
|
}
|
|
386
460
|
|
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,
|