@zohodesk/dot 1.9.11 → 1.9.13
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/README.md +20 -0
- package/es/ActionButton/__tests__/ActionButton.spec.js +4 -5
- package/es/AttachmentViewer/AttachmentImage.js +3 -1
- package/es/AttachmentViewer/AttachmentViewer.js +340 -273
- package/es/AttachmentViewer/AttachmentViewer.module.css +8 -15
- package/es/AttachmentViewer/__tests__/AttachmentViewer.spec.js +104 -100
- package/es/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
- package/es/AttachmentViewer/props/defaultProps.js +4 -2
- package/es/AttachmentViewer/props/propTypes.js +9 -2
- package/es/AttachmentViewer/utils.js +6 -7
- package/es/AudioPlayer/utils/utils.js +2 -5
- package/es/DotProvider/hooks/useDotProvider.js +14 -15
- package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +12 -13
- package/es/DotProvider/props/defaultProps.js +1 -1
- package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +3 -4
- package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +4 -5
- package/es/DotProvider/utils/errorValidation.js +5 -6
- package/es/DotProvider/utils/getAssetsImportPromises.js +4 -5
- package/es/Drawer/Drawer.js +6 -8
- package/es/FreezeLayer/css/cssJSLogic.js +4 -5
- package/es/Hooks/Dragger/useDragger.js +5 -6
- package/es/Hooks/Dragger/utils/DraggerUtil.js +7 -8
- package/es/Hooks/useFreezeLayer.js +4 -5
- package/es/Link/Link.js +4 -3
- package/es/Link/props/propTypes.js +1 -0
- package/es/Onboarding/CarouselDots/CarouselDots.js +29 -32
- package/es/Onboarding/Onboarding.js +23 -24
- package/es/Onboarding/hooks/useOnboarding.js +4 -5
- package/es/Onboarding/hooks/useOnboardingSlider.js +5 -6
- package/es/deprecated/SelectDropdown/SelectDropdown.js +43 -47
- package/es/dropdown/ToggleDropDown/ToggleDropDown.js +214 -225
- package/es/errorstate/Inconvenience/Inconvenience.js +32 -36
- package/es/errorstate/NoRequestFound/NoRequestFound.js +32 -36
- package/es/errorstate/PermissionPlay/PermissionPlay.js +31 -35
- package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +32 -36
- package/es/errorstate/UnableToProcess/UnableToProcess.js +32 -36
- package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +32 -36
- package/es/errorstate/WillBack/WillBack.js +30 -34
- package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +81 -85
- package/es/list/status/StatusDropdown/StatusDropdown.js +109 -113
- package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +3 -4
- package/es/lookup/header/Search/Search.js +4 -5
- package/es/lookup/header/Search/__tests__/Search.spec.js +3 -4
- package/es/lookup/header/ViewDropDown/ViewDropDown.js +67 -75
- package/es/utils/General.js +2 -7
- package/es/utils/editorUtils.js +1 -5
- package/es/version2/lookup/AlertHeader/AlertHeader.js +5 -3
- package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +24 -0
- package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
- package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +4 -5
- package/es/version2/lookup/AlertHeader/props/propTypes.js +2 -1
- package/es/version2/notification/DesktopNotification/DesktopNotification.js +59 -63
- package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +40 -44
- package/lib/AttachmentViewer/AttachmentImage.js +3 -1
- package/lib/AttachmentViewer/AttachmentViewer.js +158 -82
- package/lib/AttachmentViewer/AttachmentViewer.module.css +8 -15
- package/lib/AttachmentViewer/__tests__/AttachmentViewer.spec.js +100 -100
- package/lib/AttachmentViewer/__tests__/__snapshots__/AttachmentViewer.spec.js.snap +778 -1
- package/lib/AttachmentViewer/props/defaultProps.js +6 -2
- package/lib/AttachmentViewer/props/propTypes.js +9 -2
- package/lib/DotProvider/props/defaultProps.js +2 -2
- package/lib/Link/Link.js +4 -3
- package/lib/Link/props/propTypes.js +1 -0
- package/lib/version2/lookup/AlertHeader/AlertHeader.js +5 -2
- package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +26 -0
- package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
- package/lib/version2/lookup/AlertHeader/props/propTypes.js +2 -1
- package/package.json +26 -24
|
@@ -113,10 +113,9 @@ export class StatusDropdown extends React.Component {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
responsiveFunc(
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
} = _ref;
|
|
116
|
+
responsiveFunc({
|
|
117
|
+
mediaQueryOR
|
|
118
|
+
}) {
|
|
120
119
|
return {
|
|
121
120
|
tabletMode: mediaQueryOR([{
|
|
122
121
|
maxWidth: 700
|
|
@@ -234,118 +233,115 @@ export class StatusDropdown extends React.Component {
|
|
|
234
233
|
}) : null), isPopupOpen && isEditable ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
235
234
|
query: this.responsiveFunc,
|
|
236
235
|
responsiveId: "Helmet"
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
searchValue: searchString,
|
|
270
|
-
isFetchingOptions: isFetchingOptions
|
|
271
|
-
}
|
|
236
|
+
}, ({
|
|
237
|
+
tabletMode
|
|
238
|
+
}) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
239
|
+
boxPosition: position,
|
|
240
|
+
isActive: isPopupReady,
|
|
241
|
+
onClick: removeClose,
|
|
242
|
+
size: boxSize,
|
|
243
|
+
right: right,
|
|
244
|
+
left: left,
|
|
245
|
+
top: top,
|
|
246
|
+
bottom: bottom,
|
|
247
|
+
isArrow: isArrow,
|
|
248
|
+
isAnimate: true,
|
|
249
|
+
getRef: getContainerRef,
|
|
250
|
+
customClass: {
|
|
251
|
+
customDropBoxWrap: style.dropBoxContainer,
|
|
252
|
+
customDropBox: dropBoxClass
|
|
253
|
+
},
|
|
254
|
+
needResponsive: needResponsive,
|
|
255
|
+
isResponsivePadding: true,
|
|
256
|
+
needFocusScope: true,
|
|
257
|
+
onClose: this.handleTogglePopup,
|
|
258
|
+
dataId: `${dataId}_dropbox`,
|
|
259
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
260
|
+
isRestrictScroll: isRestrictScroll,
|
|
261
|
+
positionsOffset: positionsOffset,
|
|
262
|
+
targetOffset: targetOffset,
|
|
263
|
+
customProps: {
|
|
264
|
+
focusScopeProps: {
|
|
265
|
+
loadNextOptions: getNextOptions,
|
|
266
|
+
searchValue: searchString,
|
|
267
|
+
isFetchingOptions: isFetchingOptions
|
|
272
268
|
}
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
269
|
+
}
|
|
270
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, isSearch ? /*#__PURE__*/React.createElement(Box, {
|
|
271
|
+
className: style.search
|
|
272
|
+
}, /*#__PURE__*/React.createElement(TextBoxIcon, {
|
|
273
|
+
placeHolder: placeHolderText,
|
|
274
|
+
onChange: this.handleChange,
|
|
275
|
+
value: searchString,
|
|
276
|
+
onClear: this.onSearchClear,
|
|
277
|
+
size: searchBoxSize,
|
|
278
|
+
customProps: {
|
|
279
|
+
TextBoxProps: {
|
|
280
|
+
'data-a11y-autofocus': true
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
a11y: {
|
|
284
|
+
ariaHaspopup: isSearch ? 'listbox' : 'menu',
|
|
285
|
+
ariaExpanded: isPopupReady,
|
|
286
|
+
role: 'combobox',
|
|
287
|
+
ariaActivedescendant: isPopupReady ? value : '',
|
|
288
|
+
ariaOwns: ariaTitleId
|
|
289
|
+
},
|
|
290
|
+
dataId: `${dataId}_search`
|
|
291
|
+
})) : null, title && options.length != 0 && /*#__PURE__*/React.createElement(Box, {
|
|
292
|
+
className: style.title
|
|
293
|
+
}, /*#__PURE__*/React.createElement(DropDownHeading, {
|
|
294
|
+
htmlId: ariaTitleId,
|
|
295
|
+
text: title,
|
|
296
|
+
a11y: {
|
|
297
|
+
role: 'heading'
|
|
298
|
+
}
|
|
299
|
+
})), /*#__PURE__*/React.createElement(Box, {
|
|
300
|
+
scroll: "vertical",
|
|
301
|
+
flexible: true,
|
|
302
|
+
shrink: true,
|
|
303
|
+
dataId: `${dataId}_list`,
|
|
304
|
+
preventParentScroll: "vertical",
|
|
305
|
+
className: `${tabletMode ? style.responsivemaxHgt : style.maxHgt}`,
|
|
306
|
+
onScroll: this.handleScroll,
|
|
307
|
+
role: isSearch ? 'listbox' : 'menu',
|
|
308
|
+
tabindex: "-1",
|
|
309
|
+
isScrollAttribute: true
|
|
310
|
+
}, options.length != 0 && isDataLoaded ? /*#__PURE__*/React.createElement(React.Fragment, null, options.map((item, i) => {
|
|
311
|
+
const listItemText = item[keyName];
|
|
312
|
+
const isActive = value === listItemText;
|
|
313
|
+
return /*#__PURE__*/React.createElement(StatusListItem, {
|
|
314
|
+
key: i,
|
|
315
|
+
dataId: `dataid_${i}`,
|
|
316
|
+
value: listItemText,
|
|
317
|
+
id: item[idName],
|
|
318
|
+
active: isActive,
|
|
319
|
+
onClick: this.onSelect.bind(this, item),
|
|
320
|
+
index: i,
|
|
321
|
+
needTick: needTick,
|
|
322
|
+
needBorder: false,
|
|
323
|
+
bulletColor: item[statusColor],
|
|
324
|
+
title: listItemText,
|
|
325
|
+
needMultiLineText: needMultiLineText,
|
|
326
|
+
autoHover: true,
|
|
299
327
|
a11y: {
|
|
300
|
-
role: '
|
|
328
|
+
role: isSearch ? 'option' : 'menuitem',
|
|
329
|
+
ariaSelected: isActive,
|
|
330
|
+
ariaLabel: listItemText
|
|
301
331
|
}
|
|
302
|
-
})
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
const isActive = value === listItemText;
|
|
316
|
-
return /*#__PURE__*/React.createElement(StatusListItem, {
|
|
317
|
-
key: i,
|
|
318
|
-
dataId: `dataid_${i}`,
|
|
319
|
-
value: listItemText,
|
|
320
|
-
id: item[idName],
|
|
321
|
-
active: isActive,
|
|
322
|
-
onClick: this.onSelect.bind(this, item),
|
|
323
|
-
index: i,
|
|
324
|
-
needTick: needTick,
|
|
325
|
-
needBorder: false,
|
|
326
|
-
bulletColor: item[statusColor],
|
|
327
|
-
title: listItemText,
|
|
328
|
-
needMultiLineText: needMultiLineText,
|
|
329
|
-
autoHover: true,
|
|
330
|
-
a11y: {
|
|
331
|
-
role: isSearch ? 'option' : 'menuitem',
|
|
332
|
-
ariaSelected: isActive,
|
|
333
|
-
ariaLabel: listItemText
|
|
334
|
-
}
|
|
335
|
-
});
|
|
336
|
-
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
337
|
-
isCover: false,
|
|
338
|
-
align: "both"
|
|
339
|
-
}, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
340
|
-
className: style.svgWrapper,
|
|
341
|
-
title: searchErrorText || 'No results',
|
|
342
|
-
description: searchEmptyHint,
|
|
343
|
-
size: "small",
|
|
344
|
-
getEmptyState: this.emptySearchSVG
|
|
345
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
346
|
-
className: style.loader
|
|
347
|
-
}, /*#__PURE__*/React.createElement(Loader, null))), renderFooterElement ? renderFooterElement : null));
|
|
348
|
-
}) : null);
|
|
332
|
+
});
|
|
333
|
+
}), isFetchingOptions && /*#__PURE__*/React.createElement(Container, {
|
|
334
|
+
isCover: false,
|
|
335
|
+
align: "both"
|
|
336
|
+
}, /*#__PURE__*/React.createElement(Loader, null))) : isDataLoaded ? /*#__PURE__*/React.createElement(CommonEmptyState, {
|
|
337
|
+
className: style.svgWrapper,
|
|
338
|
+
title: searchErrorText || 'No results',
|
|
339
|
+
description: searchEmptyHint,
|
|
340
|
+
size: "small",
|
|
341
|
+
getEmptyState: this.emptySearchSVG
|
|
342
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
343
|
+
className: style.loader
|
|
344
|
+
}, /*#__PURE__*/React.createElement(Loader, null))), renderFooterElement ? renderFooterElement : null))) : null);
|
|
349
345
|
}
|
|
350
346
|
|
|
351
347
|
} // if (__DOCS__) {
|
|
@@ -8,10 +8,9 @@ describe('StatusDropdown', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(StatusDropdown, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
}), test('rendering target element', () => {
|
|
11
|
-
const renderTargetElement =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} = _ref;
|
|
11
|
+
const renderTargetElement = ({
|
|
12
|
+
isPopupOpen
|
|
13
|
+
}) => {
|
|
15
14
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
15
|
className: isPopupOpen ? 'popupOpened' : 'popupClosed'
|
|
17
16
|
}, "Target Element");
|
|
@@ -60,11 +60,10 @@ export default class Search extends Component {
|
|
|
60
60
|
getRef && getRef(el);
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
handleRenderChildren(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
} = _ref;
|
|
63
|
+
handleRenderChildren({
|
|
64
|
+
isActive,
|
|
65
|
+
isFocus
|
|
66
|
+
}) {
|
|
68
67
|
const {
|
|
69
68
|
value,
|
|
70
69
|
selectedId,
|
|
@@ -39,10 +39,9 @@ class DropDown extends SelectComponent {
|
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
responsiveFunc(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
} = _ref;
|
|
42
|
+
responsiveFunc({
|
|
43
|
+
mediaQueryOR
|
|
44
|
+
}) {
|
|
46
45
|
return {
|
|
47
46
|
tabletMode: mediaQueryOR([{
|
|
48
47
|
maxWidth: 700
|
|
@@ -51,8 +50,6 @@ class DropDown extends SelectComponent {
|
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
render() {
|
|
54
|
-
var _this = this;
|
|
55
|
-
|
|
56
53
|
const {
|
|
57
54
|
needSearch,
|
|
58
55
|
dropBoxSize,
|
|
@@ -106,75 +103,70 @@ class DropDown extends SelectComponent {
|
|
|
106
103
|
}))), isPopupOpen ? /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
107
104
|
query: this.responsiveFunc,
|
|
108
105
|
responsiveId: "Helmet"
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
className: style.emptyState
|
|
174
|
-
}, searchEmptyMessage || emptyMessage) : /*#__PURE__*/React.createElement("div", {
|
|
175
|
-
className: style.emptyState
|
|
176
|
-
}, emptyMessage)))));
|
|
177
|
-
}) : null);
|
|
106
|
+
}, ({
|
|
107
|
+
tabletMode
|
|
108
|
+
}) => /*#__PURE__*/React.createElement(ResponsiveDropBox, {
|
|
109
|
+
isAnimate: true,
|
|
110
|
+
isArrow: false,
|
|
111
|
+
isActive: isPopupReady,
|
|
112
|
+
boxPosition: position || `${defaultDropBoxPosition}Center`,
|
|
113
|
+
getRef: getContainerRef,
|
|
114
|
+
onClick: removeClose,
|
|
115
|
+
animationStyle: animationStyle,
|
|
116
|
+
size: "large",
|
|
117
|
+
alignBox: "row",
|
|
118
|
+
isResponsivePadding: true,
|
|
119
|
+
dataId: `${dataId}_dropbox`,
|
|
120
|
+
isAbsolutePositioningNeeded: isAbsolutePositioningNeeded,
|
|
121
|
+
isRestrictScroll: isRestrictScroll,
|
|
122
|
+
positionsOffset: positionsOffset,
|
|
123
|
+
targetOffset: targetOffset
|
|
124
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
125
|
+
flexible: true
|
|
126
|
+
}, /*#__PURE__*/React.createElement(Card, null, needSearch ? /*#__PURE__*/React.createElement(CardHeader, null, /*#__PURE__*/React.createElement(DropDownSearch, {
|
|
127
|
+
value: searchStr,
|
|
128
|
+
onChange: this.handleSearch,
|
|
129
|
+
onKeyDown: this.onSearchKeyDown,
|
|
130
|
+
getRef: this.searchInputRef,
|
|
131
|
+
size: searchBoxSize,
|
|
132
|
+
variant: searchBoxVariant,
|
|
133
|
+
placeHolder: searchBoxPlaceHolder,
|
|
134
|
+
maxLength: maxLength,
|
|
135
|
+
dataId: `${dataId}_search`
|
|
136
|
+
})) : null, /*#__PURE__*/React.createElement(CardContent, {
|
|
137
|
+
shrink: true,
|
|
138
|
+
eleRef: this.suggestionContainerRef,
|
|
139
|
+
customClass: !tabletMode && dropBoxSize ? style[dropBoxSize] : ''
|
|
140
|
+
}, suggestions.length ? /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: style.listItemContainer,
|
|
142
|
+
"data-id": `${dataId}_Options`
|
|
143
|
+
}, suggestions.map((option = {}, index) => {
|
|
144
|
+
const {
|
|
145
|
+
id,
|
|
146
|
+
value
|
|
147
|
+
} = option;
|
|
148
|
+
return /*#__PURE__*/React.createElement(ListItem, {
|
|
149
|
+
active: id === selectedId,
|
|
150
|
+
getRef: this.suggestionItemRef,
|
|
151
|
+
highlight: hoverIndex === index ? true : false,
|
|
152
|
+
id: id,
|
|
153
|
+
key: `${id}dropDown`,
|
|
154
|
+
onClick: this.handleChange,
|
|
155
|
+
onMouseEnter: this.handleMouseEnter,
|
|
156
|
+
size: "medium",
|
|
157
|
+
value: value,
|
|
158
|
+
index: index,
|
|
159
|
+
needTick: true,
|
|
160
|
+
needBorder: false
|
|
161
|
+
});
|
|
162
|
+
})) : isFetchingOptions ? /*#__PURE__*/React.createElement(Container, {
|
|
163
|
+
align: "both",
|
|
164
|
+
className: style.loader
|
|
165
|
+
}, /*#__PURE__*/React.createElement(Loader, null)) : searchStr ? /*#__PURE__*/React.createElement("div", {
|
|
166
|
+
className: style.emptyState
|
|
167
|
+
}, searchEmptyMessage || emptyMessage) : /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: style.emptyState
|
|
169
|
+
}, emptyMessage)))))) : null);
|
|
178
170
|
}
|
|
179
171
|
|
|
180
172
|
}
|
package/es/utils/General.js
CHANGED
|
@@ -3,9 +3,7 @@ export function stopBubbling(event) {
|
|
|
3
3
|
event.stopPropagation && event.stopPropagation();
|
|
4
4
|
event.nativeEvent && event.nativeEvent.stopImmediatePropagation && event.nativeEvent.stopImmediatePropagation();
|
|
5
5
|
}
|
|
6
|
-
export function getFullName() {
|
|
7
|
-
let firstName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
8
|
-
let lastName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
6
|
+
export function getFullName(firstName = '', lastName = '') {
|
|
9
7
|
let fullName = '';
|
|
10
8
|
|
|
11
9
|
if (firstName !== null && firstName !== '') {
|
|
@@ -18,10 +16,7 @@ export function getFullName() {
|
|
|
18
16
|
|
|
19
17
|
return fullName;
|
|
20
18
|
}
|
|
21
|
-
export function shallowDiff() {
|
|
22
|
-
let a = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
23
|
-
let b = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
24
|
-
|
|
19
|
+
export function shallowDiff(a = {}, b = {}) {
|
|
25
20
|
for (let i in a) {
|
|
26
21
|
if (!(i in b)) {
|
|
27
22
|
return true;
|
package/es/utils/editorUtils.js
CHANGED
|
@@ -176,11 +176,7 @@ export function loadResource(url, type, id, callback) {
|
|
|
176
176
|
});
|
|
177
177
|
} // bind
|
|
178
178
|
|
|
179
|
-
export function bind() {
|
|
180
|
-
for (var _len = arguments.length, handlers = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
181
|
-
handlers[_key] = arguments[_key];
|
|
182
|
-
}
|
|
183
|
-
|
|
179
|
+
export function bind(...handlers) {
|
|
184
180
|
handlers.forEach(handler => {
|
|
185
181
|
if (__DEVELOPMENT__) {
|
|
186
182
|
if (!this[handler]) {
|
|
@@ -2,7 +2,8 @@ import React, { useRef } from 'react'; //AlertDependencies
|
|
|
2
2
|
|
|
3
3
|
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
4
4
|
import AlertClose from "../../AlertClose/AlertClose";
|
|
5
|
-
import AlertIcons from "../../alertIcons/AlertIcons";
|
|
5
|
+
import AlertIcons from "../../alertIcons/AlertIcons";
|
|
6
|
+
import renderNode from '@zohodesk/utils/es/renderNode'; //CSS
|
|
6
7
|
|
|
7
8
|
import style from "./css/AlertHeaderNew.module.css";
|
|
8
9
|
import cssJSLogic from "./css/cssJSLogic";
|
|
@@ -24,7 +25,8 @@ export default function AlertHeader(props) {
|
|
|
24
25
|
type,
|
|
25
26
|
htmlId,
|
|
26
27
|
customStyle,
|
|
27
|
-
dragBoundaryLimit
|
|
28
|
+
dragBoundaryLimit,
|
|
29
|
+
renderAlertIcon
|
|
28
30
|
} = props;
|
|
29
31
|
const finalStyle = mergeStyle(style, customStyle);
|
|
30
32
|
const {
|
|
@@ -51,7 +53,7 @@ export default function AlertHeader(props) {
|
|
|
51
53
|
eleRef: dragRef
|
|
52
54
|
}, needIcon && /*#__PURE__*/React.createElement("div", {
|
|
53
55
|
className: finalStyle.iconContainer
|
|
54
|
-
}, /*#__PURE__*/React.createElement(AlertIcons, {
|
|
56
|
+
}, renderNode(renderAlertIcon) || /*#__PURE__*/React.createElement(AlertIcons, {
|
|
55
57
|
type: type
|
|
56
58
|
})), (title || children) && /*#__PURE__*/React.createElement(Box, {
|
|
57
59
|
flexible: true
|
|
@@ -8,4 +8,28 @@ describe('AlertHeader', () => {
|
|
|
8
8
|
} = render( /*#__PURE__*/React.createElement(AlertHeader, null));
|
|
9
9
|
expect(asFragment()).toMatchSnapshot();
|
|
10
10
|
});
|
|
11
|
+
test('renders custom renderAlertIcon when needIcon is true', () => {
|
|
12
|
+
const customIcon = /*#__PURE__*/React.createElement("span", {
|
|
13
|
+
"data-test-id": "custom-icon"
|
|
14
|
+
}, "icon");
|
|
15
|
+
const {
|
|
16
|
+
asFragment
|
|
17
|
+
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
18
|
+
needIcon: true,
|
|
19
|
+
renderAlertIcon: customIcon
|
|
20
|
+
}));
|
|
21
|
+
expect(asFragment()).toMatchSnapshot();
|
|
22
|
+
});
|
|
23
|
+
test('does not render custom renderAlertIcon when needIcon is false', () => {
|
|
24
|
+
const customIcon = /*#__PURE__*/React.createElement("span", {
|
|
25
|
+
"data-test-id": "custom-icon"
|
|
26
|
+
}, "icon");
|
|
27
|
+
const {
|
|
28
|
+
asFragment
|
|
29
|
+
} = render( /*#__PURE__*/React.createElement(AlertHeader, {
|
|
30
|
+
needIcon: false,
|
|
31
|
+
renderAlertIcon: customIcon
|
|
32
|
+
}));
|
|
33
|
+
expect(asFragment()).toMatchSnapshot();
|
|
34
|
+
});
|
|
11
35
|
});
|
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`AlertHeader does not render custom renderAlertIcon when needIcon is false 1`] = `
|
|
4
|
+
<DocumentFragment>
|
|
5
|
+
<div
|
|
6
|
+
class="container danger flex rowdir wrap vCenter"
|
|
7
|
+
data-drag-hook="true"
|
|
8
|
+
data-id="containerComponent"
|
|
9
|
+
data-selector-id="container"
|
|
10
|
+
data-test-id="containerComponent"
|
|
11
|
+
/>
|
|
12
|
+
</DocumentFragment>
|
|
13
|
+
`;
|
|
14
|
+
|
|
3
15
|
exports[`AlertHeader rendering the defult props 1`] = `
|
|
4
16
|
<DocumentFragment>
|
|
5
17
|
<div
|
|
@@ -86,3 +98,25 @@ exports[`AlertHeader rendering the defult props 1`] = `
|
|
|
86
98
|
</div>
|
|
87
99
|
</DocumentFragment>
|
|
88
100
|
`;
|
|
101
|
+
|
|
102
|
+
exports[`AlertHeader renders custom renderAlertIcon when needIcon is true 1`] = `
|
|
103
|
+
<DocumentFragment>
|
|
104
|
+
<div
|
|
105
|
+
class="container danger flex rowdir wrap vCenter"
|
|
106
|
+
data-drag-hook="true"
|
|
107
|
+
data-id="containerComponent"
|
|
108
|
+
data-selector-id="container"
|
|
109
|
+
data-test-id="containerComponent"
|
|
110
|
+
>
|
|
111
|
+
<div
|
|
112
|
+
class="iconContainer"
|
|
113
|
+
>
|
|
114
|
+
<span
|
|
115
|
+
data-test-id="custom-icon"
|
|
116
|
+
>
|
|
117
|
+
icon
|
|
118
|
+
</span>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</DocumentFragment>
|
|
122
|
+
`;
|