@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
|
@@ -9,8 +9,6 @@ import DropDownHeading from '@zohodesk/components/es/v1/DropDown/DropDownHeading
|
|
|
9
9
|
import TextBoxIcon from '@zohodesk/components/es/v1/TextBoxIcon/TextBoxIcon';
|
|
10
10
|
import Loader from '@zohodesk/svg/lib/Loader/Loader';
|
|
11
11
|
import EmptySearch from '@zohodesk/svg/lib/emptystate/version3/EmptySearch';
|
|
12
|
-
import { scrollTo } from '@zohodesk/components/es/utils/Common';
|
|
13
|
-
import TextBox from '@zohodesk/components/es/v1/TextBox/TextBox';
|
|
14
12
|
import CommonEmptyState from '../../../emptystate/CommonEmptyState/CommonEmptyState';
|
|
15
13
|
import StatusListItem from '../StatusListItem/StatusListItem';
|
|
16
14
|
import commonStyle from '@zohodesk/components/es/common/common.module.css';
|
|
@@ -68,18 +66,13 @@ function StatusDropdown(props) {
|
|
|
68
66
|
onTogglePopup,
|
|
69
67
|
onClick,
|
|
70
68
|
onSelectLabel,
|
|
71
|
-
|
|
69
|
+
isFetchingOptions,
|
|
72
70
|
getNextOptions,
|
|
73
71
|
options,
|
|
74
72
|
a11y = {}
|
|
75
73
|
} = props;
|
|
76
74
|
const [optionsList, setOptionsList] = useState(options);
|
|
77
|
-
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
78
75
|
const [searchString, setSearchString] = useState('');
|
|
79
|
-
const hiddenInput = useRef(null);
|
|
80
|
-
const searchInput = useRef(null);
|
|
81
|
-
const optionsContainer = useRef(null);
|
|
82
|
-
const dropdown = useRef({});
|
|
83
76
|
const getAriaId = useUniqueId();
|
|
84
77
|
const {
|
|
85
78
|
tabIndex = 0,
|
|
@@ -96,86 +89,18 @@ function StatusDropdown(props) {
|
|
|
96
89
|
});
|
|
97
90
|
}
|
|
98
91
|
|
|
99
|
-
function handleInputRef(el) {
|
|
100
|
-
hiddenInput.current = el;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
function itemRef(ele, index, id) {
|
|
104
|
-
dropdown.current[`suggestion_${id}`] = ele;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function searchInputRef(el) {
|
|
108
|
-
searchInput.current = el;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
92
|
function handleTogglePopup(e) {
|
|
112
93
|
!isPopupOpen && onSelectLabel && onSelectLabel(e);
|
|
113
94
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
114
95
|
togglePopup(e, boxPosition);
|
|
115
96
|
}
|
|
116
97
|
|
|
117
|
-
function scrollContentRef(el) {
|
|
118
|
-
if (isPopupOpen) {
|
|
119
|
-
optionsContainer.current = el;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
98
|
function onSelect(element, e) {
|
|
124
99
|
onClick && onClick(e, element);
|
|
125
100
|
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
126
101
|
togglePopup(e);
|
|
127
102
|
}
|
|
128
103
|
|
|
129
|
-
function handleKeyDown(e) {
|
|
130
|
-
let {
|
|
131
|
-
keyCode
|
|
132
|
-
} = e;
|
|
133
|
-
let totalIndex = optionsList.length;
|
|
134
|
-
|
|
135
|
-
if (isPopupReady && (keyCode === 38 || keyCode === 40) && e.preventDefault) {
|
|
136
|
-
e.preventDefault(); //prevent body scroll
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
if (isPopupReady) {
|
|
140
|
-
switch (keyCode) {
|
|
141
|
-
case 40:
|
|
142
|
-
if (selectedIndex === totalIndex - 1) {
|
|
143
|
-
setSelectedIndex(0);
|
|
144
|
-
} else {
|
|
145
|
-
if (selectedIndex === totalIndex - 3) {
|
|
146
|
-
isNextOptions && getNextOptions && getNextOptions();
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
setSelectedIndex(selectedIndex + 1);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
break;
|
|
153
|
-
|
|
154
|
-
case 38:
|
|
155
|
-
if (selectedIndex === 0) {
|
|
156
|
-
setSelectedIndex(totalIndex - 1);
|
|
157
|
-
} else {
|
|
158
|
-
setSelectedIndex(selectedIndex - 1);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
break;
|
|
162
|
-
|
|
163
|
-
case 13:
|
|
164
|
-
onClick && onClick(optionsList[selectedIndex].name, e);
|
|
165
|
-
onTogglePopup && onTogglePopup(isPopupOpen);
|
|
166
|
-
togglePopup(e, boxPosition);
|
|
167
|
-
break;
|
|
168
|
-
|
|
169
|
-
default:
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
} else {
|
|
173
|
-
if (keyCode === 13 || keyCode === 40) {
|
|
174
|
-
togglePopup(e, boxPosition);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
104
|
function searchList(value) {
|
|
180
105
|
let foptions = options.filter(dept => dept[keyName].toLowerCase().indexOf(value.toLowerCase()) != -1);
|
|
181
106
|
return foptions;
|
|
@@ -184,7 +109,6 @@ function StatusDropdown(props) {
|
|
|
184
109
|
function handleChange(value, e) {
|
|
185
110
|
let foptions = searchList(value);
|
|
186
111
|
setSearchString(value);
|
|
187
|
-
setSelectedIndex(-1);
|
|
188
112
|
setOptionsList(foptions);
|
|
189
113
|
}
|
|
190
114
|
|
|
@@ -194,13 +118,9 @@ function StatusDropdown(props) {
|
|
|
194
118
|
setOptionsList(foptions);
|
|
195
119
|
}
|
|
196
120
|
|
|
197
|
-
function handleMouseEnter(id, value, index, e) {
|
|
198
|
-
setSelectedIndex(index);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
121
|
function handleScroll(e) {
|
|
202
122
|
if (e.target.scrollTop + e.target.offsetHeight > e.target.scrollHeight - 1) {
|
|
203
|
-
|
|
123
|
+
getNextOptions && getNextOptions(e);
|
|
204
124
|
}
|
|
205
125
|
}
|
|
206
126
|
|
|
@@ -219,18 +139,7 @@ function StatusDropdown(props) {
|
|
|
219
139
|
setOptionsList(options);
|
|
220
140
|
}, [options.length]);
|
|
221
141
|
useEffectCallOnlyAfterState(() => {
|
|
222
|
-
|
|
223
|
-
isPopupOpen && isSearch ? searchInput.current && searchInput.current.focus() : hiddenInput.current && hiddenInput.current.focus();
|
|
224
|
-
}, 10);
|
|
225
|
-
let mergeOptions = optionsList;
|
|
226
|
-
let option = mergeOptions[selectedIndex];
|
|
227
|
-
let id = option && option[idName] || {};
|
|
228
|
-
let selSuggestion = dropdown.current[`suggestion_${id}`];
|
|
229
|
-
|
|
230
|
-
if (isPopupOpen) {
|
|
231
|
-
optionsContainer.current && scrollTo(optionsContainer.current, selSuggestion);
|
|
232
|
-
onSearchClear();
|
|
233
|
-
}
|
|
142
|
+
isPopupOpen && onSearchClear();
|
|
234
143
|
}, [isPopupOpen]);
|
|
235
144
|
return /*#__PURE__*/React.createElement("div", {
|
|
236
145
|
className: style.posRel,
|
|
@@ -240,12 +149,11 @@ function StatusDropdown(props) {
|
|
|
240
149
|
tagName: "button",
|
|
241
150
|
alignBox: "row",
|
|
242
151
|
className: `${style.container} ${containerClass} ${btnStyle.buttonReset}`,
|
|
243
|
-
|
|
152
|
+
onClick: !showOnHover && !isDisabled && !isReadOnly && isEditable ? handleTogglePopup : null,
|
|
244
153
|
eleRef: getTargetRef,
|
|
245
154
|
align: targetAlign,
|
|
246
155
|
isCover: false,
|
|
247
156
|
dataId: dataId,
|
|
248
|
-
onClick: removeClose,
|
|
249
157
|
disabled: isDisabled || isReadOnly ? true : false,
|
|
250
158
|
"aria-haspopup": isSearch ? 'listbox' : 'menu',
|
|
251
159
|
"aria-expanded": isPopupReady && isEditable ? true : false,
|
|
@@ -253,15 +161,7 @@ function StatusDropdown(props) {
|
|
|
253
161
|
"aria-labelledby": ariaLabelledby,
|
|
254
162
|
"aria-label": ariaLabel,
|
|
255
163
|
"aria-disabled": isDisabled || isReadOnly
|
|
256
|
-
},
|
|
257
|
-
className: style.hiddenInput
|
|
258
|
-
}, /*#__PURE__*/React.createElement(TextBox, {
|
|
259
|
-
type: "text",
|
|
260
|
-
inputRef: handleInputRef,
|
|
261
|
-
onKeyDown: handleKeyDown,
|
|
262
|
-
needAppearance: false,
|
|
263
|
-
placeHolder: placeHolderText
|
|
264
|
-
})) : null, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
164
|
+
}, children ? children : /*#__PURE__*/React.createElement(Box, {
|
|
265
165
|
className: `${style.value} toggleDropText`,
|
|
266
166
|
shrink: true,
|
|
267
167
|
tagName: "span",
|
|
@@ -295,7 +195,16 @@ function StatusDropdown(props) {
|
|
|
295
195
|
customDropBoxWrap: style.dropBoxContainer
|
|
296
196
|
},
|
|
297
197
|
needResponsive: needResponsive,
|
|
298
|
-
isResponsivePadding: true
|
|
198
|
+
isResponsivePadding: true,
|
|
199
|
+
needFocusScope: true,
|
|
200
|
+
onClose: handleTogglePopup,
|
|
201
|
+
customProps: {
|
|
202
|
+
focusScopeProps: {
|
|
203
|
+
searchValue: searchString,
|
|
204
|
+
loadNextOptions: getNextOptions,
|
|
205
|
+
isFetchingOptions: isFetchingOptions
|
|
206
|
+
}
|
|
207
|
+
}
|
|
299
208
|
}, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
300
209
|
className: style.search
|
|
301
210
|
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
@@ -304,8 +213,11 @@ function StatusDropdown(props) {
|
|
|
304
213
|
value: searchString,
|
|
305
214
|
onClear: onSearchClear,
|
|
306
215
|
size: searchBoxSize,
|
|
307
|
-
|
|
308
|
-
|
|
216
|
+
customProps: {
|
|
217
|
+
TextBoxProps: {
|
|
218
|
+
'data-a11y-autofocus': true
|
|
219
|
+
}
|
|
220
|
+
},
|
|
309
221
|
a11y: {
|
|
310
222
|
ariaHaspopup: isSearch ? 'listbox' : 'menu',
|
|
311
223
|
ariaExpanded: isPopupReady,
|
|
@@ -328,34 +240,37 @@ function StatusDropdown(props) {
|
|
|
328
240
|
dataId: `${dataId}_list`,
|
|
329
241
|
preventParentScroll: "vertical",
|
|
330
242
|
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
331
|
-
eleRef: scrollContentRef,
|
|
332
243
|
onScroll: handleScroll,
|
|
333
244
|
role: isSearch ? 'listbox' : 'menu',
|
|
334
|
-
"
|
|
335
|
-
|
|
336
|
-
}, optionsList.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, optionsList.map((item, i) =>
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
245
|
+
tabindex: "-1",
|
|
246
|
+
isScrollAttribute: true
|
|
247
|
+
}, optionsList.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, optionsList.map((item, i) => {
|
|
248
|
+
const listItemText = item[keyName];
|
|
249
|
+
const isActive = value === listItemText;
|
|
250
|
+
return /*#__PURE__*/React.createElement(StatusListItem, {
|
|
251
|
+
key: i,
|
|
252
|
+
dataId: `dataid_${i}`,
|
|
253
|
+
value: listItemText,
|
|
254
|
+
id: item[idName],
|
|
255
|
+
active: isActive,
|
|
256
|
+
onClick: e => onSelect(item, e),
|
|
257
|
+
index: i,
|
|
258
|
+
needTick: needTick,
|
|
259
|
+
needBorder: false,
|
|
260
|
+
bulletColor: item[statusColor],
|
|
261
|
+
title: listItemText,
|
|
262
|
+
needMultiLineText: needMultiLineText,
|
|
263
|
+
autoHover: true,
|
|
264
|
+
a11y: {
|
|
265
|
+
role: isSearch ? 'option' : 'menuitem',
|
|
266
|
+
ariaSelected: isActive,
|
|
267
|
+
ariaLabel: listItemText
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
271
|
+
isCover: false,
|
|
272
|
+
align: "both"
|
|
273
|
+
}, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
359
274
|
className: style.svgWrapper,
|
|
360
275
|
title: searchErrorText || 'No results',
|
|
361
276
|
description: searchEmptyHint,
|
|
@@ -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,
|
|
@@ -43,7 +43,9 @@ export default function StatusListItem(props) {
|
|
|
43
43
|
let {
|
|
44
44
|
role,
|
|
45
45
|
ariaSelected,
|
|
46
|
-
ariaHidden = true
|
|
46
|
+
ariaHidden = true,
|
|
47
|
+
ariaLabel,
|
|
48
|
+
insetFocus = true
|
|
47
49
|
} = a11y;
|
|
48
50
|
|
|
49
51
|
if (isLink) {
|
|
@@ -69,6 +71,8 @@ export default function StatusListItem(props) {
|
|
|
69
71
|
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
70
72
|
role: role,
|
|
71
73
|
"aria-selected": ariaSelected,
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
"data-a11y-inset-focus": insetFocus,
|
|
72
76
|
isCover: false,
|
|
73
77
|
align: "baseline",
|
|
74
78
|
alignBox: "row",
|
|
@@ -31,7 +31,8 @@ export default function Lookup(props) {
|
|
|
31
31
|
needFocusScope,
|
|
32
32
|
customProps,
|
|
33
33
|
onKeyDown,
|
|
34
|
-
isMinHeight
|
|
34
|
+
isMinHeight,
|
|
35
|
+
lookupClass
|
|
35
36
|
} = props;
|
|
36
37
|
const {
|
|
37
38
|
role = 'dialog',
|
|
@@ -77,7 +78,7 @@ export default function Lookup(props) {
|
|
|
77
78
|
"aria-label": ariaLabel,
|
|
78
79
|
"aria-modal": ariaModal,
|
|
79
80
|
id: htmlId,
|
|
80
|
-
className: `${style.box} ${style[`${size}Size`]}`,
|
|
81
|
+
className: `${style.box} ${style[`${size}Size`]} ${lookupClass ? lookupClass : ''}`,
|
|
81
82
|
"data-id": dataId,
|
|
82
83
|
"data-test-id": dataId
|
|
83
84
|
}, 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 from '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 '../../../../lookup/header/ViewDropDown/ViewDropDown';
|
|
11
11
|
import { Container, Box } from '@zohodesk/components/es/v1/Layout';
|
|
12
|
+
import useDragger from '../../../../Hooks/Dragger/useDragger';
|
|
12
13
|
/*** CSS ***/
|
|
13
14
|
|
|
14
15
|
import commonStyle from '../../../../lookup/header/lookupHeaderCommon.module.css';
|
|
@@ -16,7 +17,7 @@ import commonResponsive from '../../../../lookup/header/lookupHeaderCommonRespon
|
|
|
16
17
|
import style from '../../../../lookup/header/TicketHeader/TicketHeader.module.css';
|
|
17
18
|
/* eslint-disable react/forbid-component-props */
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
function TicketHeader(props) {
|
|
20
21
|
let {
|
|
21
22
|
needSearch,
|
|
22
23
|
onLookupClose,
|
|
@@ -32,23 +33,29 @@ export default function TicketHeader(props) {
|
|
|
32
33
|
getSearchBoxRef,
|
|
33
34
|
needViewsList,
|
|
34
35
|
i18nKeys,
|
|
35
|
-
palette
|
|
36
|
+
palette,
|
|
37
|
+
dragBoundaryLimit
|
|
36
38
|
} = props;
|
|
37
39
|
let {
|
|
38
40
|
menuEmptyMessage = 'No matches found'
|
|
39
41
|
} = i18nKeys;
|
|
42
|
+
const dragRef = useRef(null); //dragRef
|
|
43
|
+
|
|
44
|
+
useDragger({
|
|
45
|
+
isActive: true,
|
|
46
|
+
ChildRef: dragRef,
|
|
47
|
+
boundaryLimit: dragBoundaryLimit
|
|
48
|
+
}); //custom Hook
|
|
49
|
+
|
|
40
50
|
return /*#__PURE__*/React.createElement(Container, {
|
|
41
51
|
align: "vertical",
|
|
42
52
|
alignBox: "row",
|
|
43
53
|
className: `${commonStyle.container} ${commonStyle[`${palette}`]} ${commonResponsive.container} ${style.container}`,
|
|
44
54
|
isCover: false,
|
|
45
|
-
wrap: "wrap"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
-
onClose: onLookupClose,
|
|
50
|
-
dataId: "close"
|
|
51
|
-
})), /*#__PURE__*/React.createElement(Box, {
|
|
55
|
+
wrap: "wrap",
|
|
56
|
+
ref: dragRef,
|
|
57
|
+
"data-drag-hook": "true"
|
|
58
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
52
59
|
flexible: true
|
|
53
60
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
54
61
|
alignBox: "column",
|
|
@@ -84,7 +91,18 @@ export default function TicketHeader(props) {
|
|
|
84
91
|
dataId: "search",
|
|
85
92
|
needOnTypeSearch: needOnTypeSearch,
|
|
86
93
|
getRef: getSearchBoxRef
|
|
87
|
-
})) : null
|
|
94
|
+
})) : null, /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: commonStyle.closeContainer
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Close, {
|
|
97
|
+
onClose: onLookupClose,
|
|
98
|
+
dataId: "close"
|
|
99
|
+
})));
|
|
88
100
|
}
|
|
101
|
+
|
|
89
102
|
TicketHeader.propTypes = propTypes;
|
|
90
|
-
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;
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
.stackShadowTwo::before {
|
|
30
30
|
content: '';
|
|
31
31
|
position: absolute;
|
|
32
|
-
/* css:theme-validation:ignore */
|
|
33
32
|
height: var(--zd_size20) ;
|
|
34
33
|
}
|
|
35
34
|
|
|
@@ -78,9 +77,6 @@
|
|
|
78
77
|
.container {
|
|
79
78
|
position: relative;
|
|
80
79
|
pointer-events: initial;
|
|
81
|
-
/* css:theme-validation:ignore */
|
|
82
|
-
/* css:theme-validation:ignore */
|
|
83
|
-
/* css:theme-validation:ignore */
|
|
84
80
|
color: var(--globalnotification_text_color);
|
|
85
81
|
z-index: 1;
|
|
86
82
|
composes: wbreak from '~@zohodesk/components/lib/common/common.module.css';
|
package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css
CHANGED
|
@@ -5,8 +5,6 @@
|
|
|
5
5
|
composes: varClass;
|
|
6
6
|
min-height: var(--zd_size54) ;
|
|
7
7
|
position: relative;
|
|
8
|
-
/* css:theme-validation:ignore */
|
|
9
|
-
/* css:theme-validation:ignore */
|
|
10
8
|
color: var(--zdt_desktopnotification_text);
|
|
11
9
|
background-color: var(--alert_lookup_bg_color);
|
|
12
10
|
border-style: solid;
|