@zohodesk/dot 1.0.0-temp-184.2 → 1.0.0-temp-186
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/README.md +8 -0
- 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/index.html +1 -1
- package/es/Drawer/Drawer.js +4 -5
- package/es/ExternalLink/ExternalLink.js +4 -5
- package/es/FlipCard/FlipCard.js +14 -12
- package/es/IconButton/IconButton.js +4 -5
- package/es/Link/Link.js +8 -10
- package/es/Message/Message.js +4 -5
- package/es/ToastMessage/ToastMessage.js +2 -4
- package/es/actions/AutoClose.js +2 -1
- package/es/alert/AlertLookup/AlertLookup.js +14 -12
- package/es/avatar/AvatarClose/AvatarClose.js +7 -7
- package/es/avatar/AvatarCollision/AvatarCollision.js +7 -7
- package/es/avatar/AvatarIcon/AvatarIcon.js +4 -5
- package/es/avatar/AvatarStatus/AvatarStatus.js +7 -8
- package/es/avatar/AvatarThread/AvatarThread.js +7 -7
- package/es/avatar/AvatarUser/AvatarUser.js +10 -9
- package/es/avatar/AvatarWithTeam/AvatarWithTeam.js +17 -14
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +28 -24
- package/es/form/fields/CheckBoxField/CheckBoxField.js +15 -13
- package/es/form/fields/CurrencyField/CurrencyField.js +14 -12
- package/es/form/fields/DateField/DateField.js +14 -14
- package/es/form/fields/MultiSelectField/MultiSelectField.js +13 -12
- package/es/form/fields/PhoneField/PhoneField.js +7 -7
- package/es/form/fields/RadioField/RadioField.js +18 -15
- package/es/form/fields/SelectField/SelectField.js +14 -14
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +15 -11
- package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +11 -11
- package/es/form/fields/TextBoxField/TextBoxField.js +14 -14
- package/es/form/fields/TextEditorField/TextEditorField.js +11 -10
- package/es/form/fields/TextEditorWrapper/TextEditorWrapper.js +11 -10
- package/es/form/fields/TextareaField/TextareaField.js +14 -13
- package/es/layout/SubtabLayout/SubtabLayout.js +4 -6
- package/es/list/ListLayout/ListLayout.js +4 -5
- package/es/list/SecondaryText/AccountName.js +12 -12
- package/es/list/SecondaryText/ContactName.js +8 -9
- package/es/list/SecondaryText/Email.js +8 -8
- package/es/list/SecondaryText/PhoneNumber.js +8 -8
- package/es/list/SecondaryText/SecondaryText.js +4 -5
- package/es/list/SecondaryText/TicketId.js +7 -7
- package/es/list/Subject/Subject.js +7 -7
- package/es/list/status/StatusDropdown/StatusDropdown.js +30 -115
- package/es/list/status/StatusDropdown/StatusDropdown.module.css +1 -10
- package/es/list/status/StatusDropdown/props/defaultProps.js +2 -1
- package/es/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/es/list/status/StatusListItem/StatusListItem.js +5 -5
- package/es/lookup/Lookup/Lookup.js +4 -5
- package/es/lookup/header/Search/Search.js +5 -3
- package/es/v1/Drawer/Drawer.js +4 -5
- package/es/v1/ExternalLink/ExternalLink.js +4 -5
- package/es/v1/FlipCard/FlipCard.js +14 -12
- package/es/v1/GlobalNotification/GlobalNotification.js +6 -7
- package/es/v1/IconButton/IconButton.js +4 -5
- package/es/v1/Link/Link.js +8 -10
- package/es/v1/Message/Message.js +4 -5
- package/es/v1/ToastMessage/ToastMessage.js +2 -4
- package/es/v1/actions/AutoClose.js +2 -1
- package/es/v1/alert/AlertLookup/AlertLookup.js +15 -15
- package/es/v1/avatar/AvatarClose/AvatarClose.js +7 -7
- package/es/v1/avatar/AvatarCollision/AvatarCollision.js +7 -7
- package/es/v1/avatar/AvatarIcon/AvatarIcon.js +4 -5
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +7 -8
- package/es/v1/avatar/AvatarThread/AvatarThread.js +7 -7
- package/es/v1/avatar/AvatarUser/AvatarUser.js +10 -9
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +17 -14
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +28 -24
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +15 -13
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +14 -12
- package/es/v1/form/fields/DateField/DateField.js +14 -14
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +13 -12
- package/es/v1/form/fields/PhoneField/PhoneField.js +7 -7
- package/es/v1/form/fields/RadioField/RadioField.js +18 -16
- package/es/v1/form/fields/SelectField/SelectField.js +14 -14
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +15 -11
- package/es/v1/form/fields/TagsMultiSelectField/TagsMultiSelectField.js +11 -11
- package/es/v1/form/fields/TextBoxField/TextBoxField.js +14 -14
- package/es/v1/form/fields/TextEditorField/TextEditorField.js +11 -10
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +11 -10
- package/es/v1/form/fields/TextareaField/TextareaField.js +14 -13
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +4 -6
- package/es/v1/list/ListLayout/ListLayout.js +4 -5
- package/es/v1/list/SecondaryText/AccountName.js +12 -12
- package/es/v1/list/SecondaryText/ContactName.js +8 -9
- package/es/v1/list/SecondaryText/Email.js +8 -8
- package/es/v1/list/SecondaryText/PhoneNumber.js +8 -8
- package/es/v1/list/SecondaryText/SecondaryText.js +4 -5
- package/es/v1/list/SecondaryText/TicketId.js +7 -7
- package/es/v1/list/Subject/Subject.js +7 -7
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +32 -106
- package/es/v1/list/status/StatusDropdown/props/defaultProps.js +2 -1
- package/es/v1/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/es/v1/list/status/StatusListItem/StatusListItem.js +5 -5
- package/es/v1/lookup/Lookup/Lookup.js +4 -5
- package/es/v1/lookup/header/Search/Search.js +5 -3
- package/es/v1/notification/DesktopNotification/DesktopNotification.js +6 -7
- package/es/version2/GlobalNotification/GlobalNotification.js +6 -7
- package/es/version2/lookup/AlertLookup/AlertLookup.js +15 -15
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +6 -7
- package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +77 -161
- package/lib/list/status/StatusDropdown/StatusDropdown.module.css +1 -10
- package/lib/list/status/StatusDropdown/props/defaultProps.js +2 -1
- package/lib/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -1
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +31 -103
- package/lib/v1/list/status/StatusDropdown/props/defaultProps.js +2 -1
- package/lib/v1/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/package.json +3 -3
- package/result.json +1 -1
|
@@ -78,20 +78,13 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
78
78
|
_this = _super.call(this, props);
|
|
79
79
|
_this.state = {
|
|
80
80
|
searchString: '',
|
|
81
|
-
// selectedIndex: 0,
|
|
82
81
|
options: props.options
|
|
83
82
|
};
|
|
84
|
-
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
85
|
-
|
|
83
|
+
_this.handleChange = _this.handleChange.bind(_assertThisInitialized(_this));
|
|
86
84
|
_this.onSelect = _this.onSelect.bind(_assertThisInitialized(_this));
|
|
87
85
|
_this.handleTogglePopup = _this.handleTogglePopup.bind(_assertThisInitialized(_this));
|
|
88
86
|
_this.onSearchClear = _this.onSearchClear.bind(_assertThisInitialized(_this));
|
|
89
|
-
_this.searchList = _this.searchList.bind(_assertThisInitialized(_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
|
-
|
|
87
|
+
_this.searchList = _this.searchList.bind(_assertThisInitialized(_this));
|
|
95
88
|
_this.handleScroll = _this.handleScroll.bind(_assertThisInitialized(_this));
|
|
96
89
|
_this.emptySearchSVG = _this.emptySearchSVG.bind(_assertThisInitialized(_this));
|
|
97
90
|
_this.getAriaId = (0, _IdProvider.getUniqueId)(_assertThisInitialized(_this));
|
|
@@ -104,16 +97,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
104
97
|
return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
|
|
105
98
|
size: "small"
|
|
106
99
|
});
|
|
107
|
-
}
|
|
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
|
-
|
|
100
|
+
}
|
|
117
101
|
}, {
|
|
118
102
|
key: "handleTogglePopup",
|
|
119
103
|
value: function handleTogglePopup(e) {
|
|
@@ -126,13 +110,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
126
110
|
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
127
111
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
128
112
|
togglePopup(e, boxPosition);
|
|
129
|
-
}
|
|
130
|
-
// let { isPopupOpen } = this.props;
|
|
131
|
-
// if (isPopupOpen) {
|
|
132
|
-
// this.optionsContainer = el;
|
|
133
|
-
// }
|
|
134
|
-
// }
|
|
135
|
-
|
|
113
|
+
}
|
|
136
114
|
}, {
|
|
137
115
|
key: "componentWillReceiveProps",
|
|
138
116
|
value: function componentWillReceiveProps(nextProps) {
|
|
@@ -157,68 +135,10 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
157
135
|
}, {
|
|
158
136
|
key: "componentDidUpdate",
|
|
159
137
|
value: function componentDidUpdate(prevProps) {
|
|
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
|
-
// }
|
|
176
138
|
if (!prevProps.isPopupOpen && this.props.isPopupOpen) {
|
|
177
139
|
this.onSearchClear();
|
|
178
140
|
}
|
|
179
|
-
}
|
|
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
|
-
// }
|
|
221
|
-
|
|
141
|
+
}
|
|
222
142
|
}, {
|
|
223
143
|
key: "searchList",
|
|
224
144
|
value: function searchList(value) {
|
|
@@ -236,7 +156,6 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
236
156
|
var foptions = this.searchList(value);
|
|
237
157
|
this.setState({
|
|
238
158
|
searchString: value,
|
|
239
|
-
// selectedIndex: -1,
|
|
240
159
|
options: foptions
|
|
241
160
|
});
|
|
242
161
|
}
|
|
@@ -248,21 +167,14 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
248
167
|
searchString: '',
|
|
249
168
|
options: foptions
|
|
250
169
|
});
|
|
251
|
-
}
|
|
252
|
-
// this.setState({
|
|
253
|
-
// selectedIndex: index
|
|
254
|
-
// });
|
|
255
|
-
// }
|
|
256
|
-
|
|
170
|
+
}
|
|
257
171
|
}, {
|
|
258
172
|
key: "handleScroll",
|
|
259
173
|
value: function handleScroll(e) {
|
|
260
|
-
var
|
|
261
|
-
isNextOptions = _this$props4.isNextOptions,
|
|
262
|
-
getNextOptions = _this$props4.getNextOptions;
|
|
174
|
+
var getNextOptions = this.props.getNextOptions;
|
|
263
175
|
|
|
264
176
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
265
|
-
|
|
177
|
+
getNextOptions && getNextOptions(e);
|
|
266
178
|
}
|
|
267
179
|
}
|
|
268
180
|
}, {
|
|
@@ -281,53 +193,55 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
281
193
|
var _this2 = this;
|
|
282
194
|
|
|
283
195
|
var options = this.state.options;
|
|
284
|
-
var _this$
|
|
285
|
-
value = _this$
|
|
286
|
-
removeClose = _this$
|
|
287
|
-
boxSize = _this$
|
|
288
|
-
keyName = _this$
|
|
289
|
-
idName = _this$
|
|
290
|
-
title = _this$
|
|
291
|
-
isSearch = _this$
|
|
292
|
-
isArrow = _this$
|
|
293
|
-
placeHolderText = _this$
|
|
294
|
-
className = _this$
|
|
295
|
-
right = _this$
|
|
296
|
-
left = _this$
|
|
297
|
-
top = _this$
|
|
298
|
-
bottom = _this$
|
|
299
|
-
isOpen = _this$
|
|
300
|
-
isPopupReady = _this$
|
|
301
|
-
position = _this$
|
|
302
|
-
getTargetRef = _this$
|
|
303
|
-
getContainerRef = _this$
|
|
304
|
-
dataId = _this$
|
|
305
|
-
searchBoxSize = _this$
|
|
306
|
-
searchEmptyHint = _this$
|
|
307
|
-
searchErrorText = _this$
|
|
308
|
-
activeStyle = _this$
|
|
309
|
-
_this$
|
|
310
|
-
showOnHover = _this$
|
|
311
|
-
isDisabled = _this$
|
|
312
|
-
showIconOnHover = _this$
|
|
313
|
-
isReadOnly = _this$
|
|
314
|
-
hoverStyle = _this$
|
|
315
|
-
isEditable = _this$
|
|
316
|
-
needTick = _this$
|
|
317
|
-
dataTitle = _this$
|
|
318
|
-
isDataLoaded = _this$
|
|
319
|
-
children = _this$
|
|
320
|
-
targetAlign = _this$
|
|
321
|
-
needResponsive = _this$
|
|
322
|
-
arrowIconPosition = _this$
|
|
323
|
-
statusColor = _this$
|
|
324
|
-
_this$
|
|
325
|
-
needExternalPopupState = _this$
|
|
326
|
-
_this$
|
|
327
|
-
isPopupActive = _this$
|
|
328
|
-
needMultiLineText = _this$
|
|
329
|
-
|
|
330
|
-
|
|
196
|
+
var _this$props4 = this.props,
|
|
197
|
+
value = _this$props4.value,
|
|
198
|
+
removeClose = _this$props4.removeClose,
|
|
199
|
+
boxSize = _this$props4.boxSize,
|
|
200
|
+
keyName = _this$props4.keyName,
|
|
201
|
+
idName = _this$props4.idName,
|
|
202
|
+
title = _this$props4.title,
|
|
203
|
+
isSearch = _this$props4.isSearch,
|
|
204
|
+
isArrow = _this$props4.isArrow,
|
|
205
|
+
placeHolderText = _this$props4.placeHolderText,
|
|
206
|
+
className = _this$props4.className,
|
|
207
|
+
right = _this$props4.right,
|
|
208
|
+
left = _this$props4.left,
|
|
209
|
+
top = _this$props4.top,
|
|
210
|
+
bottom = _this$props4.bottom,
|
|
211
|
+
isOpen = _this$props4.isPopupOpen,
|
|
212
|
+
isPopupReady = _this$props4.isPopupReady,
|
|
213
|
+
position = _this$props4.position,
|
|
214
|
+
getTargetRef = _this$props4.getTargetRef,
|
|
215
|
+
getContainerRef = _this$props4.getContainerRef,
|
|
216
|
+
dataId = _this$props4.dataId,
|
|
217
|
+
searchBoxSize = _this$props4.searchBoxSize,
|
|
218
|
+
searchEmptyHint = _this$props4.searchEmptyHint,
|
|
219
|
+
searchErrorText = _this$props4.searchErrorText,
|
|
220
|
+
activeStyle = _this$props4.activeStyle,
|
|
221
|
+
_this$props4$showOnHo = _this$props4.showOnHover,
|
|
222
|
+
showOnHover = _this$props4$showOnHo === void 0 ? false : _this$props4$showOnHo,
|
|
223
|
+
isDisabled = _this$props4.isDisabled,
|
|
224
|
+
showIconOnHover = _this$props4.showIconOnHover,
|
|
225
|
+
isReadOnly = _this$props4.isReadOnly,
|
|
226
|
+
hoverStyle = _this$props4.hoverStyle,
|
|
227
|
+
isEditable = _this$props4.isEditable,
|
|
228
|
+
needTick = _this$props4.needTick,
|
|
229
|
+
dataTitle = _this$props4.dataTitle,
|
|
230
|
+
isDataLoaded = _this$props4.isDataLoaded,
|
|
231
|
+
children = _this$props4.children,
|
|
232
|
+
targetAlign = _this$props4.targetAlign,
|
|
233
|
+
needResponsive = _this$props4.needResponsive,
|
|
234
|
+
arrowIconPosition = _this$props4.arrowIconPosition,
|
|
235
|
+
statusColor = _this$props4.statusColor,
|
|
236
|
+
_this$props4$needExte = _this$props4.needExternalPopupState,
|
|
237
|
+
needExternalPopupState = _this$props4$needExte === void 0 ? false : _this$props4$needExte,
|
|
238
|
+
_this$props4$isPopupA = _this$props4.isPopupActive,
|
|
239
|
+
isPopupActive = _this$props4$isPopupA === void 0 ? false : _this$props4$isPopupA,
|
|
240
|
+
needMultiLineText = _this$props4.needMultiLineText,
|
|
241
|
+
isFetchingOptions = _this$props4.isFetchingOptions,
|
|
242
|
+
getNextOptions = _this$props4.getNextOptions,
|
|
243
|
+
_this$props4$a11y = _this$props4.a11y,
|
|
244
|
+
a11y = _this$props4$a11y === void 0 ? {} : _this$props4$a11y;
|
|
331
245
|
var _a11y$tabIndex = a11y.tabIndex,
|
|
332
246
|
tabIndex = _a11y$tabIndex === void 0 ? 0 : _a11y$tabIndex,
|
|
333
247
|
ariaLabelledby = a11y.ariaLabelledby,
|
|
@@ -390,7 +304,14 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
390
304
|
needResponsive: needResponsive,
|
|
391
305
|
isResponsivePadding: true,
|
|
392
306
|
needFocusScope: true,
|
|
393
|
-
onClose: _this2.handleTogglePopup
|
|
307
|
+
onClose: _this2.handleTogglePopup,
|
|
308
|
+
customProps: {
|
|
309
|
+
focusScopeProps: {
|
|
310
|
+
loadNextOptions: getNextOptions,
|
|
311
|
+
searchValue: searchString,
|
|
312
|
+
isFetchingOptions: isFetchingOptions
|
|
313
|
+
}
|
|
314
|
+
}
|
|
394
315
|
}, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isSearch ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
395
316
|
className: _StatusDropdownModule["default"].search
|
|
396
317
|
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
@@ -398,9 +319,7 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
398
319
|
onChange: _this2.handleChange,
|
|
399
320
|
value: searchString,
|
|
400
321
|
onClear: _this2.onSearchClear,
|
|
401
|
-
size: searchBoxSize
|
|
402
|
-
// onKeyDown={this.handleKeyDown}
|
|
403
|
-
,
|
|
322
|
+
size: searchBoxSize,
|
|
404
323
|
customProps: {
|
|
405
324
|
TextBoxProps: {
|
|
406
325
|
'data-a11y-autofocus': true
|
|
@@ -427,30 +346,24 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
427
346
|
shrink: true,
|
|
428
347
|
dataId: "".concat(dataId, "_list"),
|
|
429
348
|
preventParentScroll: "vertical",
|
|
430
|
-
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt)
|
|
431
|
-
,
|
|
349
|
+
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt),
|
|
432
350
|
onScroll: _this2.handleScroll,
|
|
433
351
|
role: isSearch ? 'listbox' : 'menu',
|
|
434
352
|
tabindex: "-1",
|
|
435
|
-
|
|
353
|
+
isScrollAttribute: true
|
|
436
354
|
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, options.map(function (item, i) {
|
|
437
355
|
var listItemText = item[keyName];
|
|
438
|
-
;
|
|
439
356
|
var isActive = value === listItemText;
|
|
440
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
441
|
-
key: i
|
|
442
|
-
}, /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
|
|
357
|
+
return /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
|
|
358
|
+
key: i,
|
|
443
359
|
dataId: "dataid_".concat(i),
|
|
444
360
|
value: listItemText,
|
|
445
361
|
id: item[idName],
|
|
446
362
|
active: isActive,
|
|
447
363
|
onClick: _this2.onSelect.bind(_this2, item),
|
|
448
|
-
index: i
|
|
449
|
-
,
|
|
364
|
+
index: i,
|
|
450
365
|
needTick: needTick,
|
|
451
|
-
needBorder: false
|
|
452
|
-
// getRef={this.itemRef}
|
|
453
|
-
,
|
|
366
|
+
needBorder: false,
|
|
454
367
|
bulletColor: item[statusColor],
|
|
455
368
|
title: listItemText,
|
|
456
369
|
needMultiLineText: needMultiLineText,
|
|
@@ -460,8 +373,11 @@ var StatusDropdown = /*#__PURE__*/function (_React$Component) {
|
|
|
460
373
|
ariaSelected: isActive,
|
|
461
374
|
ariaLabel: listItemText
|
|
462
375
|
}
|
|
463
|
-
})
|
|
464
|
-
})
|
|
376
|
+
});
|
|
377
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
378
|
+
isCover: false,
|
|
379
|
+
align: "both"
|
|
380
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))) : isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
|
|
465
381
|
className: _StatusDropdownModule["default"].svgWrapper,
|
|
466
382
|
title: searchErrorText || 'No results',
|
|
467
383
|
description: searchEmptyHint,
|
|
@@ -80,13 +80,4 @@
|
|
|
80
80
|
height: var(--zd_size1) ;
|
|
81
81
|
border-bottom: 1px solid var(--zdt_statusdropdown_line_border);
|
|
82
82
|
margin: var(--zd_size9) 0 var(--zd_size10) ;
|
|
83
|
-
}
|
|
84
|
-
/* .hiddenInput {
|
|
85
|
-
width: 0;
|
|
86
|
-
height: 0;
|
|
87
|
-
opacity: 0;
|
|
88
|
-
}
|
|
89
|
-
.hiddenInput > input {
|
|
90
|
-
width: 100%;
|
|
91
|
-
padding: 0;
|
|
92
|
-
} */
|
|
83
|
+
}
|
|
@@ -30,5 +30,5 @@ var propTypes = (_propTypes = {
|
|
|
30
30
|
idName: _propTypes2["default"].string,
|
|
31
31
|
isArrow: _propTypes2["default"].bool,
|
|
32
32
|
isDataLoaded: _propTypes2["default"].bool
|
|
33
|
-
}, _defineProperty(_propTypes, "isDataLoaded", _propTypes2["default"].bool), _defineProperty(_propTypes, "isDisabled", _propTypes2["default"].bool), _defineProperty(_propTypes, "isEditable", _propTypes2["default"].bool), _defineProperty(_propTypes, "
|
|
33
|
+
}, _defineProperty(_propTypes, "isDataLoaded", _propTypes2["default"].bool), _defineProperty(_propTypes, "isDisabled", _propTypes2["default"].bool), _defineProperty(_propTypes, "isEditable", _propTypes2["default"].bool), _defineProperty(_propTypes, "isFetchingOptions", _propTypes2["default"].bool), _defineProperty(_propTypes, "isPopupActive", _propTypes2["default"].bool), _defineProperty(_propTypes, "isPopupOpen", _propTypes2["default"].bool), _defineProperty(_propTypes, "isPopupReady", _propTypes2["default"].bool), _defineProperty(_propTypes, "isReadOnly", _propTypes2["default"].bool), _defineProperty(_propTypes, "isSearch", _propTypes2["default"].bool), _defineProperty(_propTypes, "keyName", _propTypes2["default"].string), _defineProperty(_propTypes, "left", _propTypes2["default"].number), _defineProperty(_propTypes, "needExternalPopupState", _propTypes2["default"].bool), _defineProperty(_propTypes, "needResponsive", _propTypes2["default"].bool), _defineProperty(_propTypes, "needTick", _propTypes2["default"].bool), _defineProperty(_propTypes, "onClick", _propTypes2["default"].func), _defineProperty(_propTypes, "onTogglePopup", _propTypes2["default"].func), _defineProperty(_propTypes, "options", _propTypes2["default"].array.isRequired), _defineProperty(_propTypes, "placeHolderText", _propTypes2["default"].string), _defineProperty(_propTypes, "position", _propTypes2["default"].string), _defineProperty(_propTypes, "removeClose", _propTypes2["default"].func), _defineProperty(_propTypes, "right", _propTypes2["default"].number), _defineProperty(_propTypes, "searchBoxSize", _propTypes2["default"].oneOf(['small', 'medium', 'xmedium'])), _defineProperty(_propTypes, "searchEmptyHint", _propTypes2["default"].string), _defineProperty(_propTypes, "searchErrorText", _propTypes2["default"].string), _defineProperty(_propTypes, "showIconOnHover", _propTypes2["default"].bool), _defineProperty(_propTypes, "showOnHover", _propTypes2["default"].bool), _defineProperty(_propTypes, "statusColor", _propTypes2["default"].string), _defineProperty(_propTypes, "targetAlign", _propTypes2["default"].oneOf(['vertical', 'horizontal', 'both', 'top', 'right', 'bottom', 'left', 'between', 'around'])), _defineProperty(_propTypes, "title", _propTypes2["default"].string), _defineProperty(_propTypes, "togglePopup", _propTypes2["default"].func), _defineProperty(_propTypes, "value", _propTypes2["default"].node), _defineProperty(_propTypes, "needMultiLineText", _propTypes2["default"].bool), _defineProperty(_propTypes, "onSelectLabel", _propTypes2["default"].func), _defineProperty(_propTypes, "top", _propTypes2["default"].number), _defineProperty(_propTypes, "a11y", _propTypes2["default"].object), _propTypes);
|
|
34
34
|
exports.propTypes = propTypes;
|
|
@@ -322,7 +322,8 @@ var TagsMultiSelect = /*#__PURE__*/function (_React$Component) {
|
|
|
322
322
|
eleRef: _this3.getContainerRef
|
|
323
323
|
}, searchList.length ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
324
324
|
flexible: true,
|
|
325
|
-
shrink: true
|
|
325
|
+
shrink: true,
|
|
326
|
+
dataId: "".concat(dataId, "_Options")
|
|
326
327
|
}, searchList.map(function (item, index) {
|
|
327
328
|
var name = item.name,
|
|
328
329
|
isNew = item.isNew,
|
|
@@ -113,7 +113,7 @@ function StatusDropdown(props) {
|
|
|
113
113
|
onTogglePopup = props.onTogglePopup,
|
|
114
114
|
onClick = props.onClick,
|
|
115
115
|
onSelectLabel = props.onSelectLabel,
|
|
116
|
-
|
|
116
|
+
isFetchingOptions = props.isFetchingOptions,
|
|
117
117
|
getNextOptions = props.getNextOptions,
|
|
118
118
|
options = props.options,
|
|
119
119
|
_props$a11y = props.a11y,
|
|
@@ -122,17 +122,12 @@ function StatusDropdown(props) {
|
|
|
122
122
|
var _useState = (0, _react.useState)(options),
|
|
123
123
|
_useState2 = _slicedToArray(_useState, 2),
|
|
124
124
|
optionsList = _useState2[0],
|
|
125
|
-
setOptionsList = _useState2[1];
|
|
126
|
-
|
|
125
|
+
setOptionsList = _useState2[1];
|
|
127
126
|
|
|
128
127
|
var _useState3 = (0, _react.useState)(''),
|
|
129
128
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
130
129
|
searchString = _useState4[0],
|
|
131
|
-
setSearchString = _useState4[1];
|
|
132
|
-
// const searchInput = useRef(null);
|
|
133
|
-
// const optionsContainer = useRef(null);
|
|
134
|
-
// const dropdown = useRef({});
|
|
135
|
-
|
|
130
|
+
setSearchString = _useState4[1];
|
|
136
131
|
|
|
137
132
|
var getAriaId = (0, _IdProvider.useUniqueId)();
|
|
138
133
|
var _a11y$tabIndex = a11y.tabIndex,
|
|
@@ -147,72 +142,19 @@ function StatusDropdown(props) {
|
|
|
147
142
|
return /*#__PURE__*/_react["default"].createElement(_EmptySearch["default"], {
|
|
148
143
|
size: "small"
|
|
149
144
|
});
|
|
150
|
-
}
|
|
151
|
-
// hiddenInput.current = el;
|
|
152
|
-
// }
|
|
153
|
-
// function itemRef(ele, index, id) {
|
|
154
|
-
// dropdown.current[`suggestion_${id}`] = ele;
|
|
155
|
-
// }
|
|
156
|
-
// function searchInputRef(el) {
|
|
157
|
-
// searchInput.current = el;
|
|
158
|
-
// }
|
|
159
|
-
|
|
145
|
+
}
|
|
160
146
|
|
|
161
147
|
function handleTogglePopup(e) {
|
|
162
148
|
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
163
149
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
164
150
|
togglePopup(e, boxPosition);
|
|
165
|
-
}
|
|
166
|
-
// if (isPopupOpen) {
|
|
167
|
-
// optionsContainer.current = el;
|
|
168
|
-
// }
|
|
169
|
-
// }
|
|
170
|
-
|
|
151
|
+
}
|
|
171
152
|
|
|
172
153
|
function onSelect(element, e) {
|
|
173
154
|
onClick && onClick(e, element);
|
|
174
155
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
175
156
|
togglePopup(e);
|
|
176
|
-
}
|
|
177
|
-
// let { keyCode } = e;
|
|
178
|
-
// let totalIndex = optionsList.length;
|
|
179
|
-
// if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
180
|
-
// e.preventDefault(); //prevent body scroll
|
|
181
|
-
// }
|
|
182
|
-
// if (isPopupReady) {
|
|
183
|
-
// switch (keyCode) {
|
|
184
|
-
// case 40:
|
|
185
|
-
// if (selectedIndex === totalIndex - 1) {
|
|
186
|
-
// setSelectedIndex(0);
|
|
187
|
-
// } else {
|
|
188
|
-
// if (selectedIndex === totalIndex - 3) {
|
|
189
|
-
// isNextOptions && getNextOptions && getNextOptions();
|
|
190
|
-
// }
|
|
191
|
-
// setSelectedIndex(selectedIndex + 1);
|
|
192
|
-
// }
|
|
193
|
-
// break;
|
|
194
|
-
// case 38:
|
|
195
|
-
// if (selectedIndex === 0) {
|
|
196
|
-
// setSelectedIndex(totalIndex - 1);
|
|
197
|
-
// } else {
|
|
198
|
-
// setSelectedIndex(selectedIndex - 1);
|
|
199
|
-
// }
|
|
200
|
-
// break;
|
|
201
|
-
// case 13:
|
|
202
|
-
// onClick && onClick(optionsList[selectedIndex].name, e);
|
|
203
|
-
// onTogglePopup && onTogglePopup(isPopupOpen);
|
|
204
|
-
// togglePopup(e, boxPosition);
|
|
205
|
-
// break;
|
|
206
|
-
// default:
|
|
207
|
-
// break;
|
|
208
|
-
// }
|
|
209
|
-
// } else {
|
|
210
|
-
// if (keyCode === 13 || keyCode === 40) {
|
|
211
|
-
// togglePopup(e, boxPosition);
|
|
212
|
-
// }
|
|
213
|
-
// }
|
|
214
|
-
// }
|
|
215
|
-
|
|
157
|
+
}
|
|
216
158
|
|
|
217
159
|
function searchList(value) {
|
|
218
160
|
var foptions = options.filter(function (dept) {
|
|
@@ -223,8 +165,7 @@ function StatusDropdown(props) {
|
|
|
223
165
|
|
|
224
166
|
function handleChange(value, e) {
|
|
225
167
|
var foptions = searchList(value);
|
|
226
|
-
setSearchString(value);
|
|
227
|
-
|
|
168
|
+
setSearchString(value);
|
|
228
169
|
setOptionsList(foptions);
|
|
229
170
|
}
|
|
230
171
|
|
|
@@ -232,14 +173,11 @@ function StatusDropdown(props) {
|
|
|
232
173
|
var foptions = searchList('');
|
|
233
174
|
setSearchString('');
|
|
234
175
|
setOptionsList(foptions);
|
|
235
|
-
}
|
|
236
|
-
// setSelectedIndex(index);
|
|
237
|
-
// }
|
|
238
|
-
|
|
176
|
+
}
|
|
239
177
|
|
|
240
178
|
function handleScroll(e) {
|
|
241
179
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
242
|
-
|
|
180
|
+
getNextOptions && getNextOptions(e);
|
|
243
181
|
}
|
|
244
182
|
}
|
|
245
183
|
|
|
@@ -256,19 +194,7 @@ function StatusDropdown(props) {
|
|
|
256
194
|
setOptionsList(options);
|
|
257
195
|
}, [options.length]);
|
|
258
196
|
(0, _hooks.useEffectCallOnlyAfterState)(function () {
|
|
259
|
-
|
|
260
|
-
onSearchClear();
|
|
261
|
-
} // setTimeout(() => {
|
|
262
|
-
// isPopupOpen && isSearch
|
|
263
|
-
// ? searchInput.current && searchInput.current.focus()
|
|
264
|
-
// : hiddenInput.current && hiddenInput.current.focus();
|
|
265
|
-
// }, 10);
|
|
266
|
-
// let mergeOptions = optionsList;
|
|
267
|
-
// let option = mergeOptions[selectedIndex];
|
|
268
|
-
// let id = (option && option[idName]) || {};
|
|
269
|
-
// let selSuggestion = dropdown.current[`suggestion_${id}`];
|
|
270
|
-
// optionsContainer.current && scrollTo(optionsContainer.current, selSuggestion);
|
|
271
|
-
|
|
197
|
+
isPopupOpen && onSearchClear();
|
|
272
198
|
}, [isPopupOpen]);
|
|
273
199
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
274
200
|
className: _StatusDropdownModule["default"].posRel,
|
|
@@ -282,8 +208,7 @@ function StatusDropdown(props) {
|
|
|
282
208
|
eleRef: getTargetRef,
|
|
283
209
|
align: targetAlign,
|
|
284
210
|
isCover: false,
|
|
285
|
-
dataId: dataId
|
|
286
|
-
,
|
|
211
|
+
dataId: dataId,
|
|
287
212
|
disabled: isDisabled || isReadOnly ? true : false,
|
|
288
213
|
"aria-haspopup": isSearch ? 'listbox' : 'menu',
|
|
289
214
|
"aria-expanded": isPopupReady && isEditable ? true : false,
|
|
@@ -325,7 +250,14 @@ function StatusDropdown(props) {
|
|
|
325
250
|
needResponsive: needResponsive,
|
|
326
251
|
isResponsivePadding: true,
|
|
327
252
|
needFocusScope: true,
|
|
328
|
-
onClose: handleTogglePopup
|
|
253
|
+
onClose: handleTogglePopup,
|
|
254
|
+
customProps: {
|
|
255
|
+
focusScopeProps: {
|
|
256
|
+
searchValue: searchString,
|
|
257
|
+
loadNextOptions: getNextOptions,
|
|
258
|
+
isFetchingOptions: isFetchingOptions
|
|
259
|
+
}
|
|
260
|
+
}
|
|
329
261
|
}, /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, isSearch ? /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
|
|
330
262
|
className: _StatusDropdownModule["default"].search
|
|
331
263
|
}, /*#__PURE__*/_react["default"].createElement(_TextBoxIcon["default"], {
|
|
@@ -333,9 +265,7 @@ function StatusDropdown(props) {
|
|
|
333
265
|
onChange: handleChange,
|
|
334
266
|
value: searchString,
|
|
335
267
|
onClear: onSearchClear,
|
|
336
|
-
size: searchBoxSize
|
|
337
|
-
// onKeyDown={handleKeyDown}
|
|
338
|
-
,
|
|
268
|
+
size: searchBoxSize,
|
|
339
269
|
customProps: {
|
|
340
270
|
TextBoxProps: {
|
|
341
271
|
'data-a11y-autofocus': true
|
|
@@ -362,18 +292,16 @@ function StatusDropdown(props) {
|
|
|
362
292
|
shrink: true,
|
|
363
293
|
dataId: "".concat(dataId, "_list"),
|
|
364
294
|
preventParentScroll: "vertical",
|
|
365
|
-
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt)
|
|
366
|
-
,
|
|
295
|
+
className: "".concat(tabletMode ? _StatusDropdownModule["default"].responsivemaxHgt : _StatusDropdownModule["default"].maxHgt),
|
|
367
296
|
onScroll: handleScroll,
|
|
368
297
|
role: isSearch ? 'listbox' : 'menu',
|
|
369
298
|
tabindex: "-1",
|
|
370
|
-
|
|
299
|
+
isScrollAttribute: true
|
|
371
300
|
}, optionsList.length != 0 && isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, optionsList.map(function (item, i) {
|
|
372
301
|
var listItemText = item[keyName];
|
|
373
302
|
var isActive = value === listItemText;
|
|
374
|
-
return /*#__PURE__*/_react["default"].createElement(
|
|
375
|
-
key: i
|
|
376
|
-
}, /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
|
|
303
|
+
return /*#__PURE__*/_react["default"].createElement(_StatusListItem["default"], {
|
|
304
|
+
key: i,
|
|
377
305
|
dataId: "dataid_".concat(i),
|
|
378
306
|
value: listItemText,
|
|
379
307
|
id: item[idName],
|
|
@@ -381,12 +309,9 @@ function StatusDropdown(props) {
|
|
|
381
309
|
onClick: function onClick(e) {
|
|
382
310
|
return onSelect(item, e);
|
|
383
311
|
},
|
|
384
|
-
index: i
|
|
385
|
-
,
|
|
312
|
+
index: i,
|
|
386
313
|
needTick: needTick,
|
|
387
|
-
needBorder: false
|
|
388
|
-
// getRef={itemRef}
|
|
389
|
-
,
|
|
314
|
+
needBorder: false,
|
|
390
315
|
bulletColor: item[statusColor],
|
|
391
316
|
title: listItemText,
|
|
392
317
|
needMultiLineText: needMultiLineText,
|
|
@@ -396,8 +321,11 @@ function StatusDropdown(props) {
|
|
|
396
321
|
ariaSelected: isActive,
|
|
397
322
|
ariaLabel: listItemText
|
|
398
323
|
}
|
|
399
|
-
})
|
|
400
|
-
})
|
|
324
|
+
});
|
|
325
|
+
}), isFetchingOptions && /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
|
|
326
|
+
isCover: false,
|
|
327
|
+
align: "both"
|
|
328
|
+
}, /*#__PURE__*/_react["default"].createElement(_Loader["default"], null))) : isDataLoaded ? /*#__PURE__*/_react["default"].createElement(_CommonEmptyState["default"], {
|
|
401
329
|
className: _StatusDropdownModule["default"].svgWrapper,
|
|
402
330
|
title: searchErrorText || 'No results',
|
|
403
331
|
description: searchEmptyHint,
|