@zohodesk/dot 1.0.0-temp-187.2 → 1.0.0-temp-200

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 (44) hide show
  1. package/.cli/propValidation_report.html +1 -1
  2. package/README.md +4 -0
  3. package/es/Attachment/Attachment.js +2 -1
  4. package/es/Attachment/Attachment.module.css +7 -3
  5. package/es/AttachmentViewer/Attachment.js +60 -1
  6. package/es/AttachmentViewer/AttachmentViewer.js +146 -12
  7. package/es/AttachmentViewer/AttachmentViewer.module.css +124 -4
  8. package/es/DotProvider/__tests__/DotProvider.spec.js +174 -0
  9. package/es/DotProvider/__tests__/__snapshots__/DotProvider.spec.js.snap +478 -0
  10. package/es/common/dot_common.module.css +35 -0
  11. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.js +2 -4
  12. package/es/list/DepartmentDropDown/DepartmentDropDown.js +2 -7
  13. package/es/list/DepartmentDropDown/props/defaultProps.js +1 -2
  14. package/es/list/DepartmentDropDown/props/propTypes.js +1 -2
  15. package/es/list/status/StatusListItem/StatusListItem.module.css +5 -35
  16. package/es/lookup/header/Search/LookupSearch.module.css +33 -27
  17. package/es/lookup/header/Search/Search.js +58 -40
  18. package/es/lookup/header/Search/__tests__/Search.spec.js +67 -1
  19. package/es/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +316 -3
  20. package/es/lookup/header/Search/props/defaultProps.js +3 -1
  21. package/es/lookup/header/Search/props/propTypes.js +6 -1
  22. package/lib/Attachment/Attachment.js +3 -1
  23. package/lib/Attachment/Attachment.module.css +7 -3
  24. package/lib/AttachmentViewer/Attachment.js +88 -1
  25. package/lib/AttachmentViewer/AttachmentViewer.js +147 -13
  26. package/lib/AttachmentViewer/AttachmentViewer.module.css +124 -4
  27. package/lib/DotProvider/__tests__/DotProvider.spec.js +441 -0
  28. package/lib/DotProvider/__tests__/__snapshots__/DotProvider.spec.js.snap +478 -0
  29. package/lib/common/dot_common.module.css +35 -0
  30. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.js +3 -5
  31. package/lib/list/DepartmentDropDown/DepartmentDropDown.js +3 -8
  32. package/lib/list/DepartmentDropDown/props/defaultProps.js +1 -2
  33. package/lib/list/DepartmentDropDown/props/propTypes.js +1 -1
  34. package/lib/list/status/StatusListItem/StatusListItem.module.css +5 -35
  35. package/lib/lookup/header/Search/LookupSearch.module.css +33 -27
  36. package/lib/lookup/header/Search/Search.js +76 -66
  37. package/lib/lookup/header/Search/__tests__/Search.spec.js +65 -0
  38. package/lib/lookup/header/Search/__tests__/__snapshots__/Search.spec.js.snap +316 -3
  39. package/lib/lookup/header/Search/props/defaultProps.js +3 -1
  40. package/lib/lookup/header/Search/props/propTypes.js +6 -1
  41. package/package.json +8 -8
  42. package/result.json +1 -1
  43. package/unittest/index.html +2 -6
  44. /package/images/{audio_thumbnail.png → audio_thumbnail_old.png} +0 -0
@@ -393,6 +393,60 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
393
393
  _customClass$customCh = customClass.customChildrenClass,
394
394
  customChildrenClass = _customClass$customCh === void 0 ? '' : _customClass$customCh;
395
395
  var retainZoom = canZoom && selectedIndex == i && maintainZoom;
396
+ var previewurl = data.previewurl;
397
+ var fileTypeIconList = [{
398
+ check: (0, _Attachment.isAudioFile)(data.name),
399
+ name: 'ZD-EF-fileMp3',
400
+ size: '50'
401
+ }, {
402
+ check: (0, _Attachment.isVideoFile)(data.name),
403
+ name: 'ZD-EF-fileMp4',
404
+ size: '50'
405
+ }, {
406
+ check: (0, _Attachment.isPdfFile)(data.name),
407
+ name: 'ZD-EF-filePdf',
408
+ size: '50'
409
+ }, {
410
+ check: (0, _Attachment.docsFileTypes)(data.name),
411
+ name: 'ZD-EF-fileWord',
412
+ size: '50'
413
+ }, {
414
+ check: (0, _Attachment.sheetFileTypes)(data.name),
415
+ name: 'ZD-EF-fileExcel',
416
+ size: '50'
417
+ }, {
418
+ check: (0, _Attachment.showFileTypes)(data.name),
419
+ name: 'ZD-SE-ppt',
420
+ size: '50'
421
+ }, {
422
+ check: (0, _Attachment.designFileTypes)(data.name),
423
+ name: 'ZD-EF-file',
424
+ size: '50'
425
+ }, {
426
+ check: (0, _Attachment.isEmailFile)(data.name),
427
+ name: 'ZD-CH-mail',
428
+ size: '50'
429
+ }, {
430
+ check: (0, _Attachment.zipFileType)(data.name),
431
+ name: 'ZD-EF-fileZip',
432
+ size: '50'
433
+ }];
434
+
435
+ var PreviewFileIcon = function PreviewFileIcon(_ref3) {
436
+ var data = _ref3.data;
437
+ var matchedIcon = fileTypeIconList.find(function (item) {
438
+ return item.check;
439
+ });
440
+ var iconName = matchedIcon ? matchedIcon.name : 'ZD-EF-file';
441
+ var iconSize = matchedIcon ? matchedIcon.size : '50';
442
+ return /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
443
+ iconClass: _AttachmentViewerModule["default"].prevIcon,
444
+ name: iconName,
445
+ size: iconSize
446
+ });
447
+ };
448
+
449
+ console.log("...previewUrl", previewurl, "...data", data);
396
450
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
397
451
  className: _AttachmentViewerModule["default"].imgBox,
398
452
  id: "imgBox".concat(i),
@@ -410,11 +464,26 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
410
464
  "data-id": "".concat(dataId, "_videoPreview"),
411
465
  "data-test-id": "".concat(dataId, "_videoPreview")
412
466
  }, audioProps), /*#__PURE__*/_react["default"].createElement("source", {
413
- src: viewUrl,
467
+ src: previewurl,
414
468
  type: "audio/".concat((0, _Attachment.getExtensionFromFileName)(name))
415
- })) : null : /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
469
+ })) : null : (0, _Attachment.isVideoFile)(data.name) ? selectedIndex == i ? /*#__PURE__*/_react["default"].createElement("video", {
470
+ autoPlay: true,
471
+ controls: true,
472
+ className: _AttachmentViewerModule["default"].zoomIn
473
+ }, /*#__PURE__*/_react["default"].createElement("source", {
474
+ src: previewurl,
475
+ type: "video/".concat((0, _Attachment.getExtensionFromFileName)(data.name))
476
+ })) : null : (0, _Attachment.isDocsFile)(data.name) || (0, _Attachment.isSheetFile)(data.name) || (0, _Attachment.isShowFile)(data.name) ? selectedIndex == i ? (console.log("...previewurl", previewurl), /*#__PURE__*/_react["default"].createElement("iframe", {
477
+ src: previewurl,
478
+ className: _AttachmentViewerModule["default"].pdfFrame
479
+ }) // <iframe src={previewurl+"&frameorigin=https://deskqa.localzoho.com"} className={style.pdfFrame}></iframe>
480
+ ) : null : (0, _Attachment.isPdfFile)(data.name) || (0, _Attachment.isEmailFile)(data.name) ? selectedIndex == i ? /*#__PURE__*/_react["default"].createElement("iframe", {
481
+ src: previewurl,
482
+ className: _AttachmentViewerModule["default"].pdfFrame
483
+ }) // <iframe src={previewurl+"&frameorigin=https://deskqa.localzoho.com"} className={style.pdfFrame}/>
484
+ : null : (0, _Attachment.isImageFile)(data.name) ? /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
416
485
  customClass: {
417
- customImageClass: "".concat(_AttachmentViewerModule["default"].img, " ").concat(_AttachmentViewerModule["default"].altText, "\n ").concat(canZoom || retainZoom ? isZoomed ? "".concat(_AttachmentViewerModule["default"].zoomedImg, " ").concat(_AttachmentViewerModule["default"].zoomOutCursor) : "".concat(_AttachmentViewerModule["default"].normalImg, " ").concat(_AttachmentViewerModule["default"].zoomInCursor) : '', " ").concat(customImageClass),
486
+ customImageClass: "".concat(_AttachmentViewerModule["default"].img, " ").concat(_AttachmentViewerModule["default"].altText, "\n ").concat(canZoom || retainZoom ? isZoomed ? "".concat(_AttachmentViewerModule["default"].zoomedImg, " ").concat(_AttachmentViewerModule["default"].zoomOutCursor) : "".concat(_AttachmentViewerModule["default"].normalImg, " ").concat(_AttachmentViewerModule["default"].zoomInCursor) : '', " ").concat(customImageClass),
418
487
  customChildrenClass: customChildrenClass
419
488
  },
420
489
  src: viewUrl,
@@ -425,7 +494,19 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
425
494
  dataId: dataId,
426
495
  id: "img".concat(i),
427
496
  isCover: false
428
- }, imageProps), children)));
497
+ }, imageProps), children) : /*#__PURE__*/_react["default"].createElement("div", {
498
+ className: _AttachmentViewerModule["default"].previewNone
499
+ }, /*#__PURE__*/_react["default"].createElement("div", {
500
+ className: _AttachmentViewerModule["default"].fileTypeImg
501
+ }, /*#__PURE__*/_react["default"].createElement(PreviewFileIcon, {
502
+ data: data.name
503
+ })), "Preview not available for the selected file type.", /*#__PURE__*/_react["default"].createElement("br", null), /*#__PURE__*/_react["default"].createElement(_Link["default"], {
504
+ href: data.href,
505
+ className: _AttachmentViewerModule["default"].downloadLink,
506
+ onClick: function onClick() {
507
+ return (0, _Attachment.openNewTab)(data.href);
508
+ }
509
+ }, "Download"))));
429
510
  });
430
511
  }
431
512
  }, {
@@ -453,8 +534,8 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
453
534
  var authorHref;
454
535
  var authorName;
455
536
 
456
- var _ref3 = data[selectedIndex] ? data[selectedIndex] : {},
457
- author = _ref3.author;
537
+ var _ref4 = data[selectedIndex] ? data[selectedIndex] : {},
538
+ author = _ref4.author;
458
539
 
459
540
  if (author) {
460
541
  authorHref = author.href;
@@ -469,8 +550,8 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
469
550
  }, /*#__PURE__*/_react["default"].createElement(_CustomResponsive.ResponsiveReceiver, {
470
551
  responsiveId: responsiveId,
471
552
  query: this.responsiveFunc
472
- }, function (_ref4) {
473
- var uptoTablet = _ref4.uptoTablet;
553
+ }, function (_ref5) {
554
+ var uptoTablet = _ref5.uptoTablet;
474
555
  return /*#__PURE__*/_react["default"].createElement(_Layout.Container, {
475
556
  scroll: "none",
476
557
  "data-scroll-palette": "dark"
@@ -662,11 +743,62 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
662
743
  var _customClass$customIm2 = customClass.customImageClass,
663
744
  customImageClass = _customClass$customIm2 === void 0 ? '' : _customClass$customIm2,
664
745
  _customClass$customCh2 = customClass.customChildrenClass,
665
- customChildrenClass = _customClass$customCh2 === void 0 ? '' : _customClass$customCh2;
666
- thumbnail = (0, _Attachment.isAudioFile)(name) ? thumbnail || _audio_thumbnail["default"] : thumbnail; //fallback thumbnail for audio
746
+ customChildrenClass = _customClass$customCh2 === void 0 ? '' : _customClass$customCh2; // thumbnail= isAudioFile(name) ? thumbnail || audioThumbNail : thumbnail //fallback thumbnail for audio
747
+
748
+ var fileTypeIconList = [{
749
+ check: (0, _Attachment.isAudioFile)(name),
750
+ name: thumbnail || 'ZD-EF-fileMp3',
751
+ size: '30'
752
+ }, {
753
+ check: (0, _Attachment.isVideoFile)(name),
754
+ name: 'ZD-EF-fileMp4',
755
+ size: '30'
756
+ }, {
757
+ check: (0, _Attachment.isPdfFile)(name),
758
+ name: 'ZD-EF-filePdf',
759
+ size: '30'
760
+ }, {
761
+ check: (0, _Attachment.docsFileTypes)(name),
762
+ name: 'ZD-EF-fileWord',
763
+ size: '30'
764
+ }, {
765
+ check: (0, _Attachment.sheetFileTypes)(name),
766
+ name: 'ZD-EF-fileExcel',
767
+ size: '30'
768
+ }, {
769
+ check: (0, _Attachment.showFileTypes)(name),
770
+ name: 'ZD-SE-ppt',
771
+ size: '30'
772
+ }, {
773
+ check: (0, _Attachment.designFileTypes)(name),
774
+ name: 'ZD-EF-file',
775
+ size: '30'
776
+ }, {
777
+ check: (0, _Attachment.isEmailFile)(name),
778
+ name: 'ZD-CH-mail',
779
+ size: '30'
780
+ }, {
781
+ check: (0, _Attachment.zipFileType)(name),
782
+ name: 'ZD-EF-fileZip',
783
+ size: '30'
784
+ }];
785
+
786
+ var PreviewFileIcon = function PreviewFileIcon(_ref6) {
787
+ var data = _ref6.data;
788
+ var matchedIcon = fileTypeIconList.find(function (item) {
789
+ return item.check;
790
+ });
791
+ var iconName = matchedIcon ? matchedIcon.name : 'ZD-EF-file';
792
+ var iconSize = matchedIcon ? matchedIcon.size : '30';
793
+ return /*#__PURE__*/_react["default"].createElement(_icons.Icon, {
794
+ iconClass: _AttachmentViewerModule["default"].prevFooterIcon,
795
+ name: iconName,
796
+ size: iconSize
797
+ });
798
+ };
667
799
 
668
800
  return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
669
- className: "".concat(_AttachmentViewerModule["default"].imgItem, " ").concat(index === selectedIndex ? _AttachmentViewerModule["default"].selected : ''),
801
+ className: "".concat(_AttachmentViewerModule["default"].imgItem, " ").concat(index === selectedIndex ? _AttachmentViewerModule["default"].selected : '', " ").concat((0, _Attachment.isImageFile)(name) || thumbnail ? '' : _AttachmentViewerModule["default"].previewIconDiv),
670
802
  key: index,
671
803
  onClick: _this6.changeSelectedIndex.bind(_this6, index),
672
804
  eleRef: function eleRef(el) {
@@ -674,7 +806,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
674
806
  },
675
807
  dataId: "attachPreviewList",
676
808
  "data-title": name
677
- }, /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
809
+ }, (0, _Attachment.isImageFile)(name) || thumbnail ? /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
678
810
  src: thumbnail || viewUrl,
679
811
  size: "small",
680
812
  alt: name,
@@ -683,7 +815,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
683
815
  customChildrenClass: "".concat(_AttachmentViewerModule["default"].crsrPointer, " ").concat(customChildrenClass)
684
816
  },
685
817
  dataId: dataId
686
- }, customProps), children));
818
+ }, customProps), children) : /*#__PURE__*/_react["default"].createElement(PreviewFileIcon, {
819
+ data: name
820
+ }));
687
821
  }))))), totalLen !== 1 && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
688
822
  dataId: "attachToggle",
689
823
  onClick: _this6.togglePViewList,
@@ -79,7 +79,7 @@
79
79
  font-size: var(--zd_font_size22) ;
80
80
  height: var(--zd_size38) ;
81
81
  width: var(--zd_size38) ;
82
- line-height: 1.6364;
82
+ line-height: 36px;
83
83
  border-radius: 50%;
84
84
  cursor: pointer;
85
85
  }
@@ -154,6 +154,7 @@
154
154
  .imgItem {
155
155
  height: var(--zd_size60) ;
156
156
  min-width: var(--zd_size40) ;
157
+ /* css:theme-validation:ignore */
157
158
  position: relative;
158
159
  transition: border var(--zd_transition3);
159
160
  border-width: 2px;
@@ -168,6 +169,10 @@
168
169
  border-color: var(--zdt_attachmentviewer_hover_border);
169
170
  }
170
171
 
172
+ .imgItem+.imgItem {
173
+ /* margin-left: 6px; */
174
+ }
175
+
171
176
  [dir=ltr] .imgItem+.imgItem {
172
177
  margin-left: var(--zd_size12) ;
173
178
  }
@@ -230,16 +235,71 @@
230
235
  transform: rotateX(0deg);
231
236
  }
232
237
 
238
+ .isAudio,
239
+ .isVideo,
240
+ .isPdf,
241
+ .isMail,
242
+ .isWriter,
243
+ .isSheet,
244
+ .isShow,
245
+ .otherFile {
246
+ width: var(--zd_size60) ;
247
+ }
248
+
249
+ .isAudio, .isVideo, .isPdf, .isMail, .isWriter, .isSheet, .isShow, .otherFile {
250
+ background-size: 100% 100%;
251
+ }
252
+
233
253
  .isAudio {
234
254
  composes: audioImage from '../common/dot_common.module.css';
235
- width: var(--zd_size100) ;
236
- background-size: 100% 100%;
237
255
  }
238
256
 
239
- .isAudio .image {
257
+ .isVideo {
258
+ composes: videoImage from '../common/dot_common.module.css';
259
+ }
260
+
261
+ .isPdf {
262
+ composes: pdfImage from '../common/dot_common.module.css';
263
+ }
264
+
265
+ .isWriter {
266
+ composes: writerImage from '../common/dot_common.module.css';
267
+ }
268
+
269
+ .isSheet {
270
+ composes: sheetImage from '../common/dot_common.module.css';
271
+ }
272
+
273
+ .isShow {
274
+ composes: showImage from '../common/dot_common.module.css';
275
+ }
276
+
277
+
278
+ .isMail {
279
+ composes: mailImage from '../common/dot_common.module.css';
280
+ }
281
+
282
+ .otherFile {
283
+ composes: otherImage from '../common/dot_common.module.css';
284
+ }
285
+
286
+ .isAudio .image,
287
+ .isVideo .image,
288
+ .isPdf .image,
289
+ .isWriter .image,
290
+ .isSheet .image,
291
+ .isShow .image,
292
+ .isMail .image,
293
+ .otherFile .image {
240
294
  opacity: 0;
241
295
  }
242
296
 
297
+ .pdfFrame {
298
+ height: 100% ;
299
+ width: 100% ;
300
+ border: 0;
301
+ }
302
+
243
303
  .video {
244
304
  position: absolute;
245
305
  top: 0 ;
@@ -357,9 +417,69 @@
357
417
  }
358
418
 
359
419
  .btn {
420
+ /* css:theme-validation:ignore */
360
421
  height: 100% ;
361
422
  width: 100% ;
362
423
  background-color: var(--dot_mirror);
363
424
  border: 0;
364
425
  cursor: pointer;
426
+ }
427
+
428
+ .fileTypeImg {
429
+ margin: 0 auto var(--zd_size20) ;
430
+ }
431
+
432
+ .previewNone {
433
+ /* css:theme-validation:ignore */
434
+ color: #fff;
435
+ text-align: center;
436
+ margin: auto ;
437
+ }
438
+
439
+ .downloadLink {
440
+ /* css:theme-validation:ignore */
441
+ color: #0a73eb;
442
+ display: inline-block;
443
+ padding-top: var(--zd_size10) ;
444
+ }
445
+
446
+ .previewIconDiv {
447
+ width: var(--zd_size60) ;
448
+ composes: dflex from '~@zohodesk/components/lib/common/common.module.css';
449
+ }
450
+
451
+ .prevFooterIcon,
452
+ .prevIcon {
453
+ /* css:theme-validation:ignore */
454
+ color: #fff;
455
+ }
456
+
457
+ .prevFooterIcon, .prevIcon {
458
+ padding: var(--zd_size2) ;
459
+ margin: auto ;
460
+ }
461
+
462
+ .prevFooterIcon::before,
463
+ .prevIcon::before {
464
+ /* css:theme-validation:ignore */
465
+ }
466
+
467
+ .prevFooterIcon::before, .prevIcon::before {
468
+ background-color: transparent;
469
+ }
470
+
471
+ [dir=ltr] .prevIcon::before {
472
+ border-radius: 10px 30px 10px 10px;
473
+ }
474
+
475
+ [dir=rtl] .prevIcon::before {
476
+ border-radius: 30px 10px 10px 10px;
477
+ }
478
+
479
+ [dir=ltr] .prevFooterIcon::before {
480
+ border-radius: 5px 17px 5px 5px
481
+ }
482
+
483
+ [dir=rtl] .prevFooterIcon::before {
484
+ border-radius: 17px 5px 5px 5px
365
485
  }