@zohodesk/dot 1.4.14 → 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 +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/coverage-final.json +16 -16
- package/coverage/coverage-summary.json +16 -16
- package/coverage/index.html +1 -1
- package/es/Drawer/Drawer.js +5 -4
- package/es/ExternalLink/ExternalLink.js +5 -4
- package/es/FlipCard/FlipCard.js +12 -14
- package/es/IconButton/IconButton.js +5 -4
- package/es/Link/Link.js +10 -8
- package/es/Message/Message.js +5 -4
- package/es/ToastMessage/ToastMessage.js +4 -2
- package/es/actions/AutoClose.js +1 -2
- package/es/alert/AlertLookup/AlertLookup.js +12 -14
- package/es/avatar/AvatarClose/AvatarClose.js +7 -7
- package/es/avatar/AvatarCollision/AvatarCollision.js +7 -7
- package/es/avatar/AvatarIcon/AvatarIcon.js +5 -4
- package/es/avatar/AvatarStatus/AvatarStatus.js +8 -7
- package/es/avatar/AvatarThread/AvatarThread.js +7 -7
- package/es/avatar/AvatarUser/AvatarUser.js +9 -10
- package/es/avatar/AvatarWithTeam/AvatarWithTeam.js +14 -17
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +24 -28
- package/es/form/fields/CheckBoxField/CheckBoxField.js +13 -15
- package/es/form/fields/CurrencyField/CurrencyField.js +12 -14
- package/es/form/fields/DateField/DateField.js +14 -14
- package/es/form/fields/MultiSelectField/MultiSelectField.js +12 -13
- package/es/form/fields/PhoneField/PhoneField.js +7 -7
- package/es/form/fields/RadioField/RadioField.js +15 -18
- package/es/form/fields/SelectField/SelectField.js +14 -14
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +10 -13
- 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 +10 -11
- package/es/form/fields/TextEditorWrapper/TextEditorWrapper.js +10 -11
- package/es/form/fields/TextareaField/TextareaField.js +13 -14
- package/es/layout/SubtabLayout/SubtabLayout.js +6 -4
- package/es/list/ListLayout/ListLayout.js +5 -4
- package/es/list/SecondaryText/AccountName.js +12 -12
- package/es/list/SecondaryText/ContactName.js +9 -8
- package/es/list/SecondaryText/Email.js +8 -8
- package/es/list/SecondaryText/PhoneNumber.js +8 -8
- package/es/list/SecondaryText/SecondaryText.js +5 -4
- package/es/list/SecondaryText/TicketId.js +7 -7
- package/es/list/Subject/Subject.js +7 -7
- package/es/list/Thread/Thread.js +1 -2
- 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 +10 -6
- package/es/lookup/Lookup/Lookup.js +5 -4
- package/es/lookup/header/Search/Search.js +3 -5
- package/es/v1/Drawer/Drawer.js +5 -4
- package/es/v1/ExternalLink/ExternalLink.js +5 -4
- package/es/v1/FlipCard/FlipCard.js +12 -14
- package/es/v1/GlobalNotification/GlobalNotification.js +7 -6
- package/es/v1/IconButton/IconButton.js +5 -4
- package/es/v1/Link/Link.js +10 -8
- package/es/v1/Message/Message.js +5 -4
- package/es/v1/ToastMessage/ToastMessage.js +4 -2
- package/es/v1/actions/AutoClose.js +1 -2
- 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 +5 -4
- package/es/v1/avatar/AvatarStatus/AvatarStatus.js +8 -7
- package/es/v1/avatar/AvatarThread/AvatarThread.js +7 -7
- package/es/v1/avatar/AvatarUser/AvatarUser.js +9 -10
- package/es/v1/avatar/AvatarWithTeam/AvatarWithTeam.js +14 -17
- package/es/v1/dropdown/ToggleDropDown/ToggleDropDown.js +24 -28
- package/es/v1/form/fields/CheckBoxField/CheckBoxField.js +13 -15
- package/es/v1/form/fields/CurrencyField/CurrencyField.js +12 -14
- package/es/v1/form/fields/DateField/DateField.js +14 -14
- package/es/v1/form/fields/MultiSelectField/MultiSelectField.js +12 -13
- package/es/v1/form/fields/PhoneField/PhoneField.js +7 -7
- package/es/v1/form/fields/RadioField/RadioField.js +16 -18
- package/es/v1/form/fields/SelectField/SelectField.js +14 -14
- package/es/v1/form/fields/TagsMultiSelect/TagsMultiSelect.js +10 -13
- 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 +10 -11
- package/es/v1/form/fields/TextEditorWrapper/TextEditorWrapper.js +10 -11
- package/es/v1/form/fields/TextareaField/TextareaField.js +13 -14
- package/es/v1/layout/SubtabLayout/SubtabLayout.js +6 -4
- package/es/v1/list/ListLayout/ListLayout.js +5 -4
- package/es/v1/list/SecondaryText/AccountName.js +12 -12
- package/es/v1/list/SecondaryText/ContactName.js +9 -8
- 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 +5 -4
- package/es/v1/list/SecondaryText/TicketId.js +7 -7
- package/es/v1/list/Subject/Subject.js +7 -7
- 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 +10 -6
- package/es/v1/lookup/Lookup/Lookup.js +5 -4
- package/es/v1/lookup/header/Search/Search.js +3 -5
- package/es/v1/notification/DesktopNotification/DesktopNotification.js +7 -6
- package/es/version2/GlobalNotification/GlobalNotification.js +7 -6
- package/es/version2/lookup/AlertLookup/AlertLookup.js +15 -15
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +7 -6
- package/lib/list/Thread/Thread.js +1 -2
- 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/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/package.json +8 -8
- 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,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
/**** Libraries ****/
|
|
2
4
|
import React, { useRef } from 'react';
|
|
3
5
|
import { defaultProps } from './props/defaultProps';
|
|
@@ -41,7 +43,9 @@ export default function StatusListItem(props) {
|
|
|
41
43
|
let {
|
|
42
44
|
role,
|
|
43
45
|
ariaSelected,
|
|
44
|
-
ariaHidden = true
|
|
46
|
+
ariaHidden = true,
|
|
47
|
+
ariaLabel,
|
|
48
|
+
insetFocus = true
|
|
45
49
|
} = a11y;
|
|
46
50
|
|
|
47
51
|
if (isLink) {
|
|
@@ -64,9 +68,11 @@ export default function StatusListItem(props) {
|
|
|
64
68
|
onMouseEnter && onMouseEnter(id, value, index, e);
|
|
65
69
|
}
|
|
66
70
|
|
|
67
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
71
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
68
72
|
role: role,
|
|
69
73
|
"aria-selected": ariaSelected,
|
|
74
|
+
"aria-label": ariaLabel,
|
|
75
|
+
"data-a11y-inset-focus": insetFocus,
|
|
70
76
|
isCover: false,
|
|
71
77
|
align: "baseline",
|
|
72
78
|
alignBox: "row",
|
|
@@ -77,10 +83,8 @@ export default function StatusListItem(props) {
|
|
|
77
83
|
eleRef: getReference,
|
|
78
84
|
tagName: isLink ? 'a' : 'li',
|
|
79
85
|
"data-title": isDisabled ? disableTitle : null,
|
|
80
|
-
tabindex: isDisabled ? '-1' : '0'
|
|
81
|
-
|
|
82
|
-
...a11y
|
|
83
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
86
|
+
tabindex: isDisabled ? '-1' : '0'
|
|
87
|
+
}, options, a11y), /*#__PURE__*/React.createElement(Box, {
|
|
84
88
|
className: `${style.statusType} ${style[bulletColor]}`
|
|
85
89
|
}), /*#__PURE__*/React.createElement(Box, {
|
|
86
90
|
flexible: true,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
/*** Libraries ***/
|
|
2
4
|
import React, { useRef, useCallback, useEffect } from 'react';
|
|
3
5
|
import { useEffectCallOnlyAfterState } from '@zohodesk/hooks';
|
|
@@ -66,7 +68,7 @@ export default function Lookup(props) {
|
|
|
66
68
|
document.removeEventListener('keydown', handleKeyDown);
|
|
67
69
|
};
|
|
68
70
|
}, []);
|
|
69
|
-
const content = /*#__PURE__*/React.createElement("div", {
|
|
71
|
+
const content = /*#__PURE__*/React.createElement("div", _extends({
|
|
70
72
|
ref: createRef,
|
|
71
73
|
tabIndex: "-1",
|
|
72
74
|
"data-a11y-need-focus-style": "false",
|
|
@@ -78,9 +80,8 @@ export default function Lookup(props) {
|
|
|
78
80
|
id: htmlId,
|
|
79
81
|
className: `${style.box} ${style[`${size}Size`]} ${lookupClass ? lookupClass : ''}`,
|
|
80
82
|
"data-id": dataId,
|
|
81
|
-
"data-test-id": dataId
|
|
82
|
-
|
|
83
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
83
|
+
"data-test-id": dataId
|
|
84
|
+
}, a11yAttributes), /*#__PURE__*/React.createElement(Container, {
|
|
84
85
|
"data-drag-container": "true",
|
|
85
86
|
isCover: false,
|
|
86
87
|
className: isMinHeight ? `${style.wrapper}` : `${style.coverwrap}`
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
/* eslint-disable react/forbid-component-props */
|
|
2
4
|
|
|
3
5
|
/*** Libraries ***/
|
|
@@ -69,11 +71,7 @@ export default function Search(props) {
|
|
|
69
71
|
selectedId: selectedId,
|
|
70
72
|
onDropDownOpen: handleDropDownOpen,
|
|
71
73
|
onDropDownClose: handleDropDownClose
|
|
72
|
-
}, /*#__PURE__*/React.createElement(SearchUI, {
|
|
73
|
-
...searchUIExtraProps
|
|
74
|
-
})) : /*#__PURE__*/React.createElement(SearchUI, { ...props,
|
|
75
|
-
...searchUIExtraProps
|
|
76
|
-
});
|
|
74
|
+
}, /*#__PURE__*/React.createElement(SearchUI, _extends({}, props, searchUIExtraProps))) : /*#__PURE__*/React.createElement(SearchUI, _extends({}, props, searchUIExtraProps));
|
|
77
75
|
}
|
|
78
76
|
Search.propTypes = Search_propTypes;
|
|
79
77
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import defaultProps from './props/defaultProps';
|
|
3
5
|
import { propTypes, DesktopNotificationUI_propTypes } from './props/propTypes';
|
|
@@ -115,15 +117,14 @@ export function DesktopNotificationUI(props) {
|
|
|
115
117
|
let {
|
|
116
118
|
uptoTablet
|
|
117
119
|
} = _ref2;
|
|
118
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
120
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
119
121
|
className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass}
|
|
120
122
|
${isShrinkView ? style.globalNotify : ''} ${containerClass}
|
|
121
123
|
${uptoTablet ? style.tapWidth : style[`${size}`]}`,
|
|
122
124
|
isCover: false,
|
|
123
125
|
dataId: dataId,
|
|
124
|
-
isInline: uiVariantTwo
|
|
125
|
-
|
|
126
|
-
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(DesktopNotificationHeader, {
|
|
126
|
+
isInline: uiVariantTwo
|
|
127
|
+
}, ExtraProps), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(DesktopNotificationHeader, {
|
|
127
128
|
type: type,
|
|
128
129
|
title: title,
|
|
129
130
|
variant: titleVariant,
|
|
@@ -177,9 +178,9 @@ export function DesktopNotificationUI(props) {
|
|
|
177
178
|
DesktopNotificationUI.propTypes = DesktopNotificationUI_propTypes;
|
|
178
179
|
DesktopNotificationUI.propTypes = defaultProps;
|
|
179
180
|
export default function DesktopNotification(props) {
|
|
180
|
-
return /*#__PURE__*/React.createElement(AutoClose, {
|
|
181
|
+
return /*#__PURE__*/React.createElement(AutoClose, _extends({}, props, {
|
|
181
182
|
Element: DesktopNotificationUI
|
|
182
|
-
});
|
|
183
|
+
}));
|
|
183
184
|
}
|
|
184
185
|
DesktopNotification.propTypes = propTypes;
|
|
185
186
|
DesktopNotification.defaultProps = defaultProps; // if (__DOCS__) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { defaultProps } from './props/defaultProps';
|
|
3
5
|
import { propTypes, UI_propTypes, new_propTypes } from './props/propTypes';
|
|
@@ -119,7 +121,7 @@ export function GlobalNotificationUI(props) {
|
|
|
119
121
|
let {
|
|
120
122
|
ExtraProps = {}
|
|
121
123
|
} = customProps;
|
|
122
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
124
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
123
125
|
ref: eleRef,
|
|
124
126
|
className: ` ${style.message}
|
|
125
127
|
${needShadow && shadowCount >= 2 ? shadowCount > 2 ? `${style.stackShadowTwo} ${style.stackShadowOne}` : style.stackShadowOne : ''}
|
|
@@ -128,9 +130,8 @@ export function GlobalNotificationUI(props) {
|
|
|
128
130
|
"data-id": `show_${type}_message`,
|
|
129
131
|
"data-test-id": `show_${type}_message`,
|
|
130
132
|
tabIndex: 0,
|
|
131
|
-
"data-selector-id": dataSelectorId
|
|
132
|
-
|
|
133
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
133
|
+
"data-selector-id": dataSelectorId
|
|
134
|
+
}, ExtraProps), /*#__PURE__*/React.createElement(Container, {
|
|
134
135
|
className: `${style.container}`,
|
|
135
136
|
alignBox: "row",
|
|
136
137
|
isCover: false,
|
|
@@ -162,8 +163,8 @@ export function GlobalNotificationUI(props) {
|
|
|
162
163
|
}
|
|
163
164
|
GlobalNotificationUI.propTypes = UI_propTypes;
|
|
164
165
|
export function GlobalNotificationNew(props) {
|
|
165
|
-
return /*#__PURE__*/React.createElement(AutoClose, {
|
|
166
|
+
return /*#__PURE__*/React.createElement(AutoClose, _extends({}, props, {
|
|
166
167
|
Element: GlobalNotificationUI
|
|
167
|
-
});
|
|
168
|
+
}));
|
|
168
169
|
}
|
|
169
170
|
GlobalNotificationNew.propTypes = new_propTypes;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
/**** Libraries ****/
|
|
2
4
|
import React, { Component } from 'react';
|
|
3
5
|
import { defaultProps } from './props/defaultProps';
|
|
@@ -121,7 +123,7 @@ export default class AlertLookup extends Component {
|
|
|
121
123
|
ariaLabelledby: a11y && a11y.ariaLabelledby ? a11y.ariaLabelledby : ariaTitleId,
|
|
122
124
|
ariaDescribedby: a11y && a11y.ariaDescribedby ? a11y.ariaDescribedby : ariaMessageId + ' ' + ariaConfirmMsgId
|
|
123
125
|
};
|
|
124
|
-
return /*#__PURE__*/React.createElement(Lookup, {
|
|
126
|
+
return /*#__PURE__*/React.createElement(Lookup, _extends({
|
|
125
127
|
onClose: onEsc == 'close' ? onClose : onCancelClick,
|
|
126
128
|
needFocusScope: true,
|
|
127
129
|
isActive: isActive,
|
|
@@ -131,9 +133,8 @@ export default class AlertLookup extends Component {
|
|
|
131
133
|
onClick: onLookupClick,
|
|
132
134
|
customClass: containerClass,
|
|
133
135
|
a11y: a11y,
|
|
134
|
-
childAnimationName: childAnimationName
|
|
135
|
-
|
|
136
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
136
|
+
childAnimationName: childAnimationName
|
|
137
|
+
}, LookupProps), /*#__PURE__*/React.createElement(Container, {
|
|
137
138
|
alignBox: "row",
|
|
138
139
|
align: align,
|
|
139
140
|
wrap: "wrap"
|
|
@@ -142,15 +143,14 @@ export default class AlertLookup extends Component {
|
|
|
142
143
|
className: style.section
|
|
143
144
|
}, /*#__PURE__*/React.createElement(Container, {
|
|
144
145
|
alignBox: "column"
|
|
145
|
-
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AlertHeader, {
|
|
146
|
+
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(AlertHeader, _extends({
|
|
146
147
|
htmlId: ariaTitleId,
|
|
147
148
|
title: title,
|
|
148
149
|
type: type,
|
|
149
150
|
needIcon: needIcon,
|
|
150
151
|
onClose: onClose,
|
|
151
|
-
breakChildren: wrapHeader
|
|
152
|
-
|
|
153
|
-
}, headerChildren ? headerChildren() : null)), /*#__PURE__*/React.createElement(Box, {
|
|
152
|
+
breakChildren: wrapHeader
|
|
153
|
+
}, AlertHeaderProps), headerChildren ? headerChildren() : null)), /*#__PURE__*/React.createElement(Box, {
|
|
154
154
|
flexible: true
|
|
155
155
|
}, /*#__PURE__*/React.createElement("div", {
|
|
156
156
|
className: `${style.innerSection} ${style[`${scroll}Scroll`] ? style[`${scroll}Scroll`] : ''} ${sectionClass}`
|
|
@@ -169,30 +169,30 @@ export default class AlertLookup extends Component {
|
|
|
169
169
|
}, /*#__PURE__*/React.createElement(FormAction, {
|
|
170
170
|
size: "small",
|
|
171
171
|
paddingLeftSize: "xmedium"
|
|
172
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
172
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
173
173
|
text: submitText,
|
|
174
174
|
dataId: dataId === 'alertPopup' ? 'alertConfirmButton' : `${dataId}_confirmButton`,
|
|
175
175
|
onClick: onSubmitClick,
|
|
176
176
|
palette: buttonPalette,
|
|
177
177
|
customProps: {
|
|
178
178
|
'data-a11y-autofocus': isDefaultFocus
|
|
179
|
-
}
|
|
180
|
-
|
|
179
|
+
}
|
|
180
|
+
}, PrimaryButtonProps, {
|
|
181
181
|
a11y: {
|
|
182
182
|
'aria-labelledby': ariaTitleId + ' ' + ariaMessageId + ' ' + ariaLeaveButtonId
|
|
183
183
|
},
|
|
184
184
|
id: ariaLeaveButtonId
|
|
185
|
-
}), cancelText && /*#__PURE__*/React.createElement(Button, {
|
|
185
|
+
})), cancelText && /*#__PURE__*/React.createElement(Button, _extends({
|
|
186
186
|
dataId: dataId === 'alertPopup' ? 'alertCancelButton' : `${dataId}_cancelButton`,
|
|
187
187
|
text: cancelText,
|
|
188
188
|
onClick: onCancelClick,
|
|
189
|
-
palette: "secondary"
|
|
190
|
-
|
|
189
|
+
palette: "secondary"
|
|
190
|
+
}, SecondaryButtonProps, {
|
|
191
191
|
a11y: {
|
|
192
192
|
'aria-labelledby': ariaTitleId + ' ' + ariaMessageId + ' ' + ariaStayButtonId
|
|
193
193
|
},
|
|
194
194
|
id: ariaStayButtonId
|
|
195
|
-
})))) : null))));
|
|
195
|
+
}))))) : null))));
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
|
|
1
3
|
import React, { useState } from 'react';
|
|
2
4
|
import { defaultProps } from './props/defaultProps';
|
|
3
5
|
import { propTypes, DesktopNotificationUI_propTypes } from './props/propTypes';
|
|
@@ -114,14 +116,13 @@ export function DesktopNotificationUI(props) {
|
|
|
114
116
|
let {
|
|
115
117
|
uptoTablet
|
|
116
118
|
} = _ref2;
|
|
117
|
-
return /*#__PURE__*/React.createElement(Container, {
|
|
119
|
+
return /*#__PURE__*/React.createElement(Container, _extends({
|
|
118
120
|
className: `${style.container} ${isAnimate ? animateClass : animateRemoveClass}
|
|
119
121
|
${isShrinkView ? style.globalNotify : ''} ${containerClass} ${uptoTablet ? style.tapWidth : style[`${size}`]}`,
|
|
120
122
|
isCover: false,
|
|
121
123
|
dataId: dataId,
|
|
122
|
-
isInline: uiVariantTwo
|
|
123
|
-
|
|
124
|
-
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(DesktopNotificationHeader, {
|
|
124
|
+
isInline: uiVariantTwo
|
|
125
|
+
}, ExtraProps), /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(DesktopNotificationHeader, {
|
|
125
126
|
type: type,
|
|
126
127
|
title: title,
|
|
127
128
|
variant: titleVariant,
|
|
@@ -174,9 +175,9 @@ export function DesktopNotificationUI(props) {
|
|
|
174
175
|
}
|
|
175
176
|
DesktopNotificationUI.propTypes = DesktopNotificationUI_propTypes;
|
|
176
177
|
export default function DesktopNotification(props) {
|
|
177
|
-
return /*#__PURE__*/React.createElement(AutoClose, {
|
|
178
|
+
return /*#__PURE__*/React.createElement(AutoClose, _extends({}, props, {
|
|
178
179
|
Element: DesktopNotificationUI
|
|
179
|
-
});
|
|
180
|
+
}));
|
|
180
181
|
}
|
|
181
182
|
DesktopNotification.propTypes = propTypes;
|
|
182
183
|
DesktopNotification.defaultProps = defaultProps; // if (__DOCS__) {
|
|
@@ -60,12 +60,11 @@ var Thread = /*#__PURE__*/function (_Component) {
|
|
|
60
60
|
key: "render",
|
|
61
61
|
value: function render() {
|
|
62
62
|
var _this$props = this.props,
|
|
63
|
-
|
|
63
|
+
count = _this$props.count,
|
|
64
64
|
className = _this$props.className,
|
|
65
65
|
iconTitle = _this$props.iconTitle,
|
|
66
66
|
dataId = _this$props.dataId,
|
|
67
67
|
align = _this$props.align;
|
|
68
|
-
var count = threadCount === '0' ? '1' : threadCount;
|
|
69
68
|
return /*#__PURE__*/_react["default"].createElement(_Button["default"], {
|
|
70
69
|
customClass: "".concat(_ThreadModule["default"].container, " ").concat(_ThreadModule["default"]["align_".concat(align)], " ").concat(className),
|
|
71
70
|
title: iconTitle,
|