@zohodesk/dot 1.0.0-temp-230.2 → 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.
Files changed (63) hide show
  1. package/README.md +2 -11
  2. package/es/ActionButton/__tests__/ActionButton.spec.js +4 -5
  3. package/es/AttachmentViewer/AttachmentImage.js +1 -3
  4. package/es/AttachmentViewer/AttachmentViewer.js +252 -358
  5. package/es/AttachmentViewer/AttachmentViewer.module.css +1 -1
  6. package/es/AttachmentViewer/props/defaultProps.js +1 -2
  7. package/es/AttachmentViewer/props/propTypes.js +1 -9
  8. package/es/AttachmentViewer/utils.js +6 -7
  9. package/es/AudioPlayer/utils/utils.js +2 -5
  10. package/es/DotProvider/hooks/useDotProvider.js +14 -15
  11. package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +21 -16
  12. package/es/DotProvider/utils/assetPromiseHandlers/themeAppearanceAssetPromise.js +3 -4
  13. package/es/DotProvider/utils/assetPromiseHandlers/themeColorAssetPromise.js +4 -5
  14. package/es/DotProvider/utils/errorValidation.js +5 -6
  15. package/es/DotProvider/utils/getAssetsImportPromises.js +4 -5
  16. package/es/Drawer/Drawer.js +6 -8
  17. package/es/FreezeLayer/css/cssJSLogic.js +4 -5
  18. package/es/Hooks/Dragger/useDragger.js +5 -6
  19. package/es/Hooks/Dragger/utils/DraggerUtil.js +7 -8
  20. package/es/Hooks/useFreezeLayer.js +4 -5
  21. package/es/Link/Link.js +3 -4
  22. package/es/Link/props/propTypes.js +0 -1
  23. package/es/Onboarding/CarouselDots/CarouselDots.js +29 -32
  24. package/es/Onboarding/Onboarding.js +23 -24
  25. package/es/Onboarding/hooks/useOnboarding.js +4 -5
  26. package/es/Onboarding/hooks/useOnboardingSlider.js +5 -6
  27. package/es/deprecated/SelectDropdown/SelectDropdown.js +43 -47
  28. package/es/dropdown/ToggleDropDown/ToggleDropDown.js +214 -225
  29. package/es/errorstate/Inconvenience/Inconvenience.js +32 -36
  30. package/es/errorstate/NoRequestFound/NoRequestFound.js +32 -36
  31. package/es/errorstate/PermissionPlay/PermissionPlay.js +31 -35
  32. package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.js +32 -36
  33. package/es/errorstate/UnableToProcess/UnableToProcess.js +32 -36
  34. package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.js +32 -36
  35. package/es/errorstate/WillBack/WillBack.js +30 -34
  36. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +81 -85
  37. package/es/list/status/StatusDropdown/StatusDropdown.js +109 -113
  38. package/es/list/status/StatusDropdown/__tests__/StatusDropdown.spec.js +3 -4
  39. package/es/lookup/header/Search/Search.js +4 -5
  40. package/es/lookup/header/Search/__tests__/Search.spec.js +3 -4
  41. package/es/lookup/header/ViewDropDown/ViewDropDown.js +67 -75
  42. package/es/utils/General.js +2 -7
  43. package/es/utils/editorUtils.js +1 -5
  44. package/es/version2/lookup/AlertHeader/AlertHeader.js +5 -3
  45. package/es/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +24 -0
  46. package/es/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
  47. package/es/version2/lookup/AlertHeader/css/cssJSLogic.js +4 -5
  48. package/es/version2/lookup/AlertHeader/props/propTypes.js +2 -1
  49. package/es/version2/notification/DesktopNotification/DesktopNotification.js +59 -63
  50. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.js +40 -44
  51. package/lib/AttachmentViewer/AttachmentImage.js +1 -3
  52. package/lib/AttachmentViewer/AttachmentViewer.js +80 -181
  53. package/lib/AttachmentViewer/AttachmentViewer.module.css +1 -1
  54. package/lib/AttachmentViewer/props/defaultProps.js +1 -2
  55. package/lib/AttachmentViewer/props/propTypes.js +1 -9
  56. package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +9 -3
  57. package/lib/Link/Link.js +3 -4
  58. package/lib/Link/props/propTypes.js +0 -1
  59. package/lib/version2/lookup/AlertHeader/AlertHeader.js +5 -2
  60. package/lib/version2/lookup/AlertHeader/__tests__/AlertHeader.spec.js +26 -0
  61. package/lib/version2/lookup/AlertHeader/__tests__/__snapshots__/AlertHeader.spec.js.snap +34 -0
  62. package/lib/version2/lookup/AlertHeader/props/propTypes.js +2 -1
  63. package/package.json +7 -7
@@ -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); // this.updateItem = this.updateItem.bind(this);
51
- } // updateItem(idOrIndex, changes) {
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,9 +80,8 @@ 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[0]?.viewUrl !== prevState.data[0]?.viewUrl; // Triggers an update if the previewed attachment is edited by the Attachment Annotator.
111
83
 
112
- if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged || attachmentPreviewUrlChanged) {
84
+ if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged) {
113
85
  let objChanged = previewObj.previewData.some((value, index) => {
114
86
  return shallowDiff(value, prevProps.previewObj[index]);
115
87
  });
@@ -128,7 +100,7 @@ export default class AttachmentViewer extends Component {
128
100
  }
129
101
  }
130
102
 
131
- if (prevState.selectedIndex != selectedIndex || attachmentPreviewUrlChanged) {
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(_ref) {
233
- let {
234
- index,
235
- data,
236
- dataList
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(_ref2) {
300
- let {
301
- mediaQueryOR
302
- } = _ref2;
269
+ responsiveFunc({
270
+ mediaQueryOR
271
+ }) {
303
272
  return {
304
273
  uptoTablet: mediaQueryOR([{
305
274
  maxWidth: 768
@@ -336,80 +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({
393
- customClass: imageFrameCustomClass,
394
- src: viewUrl,
395
- onClick: handleImageClick,
396
- alt: name,
397
- dataId: dataId,
398
- id: `img${i}`,
399
- isCover: false
400
- }, imageProps, {
401
- imageRef: resolvedImageRef
402
- }), children);
403
- return typeof renderCustomImagePreviewElement === 'function' ? renderCustomImagePreviewElement({
404
- defaultView: img,
405
- data,
406
- index: i
407
- }) : img;
408
- }
409
-
410
308
  imgPreviewView(downloadUrl) {
411
- var _this = this;
412
-
413
309
  const {
414
310
  dataList,
415
311
  selectedIndex,
@@ -449,9 +345,7 @@ export default class AttachmentViewer extends Component {
449
345
  };
450
346
  };
451
347
 
452
- return dataList.length && dataList.map(function () {
453
- let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
454
- let i = arguments.length > 1 ? arguments[1] : undefined;
348
+ return dataList.length && dataList.map((data = {}, i) => {
455
349
  const {
456
350
  viewUrl,
457
351
  name,
@@ -487,7 +381,7 @@ export default class AttachmentViewer extends Component {
487
381
  }, /*#__PURE__*/React.createElement(Box, {
488
382
  className: style.imgRef,
489
383
  id: `imgPreviewRef${i}`
490
- }, selectedIndex == i && /*#__PURE__*/React.createElement(React.Fragment, null, _this.isAudioFileType(name) ? /*#__PURE__*/React.createElement("audio", _extends({
384
+ }, selectedIndex == i && /*#__PURE__*/React.createElement(React.Fragment, null, this.isAudioFileType(name) ? /*#__PURE__*/React.createElement("audio", _extends({
491
385
  controls: true,
492
386
  className: style.zoomIn,
493
387
  "data-id": `${dataId}_audioPreview`,
@@ -495,7 +389,7 @@ export default class AttachmentViewer extends Component {
495
389
  }, audioProps), /*#__PURE__*/React.createElement("source", {
496
390
  src: previewurl || viewUrl,
497
391
  type: `audio/${extension}`
498
- })) : _this.isVideoFileType(name) ? /*#__PURE__*/React.createElement("video", _extends({
392
+ })) : this.isVideoFileType(name) ? /*#__PURE__*/React.createElement("video", _extends({
499
393
  controls: true,
500
394
  className: style.zoomIn,
501
395
  "data-id": `${dataId}_videoPreview`,
@@ -503,19 +397,29 @@ export default class AttachmentViewer extends Component {
503
397
  }, videoProps), /*#__PURE__*/React.createElement("source", {
504
398
  src: viewUrl,
505
399
  type: `video/${extension}`
506
- })) : _this.isImageFileType(name) || children ? _this.renderImageFrame(data, i) : type === "document" && previewurl != null ? _this.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/React.createElement("div", {
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", {
507
412
  className: style.previewNone
508
413
  }, /*#__PURE__*/React.createElement("div", {
509
414
  className: style.fileTypeImg
510
- }, _this.getPreviewIconData(name, '70')), /*#__PURE__*/React.createElement(Typography, {
415
+ }, this.getPreviewIconData(name, '70')), /*#__PURE__*/React.createElement(Typography, {
511
416
  $ui_size: "20",
512
417
  $ui_weight: "semibold"
513
418
  }, previewUnsupportedText), downloadUrl ? /*#__PURE__*/React.createElement(Link, {
514
419
  href: downloadUrl,
515
- download: true,
516
- downloadName: name,
517
420
  className: style.downloadLink,
518
- hasReload: true
421
+ hasReload: true,
422
+ download: true
519
423
  }, /*#__PURE__*/React.createElement(Button, {
520
424
  palette: "primaryFilled",
521
425
  text: downloadText
@@ -538,9 +442,7 @@ export default class AttachmentViewer extends Component {
538
442
  i18nKeys,
539
443
  isActive,
540
444
  dataId,
541
- customProps,
542
- showCount,
543
- renderCustomIcons
445
+ customProps
544
446
  } = this.props;
545
447
  const {
546
448
  avatarProps = {}
@@ -568,236 +470,228 @@ export default class AttachmentViewer extends Component {
568
470
  }, /*#__PURE__*/React.createElement(ResponsiveReceiver, {
569
471
  responsiveId: responsiveId,
570
472
  query: this.responsiveFunc
571
- }, _ref4 => {
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;
572
657
  let {
573
- uptoTablet
574
- } = _ref4;
575
- return /*#__PURE__*/React.createElement(Container, {
576
- scroll: "none",
577
- "data-scroll-palette": "dark"
578
- }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(Container, {
579
- alignBox: "row",
580
- className: style.header,
581
- align: "between",
582
- tabindex: "0"
583
- }, /*#__PURE__*/React.createElement(Box, {
584
- shrink: true,
585
- className: style.title,
586
- "data-title": selectedAttachment.name,
587
- dataId: "attachName",
588
- id: ariaId
589
- }, selectedAttachment.name), showCount && /*#__PURE__*/React.createElement(Box, {
590
- flexible: true,
591
- className: style.count,
592
- dataId: "attachCountContainer"
593
- }, selectedIndex + 1, "/", totalLen), /*#__PURE__*/React.createElement(Box, {
594
- className: uptoTablet ? style.mbleMenuBar : style.menuBar
595
- }, /*#__PURE__*/React.createElement(Container, {
596
- isInline: true,
597
- alignBox: uptoTablet ? 'column-reverse' : 'row',
598
- align: uptoTablet ? 'bottom' : 'center',
599
- wrap: "wrap",
600
- isCover: false
601
- }, typeof renderCustomIcons === 'function' && renderCustomIcons({
602
- selectedAttachment,
603
- selectedIndex,
604
- totalLen
605
- }), canZoom ? isZoomed ? /*#__PURE__*/React.createElement("div", {
606
- className: uptoTablet ? style.mobileMenu : style.menu,
607
- onClick: this.zoomOut.bind(this, selectedIndex),
608
- "data-id": "zoomOut",
609
- "data-test-id": "zoomOut",
610
- "data-title": i18nKeys.zoomOutText
611
- }, /*#__PURE__*/React.createElement(IconButton, {
612
- iconName: "ZD-GN-zoomOut",
613
- className: style.menuIcon,
614
- iconSize: "16",
615
- hoverType: "border",
616
- a11y: {
617
- ariaLabel: i18nKeys.zoomOutText
618
- }
619
- })) : /*#__PURE__*/React.createElement("div", {
620
- className: uptoTablet ? style.mobileMenu : style.menu,
621
- onClick: e => this.zoomIn(e, selectedIndex),
622
- "data-id": "zoomIn",
623
- "data-test-id": "zoomIn",
624
- "data-title": i18nKeys.zoomInText
625
- }, /*#__PURE__*/React.createElement(IconButton, {
626
- iconName: "ZD-GN-zoomIn",
627
- className: style.menuIcon,
628
- iconSize: "16",
629
- hoverType: "border",
630
- a11y: {
631
- ariaLabel: i18nKeys.zoomInText
632
- }
633
- })) : null, canOpenInNewTab ? /*#__PURE__*/React.createElement("div", {
634
- className: uptoTablet ? style.mobileMenu : style.menu
635
- }, /*#__PURE__*/React.createElement(Link, {
636
- href: selectedImgUrl,
637
- target: "_blank",
638
- dataId: "newTabAttach",
639
- title: i18nKeys.newTabText
640
- }, /*#__PURE__*/React.createElement(IconButton, {
641
- iconName: "ZD-GN-newLink",
642
- className: style.menuIcon,
643
- iconSize: "16",
644
- hoverType: "border",
645
- needButtonTag: false,
646
- a11y: {
647
- ariaLabel: i18nKeys.newTabText
648
- }
649
- }))) : null, needDownload ? /*#__PURE__*/React.createElement("div", {
650
- className: uptoTablet ? style.mobileMenu : style.menu
651
- }, /*#__PURE__*/React.createElement(Link, {
652
- href: downloadUrl,
653
- downloadName: selectedAttachment.name,
654
- target: "_parent",
655
- hasReload: true,
656
- download: true,
657
- title: i18nKeys.downloadText,
658
- dataId: `${dataId}_downloadAttach`
659
- }, /*#__PURE__*/React.createElement(IconButton, {
660
- iconName: "ZD-GN-download",
661
- className: style.menuIcon,
662
- iconSize: "16",
663
- hoverType: "border",
664
- needButtonTag: false,
665
- a11y: {
666
- ariaLabel: i18nKeys.downloadText
667
- }
668
- }))) : null, /*#__PURE__*/React.createElement("div", {
669
- className: uptoTablet ? style.mobileMenu : style.menu,
670
- onClick: this.closeAttachmentViewer,
671
- "data-id": "closeAttach",
672
- "data-test-id": "closeAttach",
673
- "data-title": i18nKeys.closeText
674
- }, /*#__PURE__*/React.createElement(IconButton, {
675
- iconName: "ZD-cross",
676
- iconSize: "15",
677
- hoverType: "border",
678
- className: style.menuIcon,
679
- a11y: {
680
- ariaLabel: i18nKeys.closeText
681
- },
682
- title: i18nKeys.closeText
683
- })))))), /*#__PURE__*/React.createElement(Box, {
684
- flexible: true,
685
- role: "toolbar",
686
- tabindex: "0"
687
- }, /*#__PURE__*/React.createElement(Container, {
688
- alignBox: "row"
689
- }, /*#__PURE__*/React.createElement(Box, {
690
- className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${selectedIndex === 0 ? style.hidden : ''}`,
691
- onClick: this.changeSelectedIndex.bind(this, selectedIndex - 1),
692
- "data-title": i18nKeys.previousText,
693
- "data-title-position": "left"
694
- }, /*#__PURE__*/React.createElement("button", {
695
- className: style.btn,
696
- "aria-label": i18nKeys.previousText
697
- }, /*#__PURE__*/React.createElement(Icon, {
698
- name: "ZD-arrowLeft3",
699
- iconClass: style.arrow,
700
- dataId: "leftAttachNav",
701
- isBold: true
702
- }))), /*#__PURE__*/React.createElement(Box, {
703
- className: style.previewBox,
704
- tabindex: "0",
705
- "aria-describedby": ariaId,
706
- isShrink: false,
707
- eleRef: this.setImgBoxRef,
708
- scroll: "both",
709
- flexible: true
710
- }, this.imgPreviewView(downloadUrl)), /*#__PURE__*/React.createElement(Box, {
711
- className: `${style.arrowBox} ${uptoTablet ? style.mbleArrowBox : style.nrmlArrowBox} ${totalLen === selectedIndex + 1 ? style.hidden : ''}`,
712
- onClick: this.changeSelectedIndex.bind(this, selectedIndex + 1),
713
- "data-title": i18nKeys.nextText,
714
- "data-title-position": "right"
715
- }, /*#__PURE__*/React.createElement("button", {
716
- className: style.btn,
717
- "aria-label": i18nKeys.nextText
718
- }, /*#__PURE__*/React.createElement(Icon, {
719
- name: "ZD-arrowRight3",
720
- iconClass: style.arrow,
721
- dataId: "rightAttachNav",
722
- isBold: true
723
- }))))), /*#__PURE__*/React.createElement(Box, {
724
- className: `${style.footer} ${isPViewListOpen && totalLen !== 1 ? style.footerHeight : style.footerHide} `,
725
- dataId: `${dataId}_attachPreviewFooter`
726
- }, /*#__PURE__*/React.createElement(Container, {
727
- align: "vertical",
728
- alignBox: "row",
729
- className: style.footerHeight
730
- }, author && /*#__PURE__*/React.createElement(Box, {
731
- className: style.author,
732
- dataId: `${dataId}_authorName`
733
- }, /*#__PURE__*/React.createElement(Container, {
734
- alignBox: "row",
735
- align: "both"
736
- }, /*#__PURE__*/React.createElement(Avatar, _extends({
737
- name: authorName,
738
- size: "xmedium",
739
- src: authorHref,
740
- palette: "info"
741
- }, avatarProps)), /*#__PURE__*/React.createElement(Box, {
742
- flexible: true,
743
- className: style.authorName,
744
- "data-title": authorName
745
- }, authorName))), /*#__PURE__*/React.createElement(Box, {
746
- flexible: true
747
- }, /*#__PURE__*/React.createElement(Container, {
748
- align: "vertical",
749
- alignBox: "row",
750
- scroll: "horizontal",
751
- eleRef: el => this.imgListCont = el,
752
- className: style.listContainer
753
- }, data.map((item, index) => {
754
- const {
755
- name,
756
- viewUrl,
757
- children,
758
- customClass = {},
759
- dataId = 'AttachmentImage',
760
- customProps = {}
761
- } = item;
762
- let {
763
- thumbnail
764
- } = item;
765
- const isImageFileType = this.isImageFileType(name) || thumbnail;
766
- const {
767
- customImageClass = '',
768
- customChildrenClass = ''
769
- } = customClass;
770
- return /*#__PURE__*/React.createElement(Box, {
771
- className: `${style.imgItem} ${index === selectedIndex ? style.selected : ''} ${isImageFileType ? '' : style.previewIconDiv}`,
772
- key: index,
773
- onClick: this.changeSelectedIndex.bind(this, index),
774
- eleRef: el => this[`img_${index}`] = el,
775
- dataId: "attachPreviewList",
776
- "data-title": name
777
- }, isImageFileType || children ? /*#__PURE__*/React.createElement(AttachmentImage, _extends({
778
- src: thumbnail || viewUrl,
779
- size: "small",
780
- alt: name,
781
- customClass: {
782
- customImageClass: `${style.image} ${style.altText} ${customImageClass}`,
783
- customChildrenClass: `${style.crsrPointer} ${customChildrenClass}`
784
- },
785
- dataId: dataId
786
- }, customProps), children) : this.getPreviewIconData(name, '40'));
787
- }))))), totalLen !== 1 && /*#__PURE__*/React.createElement(IconButton, {
788
- dataId: "attachToggle",
789
- onClick: this.togglePViewList,
790
- iconName: "ZD-GN-hideTab",
791
- iconSize: "14",
792
- hoverType: "border",
793
- iconClass: `${style.thumpIcon} ${isPViewListOpen ? style.thumpIconActive : ''}`,
794
- className: style.button,
795
- a11y: {
796
- 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}`
797
679
  },
798
- title: isPViewListOpen ? i18nKeys.hideText : i18nKeys.showText
799
- }));
800
- }));
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
+ }))));
801
695
  }
802
696
 
803
697
  }