@zohodesk/dot 1.0.0-temp-230.3 → 1.0.0-temp-232
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 +2 -11
- package/es/ActionButton/__tests__/ActionButton.spec.js +4 -5
- package/es/AttachmentViewer/AttachmentImage.js +1 -3
- package/es/AttachmentViewer/AttachmentViewer.js +254 -359
- package/es/AttachmentViewer/AttachmentViewer.module.css +15 -8
- package/es/AttachmentViewer/props/defaultProps.js +2 -4
- package/es/AttachmentViewer/props/propTypes.js +2 -8
- 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 +21 -16
- 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 +3 -4
- package/es/Link/props/propTypes.js +0 -1
- 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 +1 -3
- package/lib/AttachmentViewer/AttachmentViewer.js +85 -187
- package/lib/AttachmentViewer/AttachmentViewer.module.css +15 -8
- package/lib/AttachmentViewer/props/defaultProps.js +2 -6
- package/lib/AttachmentViewer/props/propTypes.js +2 -8
- package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +9 -3
- package/lib/Link/Link.js +3 -4
- package/lib/Link/props/propTypes.js +0 -1
- 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 +7 -7
|
@@ -4,7 +4,7 @@ import React, { Component } from 'react';
|
|
|
4
4
|
import { AttachmentViewer_defaultProps } from "./props/defaultProps";
|
|
5
5
|
import { AttachmentViewer_propTypes } from "./props/propTypes";
|
|
6
6
|
import { Container, Box } from '@zohodesk/components/es/Layout';
|
|
7
|
-
import Icon from '@zohodesk/icons
|
|
7
|
+
import { Icon } from '@zohodesk/icons';
|
|
8
8
|
import Avatar from '@zohodesk/components/es/Avatar/Avatar';
|
|
9
9
|
import { ResponsiveReceiver } from '@zohodesk/components/es/Responsive/CustomResponsive';
|
|
10
10
|
import Typography from '@zohodesk/components/es/Typography/Typography';
|
|
@@ -47,35 +47,8 @@ export default class AttachmentViewer extends Component {
|
|
|
47
47
|
this.zoomMaintain = this.zoomMaintain.bind(this);
|
|
48
48
|
this.handleMenuValidation = this.handleMenuValidation.bind(this);
|
|
49
49
|
this.getPreviewIconData = this.getPreviewIconData.bind(this);
|
|
50
|
-
this.renderIframe = this.renderIframe.bind(this);
|
|
51
|
-
}
|
|
52
|
-
// if (!changes || typeof changes !== 'object') {
|
|
53
|
-
// return false;
|
|
54
|
-
// }
|
|
55
|
-
// const { data } = this.state;
|
|
56
|
-
// const targetIdx = typeof idOrIndex === 'number'
|
|
57
|
-
// ? idOrIndex
|
|
58
|
-
// : data.findIndex((item) => item && item.id === idOrIndex);
|
|
59
|
-
// if (targetIdx < 0 || targetIdx >= data.length) {
|
|
60
|
-
// return false;
|
|
61
|
-
// }
|
|
62
|
-
// this.setState((prevState) => {
|
|
63
|
-
// const nextData = prevState.data.slice();
|
|
64
|
-
// nextData[targetIdx] = { ...nextData[targetIdx], ...changes };
|
|
65
|
-
// let nextDataList = prevState.dataList;
|
|
66
|
-
// if (targetIdx < prevState.dataList.length) {
|
|
67
|
-
// nextDataList = prevState.dataList.slice();
|
|
68
|
-
// nextDataList[targetIdx] = { ...nextDataList[targetIdx], ...changes };
|
|
69
|
-
// }
|
|
70
|
-
// return { data: nextData, dataList: nextDataList };
|
|
71
|
-
// }, () => {
|
|
72
|
-
// if (this.state.selectedIndex === targetIdx) {
|
|
73
|
-
// this.handleMenuValidation();
|
|
74
|
-
// }
|
|
75
|
-
// });
|
|
76
|
-
// return true;
|
|
77
|
-
// }
|
|
78
|
-
|
|
50
|
+
this.renderIframe = this.renderIframe.bind(this);
|
|
51
|
+
}
|
|
79
52
|
|
|
80
53
|
isImageFileType(fileName) {
|
|
81
54
|
const extension = (getExtensionFromFileName(fileName) || '').toLowerCase();
|
|
@@ -107,11 +80,10 @@ export default class AttachmentViewer extends Component {
|
|
|
107
80
|
selectedIndex
|
|
108
81
|
} = this.state;
|
|
109
82
|
let indexChanged = previewObj.selectedIndex != prevProps.previewObj.selectedIndex;
|
|
110
|
-
const attachmentPreviewUrlChanged = previewObj.previewData.some((value, index) => value?.viewUrl !== prevState.data[index]?.viewUrl); // Triggers an update if any previewed attachment is edited by the Attachment Annotator.
|
|
111
83
|
|
|
112
|
-
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged
|
|
84
|
+
if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged) {
|
|
113
85
|
let objChanged = previewObj.previewData.some((value, index) => {
|
|
114
|
-
return shallowDiff(value, prevProps.previewObj
|
|
86
|
+
return shallowDiff(value, prevProps.previewObj[index]);
|
|
115
87
|
});
|
|
116
88
|
|
|
117
89
|
if (objChanged || indexChanged) {
|
|
@@ -128,7 +100,7 @@ export default class AttachmentViewer extends Component {
|
|
|
128
100
|
}
|
|
129
101
|
}
|
|
130
102
|
|
|
131
|
-
if (prevState.selectedIndex != selectedIndex
|
|
103
|
+
if (prevState.selectedIndex != selectedIndex) {
|
|
132
104
|
this.handleMenuValidation();
|
|
133
105
|
}
|
|
134
106
|
}
|
|
@@ -182,8 +154,7 @@ export default class AttachmentViewer extends Component {
|
|
|
182
154
|
// }
|
|
183
155
|
}
|
|
184
156
|
|
|
185
|
-
zoomIn(event, ele) {
|
|
186
|
-
let moveToPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
157
|
+
zoomIn(event, ele, moveToPosition = false) {
|
|
187
158
|
this.setState({
|
|
188
159
|
isZoomed: true
|
|
189
160
|
});
|
|
@@ -229,12 +200,11 @@ export default class AttachmentViewer extends Component {
|
|
|
229
200
|
isZoomed ? this.zoomIn({}, selectedIndex) : this.zoomOut(selectedIndex);
|
|
230
201
|
}
|
|
231
202
|
|
|
232
|
-
getUpdateDataList(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
} = _ref;
|
|
203
|
+
getUpdateDataList({
|
|
204
|
+
index,
|
|
205
|
+
data,
|
|
206
|
+
dataList
|
|
207
|
+
}) {
|
|
238
208
|
data = data || this.state.data;
|
|
239
209
|
dataList = dataList || this.state.dataList;
|
|
240
210
|
const finalDataList = [...dataList];
|
|
@@ -296,10 +266,9 @@ export default class AttachmentViewer extends Component {
|
|
|
296
266
|
this.props.hideAttachmentViewer();
|
|
297
267
|
}
|
|
298
268
|
|
|
299
|
-
responsiveFunc(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
} = _ref2;
|
|
269
|
+
responsiveFunc({
|
|
270
|
+
mediaQueryOR
|
|
271
|
+
}) {
|
|
303
272
|
return {
|
|
304
273
|
uptoTablet: mediaQueryOR([{
|
|
305
274
|
maxWidth: 768
|
|
@@ -336,79 +305,7 @@ export default class AttachmentViewer extends Component {
|
|
|
336
305
|
}, this.props.customProps.iframeProps));
|
|
337
306
|
}
|
|
338
307
|
|
|
339
|
-
getRenderImageFrameCustomClass(_ref3) {
|
|
340
|
-
let {
|
|
341
|
-
canZoom,
|
|
342
|
-
retainZoom,
|
|
343
|
-
isZoomed,
|
|
344
|
-
customImageClass,
|
|
345
|
-
customChildrenClass
|
|
346
|
-
} = _ref3;
|
|
347
|
-
return {
|
|
348
|
-
customImageClass: `${style.img} ${style.altText} ${canZoom || retainZoom ? isZoomed ? `${style.zoomedImg} ${style.zoomOutCursor}` : `${style.normalImg} ${style.zoomInCursor}` : ''} ${customImageClass}`,
|
|
349
|
-
customChildrenClass
|
|
350
|
-
};
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
renderImageFrame(data, i) {
|
|
354
|
-
const {
|
|
355
|
-
selectedIndex,
|
|
356
|
-
isZoomed,
|
|
357
|
-
canZoom,
|
|
358
|
-
isPreviewAttachmentValid
|
|
359
|
-
} = this.state;
|
|
360
|
-
const {
|
|
361
|
-
maintainZoom,
|
|
362
|
-
renderCustomImagePreviewElement
|
|
363
|
-
} = this.props;
|
|
364
|
-
const {
|
|
365
|
-
viewUrl,
|
|
366
|
-
name,
|
|
367
|
-
children,
|
|
368
|
-
dataId = 'attachViewer',
|
|
369
|
-
customClass = {},
|
|
370
|
-
customProps = {},
|
|
371
|
-
imageRef
|
|
372
|
-
} = data;
|
|
373
|
-
const {
|
|
374
|
-
imageProps = {}
|
|
375
|
-
} = customProps;
|
|
376
|
-
const {
|
|
377
|
-
customImageClass = '',
|
|
378
|
-
customChildrenClass = ''
|
|
379
|
-
} = customClass;
|
|
380
|
-
const resolvedImageRef = imageRef;
|
|
381
|
-
const retainZoom = canZoom && selectedIndex == i && maintainZoom;
|
|
382
|
-
const handleZoomOut = isPreviewAttachmentValid && isZoomed ? this.zoomOut.bind(this, i) : undefined;
|
|
383
|
-
const handleZoomIn = isPreviewAttachmentValid && !isZoomed ? e => this.zoomIn(e, i, true) : undefined;
|
|
384
|
-
const handleImageClick = isPreviewAttachmentValid ? isZoomed ? handleZoomOut : handleZoomIn : undefined;
|
|
385
|
-
const imageFrameCustomClass = this.getRenderImageFrameCustomClass({
|
|
386
|
-
canZoom,
|
|
387
|
-
retainZoom,
|
|
388
|
-
isZoomed,
|
|
389
|
-
customImageClass,
|
|
390
|
-
customChildrenClass
|
|
391
|
-
});
|
|
392
|
-
const img = /*#__PURE__*/React.createElement(AttachmentImage, _extends({}, imageProps, {
|
|
393
|
-
customClass: imageFrameCustomClass,
|
|
394
|
-
src: viewUrl,
|
|
395
|
-
onClick: handleImageClick,
|
|
396
|
-
alt: name,
|
|
397
|
-
dataId: dataId,
|
|
398
|
-
id: `img${i}`,
|
|
399
|
-
isCover: false,
|
|
400
|
-
imageRef: resolvedImageRef
|
|
401
|
-
}), children);
|
|
402
|
-
return typeof renderCustomImagePreviewElement === 'function' ? renderCustomImagePreviewElement({
|
|
403
|
-
defaultView: img,
|
|
404
|
-
data,
|
|
405
|
-
index: i
|
|
406
|
-
}) : img;
|
|
407
|
-
}
|
|
408
|
-
|
|
409
308
|
imgPreviewView(downloadUrl) {
|
|
410
|
-
var _this = this;
|
|
411
|
-
|
|
412
309
|
const {
|
|
413
310
|
dataList,
|
|
414
311
|
selectedIndex,
|
|
@@ -448,9 +345,7 @@ export default class AttachmentViewer extends Component {
|
|
|
448
345
|
};
|
|
449
346
|
};
|
|
450
347
|
|
|
451
|
-
return dataList.length && dataList.map(
|
|
452
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
453
|
-
let i = arguments.length > 1 ? arguments[1] : undefined;
|
|
348
|
+
return dataList.length && dataList.map((data = {}, i) => {
|
|
454
349
|
const {
|
|
455
350
|
viewUrl,
|
|
456
351
|
name,
|
|
@@ -486,7 +381,7 @@ export default class AttachmentViewer extends Component {
|
|
|
486
381
|
}, /*#__PURE__*/React.createElement(Box, {
|
|
487
382
|
className: style.imgRef,
|
|
488
383
|
id: `imgPreviewRef${i}`
|
|
489
|
-
}, selectedIndex == i && /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
384
|
+
}, selectedIndex == i && /*#__PURE__*/React.createElement(React.Fragment, null, this.isAudioFileType(name) ? /*#__PURE__*/React.createElement("audio", _extends({
|
|
490
385
|
controls: true,
|
|
491
386
|
className: style.zoomIn,
|
|
492
387
|
"data-id": `${dataId}_audioPreview`,
|
|
@@ -494,7 +389,7 @@ export default class AttachmentViewer extends Component {
|
|
|
494
389
|
}, audioProps), /*#__PURE__*/React.createElement("source", {
|
|
495
390
|
src: previewurl || viewUrl,
|
|
496
391
|
type: `audio/${extension}`
|
|
497
|
-
})) :
|
|
392
|
+
})) : this.isVideoFileType(name) ? /*#__PURE__*/React.createElement("video", _extends({
|
|
498
393
|
controls: true,
|
|
499
394
|
className: style.zoomIn,
|
|
500
395
|
"data-id": `${dataId}_videoPreview`,
|
|
@@ -502,19 +397,29 @@ export default class AttachmentViewer extends Component {
|
|
|
502
397
|
}, videoProps), /*#__PURE__*/React.createElement("source", {
|
|
503
398
|
src: viewUrl,
|
|
504
399
|
type: `video/${extension}`
|
|
505
|
-
})) :
|
|
400
|
+
})) : this.isImageFileType(name) || children ? /*#__PURE__*/React.createElement(AttachmentImage, _extends({
|
|
401
|
+
customClass: {
|
|
402
|
+
customImageClass: `${style.img} ${style.altText} ${canZoom || retainZoom ? isZoomed ? `${style.zoomedImg} ${style.zoomOutCursor}` : `${style.normalImg} ${style.zoomInCursor}` : ''} ${customImageClass}`,
|
|
403
|
+
customChildrenClass
|
|
404
|
+
},
|
|
405
|
+
src: viewUrl,
|
|
406
|
+
onClick: isPreviewAttachmentValid ? isZoomed ? this.zoomOut.bind(this, i) : e => this.zoomIn(e, i, true) : undefined,
|
|
407
|
+
alt: name,
|
|
408
|
+
dataId: dataId,
|
|
409
|
+
id: `img${i}`,
|
|
410
|
+
isCover: false
|
|
411
|
+
}, imageProps), children) : type === "document" && previewurl != null ? this.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/React.createElement("div", {
|
|
506
412
|
className: style.previewNone
|
|
507
413
|
}, /*#__PURE__*/React.createElement("div", {
|
|
508
414
|
className: style.fileTypeImg
|
|
509
|
-
},
|
|
415
|
+
}, this.getPreviewIconData(name, '70')), /*#__PURE__*/React.createElement(Typography, {
|
|
510
416
|
$ui_size: "20",
|
|
511
417
|
$ui_weight: "semibold"
|
|
512
418
|
}, previewUnsupportedText), downloadUrl ? /*#__PURE__*/React.createElement(Link, {
|
|
513
419
|
href: downloadUrl,
|
|
514
|
-
download: true,
|
|
515
|
-
downloadName: name,
|
|
516
420
|
className: style.downloadLink,
|
|
517
|
-
hasReload: true
|
|
421
|
+
hasReload: true,
|
|
422
|
+
download: true
|
|
518
423
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
519
424
|
palette: "primaryFilled",
|
|
520
425
|
text: downloadText
|
|
@@ -537,9 +442,7 @@ export default class AttachmentViewer extends Component {
|
|
|
537
442
|
i18nKeys,
|
|
538
443
|
isActive,
|
|
539
444
|
dataId,
|
|
540
|
-
customProps
|
|
541
|
-
showCount,
|
|
542
|
-
renderCustomIcons
|
|
445
|
+
customProps
|
|
543
446
|
} = this.props;
|
|
544
447
|
const {
|
|
545
448
|
avatarProps = {}
|
|
@@ -567,236 +470,228 @@ export default class AttachmentViewer extends Component {
|
|
|
567
470
|
}, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
|
|
568
471
|
responsiveId: responsiveId,
|
|
569
472
|
query: this.responsiveFunc
|
|
570
|
-
},
|
|
473
|
+
}, ({
|
|
474
|
+
uptoTablet
|
|
475
|
+
}) => /*#__PURE__*/React.createElement(Container, {
|
|
476
|
+
scroll: "none",
|
|
477
|
+
"data-scroll-palette": "dark"
|
|
478
|
+
}, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Container, {
|
|
479
|
+
alignBox: "row",
|
|
480
|
+
className: style.header,
|
|
481
|
+
align: "between",
|
|
482
|
+
tabindex: "0"
|
|
483
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
484
|
+
shrink: true,
|
|
485
|
+
className: style.title,
|
|
486
|
+
"data-title": selectedAttachment.name,
|
|
487
|
+
dataId: "attachName",
|
|
488
|
+
id: ariaId
|
|
489
|
+
}, selectedAttachment.name), /*#__PURE__*/React.createElement(Box, {
|
|
490
|
+
flexible: true,
|
|
491
|
+
className: style.count,
|
|
492
|
+
dataId: "attachCountContainer"
|
|
493
|
+
}, selectedIndex + 1, "/", totalLen), /*#__PURE__*/React.createElement(Box, {
|
|
494
|
+
className: uptoTablet ? style.mbleMenuBar : style.menuBar
|
|
495
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
496
|
+
isInline: true,
|
|
497
|
+
alignBox: uptoTablet ? 'column-reverse' : 'row',
|
|
498
|
+
align: uptoTablet ? 'bottom' : 'center',
|
|
499
|
+
wrap: "wrap",
|
|
500
|
+
isCover: false
|
|
501
|
+
}, canZoom ? isZoomed ? /*#__PURE__*/React.createElement("div", {
|
|
502
|
+
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
503
|
+
onClick: this.zoomOut.bind(this, selectedIndex),
|
|
504
|
+
"data-id": "zoomOut",
|
|
505
|
+
"data-test-id": "zoomOut",
|
|
506
|
+
"data-title": i18nKeys.zoomOutText
|
|
507
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
508
|
+
iconName: "ZD-GN-zoomOut",
|
|
509
|
+
className: style.menuIcon,
|
|
510
|
+
iconSize: "16",
|
|
511
|
+
hoverType: "border",
|
|
512
|
+
a11y: {
|
|
513
|
+
ariaLabel: i18nKeys.zoomOutText
|
|
514
|
+
}
|
|
515
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
516
|
+
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
517
|
+
onClick: e => this.zoomIn(e, selectedIndex),
|
|
518
|
+
"data-id": "zoomIn",
|
|
519
|
+
"data-test-id": "zoomIn",
|
|
520
|
+
"data-title": i18nKeys.zoomInText
|
|
521
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
522
|
+
iconName: "ZD-GN-zoomIn",
|
|
523
|
+
className: style.menuIcon,
|
|
524
|
+
iconSize: "16",
|
|
525
|
+
hoverType: "border",
|
|
526
|
+
a11y: {
|
|
527
|
+
ariaLabel: i18nKeys.zoomInText
|
|
528
|
+
}
|
|
529
|
+
})) : null, canOpenInNewTab ? /*#__PURE__*/React.createElement("div", {
|
|
530
|
+
className: uptoTablet ? style.mobileMenu : style.menu
|
|
531
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
532
|
+
href: selectedImgUrl,
|
|
533
|
+
target: "_blank",
|
|
534
|
+
dataId: "newTabAttach",
|
|
535
|
+
title: i18nKeys.newTabText
|
|
536
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
537
|
+
iconName: "ZD-GN-newLink",
|
|
538
|
+
className: style.menuIcon,
|
|
539
|
+
iconSize: "16",
|
|
540
|
+
hoverType: "border",
|
|
541
|
+
needButtonTag: false,
|
|
542
|
+
a11y: {
|
|
543
|
+
ariaLabel: i18nKeys.newTabText
|
|
544
|
+
}
|
|
545
|
+
}))) : null, needDownload ? /*#__PURE__*/React.createElement("div", {
|
|
546
|
+
className: uptoTablet ? style.mobileMenu : style.menu
|
|
547
|
+
}, /*#__PURE__*/React.createElement(Link, {
|
|
548
|
+
href: downloadUrl,
|
|
549
|
+
target: "_parent",
|
|
550
|
+
hasReload: true,
|
|
551
|
+
download: true,
|
|
552
|
+
title: i18nKeys.downloadText,
|
|
553
|
+
dataId: `${dataId}_downloadAttach`
|
|
554
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
555
|
+
iconName: "ZD-GN-download",
|
|
556
|
+
className: style.menuIcon,
|
|
557
|
+
iconSize: "16",
|
|
558
|
+
hoverType: "border",
|
|
559
|
+
needButtonTag: false,
|
|
560
|
+
a11y: {
|
|
561
|
+
ariaLabel: i18nKeys.downloadText
|
|
562
|
+
}
|
|
563
|
+
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
564
|
+
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
565
|
+
onClick: this.closeAttachmentViewer,
|
|
566
|
+
"data-id": "closeAttach",
|
|
567
|
+
"data-test-id": "closeAttach",
|
|
568
|
+
"data-title": i18nKeys.closeText
|
|
569
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
570
|
+
iconName: "ZD-cross",
|
|
571
|
+
iconSize: "15",
|
|
572
|
+
hoverType: "border",
|
|
573
|
+
className: style.menuIcon,
|
|
574
|
+
a11y: {
|
|
575
|
+
ariaLabel: i18nKeys.closeText
|
|
576
|
+
},
|
|
577
|
+
title: i18nKeys.closeText
|
|
578
|
+
})))))), /*#__PURE__*/React.createElement(Box, {
|
|
579
|
+
flexible: true,
|
|
580
|
+
role: "toolbar",
|
|
581
|
+
tabindex: "0"
|
|
582
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
583
|
+
alignBox: "row"
|
|
584
|
+
}, /*#__PURE__*/React.createElement(Box, {
|
|
585
|
+
className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${selectedIndex === 0 ? style.hidden : ''}`,
|
|
586
|
+
onClick: this.changeSelectedIndex.bind(this, selectedIndex - 1),
|
|
587
|
+
"data-title": i18nKeys.previousText,
|
|
588
|
+
"data-title-position": "left"
|
|
589
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
590
|
+
className: style.btn,
|
|
591
|
+
"aria-label": i18nKeys.previousText
|
|
592
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
593
|
+
name: "ZD-arrowLeft3",
|
|
594
|
+
iconClass: style.arrow,
|
|
595
|
+
dataId: "leftAttachNav",
|
|
596
|
+
isBold: true
|
|
597
|
+
}))), /*#__PURE__*/React.createElement(Box, {
|
|
598
|
+
className: style.previewBox,
|
|
599
|
+
tabindex: "0",
|
|
600
|
+
"aria-describedby": ariaId,
|
|
601
|
+
isShrink: false,
|
|
602
|
+
eleRef: this.setImgBoxRef,
|
|
603
|
+
scroll: "both",
|
|
604
|
+
flexible: true
|
|
605
|
+
}, this.imgPreviewView(downloadUrl)), /*#__PURE__*/React.createElement(Box, {
|
|
606
|
+
className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${totalLen === selectedIndex + 1 ? style.hidden : ''}`,
|
|
607
|
+
onClick: this.changeSelectedIndex.bind(this, selectedIndex + 1),
|
|
608
|
+
"data-title": i18nKeys.nextText,
|
|
609
|
+
"data-title-position": "right"
|
|
610
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
611
|
+
className: style.btn,
|
|
612
|
+
"aria-label": i18nKeys.nextText
|
|
613
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
614
|
+
name: "ZD-arrowRight3",
|
|
615
|
+
iconClass: style.arrow,
|
|
616
|
+
dataId: "rightAttachNav",
|
|
617
|
+
isBold: true
|
|
618
|
+
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
619
|
+
className: `${style.footer} ${isPViewListOpen && totalLen !== 1 ? style.footerHeight : style.footerHide} `,
|
|
620
|
+
dataId: `${dataId}_attachPreviewFooter`
|
|
621
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
622
|
+
align: "vertical",
|
|
623
|
+
alignBox: "row",
|
|
624
|
+
className: style.footerHeight
|
|
625
|
+
}, author && /*#__PURE__*/React.createElement(Box, {
|
|
626
|
+
className: style.author,
|
|
627
|
+
dataId: `${dataId}_authorName`
|
|
628
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
629
|
+
alignBox: "row",
|
|
630
|
+
align: "both"
|
|
631
|
+
}, /*#__PURE__*/React.createElement(Avatar, _extends({
|
|
632
|
+
name: authorName,
|
|
633
|
+
size: "xmedium",
|
|
634
|
+
src: authorHref,
|
|
635
|
+
palette: "info"
|
|
636
|
+
}, avatarProps)), /*#__PURE__*/React.createElement(Box, {
|
|
637
|
+
flexible: true,
|
|
638
|
+
className: style.authorName,
|
|
639
|
+
"data-title": authorName
|
|
640
|
+
}, authorName))), /*#__PURE__*/React.createElement(Box, {
|
|
641
|
+
flexible: true
|
|
642
|
+
}, /*#__PURE__*/React.createElement(Container, {
|
|
643
|
+
align: "vertical",
|
|
644
|
+
alignBox: "row",
|
|
645
|
+
scroll: "horizontal",
|
|
646
|
+
eleRef: el => this.imgListCont = el,
|
|
647
|
+
className: style.listContainer
|
|
648
|
+
}, data.map((item, index) => {
|
|
649
|
+
const {
|
|
650
|
+
name,
|
|
651
|
+
viewUrl,
|
|
652
|
+
children,
|
|
653
|
+
customClass = {},
|
|
654
|
+
dataId = 'AttachmentImage',
|
|
655
|
+
customProps = {}
|
|
656
|
+
} = item;
|
|
571
657
|
let {
|
|
572
|
-
|
|
573
|
-
} =
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
"data-title":
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
className: uptoTablet ? style.mbleMenuBar : style.menuBar
|
|
594
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
595
|
-
isInline: true,
|
|
596
|
-
alignBox: uptoTablet ? 'column-reverse' : 'row',
|
|
597
|
-
align: uptoTablet ? 'bottom' : 'center',
|
|
598
|
-
wrap: "wrap",
|
|
599
|
-
isCover: false
|
|
600
|
-
}, typeof renderCustomIcons === 'function' && renderCustomIcons({
|
|
601
|
-
selectedAttachment,
|
|
602
|
-
selectedIndex,
|
|
603
|
-
totalLen
|
|
604
|
-
}), canZoom ? isZoomed ? /*#__PURE__*/React.createElement("div", {
|
|
605
|
-
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
606
|
-
onClick: this.zoomOut.bind(this, selectedIndex),
|
|
607
|
-
"data-id": "zoomOut",
|
|
608
|
-
"data-test-id": "zoomOut",
|
|
609
|
-
"data-title": i18nKeys.zoomOutText
|
|
610
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
611
|
-
iconName: "ZD-GN-zoomOut",
|
|
612
|
-
className: style.menuIcon,
|
|
613
|
-
iconSize: "16",
|
|
614
|
-
hoverType: "border",
|
|
615
|
-
a11y: {
|
|
616
|
-
ariaLabel: i18nKeys.zoomOutText
|
|
617
|
-
}
|
|
618
|
-
})) : /*#__PURE__*/React.createElement("div", {
|
|
619
|
-
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
620
|
-
onClick: e => this.zoomIn(e, selectedIndex),
|
|
621
|
-
"data-id": "zoomIn",
|
|
622
|
-
"data-test-id": "zoomIn",
|
|
623
|
-
"data-title": i18nKeys.zoomInText
|
|
624
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
625
|
-
iconName: "ZD-GN-zoomIn",
|
|
626
|
-
className: style.menuIcon,
|
|
627
|
-
iconSize: "16",
|
|
628
|
-
hoverType: "border",
|
|
629
|
-
a11y: {
|
|
630
|
-
ariaLabel: i18nKeys.zoomInText
|
|
631
|
-
}
|
|
632
|
-
})) : null, canOpenInNewTab ? /*#__PURE__*/React.createElement("div", {
|
|
633
|
-
className: uptoTablet ? style.mobileMenu : style.menu
|
|
634
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
635
|
-
href: selectedImgUrl,
|
|
636
|
-
target: "_blank",
|
|
637
|
-
dataId: "newTabAttach",
|
|
638
|
-
title: i18nKeys.newTabText
|
|
639
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
640
|
-
iconName: "ZD-GN-newLink",
|
|
641
|
-
className: style.menuIcon,
|
|
642
|
-
iconSize: "16",
|
|
643
|
-
hoverType: "border",
|
|
644
|
-
needButtonTag: false,
|
|
645
|
-
a11y: {
|
|
646
|
-
ariaLabel: i18nKeys.newTabText
|
|
647
|
-
}
|
|
648
|
-
}))) : null, needDownload ? /*#__PURE__*/React.createElement("div", {
|
|
649
|
-
className: uptoTablet ? style.mobileMenu : style.menu
|
|
650
|
-
}, /*#__PURE__*/React.createElement(Link, {
|
|
651
|
-
href: downloadUrl,
|
|
652
|
-
downloadName: selectedAttachment.name,
|
|
653
|
-
target: "_parent",
|
|
654
|
-
hasReload: true,
|
|
655
|
-
download: true,
|
|
656
|
-
title: i18nKeys.downloadText,
|
|
657
|
-
dataId: `${dataId}_downloadAttach`
|
|
658
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
659
|
-
iconName: "ZD-GN-download",
|
|
660
|
-
className: style.menuIcon,
|
|
661
|
-
iconSize: "16",
|
|
662
|
-
hoverType: "border",
|
|
663
|
-
needButtonTag: false,
|
|
664
|
-
a11y: {
|
|
665
|
-
ariaLabel: i18nKeys.downloadText
|
|
666
|
-
}
|
|
667
|
-
}))) : null, /*#__PURE__*/React.createElement("div", {
|
|
668
|
-
className: uptoTablet ? style.mobileMenu : style.menu,
|
|
669
|
-
onClick: this.closeAttachmentViewer,
|
|
670
|
-
"data-id": "closeAttach",
|
|
671
|
-
"data-test-id": "closeAttach",
|
|
672
|
-
"data-title": i18nKeys.closeText
|
|
673
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
674
|
-
iconName: "ZD-cross",
|
|
675
|
-
iconSize: "15",
|
|
676
|
-
hoverType: "border",
|
|
677
|
-
className: style.menuIcon,
|
|
678
|
-
a11y: {
|
|
679
|
-
ariaLabel: i18nKeys.closeText
|
|
680
|
-
},
|
|
681
|
-
title: i18nKeys.closeText
|
|
682
|
-
})))))), /*#__PURE__*/React.createElement(Box, {
|
|
683
|
-
flexible: true,
|
|
684
|
-
role: "toolbar",
|
|
685
|
-
tabindex: "0"
|
|
686
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
687
|
-
alignBox: "row"
|
|
688
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
689
|
-
className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${selectedIndex === 0 ? style.hidden : ''}`,
|
|
690
|
-
onClick: this.changeSelectedIndex.bind(this, selectedIndex - 1),
|
|
691
|
-
"data-title": i18nKeys.previousText,
|
|
692
|
-
"data-title-position": "left"
|
|
693
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
694
|
-
className: style.btn,
|
|
695
|
-
"aria-label": i18nKeys.previousText
|
|
696
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
697
|
-
name: "ZD-arrowLeft3",
|
|
698
|
-
iconClass: style.arrow,
|
|
699
|
-
dataId: "leftAttachNav",
|
|
700
|
-
isBold: true
|
|
701
|
-
}))), /*#__PURE__*/React.createElement(Box, {
|
|
702
|
-
className: style.previewBox,
|
|
703
|
-
tabindex: "0",
|
|
704
|
-
"aria-describedby": ariaId,
|
|
705
|
-
isShrink: false,
|
|
706
|
-
eleRef: this.setImgBoxRef,
|
|
707
|
-
scroll: "both",
|
|
708
|
-
flexible: true
|
|
709
|
-
}, this.imgPreviewView(downloadUrl)), /*#__PURE__*/React.createElement(Box, {
|
|
710
|
-
className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${totalLen === selectedIndex + 1 ? style.hidden : ''}`,
|
|
711
|
-
onClick: this.changeSelectedIndex.bind(this, selectedIndex + 1),
|
|
712
|
-
"data-title": i18nKeys.nextText,
|
|
713
|
-
"data-title-position": "right"
|
|
714
|
-
}, /*#__PURE__*/React.createElement("button", {
|
|
715
|
-
className: style.btn,
|
|
716
|
-
"aria-label": i18nKeys.nextText
|
|
717
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
718
|
-
name: "ZD-arrowRight3",
|
|
719
|
-
iconClass: style.arrow,
|
|
720
|
-
dataId: "rightAttachNav",
|
|
721
|
-
isBold: true
|
|
722
|
-
}))))), /*#__PURE__*/React.createElement(Box, {
|
|
723
|
-
className: `${style.footer} ${isPViewListOpen && totalLen !== 1 ? style.footerHeight : style.footerHide} `,
|
|
724
|
-
dataId: `${dataId}_attachPreviewFooter`
|
|
725
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
726
|
-
align: "vertical",
|
|
727
|
-
alignBox: "row",
|
|
728
|
-
className: style.footerHeight
|
|
729
|
-
}, author && /*#__PURE__*/React.createElement(Box, {
|
|
730
|
-
className: style.author,
|
|
731
|
-
dataId: `${dataId}_authorName`
|
|
732
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
733
|
-
alignBox: "row",
|
|
734
|
-
align: "both"
|
|
735
|
-
}, /*#__PURE__*/React.createElement(Avatar, _extends({
|
|
736
|
-
name: authorName,
|
|
737
|
-
size: "xmedium",
|
|
738
|
-
src: authorHref,
|
|
739
|
-
palette: "info"
|
|
740
|
-
}, avatarProps)), /*#__PURE__*/React.createElement(Box, {
|
|
741
|
-
flexible: true,
|
|
742
|
-
className: style.authorName,
|
|
743
|
-
"data-title": authorName
|
|
744
|
-
}, authorName))), /*#__PURE__*/React.createElement(Box, {
|
|
745
|
-
flexible: true
|
|
746
|
-
}, /*#__PURE__*/React.createElement(Container, {
|
|
747
|
-
align: "vertical",
|
|
748
|
-
alignBox: "row",
|
|
749
|
-
scroll: "horizontal",
|
|
750
|
-
eleRef: el => this.imgListCont = el,
|
|
751
|
-
className: style.listContainer
|
|
752
|
-
}, data.map((item, index) => {
|
|
753
|
-
const {
|
|
754
|
-
name,
|
|
755
|
-
viewUrl,
|
|
756
|
-
children,
|
|
757
|
-
customClass = {},
|
|
758
|
-
dataId = 'AttachmentImage',
|
|
759
|
-
customProps = {}
|
|
760
|
-
} = item;
|
|
761
|
-
let {
|
|
762
|
-
thumbnail
|
|
763
|
-
} = item;
|
|
764
|
-
const isImageFileType = this.isImageFileType(name) || thumbnail;
|
|
765
|
-
const {
|
|
766
|
-
customImageClass = '',
|
|
767
|
-
customChildrenClass = ''
|
|
768
|
-
} = customClass;
|
|
769
|
-
return /*#__PURE__*/React.createElement(Box, {
|
|
770
|
-
className: `${style.imgItem} ${index === selectedIndex ? style.selected : ''} ${isImageFileType ? '' : style.previewIconDiv}`,
|
|
771
|
-
key: index,
|
|
772
|
-
onClick: this.changeSelectedIndex.bind(this, index),
|
|
773
|
-
eleRef: el => this[`img_${index}`] = el,
|
|
774
|
-
dataId: "attachPreviewList",
|
|
775
|
-
"data-title": name
|
|
776
|
-
}, isImageFileType || children ? /*#__PURE__*/React.createElement(AttachmentImage, _extends({
|
|
777
|
-
src: thumbnail || viewUrl,
|
|
778
|
-
size: "small",
|
|
779
|
-
alt: name,
|
|
780
|
-
customClass: {
|
|
781
|
-
customImageClass: `${style.image} ${style.altText} ${customImageClass}`,
|
|
782
|
-
customChildrenClass: `${style.crsrPointer} ${customChildrenClass}`
|
|
783
|
-
},
|
|
784
|
-
dataId: dataId
|
|
785
|
-
}, customProps), children) : this.getPreviewIconData(name, '40'));
|
|
786
|
-
}))))), totalLen !== 1 && /*#__PURE__*/React.createElement(IconButton, {
|
|
787
|
-
dataId: "attachToggle",
|
|
788
|
-
onClick: this.togglePViewList,
|
|
789
|
-
iconName: "ZD-GN-hideTab",
|
|
790
|
-
iconSize: "14",
|
|
791
|
-
hoverType: "border",
|
|
792
|
-
iconClass: `${style.thumpIcon} ${isPViewListOpen ? style.thumpIconActive : ''}`,
|
|
793
|
-
className: style.button,
|
|
794
|
-
a11y: {
|
|
795
|
-
ariaLabel: i18nKeys.hideText
|
|
658
|
+
thumbnail
|
|
659
|
+
} = item;
|
|
660
|
+
const isImageFileType = this.isImageFileType(name) || thumbnail;
|
|
661
|
+
const {
|
|
662
|
+
customImageClass = '',
|
|
663
|
+
customChildrenClass = ''
|
|
664
|
+
} = customClass;
|
|
665
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
666
|
+
className: `${style.imgItem} ${index === selectedIndex ? style.selected : ''} ${isImageFileType ? '' : style.previewIconDiv}`,
|
|
667
|
+
key: index,
|
|
668
|
+
onClick: this.changeSelectedIndex.bind(this, index),
|
|
669
|
+
eleRef: el => this[`img_${index}`] = el,
|
|
670
|
+
dataId: "attachPreviewList",
|
|
671
|
+
"data-title": name
|
|
672
|
+
}, isImageFileType || children ? /*#__PURE__*/React.createElement(AttachmentImage, _extends({
|
|
673
|
+
src: thumbnail || viewUrl,
|
|
674
|
+
size: "small",
|
|
675
|
+
alt: name,
|
|
676
|
+
customClass: {
|
|
677
|
+
customImageClass: `${style.image} ${style.altText} ${customImageClass}`,
|
|
678
|
+
customChildrenClass: `${style.crsrPointer} ${customChildrenClass}`
|
|
796
679
|
},
|
|
797
|
-
|
|
798
|
-
}));
|
|
799
|
-
}))
|
|
680
|
+
dataId: dataId
|
|
681
|
+
}, customProps), children) : this.getPreviewIconData(name, '40'));
|
|
682
|
+
}))))), totalLen !== 1 && /*#__PURE__*/React.createElement(IconButton, {
|
|
683
|
+
dataId: "attachToggle",
|
|
684
|
+
onClick: this.togglePViewList,
|
|
685
|
+
iconName: "ZD-GN-hideTab",
|
|
686
|
+
iconSize: "14",
|
|
687
|
+
hoverType: "border",
|
|
688
|
+
iconClass: `${style.thumpIcon} ${isPViewListOpen ? style.thumpIconActive : ''}`,
|
|
689
|
+
className: style.button,
|
|
690
|
+
a11y: {
|
|
691
|
+
ariaLabel: i18nKeys.hideText
|
|
692
|
+
},
|
|
693
|
+
title: isPViewListOpen ? i18nKeys.hideText : i18nKeys.showText
|
|
694
|
+
}))));
|
|
800
695
|
}
|
|
801
696
|
|
|
802
697
|
}
|