@zohodesk/dot 1.4.13 → 1.4.15
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 +14 -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 +2 -5
- 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/ActionButton/ActionButton.module.css +51 -4
- package/es/AlphabeticList/AlphabeticList.module.css +0 -2
- package/es/AttachmentViewer/AttachmentViewer.module.css +0 -2
- package/es/ChannelIcon/ChannelIcon.module.css +9 -4
- package/es/FormAction/FormAction.module.css +18 -1
- package/es/IconButton/IconButton.module.css +0 -1
- package/es/TagWithIcon/TagWithIcon.module.css +0 -3
- package/es/avatar/AvatarIcon/AvatarIcon.module.css +0 -6
- package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +0 -4
- package/es/form/fields/ValidationMessage/ValidationMessage.module.css +0 -1
- package/es/layout/SubtabLayout/SubtabLayout.module.css +0 -2
- package/es/list/Comment/Comment.module.css +0 -1
- package/es/list/Dot/Dot.module.css +0 -1
- package/es/list/ListLayout/ListLayout.module.css +0 -6
- package/es/list/Subject/Subject.module.css +8 -1
- package/es/list/Thread/Thread.js +1 -2
- package/es/list/Thread/Thread.module.css +0 -1
- package/es/list/status/StatusDropdown/StatusDropdown.js +50 -179
- 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 -1
- package/es/lookup/Lookup/Lookup.js +3 -2
- package/es/lookup/Lookup/Lookup.module.css +4 -1
- package/es/lookup/Lookup/props/propTypes.js +3 -2
- package/es/lookup/header/TicketHeader/TicketHeader.js +88 -73
- package/es/lookup/header/TicketHeader/props/defaultProps.js +7 -1
- package/es/lookup/header/TicketHeader/props/propTypes.js +2 -1
- package/es/v1/list/Thread/Thread.js +1 -2
- package/es/v1/list/status/StatusDropdown/StatusDropdown.js +49 -134
- 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 -1
- package/es/v1/lookup/Lookup/Lookup.js +3 -2
- package/es/v1/lookup/Lookup/props/propTypes.js +3 -2
- package/es/v1/lookup/header/TicketHeader/TicketHeader.js +30 -12
- package/es/v1/lookup/header/TicketHeader/props/defaultProps.js +7 -1
- package/es/v1/lookup/header/TicketHeader/props/propTypes.js +2 -1
- package/es/version2/GlobalNotification/GlobalNotification.module.css +0 -4
- package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +0 -1
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +0 -2
- package/lib/ActionButton/ActionButton.module.css +51 -4
- package/lib/AlphabeticList/AlphabeticList.module.css +0 -2
- package/lib/AttachmentViewer/AttachmentViewer.module.css +0 -2
- package/lib/ChannelIcon/ChannelIcon.module.css +9 -4
- package/lib/FormAction/FormAction.module.css +18 -1
- package/lib/IconButton/IconButton.module.css +0 -1
- package/lib/TagWithIcon/TagWithIcon.module.css +0 -3
- package/lib/avatar/AvatarIcon/AvatarIcon.module.css +0 -6
- package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +0 -4
- package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +0 -1
- package/lib/layout/SubtabLayout/SubtabLayout.module.css +0 -2
- package/lib/list/Comment/Comment.module.css +0 -1
- package/lib/list/Dot/Dot.module.css +0 -1
- package/lib/list/ListLayout/ListLayout.module.css +0 -6
- package/lib/list/Subject/Subject.module.css +8 -1
- package/lib/list/Thread/Thread.js +1 -2
- package/lib/list/Thread/Thread.module.css +0 -1
- package/lib/list/status/StatusDropdown/StatusDropdown.js +96 -231
- 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/list/status/StatusListItem/StatusListItem.js +6 -1
- package/lib/lookup/Lookup/Lookup.js +3 -2
- package/lib/lookup/Lookup/Lookup.module.css +4 -1
- package/lib/lookup/Lookup/props/propTypes.js +3 -2
- package/lib/lookup/header/TicketHeader/TicketHeader.js +93 -106
- package/lib/lookup/header/TicketHeader/props/defaultProps.js +7 -1
- package/lib/lookup/header/TicketHeader/props/propTypes.js +2 -1
- package/lib/v1/list/Thread/Thread.js +1 -2
- package/lib/v1/list/status/StatusDropdown/StatusDropdown.js +41 -132
- package/lib/v1/list/status/StatusDropdown/props/defaultProps.js +2 -1
- package/lib/v1/list/status/StatusDropdown/props/propTypes.js +1 -1
- package/lib/v1/list/status/StatusListItem/StatusListItem.js +6 -1
- package/lib/v1/lookup/Lookup/Lookup.js +3 -2
- package/lib/v1/lookup/Lookup/props/propTypes.js +3 -2
- package/lib/v1/lookup/header/TicketHeader/TicketHeader.js +37 -12
- package/lib/v1/lookup/header/TicketHeader/props/defaultProps.js +7 -1
- package/lib/v1/lookup/header/TicketHeader/props/propTypes.js +2 -1
- package/lib/version2/GlobalNotification/GlobalNotification.module.css +0 -4
- package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +0 -1
- package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +0 -2
- package/package.json +12 -12
- package/result.json +1 -1
|
@@ -8,8 +8,6 @@ import DropDownHeading from '@zohodesk/components/lib/DropDown/DropDownHeading';
|
|
|
8
8
|
import TextBoxIcon from '@zohodesk/components/lib/TextBoxIcon/TextBoxIcon';
|
|
9
9
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
10
10
|
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
11
|
-
import { scrollTo } from '@zohodesk/components/lib/utils/Common.js';
|
|
12
|
-
import TextBox from '@zohodesk/components/lib/TextBox/TextBox';
|
|
13
11
|
import CommonEmptyState from '../../../emptystate/CommonEmptyState/CommonEmptyState';
|
|
14
12
|
import StatusListItem from '../StatusListItem/StatusListItem';
|
|
15
13
|
import commonStyle from '@zohodesk/components/lib/common/common.module.css';
|
|
@@ -23,20 +21,13 @@ export class StatusDropdown extends React.Component {
|
|
|
23
21
|
super(props);
|
|
24
22
|
this.state = {
|
|
25
23
|
searchString: '',
|
|
26
|
-
selectedIndex: 0,
|
|
27
24
|
options: props.options
|
|
28
25
|
};
|
|
29
26
|
this.handleChange = this.handleChange.bind(this);
|
|
30
|
-
this.handleKeyDown = this.handleKeyDown.bind(this);
|
|
31
27
|
this.onSelect = this.onSelect.bind(this);
|
|
32
28
|
this.handleTogglePopup = this.handleTogglePopup.bind(this);
|
|
33
29
|
this.onSearchClear = this.onSearchClear.bind(this);
|
|
34
30
|
this.searchList = this.searchList.bind(this);
|
|
35
|
-
this.scrollContentRef = this.scrollContentRef.bind(this);
|
|
36
|
-
this.handleMouseEnter = this.handleMouseEnter.bind(this);
|
|
37
|
-
this.searchInputRef = this.searchInputRef.bind(this);
|
|
38
|
-
this.itemRef = this.itemRef.bind(this);
|
|
39
|
-
this.inputRef = this.inputRef.bind(this);
|
|
40
31
|
this.handleScroll = this.handleScroll.bind(this);
|
|
41
32
|
this.emptySearchSVG = this.emptySearchSVG.bind(this);
|
|
42
33
|
this.getAriaId = getUniqueId(this);
|
|
@@ -48,18 +39,6 @@ export class StatusDropdown extends React.Component {
|
|
|
48
39
|
});
|
|
49
40
|
}
|
|
50
41
|
|
|
51
|
-
inputRef(el) {
|
|
52
|
-
this.hiddenInput = el;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
itemRef(ele, index, id) {
|
|
56
|
-
this[`suggestion_${id}`] = ele;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
searchInputRef(el) {
|
|
60
|
-
this.searchInput = el;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
42
|
handleTogglePopup(e) {
|
|
64
43
|
let {
|
|
65
44
|
togglePopup,
|
|
@@ -73,16 +52,6 @@ export class StatusDropdown extends React.Component {
|
|
|
73
52
|
togglePopup(e, boxPosition);
|
|
74
53
|
}
|
|
75
54
|
|
|
76
|
-
scrollContentRef(el) {
|
|
77
|
-
let {
|
|
78
|
-
isPopupOpen
|
|
79
|
-
} = this.props;
|
|
80
|
-
|
|
81
|
-
if (isPopupOpen) {
|
|
82
|
-
this.optionsContainer = el;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
55
|
componentWillReceiveProps(nextProps) {
|
|
87
56
|
if (nextProps.options.length != this.props.options.length) {
|
|
88
57
|
this.setState({
|
|
@@ -104,108 +73,11 @@ export class StatusDropdown extends React.Component {
|
|
|
104
73
|
}
|
|
105
74
|
|
|
106
75
|
componentDidUpdate(prevProps) {
|
|
107
|
-
let {
|
|
108
|
-
isPopupOpen,
|
|
109
|
-
isSearch,
|
|
110
|
-
idName
|
|
111
|
-
} = this.props;
|
|
112
|
-
let {
|
|
113
|
-
selectedIndex,
|
|
114
|
-
options
|
|
115
|
-
} = this.state;
|
|
116
|
-
|
|
117
|
-
if (prevProps.isPopupOpen != isPopupOpen) {
|
|
118
|
-
setTimeout(() => {
|
|
119
|
-
isPopupOpen && isSearch ? this.searchInput && this.searchInput.focus() : this.hiddenInput && this.hiddenInput.focus();
|
|
120
|
-
}, 10);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
let mergeOptions = options;
|
|
124
|
-
let option = mergeOptions[selectedIndex];
|
|
125
|
-
let id = option && option[idName] || {};
|
|
126
|
-
let selSuggestion = this[`suggestion_${id}`];
|
|
127
|
-
|
|
128
|
-
if (isPopupOpen) {
|
|
129
|
-
this.optionsContainer && scrollTo(this.optionsContainer, selSuggestion);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
76
|
if (!prevProps.isPopupOpen && this.props.isPopupOpen) {
|
|
133
77
|
this.onSearchClear();
|
|
134
78
|
}
|
|
135
79
|
}
|
|
136
80
|
|
|
137
|
-
handleKeyDown(e) {
|
|
138
|
-
let {
|
|
139
|
-
keyCode
|
|
140
|
-
} = e;
|
|
141
|
-
let {
|
|
142
|
-
selectedIndex,
|
|
143
|
-
options
|
|
144
|
-
} = this.state;
|
|
145
|
-
let totalIndex = options.length;
|
|
146
|
-
let {
|
|
147
|
-
togglePopup,
|
|
148
|
-
onClick,
|
|
149
|
-
boxPosition,
|
|
150
|
-
isPopupReady,
|
|
151
|
-
isNextOptions,
|
|
152
|
-
getNextOptions,
|
|
153
|
-
onTogglePopup,
|
|
154
|
-
isPopupOpen
|
|
155
|
-
} = this.props;
|
|
156
|
-
|
|
157
|
-
if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
158
|
-
e.preventDefault(); //prevent body scroll
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
if (isPopupReady) {
|
|
162
|
-
switch (keyCode) {
|
|
163
|
-
case 40:
|
|
164
|
-
if (selectedIndex === totalIndex - 1) {
|
|
165
|
-
this.setState({
|
|
166
|
-
selectedIndex: 0
|
|
167
|
-
});
|
|
168
|
-
} else {
|
|
169
|
-
if (selectedIndex === totalIndex - 3) {
|
|
170
|
-
isNextOptions && getNextOptions && getNextOptions();
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
this.setState({
|
|
174
|
-
selectedIndex: selectedIndex + 1
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
break;
|
|
179
|
-
|
|
180
|
-
case 38:
|
|
181
|
-
if (selectedIndex === 0) {
|
|
182
|
-
this.setState({
|
|
183
|
-
selectedIndex: totalIndex - 1
|
|
184
|
-
});
|
|
185
|
-
} else {
|
|
186
|
-
this.setState({
|
|
187
|
-
selectedIndex: selectedIndex - 1
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
break;
|
|
192
|
-
|
|
193
|
-
case 13:
|
|
194
|
-
onClick && onClick(options[selectedIndex].name, e);
|
|
195
|
-
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
196
|
-
togglePopup(e, boxPosition);
|
|
197
|
-
break;
|
|
198
|
-
|
|
199
|
-
default:
|
|
200
|
-
break;
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
if (keyCode === 13 || keyCode === 40) {
|
|
204
|
-
togglePopup(e, boxPosition);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
81
|
searchList(value) {
|
|
210
82
|
let {
|
|
211
83
|
options,
|
|
@@ -219,7 +91,6 @@ export class StatusDropdown extends React.Component {
|
|
|
219
91
|
let foptions = this.searchList(value);
|
|
220
92
|
this.setState({
|
|
221
93
|
searchString: value,
|
|
222
|
-
selectedIndex: -1,
|
|
223
94
|
options: foptions
|
|
224
95
|
});
|
|
225
96
|
}
|
|
@@ -232,20 +103,13 @@ export class StatusDropdown extends React.Component {
|
|
|
232
103
|
});
|
|
233
104
|
}
|
|
234
105
|
|
|
235
|
-
handleMouseEnter(id, value, index, e) {
|
|
236
|
-
this.setState({
|
|
237
|
-
selectedIndex: index
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
106
|
handleScroll(e) {
|
|
242
107
|
const {
|
|
243
|
-
isNextOptions,
|
|
244
108
|
getNextOptions
|
|
245
109
|
} = this.props;
|
|
246
110
|
|
|
247
111
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
248
|
-
|
|
112
|
+
getNextOptions && getNextOptions(e);
|
|
249
113
|
}
|
|
250
114
|
}
|
|
251
115
|
|
|
@@ -262,8 +126,7 @@ export class StatusDropdown extends React.Component {
|
|
|
262
126
|
|
|
263
127
|
render() {
|
|
264
128
|
let {
|
|
265
|
-
options
|
|
266
|
-
selectedIndex
|
|
129
|
+
options
|
|
267
130
|
} = this.state;
|
|
268
131
|
let {
|
|
269
132
|
value,
|
|
@@ -307,6 +170,8 @@ export class StatusDropdown extends React.Component {
|
|
|
307
170
|
needExternalPopupState = false,
|
|
308
171
|
isPopupActive = false,
|
|
309
172
|
needMultiLineText,
|
|
173
|
+
isFetchingOptions,
|
|
174
|
+
getNextOptions,
|
|
310
175
|
a11y = {}
|
|
311
176
|
} = this.props;
|
|
312
177
|
const {
|
|
@@ -328,12 +193,11 @@ export class StatusDropdown extends React.Component {
|
|
|
328
193
|
tagName: "button",
|
|
329
194
|
alignBox: "row",
|
|
330
195
|
className: `${style.container} ${containerClass} ${btnStyle.buttonReset}`,
|
|
331
|
-
|
|
196
|
+
onClick: !showOnHover && !isDisabled && !isReadOnly && isEditable ? this.handleTogglePopup : null,
|
|
332
197
|
eleRef: getTargetRef,
|
|
333
198
|
align: targetAlign,
|
|
334
199
|
isCover: false,
|
|
335
200
|
dataId: dataId,
|
|
336
|
-
onClick: removeClose,
|
|
337
201
|
disabled: isDisabled || isReadOnly ? true : false,
|
|
338
202
|
"aria-haspopup": isSearch ? 'listbox' : 'menu',
|
|
339
203
|
"aria-expanded": isPopupReady && isEditable ? true : false,
|
|
@@ -341,15 +205,7 @@ export class StatusDropdown extends React.Component {
|
|
|
341
205
|
"aria-labelledby": ariaLabelledby,
|
|
342
206
|
"aria-label": ariaLabel,
|
|
343
207
|
"aria-disabled": isDisabled || isReadOnly
|
|
344
|
-
},
|
|
345
|
-
className: style.hiddenInput
|
|
346
|
-
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
347
|
-
type: "text",
|
|
348
|
-
inputRef: this.inputRef,
|
|
349
|
-
onKeyDown: this.handleKeyDown,
|
|
350
|
-
needAppearance: false,
|
|
351
|
-
placeHolder: placeHolderText
|
|
352
|
-
})) : null, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
208
|
+
}, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
353
209
|
className: `${style.value} toggleDropText`,
|
|
354
210
|
shrink: true,
|
|
355
211
|
tagName: "span",
|
|
@@ -383,7 +239,16 @@ export class StatusDropdown extends React.Component {
|
|
|
383
239
|
customDropBoxWrap: style.dropBoxContainer
|
|
384
240
|
},
|
|
385
241
|
needResponsive: needResponsive,
|
|
386
|
-
isResponsivePadding: true
|
|
242
|
+
isResponsivePadding: true,
|
|
243
|
+
needFocusScope: true,
|
|
244
|
+
onClose: this.handleTogglePopup,
|
|
245
|
+
customProps: {
|
|
246
|
+
focusScopeProps: {
|
|
247
|
+
loadNextOptions: getNextOptions,
|
|
248
|
+
searchValue: searchString,
|
|
249
|
+
isFetchingOptions: isFetchingOptions
|
|
250
|
+
}
|
|
251
|
+
}
|
|
387
252
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
388
253
|
className: style.search
|
|
389
254
|
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
@@ -392,8 +257,11 @@ export class StatusDropdown extends React.Component {
|
|
|
392
257
|
value: searchString,
|
|
393
258
|
onClear: this.onSearchClear,
|
|
394
259
|
size: searchBoxSize,
|
|
395
|
-
|
|
396
|
-
|
|
260
|
+
customProps: {
|
|
261
|
+
TextBoxProps: {
|
|
262
|
+
'data-a11y-autofocus': true
|
|
263
|
+
}
|
|
264
|
+
},
|
|
397
265
|
a11y: {
|
|
398
266
|
ariaHaspopup: isSearch ? 'listbox' : 'menu',
|
|
399
267
|
ariaExpanded: isPopupReady,
|
|
@@ -416,34 +284,37 @@ export class StatusDropdown extends React.Component {
|
|
|
416
284
|
dataId: `${dataId}_list`,
|
|
417
285
|
preventParentScroll: "vertical",
|
|
418
286
|
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
419
|
-
eleRef: this.scrollContentRef,
|
|
420
287
|
onScroll: this.handleScroll,
|
|
421
288
|
role: isSearch ? 'listbox' : 'menu',
|
|
422
|
-
"
|
|
423
|
-
|
|
424
|
-
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) =>
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
289
|
+
tabindex: "-1",
|
|
290
|
+
isScrollAttribute: true
|
|
291
|
+
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) => {
|
|
292
|
+
const listItemText = item[keyName];
|
|
293
|
+
const isActive = value === listItemText;
|
|
294
|
+
return /*#__PURE__*/React.createElement(StatusListItem, {
|
|
295
|
+
key: i,
|
|
296
|
+
dataId: `dataid_${i}`,
|
|
297
|
+
value: listItemText,
|
|
298
|
+
id: item[idName],
|
|
299
|
+
active: isActive,
|
|
300
|
+
onClick: this.onSelect.bind(this, item),
|
|
301
|
+
index: i,
|
|
302
|
+
needTick: needTick,
|
|
303
|
+
needBorder: false,
|
|
304
|
+
bulletColor: item[statusColor],
|
|
305
|
+
title: listItemText,
|
|
306
|
+
needMultiLineText: needMultiLineText,
|
|
307
|
+
autoHover: true,
|
|
308
|
+
a11y: {
|
|
309
|
+
role: isSearch ? 'option' : 'menuitem',
|
|
310
|
+
ariaSelected: isActive,
|
|
311
|
+
ariaLabel: listItemText
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
315
|
+
isCover: false,
|
|
316
|
+
align: "both"
|
|
317
|
+
}, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
447
318
|
className: style.svgWrapper,
|
|
448
319
|
title: searchErrorText || 'No results',
|
|
449
320
|
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
|
+
}
|
|
@@ -19,7 +19,7 @@ export const propTypes = {
|
|
|
19
19
|
isDataLoaded: PropTypes.bool,
|
|
20
20
|
isDisabled: PropTypes.bool,
|
|
21
21
|
isEditable: PropTypes.bool,
|
|
22
|
-
|
|
22
|
+
isFetchingOptions: PropTypes.bool,
|
|
23
23
|
isPopupActive: PropTypes.bool,
|
|
24
24
|
isPopupOpen: PropTypes.bool,
|
|
25
25
|
isPopupReady: PropTypes.bool,
|
|
@@ -76,7 +76,9 @@ export default class StatusListItem extends React.Component {
|
|
|
76
76
|
let {
|
|
77
77
|
role,
|
|
78
78
|
ariaSelected,
|
|
79
|
-
ariaHidden = true
|
|
79
|
+
ariaHidden = true,
|
|
80
|
+
ariaLabel,
|
|
81
|
+
insetFocus = true
|
|
80
82
|
} = a11y;
|
|
81
83
|
|
|
82
84
|
if (isLink) {
|
|
@@ -87,6 +89,8 @@ export default class StatusListItem extends React.Component {
|
|
|
87
89
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
88
90
|
role: role,
|
|
89
91
|
"aria-selected": ariaSelected,
|
|
92
|
+
"aria-label": ariaLabel,
|
|
93
|
+
"data-a11y-inset-focus": insetFocus,
|
|
90
94
|
isCover: false,
|
|
91
95
|
align: "baseline",
|
|
92
96
|
alignBox: "row",
|
|
@@ -57,7 +57,8 @@ export default class Lookup extends Component {
|
|
|
57
57
|
onClose,
|
|
58
58
|
needFocusScope,
|
|
59
59
|
customProps,
|
|
60
|
-
isMinHeight
|
|
60
|
+
isMinHeight,
|
|
61
|
+
lookupClass
|
|
61
62
|
} = this.props;
|
|
62
63
|
const {
|
|
63
64
|
role = 'dialog',
|
|
@@ -87,7 +88,7 @@ export default class Lookup extends Component {
|
|
|
87
88
|
"aria-label": ariaLabel,
|
|
88
89
|
"aria-modal": ariaModal,
|
|
89
90
|
id: htmlId,
|
|
90
|
-
className: `${style.box} ${style[`${size}Size`]}`,
|
|
91
|
+
className: `${style.box} ${style[`${size}Size`]} ${lookupClass ? lookupClass : ''}`,
|
|
91
92
|
"data-id": dataId,
|
|
92
93
|
"data-test-id": dataId
|
|
93
94
|
}, a11yAttributes), /*#__PURE__*/React.createElement(Container, {
|
|
@@ -4,7 +4,7 @@ export const propTypes = {
|
|
|
4
4
|
customClass: PropTypes.string,
|
|
5
5
|
dataId: PropTypes.string,
|
|
6
6
|
isActive: PropTypes.bool,
|
|
7
|
-
size: PropTypes.oneOf(['small', 'xmedium', 'medium', 'large', 'full']),
|
|
7
|
+
size: PropTypes.oneOf(['small', 'xmedium', 'medium', 'large', 'xlarge', 'full']),
|
|
8
8
|
htmlId: PropTypes.string,
|
|
9
9
|
a11y: PropTypes.shape({
|
|
10
10
|
role: PropTypes.string,
|
|
@@ -19,5 +19,6 @@ export const propTypes = {
|
|
|
19
19
|
forwardRef: PropTypes.object,
|
|
20
20
|
onClick: PropTypes.func,
|
|
21
21
|
onClose: PropTypes.func,
|
|
22
|
-
isMinHeight: PropTypes.bool
|
|
22
|
+
isMinHeight: PropTypes.bool,
|
|
23
|
+
lookupClass: PropTypes.string
|
|
23
24
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*** Libraries ***/
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { memo, useRef } from 'react';
|
|
3
3
|
import { defaultProps } from './props/defaultProps';
|
|
4
4
|
import { propTypes } from './props/propTypes';
|
|
5
5
|
/*** Components ***/
|
|
@@ -9,6 +9,7 @@ import Close from '../Close/Close';
|
|
|
9
9
|
import Search from '../Search/Search';
|
|
10
10
|
import ViewDropDown from '../ViewDropDown/ViewDropDown';
|
|
11
11
|
import { Container, Box } from '@zohodesk/components/lib/Layout';
|
|
12
|
+
import useDragger from '../../../Hooks/Dragger/useDragger';
|
|
12
13
|
/*** CSS ***/
|
|
13
14
|
|
|
14
15
|
import commonStyle from '../lookupHeaderCommon.module.css';
|
|
@@ -16,81 +17,95 @@ import commonResponsive from '../lookupHeaderCommonResponsive.module.css';
|
|
|
16
17
|
import style from './TicketHeader.module.css';
|
|
17
18
|
/* eslint-disable react/forbid-component-props */
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
align: "vertical",
|
|
43
|
-
alignBox: "row",
|
|
44
|
-
className: `${commonStyle.container} ${commonStyle[`${palette}`]} ${commonResponsive.container} ${style.container}`,
|
|
45
|
-
isCover: false,
|
|
46
|
-
wrap: "wrap"
|
|
47
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
48
|
-
className: commonStyle.closeContainer
|
|
49
|
-
}, /*#__PURE__*/React.createElement(Close, {
|
|
50
|
-
onClose: onLookupClose,
|
|
51
|
-
dataId: "close"
|
|
52
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
53
|
-
flexible: true
|
|
54
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
55
|
-
alignBox: "column",
|
|
56
|
-
className: `${style.innerContainer}`,
|
|
57
|
-
isCover: false,
|
|
58
|
-
wrap: "wrap",
|
|
59
|
-
dataId: "lookupView"
|
|
60
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
61
|
-
className: commonStyle.title
|
|
62
|
-
}, /*#__PURE__*/React.createElement(Title, {
|
|
63
|
-
text: title
|
|
64
|
-
})), needViewsList ? /*#__PURE__*/React.createElement(Box, {
|
|
65
|
-
className: `${style.dropdown}`,
|
|
66
|
-
dataId: "filterIdselected"
|
|
67
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: style.menuWrapper
|
|
69
|
-
}, /*#__PURE__*/React.createElement(ViewDropDown, {
|
|
70
|
-
dropBoxSize: "small",
|
|
71
|
-
emptyMessage: menuEmptyMessage,
|
|
72
|
-
needSearch: true,
|
|
73
|
-
onChange: onSelectView,
|
|
74
|
-
options: allViews,
|
|
75
|
-
textField: "displayLabel",
|
|
76
|
-
selectedValue: selectedViewId,
|
|
77
|
-
needCloseOnSelect: true
|
|
78
|
-
}))) : null)), needSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
79
|
-
className: `${commonStyle.searchContainer} ${commonResponsive.searchContainer} ${style.searchContainer}`
|
|
80
|
-
}, /*#__PURE__*/React.createElement(Search, {
|
|
81
|
-
onSearch: onSearch,
|
|
82
|
-
searchStr: searchStr,
|
|
83
|
-
onChange: onSearchChange,
|
|
84
|
-
placeHolder: searchPlaceHolder,
|
|
85
|
-
dataId: "search",
|
|
86
|
-
needOnTypeSearch: needOnTypeSearch,
|
|
87
|
-
getRef: getSearchBoxRef
|
|
88
|
-
})) : null);
|
|
89
|
-
}
|
|
20
|
+
function TicketHeader(props) {
|
|
21
|
+
let {
|
|
22
|
+
needSearch,
|
|
23
|
+
onLookupClose,
|
|
24
|
+
searchStr,
|
|
25
|
+
onSearchChange,
|
|
26
|
+
searchPlaceHolder,
|
|
27
|
+
title,
|
|
28
|
+
selectedViewId,
|
|
29
|
+
onSelectView,
|
|
30
|
+
allViews,
|
|
31
|
+
onSearch,
|
|
32
|
+
needOnTypeSearch,
|
|
33
|
+
getSearchBoxRef,
|
|
34
|
+
needViewsList,
|
|
35
|
+
i18nKeys,
|
|
36
|
+
palette,
|
|
37
|
+
dragBoundaryLimit
|
|
38
|
+
} = props;
|
|
39
|
+
let {
|
|
40
|
+
menuEmptyMessage = 'No matches found'
|
|
41
|
+
} = i18nKeys;
|
|
42
|
+
const dragRef = useRef(null); //dragRef
|
|
90
43
|
|
|
44
|
+
useDragger({
|
|
45
|
+
isActive: true,
|
|
46
|
+
ChildRef: dragRef,
|
|
47
|
+
boundaryLimit: dragBoundaryLimit
|
|
48
|
+
}); //custom Hook
|
|
49
|
+
|
|
50
|
+
return /*#__PURE__*/React.createElement(Container, {
|
|
51
|
+
align: "vertical",
|
|
52
|
+
alignBox: "row",
|
|
53
|
+
className: `${commonStyle.container} ${commonStyle[`${palette}`]} ${commonResponsive.container} ${style.container}`,
|
|
54
|
+
isCover: false,
|
|
55
|
+
wrap: "wrap",
|
|
56
|
+
eleRef: dragRef,
|
|
57
|
+
"data-drag-hook": "true"
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
59
|
+
flexible: true
|
|
60
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
61
|
+
alignBox: "column",
|
|
62
|
+
className: `${style.innerContainer}`,
|
|
63
|
+
isCover: false,
|
|
64
|
+
wrap: "wrap",
|
|
65
|
+
dataId: "lookupView"
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
67
|
+
className: commonStyle.title
|
|
68
|
+
}, /*#__PURE__*/React.createElement(Title, {
|
|
69
|
+
text: title
|
|
70
|
+
})), needViewsList ? /*#__PURE__*/React.createElement(Box, {
|
|
71
|
+
className: `${style.dropdown}`,
|
|
72
|
+
dataId: "filterIdselected"
|
|
73
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
74
|
+
className: style.menuWrapper
|
|
75
|
+
}, /*#__PURE__*/React.createElement(ViewDropDown, {
|
|
76
|
+
dropBoxSize: "small",
|
|
77
|
+
emptyMessage: menuEmptyMessage,
|
|
78
|
+
needSearch: true,
|
|
79
|
+
onChange: onSelectView,
|
|
80
|
+
options: allViews,
|
|
81
|
+
textField: "displayLabel",
|
|
82
|
+
selectedValue: selectedViewId,
|
|
83
|
+
needCloseOnSelect: true
|
|
84
|
+
}))) : null)), needSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
85
|
+
className: `${commonStyle.searchContainer} ${commonResponsive.searchContainer} ${style.searchContainer}`
|
|
86
|
+
}, /*#__PURE__*/React.createElement(Search, {
|
|
87
|
+
onSearch: onSearch,
|
|
88
|
+
searchStr: searchStr,
|
|
89
|
+
onChange: onSearchChange,
|
|
90
|
+
placeHolder: searchPlaceHolder,
|
|
91
|
+
dataId: "search",
|
|
92
|
+
needOnTypeSearch: needOnTypeSearch,
|
|
93
|
+
getRef: getSearchBoxRef
|
|
94
|
+
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: commonStyle.closeContainer
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
97
|
+
onClose: onLookupClose,
|
|
98
|
+
dataId: "close"
|
|
99
|
+
})));
|
|
91
100
|
}
|
|
101
|
+
|
|
92
102
|
TicketHeader.propTypes = propTypes;
|
|
93
|
-
TicketHeader.defaultProps = defaultProps;
|
|
103
|
+
TicketHeader.defaultProps = defaultProps;
|
|
104
|
+
const MemoizedTicketHeader = /*#__PURE__*/memo(TicketHeader);
|
|
105
|
+
MemoizedTicketHeader.propTypes = propTypes;
|
|
106
|
+
MemoizedTicketHeader.defaultProps = defaultProps;
|
|
107
|
+
MemoizedTicketHeader.displayName = 'TicketHeader';
|
|
108
|
+
export default MemoizedTicketHeader; // if (__DOCS__) {
|
|
94
109
|
// TicketHeader.docs = {
|
|
95
110
|
// componentGroup: 'Lookup'
|
|
96
111
|
// };
|
|
@@ -7,13 +7,12 @@ import style from '../../../list/Thread/Thread.module.css';
|
|
|
7
7
|
|
|
8
8
|
const Thread = props => {
|
|
9
9
|
const {
|
|
10
|
-
count
|
|
10
|
+
count,
|
|
11
11
|
className,
|
|
12
12
|
iconTitle,
|
|
13
13
|
dataId,
|
|
14
14
|
align
|
|
15
15
|
} = props;
|
|
16
|
-
const count = threadCount === '0' ? '1' : threadCount;
|
|
17
16
|
return /*#__PURE__*/React.createElement(Button, {
|
|
18
17
|
customClass: `${style.container} ${style[`align_${align}`]} ${className}`,
|
|
19
18
|
title: iconTitle,
|