@zohodesk/components 1.0.0-temp-210.1 → 1.0.0-temp-199.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/README.md +4 -4
- package/es/DateTime/CalendarView.js +9 -7
- package/es/ListItem/ListItem.js +2 -2
- package/es/ListItem/ListItem.module.css +85 -18
- package/es/ListItem/ListItemWithAvatar.js +3 -3
- package/es/ListItem/ListItemWithIcon.js +2 -2
- package/es/MultiSelect/AdvancedGroupMultiSelect.js +7 -2
- package/es/MultiSelect/AdvancedMultiSelect.js +2 -1
- package/es/MultiSelect/MultiSelect.js +7 -2
- package/es/MultiSelect/Suggestions.js +8 -4
- package/es/MultiSelect/props/defaultProps.js +6 -4
- package/es/MultiSelect/props/propTypes.js +4 -2
- package/es/Popup/Popup.js +8 -97
- package/es/Select/GroupSelect.js +7 -2
- package/es/Select/SelectWithAvatar.js +7 -2
- package/es/Select/SelectWithIcon.js +4 -2
- package/es/Select/props/defaultProps.js +4 -2
- package/es/Select/props/propTypes.js +4 -2
- package/es/v1/Popup/Popup.js +8 -96
- package/lib/DateTime/CalendarView.js +9 -7
- package/lib/ListItem/ListItem.js +2 -2
- package/lib/ListItem/ListItem.module.css +85 -18
- package/lib/ListItem/ListItemWithAvatar.js +3 -3
- package/lib/ListItem/ListItemWithIcon.js +2 -2
- package/lib/MultiSelect/AdvancedGroupMultiSelect.js +7 -3
- package/lib/MultiSelect/AdvancedMultiSelect.js +3 -1
- package/lib/MultiSelect/MultiSelect.js +6 -3
- package/lib/MultiSelect/Suggestions.js +8 -4
- package/lib/MultiSelect/props/defaultProps.js +6 -4
- package/lib/MultiSelect/props/propTypes.js +6 -5
- package/lib/Popup/Popup.js +9 -106
- package/lib/Select/GroupSelect.js +8 -3
- package/lib/Select/SelectWithAvatar.js +8 -3
- package/lib/Select/SelectWithIcon.js +5 -3
- package/lib/Select/props/defaultProps.js +4 -2
- package/lib/Select/props/propTypes.js +4 -2
- package/lib/v1/Popup/Popup.js +9 -105
- package/package.json +4 -4
- package/result.json +1 -1
- package/es/Popup/props/propTypes.js +0 -31
- package/lib/Popup/props/propTypes.js +0 -44
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
}[dir=ltr] .varClass {
|
|
18
18
|
--listitem_avatar_margin: 0 var(--zd_size15) 0 0;
|
|
19
19
|
}[dir=rtl] .varClass {
|
|
20
|
-
--listitem_avatar_margin: 0
|
|
20
|
+
--listitem_avatar_margin: 0 var(--zd_size15) 0 0;
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
.list {
|
|
23
24
|
composes: varClass;
|
|
24
25
|
position: relative;
|
|
@@ -34,62 +35,84 @@
|
|
|
34
35
|
border-color: var(--listitem_border_color);
|
|
35
36
|
cursor: pointer;
|
|
36
37
|
}
|
|
38
|
+
|
|
37
39
|
.list, .default, .secondary {
|
|
38
40
|
background-color: var(--listitem_bg_color);
|
|
39
41
|
}
|
|
42
|
+
|
|
40
43
|
[dir=ltr] .withBorder {
|
|
41
|
-
--listitem_border_width: 0 0 0 1px
|
|
44
|
+
--listitem_border_width: 0 0 0 1px
|
|
45
|
+
/*rtl: 0 1px 0 0*/
|
|
46
|
+
;
|
|
42
47
|
}
|
|
48
|
+
|
|
43
49
|
[dir=rtl] .withBorder {
|
|
44
|
-
--listitem_border_width: 0
|
|
50
|
+
--listitem_border_width: 0 0 0 1px ;
|
|
45
51
|
}
|
|
52
|
+
|
|
46
53
|
.active {
|
|
47
54
|
--listitem_border_color: var(--zdt_listitem_active_border);
|
|
48
55
|
}
|
|
56
|
+
|
|
49
57
|
[dir=ltr] .small {
|
|
50
58
|
--listitem_padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
|
|
51
59
|
}
|
|
60
|
+
|
|
52
61
|
[dir=rtl] .small {
|
|
53
|
-
--listitem_padding: var(--zd_size7) var(--
|
|
62
|
+
--listitem_padding: var(--zd_size7) var(--zd_size3) var(--zd_size7) var(--zd_size5);
|
|
54
63
|
}
|
|
64
|
+
|
|
55
65
|
.medium {
|
|
56
66
|
--listitem_padding: var(--zd_size7) var(--zd_size20);
|
|
57
67
|
--listitem_min_height: var(--zd_size35);
|
|
58
68
|
}
|
|
69
|
+
|
|
59
70
|
.large {
|
|
60
71
|
--listitem_height: var(--zd_size48);
|
|
61
72
|
}
|
|
73
|
+
|
|
62
74
|
[dir=ltr] .large {
|
|
63
75
|
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
|
|
64
76
|
}
|
|
77
|
+
|
|
65
78
|
[dir=rtl] .large {
|
|
66
|
-
--listitem_padding: var(--zd_size10) var(--
|
|
79
|
+
--listitem_padding: var(--zd_size10) var(--zd_size3) var(--zd_size10) var(--zd_size25);
|
|
67
80
|
}
|
|
81
|
+
|
|
68
82
|
.value,
|
|
69
83
|
.children {
|
|
70
84
|
composes: dotted from '../common/common.module.css';
|
|
71
85
|
}
|
|
72
|
-
|
|
86
|
+
|
|
87
|
+
.value {
|
|
73
88
|
line-height: 1.5385;
|
|
74
89
|
}
|
|
75
|
-
|
|
90
|
+
|
|
91
|
+
.multiLineValue {
|
|
92
|
+
line-height: 1.5385;
|
|
76
93
|
word-break: break-word;
|
|
77
|
-
|
|
94
|
+
-webkit-line-clamp: 3;
|
|
95
|
+
composes: clamp from '../common/common.module.css';
|
|
78
96
|
}
|
|
97
|
+
|
|
79
98
|
.iconBox {
|
|
80
99
|
width: var(--zd_size20) ;
|
|
81
100
|
text-align: center;
|
|
82
101
|
}
|
|
102
|
+
|
|
83
103
|
[dir=ltr] .iconBox {
|
|
84
104
|
margin-right: var(--zd_size10) ;
|
|
85
105
|
}
|
|
106
|
+
|
|
86
107
|
[dir=rtl] .iconBox {
|
|
87
108
|
margin-left: var(--zd_size10) ;
|
|
88
109
|
}
|
|
110
|
+
|
|
89
111
|
.iconBox,
|
|
90
112
|
.leftAvatar {
|
|
91
113
|
font-size: 0 ;
|
|
92
114
|
}
|
|
115
|
+
|
|
93
116
|
.leftAvatar {
|
|
94
117
|
margin: var(--listitem_avatar_margin);
|
|
95
118
|
}
|
|
@@ -97,61 +120,78 @@
|
|
|
97
120
|
.defaultHover, .primaryHover, .secondaryHover, .darkHover {
|
|
98
121
|
background-color: var(--listitem_highlight_bg_color);
|
|
99
122
|
}
|
|
123
|
+
|
|
100
124
|
.activewithBorder {
|
|
101
125
|
--listitem_border_color: var(--zdt_listitem_active_border);
|
|
102
126
|
}
|
|
127
|
+
|
|
103
128
|
[dir=ltr] .activewithBorder {
|
|
104
|
-
--listitem_border_width: 0 0 0 1px
|
|
129
|
+
--listitem_border_width: 0 0 0 1px
|
|
130
|
+
/*rtl: 0 1px 0 0*/
|
|
131
|
+
;
|
|
105
132
|
}
|
|
133
|
+
|
|
106
134
|
[dir=rtl] .activewithBorder {
|
|
107
|
-
--listitem_border_width: 0
|
|
135
|
+
--listitem_border_width: 0 0 0 1px ;
|
|
108
136
|
}
|
|
109
137
|
|
|
110
138
|
.defaultHover,
|
|
111
139
|
.defaultEffect:hover
|
|
140
|
+
|
|
112
141
|
/* .defaultEffect:focus */
|
|
113
|
-
{
|
|
142
|
+
{
|
|
114
143
|
--listitem_bg_color: var(--zdt_listitem_highlight_bg);
|
|
115
144
|
}
|
|
145
|
+
|
|
116
146
|
.primaryHover,
|
|
117
147
|
.primaryEffect:hover
|
|
148
|
+
|
|
118
149
|
/* .primaryEffect:focus */
|
|
119
|
-
|
|
150
|
+
{
|
|
120
151
|
--listitem_bg_color: var(--zdt_listitem_primary_bg);
|
|
121
152
|
--listitem_highlight_bg_color: var(--zdt_listitem_primary_bg);
|
|
122
153
|
}
|
|
154
|
+
|
|
123
155
|
.secondaryHover,
|
|
124
156
|
.secondaryEffect:hover
|
|
157
|
+
|
|
125
158
|
/* .secondaryEffect:focus */
|
|
126
|
-
{
|
|
159
|
+
{
|
|
127
160
|
--listitem_bg_color: var(--zdt_listitem_secondary_bg);
|
|
128
161
|
--listitem_highlight_bg_color: var(--zdt_listitem_secondary_bg);
|
|
129
162
|
--listitem_text_color: var(--zdt_listitem_secondary_text);
|
|
130
163
|
}
|
|
164
|
+
|
|
131
165
|
.darkHover,
|
|
132
166
|
.darkEffect:hover
|
|
167
|
+
|
|
133
168
|
/* .darkEffect:focus */
|
|
134
|
-
|
|
169
|
+
{
|
|
135
170
|
--listitem_bg_color: var(--zdt_listitem_dark_effect_bg);
|
|
136
171
|
--listitem_highlight_bg_color: var(--zdt_listitem_dark_effect_bg);
|
|
137
172
|
}
|
|
173
|
+
|
|
138
174
|
.activedefault, .activeprimary, .activesecondary, .activedark {
|
|
139
175
|
background-color: var(--listitem_active_bg_color);
|
|
140
176
|
}
|
|
177
|
+
|
|
141
178
|
.activedefault,
|
|
142
179
|
.activedefault:hover,
|
|
143
180
|
.activeprimary,
|
|
144
181
|
.activeprimary:hover {
|
|
145
182
|
--listitem_active_bg_color: var(--zdt_listitem_primary_bg);
|
|
146
183
|
}
|
|
184
|
+
|
|
147
185
|
.activesecondary {
|
|
148
186
|
--listitem_active_bg_color: var(--zdt_listitem_secondary_bg);
|
|
149
187
|
--listitem_text_color: var(--zdt_listitem_secondary_text);
|
|
150
188
|
}
|
|
189
|
+
|
|
151
190
|
.dark {
|
|
152
191
|
--listitem_bg_color: var(--zdt_listitem_dark_bg);
|
|
153
192
|
--listitem_text_color: var(--zdt_listitem_dark_text);
|
|
154
193
|
}
|
|
194
|
+
|
|
155
195
|
.activedark {
|
|
156
196
|
--listitem_active_bg_color: var(--zdt_listitem_dark_active_bg);
|
|
157
197
|
}
|
|
@@ -170,36 +210,63 @@
|
|
|
170
210
|
[dir=rtl] .tickIcon, [dir=rtl] .defaultTick, [dir=rtl] .darkTick {
|
|
171
211
|
left: var(--zd_size20) ;
|
|
172
212
|
}
|
|
213
|
+
|
|
173
214
|
.defaultTick {
|
|
174
215
|
--listitem_tickicon_color: var(--zdt_listitem_default_tickicon);
|
|
175
216
|
}
|
|
217
|
+
|
|
176
218
|
.darkTick {
|
|
177
219
|
--listitem_tickicon_color: var(--zdt_listitem_dark_tickicon);
|
|
178
220
|
}
|
|
179
|
-
|
|
221
|
+
|
|
222
|
+
.defaultTick>i {
|
|
180
223
|
display: block;
|
|
181
224
|
}
|
|
225
|
+
|
|
182
226
|
[dir=ltr] .smallwithTick {
|
|
183
227
|
--listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size5);
|
|
184
228
|
}
|
|
229
|
+
|
|
185
230
|
[dir=rtl] .smallwithTick {
|
|
186
|
-
--listitem_padding: var(--zd_size7) var(--
|
|
231
|
+
--listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size5);
|
|
187
232
|
}
|
|
233
|
+
|
|
188
234
|
[dir=ltr] .mediumwithTick {
|
|
189
235
|
--listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size20);
|
|
190
236
|
}
|
|
237
|
+
|
|
191
238
|
[dir=rtl] .mediumwithTick {
|
|
192
|
-
--listitem_padding: var(--zd_size7) var(--
|
|
239
|
+
--listitem_padding: var(--zd_size7) var(--zd_size39) var(--zd_size7) var(--zd_size20);
|
|
193
240
|
}
|
|
241
|
+
|
|
194
242
|
[dir=ltr] .largewithTick {
|
|
195
243
|
--listitem_padding: var(--zd_size10) var(--zd_size39) var(--zd_size10) var(--zd_size25);
|
|
196
244
|
}
|
|
245
|
+
|
|
197
246
|
[dir=rtl] .largewithTick {
|
|
198
|
-
--listitem_padding: var(--zd_size10) var(--
|
|
247
|
+
--listitem_padding: var(--zd_size10) var(--zd_size39) var(--zd_size10) var(--zd_size25);
|
|
199
248
|
}
|
|
249
|
+
|
|
200
250
|
.responsiveHeight {
|
|
201
251
|
--listitem_min_height: var(--zd_size45);
|
|
202
252
|
font-size: var(--zd_font_size15) ;
|
|
203
253
|
padding-top: var(--zd_size10) ;
|
|
204
254
|
padding-bottom: var(--zd_size10) ;
|
|
205
255
|
}
|
|
256
|
+
|
|
257
|
+
.autoHeight {
|
|
258
|
+
height: auto ;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.tickIconCenter {
|
|
262
|
+
top: 50% ;
|
|
263
|
+
transform: translateY(-50%);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.txtAlignBaseLine {
|
|
267
|
+
align-items: baseline;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.alignSelfTop {
|
|
271
|
+
align-self: start;
|
|
272
|
+
}
|
|
@@ -158,7 +158,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
158
158
|
autoHover: autoHover,
|
|
159
159
|
needTick: needTick,
|
|
160
160
|
needBorder: needBorder,
|
|
161
|
-
customClass: customListItem,
|
|
161
|
+
customClass: "".concat(needMultiLineText ? _ListItemModule["default"].autoHeight : '', " ").concat(customListItem),
|
|
162
162
|
dataId: "".concat(dataIdString, "_ListItemWithAvatar"),
|
|
163
163
|
dataSelectorId: "".concat(dataSelectorId),
|
|
164
164
|
onClick: this.handleClick,
|
|
@@ -168,7 +168,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
168
168
|
title: null,
|
|
169
169
|
customProps: ListItemProps
|
|
170
170
|
}, ContainerProps), name || imgSrc ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
171
|
-
className: _ListItemModule["default"].leftAvatar
|
|
171
|
+
className: "".concat(needMultiLineText ? _ListItemModule["default"].alignSelfTop : '', " ").concat(_ListItemModule["default"].leftAvatar)
|
|
172
172
|
}, isTeam ? /*#__PURE__*/_react["default"].createElement(_AvatarTeam["default"], {
|
|
173
173
|
name: name,
|
|
174
174
|
size: "small",
|
|
@@ -195,7 +195,7 @@ var ListItemWithAvatar = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
195
195
|
"data-title": isDisabled ? null : title,
|
|
196
196
|
className: needMultiLineText ? _ListItemModule["default"].multiLineValue : _ListItemModule["default"].value
|
|
197
197
|
}, value) : null, needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
198
|
-
className: _ListItemModule["default"].tickIcon,
|
|
198
|
+
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(needMultiLineText ? _ListItemModule["default"].tickIconCenter : ''),
|
|
199
199
|
"aria-hidden": ariaHidden,
|
|
200
200
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
201
201
|
dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
|
|
@@ -147,7 +147,7 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
147
147
|
autoHover: autoHover,
|
|
148
148
|
needTick: needTick,
|
|
149
149
|
needBorder: needBorder,
|
|
150
|
-
customClass: customClass,
|
|
150
|
+
customClass: "".concat(needMultiLineText ? _ListItemModule["default"].autoHeight : '', " ").concat(needMultiLineText && iconClass && !iconName ? _ListItemModule["default"].txtAlignBaseLine : '', " ").concat(customClass),
|
|
151
151
|
dataId: dataIdString,
|
|
152
152
|
dataSelectorId: dataSelectorId,
|
|
153
153
|
isLink: isLink,
|
|
@@ -176,7 +176,7 @@ var ListItemWithIcon = /*#__PURE__*/function (_React$Component) {
|
|
|
176
176
|
"data-title": isDisabled ? null : title,
|
|
177
177
|
dataId: "".concat(dataIdString, "_Text")
|
|
178
178
|
}, value), needTick && active ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
179
|
-
className: _ListItemModule["default"].tickIcon,
|
|
179
|
+
className: "".concat(_ListItemModule["default"].tickIcon, " ").concat(needMultiLineText ? _ListItemModule["default"].tickIconCenter : ''),
|
|
180
180
|
"aria-hidden": ariaHidden,
|
|
181
181
|
dataId: "".concat(dataIdString, "_tickIcon"),
|
|
182
182
|
dataSelectorId: "".concat(dataSelectorId, "_tickIcon")
|
|
@@ -53,6 +53,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
53
53
|
|
|
54
54
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
55
55
|
|
|
56
|
+
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); }
|
|
57
|
+
|
|
56
58
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
57
59
|
|
|
58
60
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -965,7 +967,9 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
965
967
|
palette = _this$props8.palette,
|
|
966
968
|
needEffect = _this$props8.needEffect,
|
|
967
969
|
autoComplete = _this$props8.autoComplete,
|
|
968
|
-
getTargetRef = _this$props8.getTargetRef
|
|
970
|
+
getTargetRef = _this$props8.getTargetRef,
|
|
971
|
+
customProps = _this$props8.customProps;
|
|
972
|
+
var suggestionsProps = customProps.suggestionsProps;
|
|
969
973
|
var _i18nKeys = i18nKeys,
|
|
970
974
|
_i18nKeys$clearText = _i18nKeys.clearText,
|
|
971
975
|
clearText = _i18nKeys$clearText === void 0 ? 'Clear all' : _i18nKeys$clearText;
|
|
@@ -1128,7 +1132,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1128
1132
|
a11y: {
|
|
1129
1133
|
role: 'heading'
|
|
1130
1134
|
}
|
|
1131
|
-
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
1135
|
+
})), /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
1132
1136
|
suggestions: suggestions,
|
|
1133
1137
|
selectedOptions: selectedOptionIds,
|
|
1134
1138
|
getRef: _this5.suggestionItemRef,
|
|
@@ -1141,7 +1145,7 @@ var AdvancedGroupMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
1141
1145
|
role: 'option'
|
|
1142
1146
|
},
|
|
1143
1147
|
dataId: "".concat(dataId, "_Options")
|
|
1144
|
-
}));
|
|
1148
|
+
}, suggestionsProps)));
|
|
1145
1149
|
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
1146
1150
|
options: revampedGroups,
|
|
1147
1151
|
searchString: searchStr,
|
|
@@ -611,7 +611,9 @@ var AdvancedMultiSelectComponent = /*#__PURE__*/function (_MultiSelectComponent)
|
|
|
611
611
|
role: 'option'
|
|
612
612
|
},
|
|
613
613
|
dataId: "".concat(dataIdMultiSelectComp, "_Options")
|
|
614
|
-
}, SuggestionsProps
|
|
614
|
+
}, SuggestionsProps, {
|
|
615
|
+
needMultiLineText: true
|
|
616
|
+
})) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
615
617
|
isLoading: isFetchingOptions,
|
|
616
618
|
options: options,
|
|
617
619
|
searchString: searchStr,
|
|
@@ -1093,7 +1093,10 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1093
1093
|
boxSize = _this$props15.boxSize,
|
|
1094
1094
|
isLoading = _this$props15.isLoading,
|
|
1095
1095
|
selectAllText = _this$props15.selectAllText,
|
|
1096
|
-
needSelectAll = _this$props15.needSelectAll
|
|
1096
|
+
needSelectAll = _this$props15.needSelectAll,
|
|
1097
|
+
customProps = _this$props15.customProps;
|
|
1098
|
+
var _customProps$suggesti = customProps.suggestionsProps,
|
|
1099
|
+
suggestionsProps = _customProps$suggesti === void 0 ? {} : _customProps$suggesti;
|
|
1097
1100
|
var _this$state9 = this.state,
|
|
1098
1101
|
selectedOptions = _this$state9.selectedOptions,
|
|
1099
1102
|
searchStr = _this$state9.searchStr,
|
|
@@ -1170,7 +1173,7 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1170
1173
|
eleRef: this.suggestionContainerRef
|
|
1171
1174
|
}, isSearching ? /*#__PURE__*/_react["default"].createElement("div", {
|
|
1172
1175
|
className: _MultiSelectModule["default"][palette]
|
|
1173
|
-
}, searchText) : suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], {
|
|
1176
|
+
}, searchText) : suggestions.length ? /*#__PURE__*/_react["default"].createElement(_Suggestions["default"], _extends({
|
|
1174
1177
|
suggestions: suggestions,
|
|
1175
1178
|
getRef: this.suggestionItemRef,
|
|
1176
1179
|
hoverOption: hoverOption,
|
|
@@ -1183,7 +1186,7 @@ var MultiSelectComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1183
1186
|
a11y: {
|
|
1184
1187
|
role: 'option'
|
|
1185
1188
|
}
|
|
1186
|
-
}) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
1189
|
+
}, suggestionsProps)) : /*#__PURE__*/_react["default"].createElement(_EmptyState["default"], {
|
|
1187
1190
|
isLoading: isFetchingOptions,
|
|
1188
1191
|
options: options,
|
|
1189
1192
|
searchString: searchStr,
|
|
@@ -83,7 +83,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
83
83
|
avatarPalette = _this$props.avatarPalette,
|
|
84
84
|
palette = _this$props.palette,
|
|
85
85
|
htmlId = _this$props.htmlId,
|
|
86
|
-
a11y = _this$props.a11y
|
|
86
|
+
a11y = _this$props.a11y,
|
|
87
|
+
needMultiLineText = _this$props.needMultiLineText;
|
|
87
88
|
var ariaParentRole = a11y.ariaParentRole,
|
|
88
89
|
ariaMultiselectable = a11y.ariaMultiselectable;
|
|
89
90
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
@@ -143,7 +144,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
143
144
|
size: listItemSize,
|
|
144
145
|
avatarPalette: avatarPalette,
|
|
145
146
|
palette: palette,
|
|
146
|
-
a11y: list_a11y
|
|
147
|
+
a11y: list_a11y,
|
|
148
|
+
needMultiLineText: needMultiLineText
|
|
147
149
|
}));
|
|
148
150
|
} else if (optionType === 'icon') {
|
|
149
151
|
return /*#__PURE__*/_react["default"].createElement(_ListItemWithIcon["default"], _extends({}, commonProps, {
|
|
@@ -163,7 +165,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
163
165
|
iconSize: iconSize,
|
|
164
166
|
size: listItemSize,
|
|
165
167
|
palette: palette,
|
|
166
|
-
a11y: list_a11y
|
|
168
|
+
a11y: list_a11y,
|
|
169
|
+
needMultiLineText: needMultiLineText
|
|
167
170
|
}));
|
|
168
171
|
}
|
|
169
172
|
|
|
@@ -182,7 +185,8 @@ var Suggestions = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
182
185
|
active: isActive,
|
|
183
186
|
size: listItemSize,
|
|
184
187
|
palette: palette,
|
|
185
|
-
a11y: list_a11y
|
|
188
|
+
a11y: list_a11y,
|
|
189
|
+
needMultiLineText: needMultiLineText
|
|
186
190
|
}));
|
|
187
191
|
})));
|
|
188
192
|
}
|
|
@@ -45,7 +45,8 @@ var AdvancedGroupMultiSelect_defaultProps = {
|
|
|
45
45
|
needEffect: true,
|
|
46
46
|
palette: 'default',
|
|
47
47
|
isLoading: false,
|
|
48
|
-
dataSelectorId: 'advancedGroupMultiSelect'
|
|
48
|
+
dataSelectorId: 'advancedGroupMultiSelect',
|
|
49
|
+
customProps: {}
|
|
49
50
|
};
|
|
50
51
|
exports.AdvancedGroupMultiSelect_defaultProps = AdvancedGroupMultiSelect_defaultProps;
|
|
51
52
|
var AdvancedMultiSelect_defaultProps = {
|
|
@@ -167,8 +168,8 @@ var MultiSelectWithAvatar_defaultProps = {
|
|
|
167
168
|
isLoading: false,
|
|
168
169
|
dataSelectorId: 'multiSelectWithAvatar',
|
|
169
170
|
keepSelectedOptions: false,
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
needResponsive: true,
|
|
172
|
+
customProps: {}
|
|
172
173
|
};
|
|
173
174
|
exports.MultiSelectWithAvatar_defaultProps = MultiSelectWithAvatar_defaultProps;
|
|
174
175
|
var SelectedOptions_defaultProps = {
|
|
@@ -177,6 +178,7 @@ var SelectedOptions_defaultProps = {
|
|
|
177
178
|
};
|
|
178
179
|
exports.SelectedOptions_defaultProps = SelectedOptions_defaultProps;
|
|
179
180
|
var Suggestions_defaultProps = {
|
|
180
|
-
a11y: {}
|
|
181
|
+
a11y: {},
|
|
182
|
+
needMultiLineText: false
|
|
181
183
|
};
|
|
182
184
|
exports.Suggestions_defaultProps = Suggestions_defaultProps;
|
|
@@ -7,6 +7,8 @@ exports.Suggestions_propTypes = exports.SelectedOptions_propTypes = exports.Mult
|
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|
|
10
|
+
var _AdvancedGroupMultiSe;
|
|
11
|
+
|
|
10
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
13
|
|
|
12
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -198,11 +200,11 @@ var Suggestions_propTypes = {
|
|
|
198
200
|
logo: _propTypes["default"].string,
|
|
199
201
|
optionType: _propTypes["default"].string,
|
|
200
202
|
listItemProps: _propTypes["default"].object
|
|
201
|
-
}))
|
|
203
|
+
})),
|
|
204
|
+
needMultiLineText: _propTypes["default"].bool
|
|
202
205
|
};
|
|
203
206
|
exports.Suggestions_propTypes = Suggestions_propTypes;
|
|
204
|
-
|
|
205
|
-
var AdvancedGroupMultiSelect_propTypes = _defineProperty({
|
|
207
|
+
var AdvancedGroupMultiSelect_propTypes = (_AdvancedGroupMultiSe = {
|
|
206
208
|
animationStyle: _propTypes["default"].string,
|
|
207
209
|
autoComplete: _propTypes["default"].bool,
|
|
208
210
|
borderColor: _propTypes["default"].oneOf(['transparent', 'default']),
|
|
@@ -270,8 +272,7 @@ var AdvancedGroupMultiSelect_propTypes = _defineProperty({
|
|
|
270
272
|
needToCloseOnSelect: _propTypes["default"].func,
|
|
271
273
|
searchStr: _propTypes["default"].string,
|
|
272
274
|
children: _propTypes["default"].node
|
|
273
|
-
}, "dataSelectorId", _propTypes["default"].string);
|
|
274
|
-
|
|
275
|
+
}, _defineProperty(_AdvancedGroupMultiSe, "dataSelectorId", _propTypes["default"].string), _defineProperty(_AdvancedGroupMultiSe, "customProps", _propTypes["default"].string), _AdvancedGroupMultiSe);
|
|
275
276
|
exports.AdvancedGroupMultiSelect_propTypes = AdvancedGroupMultiSelect_propTypes;
|
|
276
277
|
|
|
277
278
|
var AdvancedMultiSelect_propTypes = _objectSpread(_objectSpread({}, MultiSelect_propTypes), {}, {
|
package/lib/Popup/Popup.js
CHANGED
|
@@ -9,9 +9,9 @@ exports["default"] = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _react = _interopRequireDefault(require("react"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _hoistNonReactStatics = _interopRequireDefault(require("hoist-non-react-statics"));
|
|
15
15
|
|
|
16
16
|
var _Common = require("../utils/Common.js");
|
|
17
17
|
|
|
@@ -151,11 +151,6 @@ var Popup = function Popup(Component) {
|
|
|
151
151
|
_this.handleDocumentMouseDown = _this.handleDocumentMouseDown.bind(_assertThisInitialized(_this));
|
|
152
152
|
_this.handleDocumentFocus = _this.handleDocumentFocus.bind(_assertThisInitialized(_this));
|
|
153
153
|
_this.handleGetNeedPrevent = _this.handleGetNeedPrevent.bind(_assertThisInitialized(_this));
|
|
154
|
-
_this.handleBlockScroll = _this.handleBlockScroll.bind(_assertThisInitialized(_this));
|
|
155
|
-
_this.handlePositionChange = _this.handlePositionChange.bind(_assertThisInitialized(_this));
|
|
156
|
-
_this.preventKeyboardScroll = _this.preventKeyboardScroll.bind(_assertThisInitialized(_this));
|
|
157
|
-
_this.addScrollBlockListeners = _this.addScrollBlockListeners.bind(_assertThisInitialized(_this));
|
|
158
|
-
_this.removeScrollBlockListeners = _this.removeScrollBlockListeners.bind(_assertThisInitialized(_this));
|
|
159
154
|
_this.popupObserver = new _ResizeObserver["default"](_this.handlePopupResize); //dropBoxSize
|
|
160
155
|
|
|
161
156
|
_this.size = null;
|
|
@@ -169,7 +164,6 @@ var Popup = function Popup(Component) {
|
|
|
169
164
|
scrollDebounceTime = _this$getScrollDeboun.scrollDebounceTime;
|
|
170
165
|
|
|
171
166
|
_this.handleScroll = (0, _Common.debounce)(_this.handleScroll.bind(_assertThisInitialized(_this)), scrollDebounceTime);
|
|
172
|
-
_this.handleDebouncedPositionChange = (0, _Common.debounce)(_this.handlePositionChange.bind(_assertThisInitialized(_this)), 100);
|
|
173
167
|
return _this;
|
|
174
168
|
}
|
|
175
169
|
|
|
@@ -213,10 +207,7 @@ var Popup = function Popup(Component) {
|
|
|
213
207
|
oldStateOpen = _ref2$isPopupReady === void 0 ? false : _ref2$isPopupReady;
|
|
214
208
|
|
|
215
209
|
var dropElement = this.dropElement;
|
|
216
|
-
var
|
|
217
|
-
propResizeHandling = _this$props.needResizeHandling,
|
|
218
|
-
isAbsolutePositioningNeeded = _this$props.isAbsolutePositioningNeeded,
|
|
219
|
-
isBlockedOutsideScroll = _this$props.isBlockedOutsideScroll;
|
|
210
|
+
var propResizeHandling = this.props.needResizeHandling;
|
|
220
211
|
|
|
221
212
|
if (oldStateOpen !== isPopupReady) {
|
|
222
213
|
if (isPopupReady && dropElement && (propResizeHandling !== undefined ? propResizeHandling : needResizeHandling)) {
|
|
@@ -225,14 +216,6 @@ var Popup = function Popup(Component) {
|
|
|
225
216
|
this.size = null;
|
|
226
217
|
this.popupObserver.disconnect();
|
|
227
218
|
}
|
|
228
|
-
|
|
229
|
-
if (isBlockedOutsideScroll && !isAbsolutePositioningNeeded) {
|
|
230
|
-
if (isPopupReady) {
|
|
231
|
-
this.addScrollBlockListeners();
|
|
232
|
-
} else {
|
|
233
|
-
this.removeScrollBlockListeners();
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
219
|
}
|
|
237
220
|
}
|
|
238
221
|
}, {
|
|
@@ -253,7 +236,6 @@ var Popup = function Popup(Component) {
|
|
|
253
236
|
|
|
254
237
|
return res;
|
|
255
238
|
}, popups);
|
|
256
|
-
this.removeScrollBlockListeners();
|
|
257
239
|
var noPopups = true;
|
|
258
240
|
|
|
259
241
|
for (var i in popups) {
|
|
@@ -277,82 +259,6 @@ var Popup = function Popup(Component) {
|
|
|
277
259
|
document.removeEventListener('focus', this.handleDocumentFocus, true);
|
|
278
260
|
}
|
|
279
261
|
}
|
|
280
|
-
}, {
|
|
281
|
-
key: "addScrollBlockListeners",
|
|
282
|
-
value: function addScrollBlockListeners() {
|
|
283
|
-
document.addEventListener('wheel', this.handleBlockScroll, {
|
|
284
|
-
capture: true,
|
|
285
|
-
passive: false
|
|
286
|
-
});
|
|
287
|
-
document.addEventListener('touchmove', this.handleBlockScroll, {
|
|
288
|
-
capture: true,
|
|
289
|
-
passive: false
|
|
290
|
-
});
|
|
291
|
-
document.addEventListener('scroll', this.handleDebouncedPositionChange, {
|
|
292
|
-
capture: true,
|
|
293
|
-
passive: false
|
|
294
|
-
});
|
|
295
|
-
document.addEventListener('keydown', this.preventKeyboardScroll, {
|
|
296
|
-
capture: true,
|
|
297
|
-
passive: false
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
}, {
|
|
301
|
-
key: "removeScrollBlockListeners",
|
|
302
|
-
value: function removeScrollBlockListeners() {
|
|
303
|
-
document.removeEventListener('wheel', this.handleBlockScroll, {
|
|
304
|
-
capture: true,
|
|
305
|
-
passive: false
|
|
306
|
-
});
|
|
307
|
-
document.removeEventListener('touchmove', this.handleBlockScroll, {
|
|
308
|
-
capture: true,
|
|
309
|
-
passive: false
|
|
310
|
-
});
|
|
311
|
-
document.removeEventListener('scroll', this.handleDebouncedPositionChange, {
|
|
312
|
-
capture: true,
|
|
313
|
-
passive: false
|
|
314
|
-
});
|
|
315
|
-
document.removeEventListener('keydown', this.preventKeyboardScroll, {
|
|
316
|
-
capture: true,
|
|
317
|
-
passive: false
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
}, {
|
|
321
|
-
key: "handleBlockScroll",
|
|
322
|
-
value: function handleBlockScroll(event) {
|
|
323
|
-
// const targetElement = this.placeHolderElement;
|
|
324
|
-
var containerElement = this.dropElement;
|
|
325
|
-
|
|
326
|
-
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target)) {
|
|
327
|
-
// --- Scroll exclude Target & Container elements --- For reference. Will adopt in future
|
|
328
|
-
// if(
|
|
329
|
-
// (containerElement && (containerElement !== event.target && !containerElement.contains(event.target)))
|
|
330
|
-
// && (targetElement && (targetElement !== event.target && !targetElement.contains(event.target)))
|
|
331
|
-
// ) {
|
|
332
|
-
event.preventDefault();
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}, {
|
|
336
|
-
key: "handlePositionChange",
|
|
337
|
-
value: function handlePositionChange(event) {
|
|
338
|
-
var targetElement = this.placeHolderElement;
|
|
339
|
-
var containerElement = this.dropElement;
|
|
340
|
-
|
|
341
|
-
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && targetElement && targetElement !== event.target && !targetElement.contains(event.target) && event.target.contains(targetElement)) {
|
|
342
|
-
// this.handlePopupPosition(this.state.position);
|
|
343
|
-
this.closePopupOnly(event);
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}, {
|
|
347
|
-
key: "preventKeyboardScroll",
|
|
348
|
-
value: function preventKeyboardScroll(event) {
|
|
349
|
-
var containerElement = this.dropElement;
|
|
350
|
-
var keys = [32, 37, 38, 39, 40]; // Space, Arrow keys
|
|
351
|
-
|
|
352
|
-
if (containerElement && containerElement !== event.target && !containerElement.contains(event.target) && keys.includes(event.keyCode)) {
|
|
353
|
-
event.preventDefault();
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
262
|
}, {
|
|
357
263
|
key: "getGroup",
|
|
358
264
|
value: function getGroup() {
|
|
@@ -681,19 +587,15 @@ var Popup = function Popup(Component) {
|
|
|
681
587
|
_ref6$left = _ref6.left,
|
|
682
588
|
oldLeft = _ref6$left === void 0 ? '' : _ref6$left,
|
|
683
589
|
_ref6$top = _ref6.top,
|
|
684
|
-
oldTop = _ref6$top === void 0 ? '' : _ref6$top
|
|
685
|
-
_ref6$bottom = _ref6.bottom,
|
|
686
|
-
oldBottom = _ref6$bottom === void 0 ? '' : _ref6$bottom;
|
|
590
|
+
oldTop = _ref6$top === void 0 ? '' : _ref6$top;
|
|
687
591
|
|
|
688
592
|
var _ref7 = viewsOffset[view] || {},
|
|
689
593
|
_ref7$left = _ref7.left,
|
|
690
594
|
left = _ref7$left === void 0 ? '' : _ref7$left,
|
|
691
595
|
_ref7$top = _ref7.top,
|
|
692
|
-
top = _ref7$top === void 0 ? '' : _ref7$top
|
|
693
|
-
_ref7$bottom = _ref7.bottom,
|
|
694
|
-
bottom = _ref7$bottom === void 0 ? '' : _ref7$bottom;
|
|
596
|
+
top = _ref7$top === void 0 ? '' : _ref7$top;
|
|
695
597
|
|
|
696
|
-
var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top
|
|
598
|
+
var changeState = isAbsolute ? position !== view : oldLeft !== left || oldTop !== top; // let isInViewPort = viewPort.isInViewPort(
|
|
697
599
|
// placeHolderElement,
|
|
698
600
|
// scrollContainer
|
|
699
601
|
// );
|
|
@@ -803,8 +705,9 @@ var Popup = function Popup(Component) {
|
|
|
803
705
|
}(_react["default"].Component);
|
|
804
706
|
|
|
805
707
|
Popup.displayName = Component.displayName || Component.name || Popup.name;
|
|
806
|
-
Popup.contextTypes =
|
|
807
|
-
|
|
708
|
+
Popup.contextTypes = {
|
|
709
|
+
direction: _propTypes["default"].string
|
|
710
|
+
};
|
|
808
711
|
return (0, _hoistNonReactStatics["default"])(Popup, Component);
|
|
809
712
|
};
|
|
810
713
|
|