@zohodesk/dot 1.0.0-temp-183.1 → 1.0.0-temp-184.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cli/propValidation_report.html +1 -1
- package/coverage/ExternalLink/ExternalLink.js.html +1 -1
- package/coverage/ExternalLink/ExternalLink.module.css.html +1 -1
- package/coverage/ExternalLink/index.html +1 -1
- package/coverage/ExternalLink/props/defaultProps.js.html +1 -1
- package/coverage/ExternalLink/props/index.html +1 -1
- package/coverage/ExternalLink/props/propTypes.js.html +1 -1
- package/coverage/IconButton/IconButton.js.html +1 -1
- package/coverage/IconButton/IconButton.module.css.html +1 -1
- package/coverage/IconButton/index.html +1 -1
- package/coverage/IconButton/props/defaultProps.js.html +1 -1
- package/coverage/IconButton/props/index.html +1 -1
- package/coverage/IconButton/props/propTypes.js.html +1 -1
- package/coverage/Image/Image.js.html +1 -1
- package/coverage/Image/Image.module.css.html +1 -1
- package/coverage/Image/index.html +1 -1
- package/coverage/Image/props/defaultProps.js.html +1 -1
- package/coverage/Image/props/index.html +1 -1
- package/coverage/Image/props/propTypes.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/AvatarWithTeam.module.css.html +1 -1
- package/coverage/avatar/AvatarWithTeam/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/defaultProps.js.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/index.html +1 -1
- package/coverage/avatar/AvatarWithTeam/props/propTypes.js.html +1 -1
- package/coverage/coverage-final.json +16 -16
- package/coverage/coverage-summary.json +16 -16
- package/coverage/index.html +1 -1
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -4
- package/es/list/DepartmentDropDown/DepartmentDropDown.js +3 -9
- package/es/list/DepartmentDropDown/props/defaultProps.js +1 -2
- package/es/list/DepartmentDropDown/props/propTypes.js +1 -2
- package/es/list/Thread/Thread.js +1 -2
- package/es/list/status/StatusDropdown/StatusDropdown.js +138 -182
- package/es/list/status/StatusDropdown/StatusDropdown.module.css +6 -6
- package/es/list/status/StatusListItem/StatusListItem.js +5 -1
- package/es/list/status/StatusListItem/StatusListItem.module.css +5 -35
- package/es/v1/list/Thread/Thread.js +1 -2
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +126 -137
- package/es/v1/list/status/StatusListItem/StatusListItem.js +5 -1
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
- package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
- package/lib/list/DepartmentDropDown/props/defaultProps.js +1 -2
- package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
- package/lib/list/Thread/Thread.js +1 -2
- package/lib/list/status/StatusDropdown/StatusDropdown.js +182 -233
- package/lib/list/status/StatusDropdown/StatusDropdown.module.css +6 -6
- package/lib/list/status/StatusListItem/StatusListItem.js +6 -1
- package/lib/list/status/StatusListItem/StatusListItem.module.css +5 -35
- package/lib/v1/list/Thread/Thread.js +1 -2
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +111 -130
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +6 -1
- package/package.json +3 -3
- package/result.json +1 -1
|
@@ -27,10 +27,6 @@ var _Loader = _interopRequireDefault(require("@zohodesk/svg/lib/Loader/Loader"))
|
|
|
27
27
|
|
|
28
28
|
var _EmptySearch = _interopRequireDefault(require("@zohodesk/svg/lib/emptystate/version3/EmptySearch"));
|
|
29
29
|
|
|
30
|
-
var _Common = require("@zohodesk/components/lib/utils/Common.js");
|
|
31
|
-
|
|
32
|
-
var _TextBox = _interopRequireDefault(require("@zohodesk/components/lib/TextBox/TextBox"));
|
|
33
|
-
|
|
34
30
|
var _CommonEmptyState = _interopRequireDefault(require("../../../emptystate/CommonEmptyState/CommonEmptyState"));
|
|
35
31
|
|
|
36
32
|
var _StatusListItem = _interopRequireDefault(require("../StatusListItem/StatusListItem"));
|
|
@@ -82,20 +78,20 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
82
78
|
_this = _super.call(this, props);
|
|
83
79
|
_this.state = {
|
|
84
80
|
searchString: '',
|
|
85
|
-
selectedIndex: 0,
|
|
81
|
+
// selectedIndex: 0,
|
|
86
82
|
options: props.options
|
|
87
83
|
};
|
|
88
|
-
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
89
|
-
|
|
84
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this)); // this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
85
|
+
|
|
90
86
|
_this.onSelect = _this.onSelect.bind(_assertThisInitialized(_this));
|
|
91
87
|
_this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
|
|
92
88
|
_this.onSearchClear = _this.onSearchClear.bind(_assertThisInitialized(_this));
|
|
93
|
-
_this.searchList = _this.searchList.bind(_assertThisInitialized(_this));
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
89
|
+
_this.searchList = _this.searchList.bind(_assertThisInitialized(_this)); // this.scrollContentRef = this.scrollContentRef.bind(this);
|
|
90
|
+
// this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
91
|
+
// this.searchInputRef = this.searchInputRef.bind(this);
|
|
92
|
+
// this.itemRef = this.itemRef.bind(this);
|
|
93
|
+
// this.inputRef = this.inputRef.bind(this);
|
|
94
|
+
|
|
99
95
|
_this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));
|
|
100
96
|
_this.emptySearchSVG = _this.emptySearchSVG.bind(_assertThisInitialized(_this));
|
|
101
97
|
_this.getAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
@@ -108,22 +104,16 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
108
104
|
return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
|
|
109
105
|
size: "small"
|
|
110
106
|
});
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
}, {
|
|
123
|
-
key: "searchInputRef",
|
|
124
|
-
value: function searchInputRef(el) {
|
|
125
|
-
this.searchInput = el;
|
|
126
|
-
}
|
|
107
|
+
} // inputRef(el) {
|
|
108
|
+
// this.hiddenInput = el;
|
|
109
|
+
// }
|
|
110
|
+
// itemRef(ele, index, id) {
|
|
111
|
+
// this[`suggestion_${id}`] = ele;
|
|
112
|
+
// }
|
|
113
|
+
// searchInputRef(el) {
|
|
114
|
+
// this.searchInput = el;
|
|
115
|
+
// }
|
|
116
|
+
|
|
127
117
|
}, {
|
|
128
118
|
key: "handleTogglePopup",
|
|
129
119
|
value: function handleTogglePopup(e) {
|
|
@@ -136,16 +126,13 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
136
126
|
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
137
127
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
138
128
|
togglePopup(e, boxPosition);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
129
|
+
} // scrollContentRef(el) {
|
|
130
|
+
// let { isPopupOpen } = this.props;
|
|
131
|
+
// if (isPopupOpen) {
|
|
132
|
+
// this.optionsContainer = el;
|
|
133
|
+
// }
|
|
134
|
+
// }
|
|
144
135
|
|
|
145
|
-
if (isPopupOpen) {
|
|
146
|
-
this.optionsContainer = el;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
136
|
}, {
|
|
150
137
|
key: "componentWillReceiveProps",
|
|
151
138
|
value: function componentWillReceiveProps(nextProps) {
|
|
@@ -170,110 +157,74 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
170
157
|
}, {
|
|
171
158
|
key: "componentDidUpdate",
|
|
172
159
|
value: function componentDidUpdate(prevProps) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
var mergeOptions = options;
|
|
190
|
-
var option = mergeOptions[selectedIndex];
|
|
191
|
-
var id = option && option[idName] || {};
|
|
192
|
-
var selSuggestion = this["suggestion_".concat(id)];
|
|
193
|
-
|
|
194
|
-
if (isPopupOpen) {
|
|
195
|
-
this.optionsContainer && (0, _Common.scrollTo)(this.optionsContainer, selSuggestion);
|
|
196
|
-
}
|
|
197
|
-
|
|
160
|
+
// let { isPopupOpen, isSearch, idName } = this.props;
|
|
161
|
+
// let { selectedIndex, options } = this.state;
|
|
162
|
+
// if (prevProps.isPopupOpen != isPopupOpen) {
|
|
163
|
+
// setTimeout(() => {
|
|
164
|
+
// isPopupOpen && isSearch
|
|
165
|
+
// ? this.searchInput && this.searchInput.focus()
|
|
166
|
+
// : this.hiddenInput && this.hiddenInput.focus();
|
|
167
|
+
// }, 10);
|
|
168
|
+
// }
|
|
169
|
+
// let mergeOptions = options;
|
|
170
|
+
// let option = mergeOptions[selectedIndex];
|
|
171
|
+
// let id = (option && option[idName]) || {};
|
|
172
|
+
// let selSuggestion = this[`suggestion_${id}`];
|
|
173
|
+
// if (isPopupOpen) {
|
|
174
|
+
// this.optionsContainer && scrollTo(this.optionsContainer, selSuggestion);
|
|
175
|
+
// }
|
|
198
176
|
if (!prevProps.isPopupOpen && this.props.isPopupOpen) {
|
|
199
177
|
this.onSearchClear();
|
|
200
178
|
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
179
|
+
} // handleKeyDown(e) {
|
|
180
|
+
// let { keyCode } = e;
|
|
181
|
+
// let { selectedIndex, options } = this.state;
|
|
182
|
+
// let totalIndex = options.length;
|
|
183
|
+
// let { togglePopup, onClick, boxPosition, isPopupReady, isNextOptions, getNextOptions, onTogglePopup, isPopupOpen } =
|
|
184
|
+
// this.props;
|
|
185
|
+
// if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
186
|
+
// e.preventDefault(); //prevent body scroll
|
|
187
|
+
// }
|
|
188
|
+
// if (isPopupReady) {
|
|
189
|
+
// switch (keyCode) {
|
|
190
|
+
// case 40:
|
|
191
|
+
// if (selectedIndex === totalIndex - 1) {
|
|
192
|
+
// this.setState({ selectedIndex: 0 });
|
|
193
|
+
// } else {
|
|
194
|
+
// if (selectedIndex === totalIndex - 3) {
|
|
195
|
+
// isNextOptions && getNextOptions && getNextOptions();
|
|
196
|
+
// }
|
|
197
|
+
// this.setState({ selectedIndex: selectedIndex + 1 });
|
|
198
|
+
// }
|
|
199
|
+
// break;
|
|
200
|
+
// case 38:
|
|
201
|
+
// if (selectedIndex === 0) {
|
|
202
|
+
// this.setState({ selectedIndex: totalIndex - 1 });
|
|
203
|
+
// } else {
|
|
204
|
+
// this.setState({ selectedIndex: selectedIndex - 1 });
|
|
205
|
+
// }
|
|
206
|
+
// break;
|
|
207
|
+
// case 13:
|
|
208
|
+
// onClick && onClick(options[selectedIndex].name, e);
|
|
209
|
+
// onTogglePopup && onTogglePopup(isPopupOpen);
|
|
210
|
+
// togglePopup(e, boxPosition);
|
|
211
|
+
// break;
|
|
212
|
+
// default:
|
|
213
|
+
// break;
|
|
214
|
+
// }
|
|
215
|
+
// } else {
|
|
216
|
+
// if (keyCode === 13 || keyCode === 40) {
|
|
217
|
+
// togglePopup(e, boxPosition);
|
|
218
|
+
// }
|
|
219
|
+
// }
|
|
220
|
+
// }
|
|
223
221
|
|
|
224
|
-
if (isPopupReady) {
|
|
225
|
-
switch (keyCode) {
|
|
226
|
-
case 40:
|
|
227
|
-
if (selectedIndex === totalIndex - 1) {
|
|
228
|
-
this.setState({
|
|
229
|
-
selectedIndex: 0
|
|
230
|
-
});
|
|
231
|
-
} else {
|
|
232
|
-
if (selectedIndex === totalIndex - 3) {
|
|
233
|
-
isNextOptions && getNextOptions && getNextOptions();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
this.setState({
|
|
237
|
-
selectedIndex: selectedIndex + 1
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
break;
|
|
242
|
-
|
|
243
|
-
case 38:
|
|
244
|
-
if (selectedIndex === 0) {
|
|
245
|
-
this.setState({
|
|
246
|
-
selectedIndex: totalIndex - 1
|
|
247
|
-
});
|
|
248
|
-
} else {
|
|
249
|
-
this.setState({
|
|
250
|
-
selectedIndex: selectedIndex - 1
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
break;
|
|
255
|
-
|
|
256
|
-
case 13:
|
|
257
|
-
onClick && onClick(options[selectedIndex].name, e);
|
|
258
|
-
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
259
|
-
togglePopup(e, boxPosition);
|
|
260
|
-
break;
|
|
261
|
-
|
|
262
|
-
default:
|
|
263
|
-
break;
|
|
264
|
-
}
|
|
265
|
-
} else {
|
|
266
|
-
if (keyCode === 13 || keyCode === 40) {
|
|
267
|
-
togglePopup(e, boxPosition);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
222
|
}, {
|
|
272
223
|
key: "searchList",
|
|
273
224
|
value: function searchList(value) {
|
|
274
|
-
var _this$
|
|
275
|
-
options = _this$
|
|
276
|
-
keyName = _this$
|
|
225
|
+
var _this$props3 = this.props,
|
|
226
|
+
options = _this$props3.options,
|
|
227
|
+
keyName = _this$props3.keyName;
|
|
277
228
|
var foptions = options.filter(function (dept) {
|
|
278
229
|
return dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1;
|
|
279
230
|
});
|
|
@@ -285,7 +236,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
285
236
|
var foptions = this.searchList(value);
|
|
286
237
|
this.setState({
|
|
287
238
|
searchString: value,
|
|
288
|
-
selectedIndex: -1,
|
|
239
|
+
// selectedIndex: -1,
|
|
289
240
|
options: foptions
|
|
290
241
|
});
|
|
291
242
|
}
|
|
@@ -297,20 +248,18 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
297
248
|
searchString: '',
|
|
298
249
|
options: foptions
|
|
299
250
|
});
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
});
|
|
307
|
-
}
|
|
251
|
+
} // handleMouseEnter(id, value, index, e) {
|
|
252
|
+
// this.setState({
|
|
253
|
+
// selectedIndex: index
|
|
254
|
+
// });
|
|
255
|
+
// }
|
|
256
|
+
|
|
308
257
|
}, {
|
|
309
258
|
key: "handleScroll",
|
|
310
259
|
value: function handleScroll(e) {
|
|
311
|
-
var _this$
|
|
312
|
-
isNextOptions = _this$
|
|
313
|
-
getNextOptions = _this$
|
|
260
|
+
var _this$props4 = this.props,
|
|
261
|
+
isNextOptions = _this$props4.isNextOptions,
|
|
262
|
+
getNextOptions = _this$props4.getNextOptions;
|
|
314
263
|
|
|
315
264
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
316
265
|
isNextOptions && getNextOptions && getNextOptions(e);
|
|
@@ -329,58 +278,56 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
329
278
|
}, {
|
|
330
279
|
key: "render",
|
|
331
280
|
value: function render() {
|
|
332
|
-
var
|
|
333
|
-
|
|
334
|
-
var
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
_this$
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
_this$props7$a11y = _this$props7.a11y,
|
|
383
|
-
a11y = _this$props7$a11y === void 0 ? {} : _this$props7$a11y;
|
|
281
|
+
var _this2 = this;
|
|
282
|
+
|
|
283
|
+
var options = this.state.options;
|
|
284
|
+
var _this$props5 = this.props,
|
|
285
|
+
value = _this$props5.value,
|
|
286
|
+
removeClose = _this$props5.removeClose,
|
|
287
|
+
boxSize = _this$props5.boxSize,
|
|
288
|
+
keyName = _this$props5.keyName,
|
|
289
|
+
idName = _this$props5.idName,
|
|
290
|
+
title = _this$props5.title,
|
|
291
|
+
isSearch = _this$props5.isSearch,
|
|
292
|
+
isArrow = _this$props5.isArrow,
|
|
293
|
+
placeHolderText = _this$props5.placeHolderText,
|
|
294
|
+
className = _this$props5.className,
|
|
295
|
+
right = _this$props5.right,
|
|
296
|
+
left = _this$props5.left,
|
|
297
|
+
top = _this$props5.top,
|
|
298
|
+
bottom = _this$props5.bottom,
|
|
299
|
+
isOpen = _this$props5.isPopupOpen,
|
|
300
|
+
isPopupReady = _this$props5.isPopupReady,
|
|
301
|
+
position = _this$props5.position,
|
|
302
|
+
getTargetRef = _this$props5.getTargetRef,
|
|
303
|
+
getContainerRef = _this$props5.getContainerRef,
|
|
304
|
+
dataId = _this$props5.dataId,
|
|
305
|
+
searchBoxSize = _this$props5.searchBoxSize,
|
|
306
|
+
searchEmptyHint = _this$props5.searchEmptyHint,
|
|
307
|
+
searchErrorText = _this$props5.searchErrorText,
|
|
308
|
+
activeStyle = _this$props5.activeStyle,
|
|
309
|
+
_this$props5$showOnHo = _this$props5.showOnHover,
|
|
310
|
+
showOnHover = _this$props5$showOnHo === void 0 ? false : _this$props5$showOnHo,
|
|
311
|
+
isDisabled = _this$props5.isDisabled,
|
|
312
|
+
showIconOnHover = _this$props5.showIconOnHover,
|
|
313
|
+
isReadOnly = _this$props5.isReadOnly,
|
|
314
|
+
hoverStyle = _this$props5.hoverStyle,
|
|
315
|
+
isEditable = _this$props5.isEditable,
|
|
316
|
+
needTick = _this$props5.needTick,
|
|
317
|
+
dataTitle = _this$props5.dataTitle,
|
|
318
|
+
isDataLoaded = _this$props5.isDataLoaded,
|
|
319
|
+
children = _this$props5.children,
|
|
320
|
+
targetAlign = _this$props5.targetAlign,
|
|
321
|
+
needResponsive = _this$props5.needResponsive,
|
|
322
|
+
arrowIconPosition = _this$props5.arrowIconPosition,
|
|
323
|
+
statusColor = _this$props5.statusColor,
|
|
324
|
+
_this$props5$needExte = _this$props5.needExternalPopupState,
|
|
325
|
+
needExternalPopupState = _this$props5$needExte === void 0 ? false : _this$props5$needExte,
|
|
326
|
+
_this$props5$isPopupA = _this$props5.isPopupActive,
|
|
327
|
+
isPopupActive = _this$props5$isPopupA === void 0 ? false : _this$props5$isPopupA,
|
|
328
|
+
needMultiLineText = _this$props5.needMultiLineText,
|
|
329
|
+
_this$props5$a11y = _this$props5.a11y,
|
|
330
|
+
a11y = _this$props5$a11y === void 0 ? {} : _this$props5$a11y;
|
|
384
331
|
var _a11y$tabIndex = a11y.tabIndex,
|
|
385
332
|
tabIndex = _a11y$tabIndex === void 0 ? 0 : _a11y$tabIndex,
|
|
386
333
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
@@ -397,12 +344,11 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
397
344
|
tagName: "button",
|
|
398
345
|
alignBox: "row",
|
|
399
346
|
className: "".concat(_StatusDropdownModule["default"].container, " ").concat(containerClass, " ").concat(_semanticButtonModule["default"].buttonReset),
|
|
400
|
-
|
|
347
|
+
onClick: !showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : null,
|
|
401
348
|
eleRef: getTargetRef,
|
|
402
349
|
align: targetAlign,
|
|
403
350
|
isCover: false,
|
|
404
351
|
dataId: dataId,
|
|
405
|
-
onClick: removeClose,
|
|
406
352
|
disabled: isDisabled || isReadOnly ? true : false,
|
|
407
353
|
"aria-haspopup": isSearch ? 'listbox' : 'menu',
|
|
408
354
|
"aria-expanded": isPopupReady && isEditable ? true : false,
|
|
@@ -410,15 +356,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
410
356
|
"aria-labelledby": ariaLabelledby,
|
|
411
357
|
"aria-label": ariaLabel,
|
|
412
358
|
"aria-disabled": isDisabled || isReadOnly
|
|
413
|
-
},
|
|
414
|
-
className: _StatusDropdownModule["default"].hiddenInput
|
|
415
|
-
}, /*#__PURE__*/_react["default"].createElement(_TextBox["default"], {
|
|
416
|
-
type: "text",
|
|
417
|
-
inputRef: this.inputRef,
|
|
418
|
-
onKeyDown: this.handleKeyDown,
|
|
419
|
-
needAppearance: false,
|
|
420
|
-
placeHolder: placeHolderText
|
|
421
|
-
})) : null, children ? children : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
359
|
+
}, children ? children : /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
422
360
|
className: "".concat(_StatusDropdownModule["default"].value, " toggleDropText"),
|
|
423
361
|
shrink: true,
|
|
424
362
|
tagName: "span",
|
|
@@ -450,17 +388,24 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
450
388
|
customDropBoxWrap: _StatusDropdownModule["default"].dropBoxContainer
|
|
451
389
|
},
|
|
452
390
|
needResponsive: needResponsive,
|
|
453
|
-
isResponsivePadding: true
|
|
391
|
+
isResponsivePadding: true,
|
|
392
|
+
needFocusScope: true,
|
|
393
|
+
onClose: _this2.handleTogglePopup
|
|
454
394
|
}, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isSearch ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
455
395
|
className: _StatusDropdownModule["default"].search
|
|
456
396
|
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
457
397
|
placeHolder: placeHolderText,
|
|
458
|
-
onChange:
|
|
398
|
+
onChange: _this2.handleChange,
|
|
459
399
|
value: searchString,
|
|
460
|
-
onClear:
|
|
461
|
-
size: searchBoxSize
|
|
462
|
-
|
|
463
|
-
|
|
400
|
+
onClear: _this2.onSearchClear,
|
|
401
|
+
size: searchBoxSize // inputRef={this.searchInputRef}
|
|
402
|
+
// onKeyDown={this.handleKeyDown}
|
|
403
|
+
,
|
|
404
|
+
customProps: {
|
|
405
|
+
TextBoxProps: {
|
|
406
|
+
'data-a11y-autofocus': true
|
|
407
|
+
}
|
|
408
|
+
},
|
|
464
409
|
a11y: {
|
|
465
410
|
ariaHaspopup: isSearch ? 'listbox' : 'menu',
|
|
466
411
|
ariaExpanded: isPopupReady,
|
|
@@ -482,34 +427,38 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
482
427
|
shrink: true,
|
|
483
428
|
dataId: "".concat(dataId, "_list"),
|
|
484
429
|
preventParentScroll: "vertical",
|
|
485
|
-
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt)
|
|
486
|
-
|
|
487
|
-
onScroll:
|
|
430
|
+
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt) // eleRef={this.scrollContentRef}
|
|
431
|
+
,
|
|
432
|
+
onScroll: _this2.handleScroll,
|
|
488
433
|
role: isSearch ? 'listbox' : 'menu',
|
|
489
|
-
"
|
|
490
|
-
|
|
434
|
+
tabindex: "-1",
|
|
435
|
+
"data-scroll": "true"
|
|
491
436
|
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, options.map(function (item, i) {
|
|
437
|
+
var listItemText = item[keyName];
|
|
438
|
+
;
|
|
439
|
+
var isActive = value === listItemText;
|
|
492
440
|
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
|
|
493
441
|
key: i
|
|
494
442
|
}, /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
|
|
495
443
|
dataId: "dataid_".concat(i),
|
|
496
|
-
value:
|
|
444
|
+
value: listItemText,
|
|
497
445
|
id: item[idName],
|
|
498
|
-
active:
|
|
499
|
-
onClick:
|
|
500
|
-
index: i
|
|
501
|
-
|
|
446
|
+
active: isActive,
|
|
447
|
+
onClick: _this2.onSelect.bind(_this2, item),
|
|
448
|
+
index: i // highlight={selectedIndex === i}
|
|
449
|
+
,
|
|
502
450
|
needTick: needTick,
|
|
503
|
-
needBorder: false
|
|
504
|
-
|
|
505
|
-
|
|
451
|
+
needBorder: false // onMouseEnter={this.handleMouseEnter}
|
|
452
|
+
// getRef={this.itemRef}
|
|
453
|
+
,
|
|
506
454
|
bulletColor: item[statusColor],
|
|
507
|
-
title:
|
|
455
|
+
title: listItemText,
|
|
508
456
|
needMultiLineText: needMultiLineText,
|
|
457
|
+
autoHover: true,
|
|
509
458
|
a11y: {
|
|
510
459
|
role: isSearch ? 'option' : 'menuitem',
|
|
511
|
-
ariaSelected:
|
|
512
|
-
|
|
460
|
+
ariaSelected: isActive,
|
|
461
|
+
ariaLabel: listItemText
|
|
513
462
|
}
|
|
514
463
|
}));
|
|
515
464
|
})) : isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
|
|
@@ -517,7 +466,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
517
466
|
title: searchErrorText || 'No results',
|
|
518
467
|
description: searchEmptyHint,
|
|
519
468
|
size: "small",
|
|
520
|
-
getEmptyState:
|
|
469
|
+
getEmptyState: _this2.emptySearchSVG
|
|
521
470
|
}) : /*#__PURE__*/_react["default"].createElement("div", {
|
|
522
471
|
className: _StatusDropdownModule["default"].loader
|
|
523
472
|
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null)))));
|
|
@@ -81,12 +81,12 @@
|
|
|
81
81
|
border-bottom: 1px solid var(--zdt_statusdropdown_line_border);
|
|
82
82
|
margin: var(--zd_size9) 0 var(--zd_size10) ;
|
|
83
83
|
}
|
|
84
|
-
.hiddenInput {
|
|
85
|
-
width: 0
|
|
86
|
-
height: 0
|
|
84
|
+
/* .hiddenInput {
|
|
85
|
+
width: 0;
|
|
86
|
+
height: 0;
|
|
87
87
|
opacity: 0;
|
|
88
88
|
}
|
|
89
89
|
.hiddenInput > input {
|
|
90
|
-
width: 100
|
|
91
|
-
padding: 0
|
|
92
|
-
}
|
|
90
|
+
width: 100%;
|
|
91
|
+
padding: 0;
|
|
92
|
+
} */
|
|
@@ -119,7 +119,10 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
119
119
|
var role = a11y.role,
|
|
120
120
|
ariaSelected = a11y.ariaSelected,
|
|
121
121
|
_a11y$ariaHidden = a11y.ariaHidden,
|
|
122
|
-
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden
|
|
122
|
+
ariaHidden = _a11y$ariaHidden === void 0 ? true : _a11y$ariaHidden,
|
|
123
|
+
ariaLabel = a11y.ariaLabel,
|
|
124
|
+
_a11y$insetFocus = a11y.insetFocus,
|
|
125
|
+
insetFocus = _a11y$insetFocus === void 0 ? true : _a11y$insetFocus;
|
|
123
126
|
|
|
124
127
|
if (isLink) {
|
|
125
128
|
options.href = href;
|
|
@@ -129,6 +132,8 @@ var StatusListItem = /*#__PURE__*/function (_React$Component) {
|
|
|
129
132
|
return /*#__PURE__*/_react["default"].createElement(_Layout.Container, _extends({
|
|
130
133
|
role: role,
|
|
131
134
|
"aria-selected": ariaSelected,
|
|
135
|
+
"aria-label": ariaLabel,
|
|
136
|
+
"data-a11y-inset-focus": insetFocus,
|
|
132
137
|
isCover: false,
|
|
133
138
|
align: "baseline",
|
|
134
139
|
alignBox: "row",
|