@zohodesk/dot 1.0.0-temp-228.2 → 1.0.0-temp-230

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 (172) hide show
  1. package/README.md +24 -0
  2. package/es/ActionButton/ActionButton.module.css +12 -11
  3. package/es/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +47 -60
  4. package/es/AlphabeticList/AlphabeticList.module.css +7 -8
  5. package/es/Attachment/Attachment.module.css +9 -10
  6. package/es/AttachmentViewer/AttachmentViewer.js +57 -7
  7. package/es/AttachmentViewer/AttachmentViewer.module.css +25 -46
  8. package/es/AttachmentViewer/props/defaultProps.js +2 -1
  9. package/es/AttachmentViewer/props/propTypes.js +3 -1
  10. package/es/AudioPlayer/AudioPlayer.module.css +5 -8
  11. package/es/DotProvider/DotProvider.js +2 -0
  12. package/es/DotProvider/__tests__/DotProvider.spec.js +106 -0
  13. package/es/DotProvider/hooks/useDotProvider.js +4 -2
  14. package/es/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +44 -15
  15. package/es/DotProvider/props/defaultProps.js +2 -0
  16. package/es/DotProvider/props/propTypes.js +1 -0
  17. package/es/Drawer/Drawer.module.css +17 -64
  18. package/es/FormAction/FormAction.module.css +20 -54
  19. package/es/ImportantNotes/ImportantNotes.module.css +2 -9
  20. package/es/Link/Link.js +4 -3
  21. package/es/Link/props/propTypes.js +1 -0
  22. package/es/Message/Message.module.css +3 -16
  23. package/es/MessageBanner/MessageBanner.module.css +4 -13
  24. package/es/Separator/Separator.module.css +2 -1
  25. package/es/TagWithIcon/TagWithIcon.module.css +5 -8
  26. package/es/ToastMessage/ToastMessage.module.css +16 -30
  27. package/es/Upload/Upload.module.css +7 -9
  28. package/es/alert/AlertHeader/AlertHeader.module.css +11 -25
  29. package/es/alert/AlertLookup/AlertLookup.module.css +9 -10
  30. package/es/avatar/AvatarCollision/AvatarCollision.module.css +1 -1
  31. package/es/avatar/AvatarWithTeam/AvatarWithTeam.module.css +1 -1
  32. package/es/dropdown/ToggleDropDown/ToggleDropDown.module.css +16 -16
  33. package/es/emptystate/CommonEmptyState/CommonEmptyState.module.css +7 -9
  34. package/es/emptystate/EditionPage/EditionPage.css +7 -4
  35. package/es/errorstate/EmptyStates.module.css +7 -8
  36. package/es/errorstate/Inconvenience/Inconvenience.module.css +2 -5
  37. package/es/errorstate/NoRequestFound/NoRequestFound.module.css +1 -1
  38. package/es/errorstate/PermissionPlay/PermissionPlay.module.css +5 -4
  39. package/es/errorstate/RequestUrlNotFound/RequestUrlNotFound.module.css +1 -1
  40. package/es/errorstate/UnableToProcess/UnableToProcess.module.css +1 -1
  41. package/es/errorstate/UnauthorizedLogin/UnauthorizedLogin.module.css +1 -1
  42. package/es/errorstate/WillBack/WillBack.module.css +6 -4
  43. package/es/form/fields/Fields.module.css +23 -68
  44. package/es/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +11 -16
  45. package/es/form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css +1 -4
  46. package/es/form/fields/TextEditor/TextEditor.module.css +40 -66
  47. package/es/form/fields/TextEditorWrapper/TextEditorWrapper.module.css +2 -7
  48. package/es/form/fields/ValidationMessage/ValidationMessage.module.css +4 -3
  49. package/es/layout/SetupDetailLayout/SetupDetailLayout.module.css +14 -36
  50. package/es/layout/SubtabLayout/SubtabLayout.module.css +33 -46
  51. package/es/list/BluePrintStatus/BluePrintStatus.module.css +1 -4
  52. package/es/list/Comment/Comment.module.css +2 -1
  53. package/es/list/Dot/Dot.module.css +4 -2
  54. package/es/list/GridStencils/GridStencils.module.css +7 -9
  55. package/es/list/ListLayout/ListLayout.module.css +7 -4
  56. package/es/list/ListStencils/ListStencils.module.css +14 -15
  57. package/es/list/SecondaryText/SecondaryText.module.css +4 -13
  58. package/es/list/SentimentStatus/SentimentStatus.module.css +2 -4
  59. package/es/list/TagNew/TagNew.module.css +3 -2
  60. package/es/list/listCommon.module.css +3 -7
  61. package/es/list/status/StatusDropdown/StatusDropdown.module.css +17 -17
  62. package/es/list/status/StatusListItem/StatusListItem.module.css +10 -18
  63. package/es/lookup/EmptyPage/LookupEmptyPage.module.css +4 -3
  64. package/es/lookup/Lookup/Lookup.module.css +2 -2
  65. package/es/lookup/header/Search/LookupSearch.module.css +10 -23
  66. package/es/lookup/header/TicketHeader/TicketHeader.module.css +3 -2
  67. package/es/lookup/header/ViewDropDown/ViewDropDown.module.css +8 -12
  68. package/es/lookup/header/lookupHeaderCommon.module.css +8 -7
  69. package/es/lookup/header/lookupHeaderCommonResponsive.module.css +2 -6
  70. package/es/setup/header/Button/HeaderButton.module.css +2 -4
  71. package/es/setup/header/Link/HeaderLink.module.css +3 -9
  72. package/es/setup/header/Search/Search.module.css +2 -10
  73. package/es/setup/header/Views/Views.module.css +1 -4
  74. package/es/setup/helptips/Description/HelpTipsDescription.module.css +2 -1
  75. package/es/setup/helptips/Link/HelpTipsLink.module.css +2 -2
  76. package/es/setup/helptips/ListGroup/ListGroup.module.css +2 -6
  77. package/es/setup/table/TableData/SetupTableData.module.css +2 -4
  78. package/es/setup/table/TableHead/SetupTableHead.module.css +1 -6
  79. package/es/setup/table/TableRow/SetupTableRow.module.css +2 -7
  80. package/es/version2/GlobalNotification/GlobalNotification.module.css +7 -12
  81. package/es/version2/errorstate/V2_ErrorStates.module.css +5 -5
  82. package/es/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +8 -23
  83. package/es/version2/lookup/AlertLookup/AlertLookupNew.module.css +9 -10
  84. package/es/version2/lookup/alertLookupCommonNew.module.css +6 -4
  85. package/es/version2/notification/DesktopNotification/DesktopNotification.module.css +8 -11
  86. package/es/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +10 -22
  87. package/lib/ActionButton/ActionButton.module.css +12 -11
  88. package/lib/ActionButton/__tests__/__snapshots__/ActionButton.spec.js.snap +47 -60
  89. package/lib/AlphabeticList/AlphabeticList.module.css +7 -8
  90. package/lib/Attachment/Attachment.module.css +9 -10
  91. package/lib/AttachmentViewer/AttachmentViewer.js +94 -37
  92. package/lib/AttachmentViewer/AttachmentViewer.module.css +25 -46
  93. package/lib/AttachmentViewer/props/defaultProps.js +2 -1
  94. package/lib/AttachmentViewer/props/propTypes.js +3 -1
  95. package/lib/AudioPlayer/AudioPlayer.module.css +5 -8
  96. package/lib/DotProvider/DotProvider.js +3 -1
  97. package/lib/DotProvider/__tests__/DotProvider.spec.js +216 -0
  98. package/lib/DotProvider/hooks/useDotProvider.js +4 -2
  99. package/lib/DotProvider/hooks/useDownloadAssetsAndSetAttr.js +46 -15
  100. package/lib/DotProvider/props/defaultProps.js +3 -0
  101. package/lib/DotProvider/props/propTypes.js +1 -0
  102. package/lib/Drawer/Drawer.module.css +17 -64
  103. package/lib/FormAction/FormAction.module.css +20 -54
  104. package/lib/ImportantNotes/ImportantNotes.module.css +2 -9
  105. package/lib/Link/Link.js +4 -3
  106. package/lib/Link/props/propTypes.js +1 -0
  107. package/lib/Message/Message.module.css +3 -16
  108. package/lib/MessageBanner/MessageBanner.module.css +4 -13
  109. package/lib/Separator/Separator.module.css +2 -1
  110. package/lib/TagWithIcon/TagWithIcon.module.css +5 -8
  111. package/lib/ToastMessage/ToastMessage.module.css +16 -30
  112. package/lib/Upload/Upload.module.css +7 -9
  113. package/lib/alert/AlertHeader/AlertHeader.module.css +11 -25
  114. package/lib/alert/AlertLookup/AlertLookup.module.css +9 -10
  115. package/lib/avatar/AvatarCollision/AvatarCollision.module.css +1 -1
  116. package/lib/avatar/AvatarWithTeam/AvatarWithTeam.module.css +1 -1
  117. package/lib/dropdown/ToggleDropDown/ToggleDropDown.module.css +16 -16
  118. package/lib/emptystate/CommonEmptyState/CommonEmptyState.module.css +7 -9
  119. package/lib/emptystate/EditionPage/EditionPage.css +7 -4
  120. package/lib/errorstate/EmptyStates.module.css +7 -8
  121. package/lib/errorstate/Inconvenience/Inconvenience.module.css +2 -5
  122. package/lib/errorstate/NoRequestFound/NoRequestFound.module.css +1 -1
  123. package/lib/errorstate/PermissionPlay/PermissionPlay.module.css +5 -4
  124. package/lib/errorstate/RequestUrlNotFound/RequestUrlNotFound.module.css +1 -1
  125. package/lib/errorstate/UnableToProcess/UnableToProcess.module.css +1 -1
  126. package/lib/errorstate/UnauthorizedLogin/UnauthorizedLogin.module.css +1 -1
  127. package/lib/errorstate/WillBack/WillBack.module.css +6 -4
  128. package/lib/form/fields/Fields.module.css +23 -68
  129. package/lib/form/fields/TagsMultiSelect/TagsMultiSelect.module.css +11 -16
  130. package/lib/form/fields/TagsMultiSelectField/TagsMultiSelectField.module.css +1 -4
  131. package/lib/form/fields/TextEditor/TextEditor.module.css +40 -66
  132. package/lib/form/fields/TextEditorWrapper/TextEditorWrapper.module.css +2 -7
  133. package/lib/form/fields/ValidationMessage/ValidationMessage.module.css +4 -3
  134. package/lib/layout/SetupDetailLayout/SetupDetailLayout.module.css +14 -36
  135. package/lib/layout/SubtabLayout/SubtabLayout.module.css +33 -46
  136. package/lib/list/BluePrintStatus/BluePrintStatus.module.css +1 -4
  137. package/lib/list/Comment/Comment.module.css +2 -1
  138. package/lib/list/Dot/Dot.module.css +4 -2
  139. package/lib/list/GridStencils/GridStencils.module.css +7 -9
  140. package/lib/list/ListLayout/ListLayout.module.css +7 -4
  141. package/lib/list/ListStencils/ListStencils.module.css +14 -15
  142. package/lib/list/SecondaryText/SecondaryText.module.css +4 -13
  143. package/lib/list/SentimentStatus/SentimentStatus.module.css +2 -4
  144. package/lib/list/TagNew/TagNew.module.css +3 -2
  145. package/lib/list/listCommon.module.css +3 -7
  146. package/lib/list/status/StatusDropdown/StatusDropdown.module.css +17 -17
  147. package/lib/list/status/StatusListItem/StatusListItem.module.css +10 -18
  148. package/lib/lookup/EmptyPage/LookupEmptyPage.module.css +4 -3
  149. package/lib/lookup/Lookup/Lookup.module.css +2 -2
  150. package/lib/lookup/header/Search/LookupSearch.module.css +10 -23
  151. package/lib/lookup/header/TicketHeader/TicketHeader.module.css +3 -2
  152. package/lib/lookup/header/ViewDropDown/ViewDropDown.module.css +8 -12
  153. package/lib/lookup/header/lookupHeaderCommon.module.css +8 -7
  154. package/lib/lookup/header/lookupHeaderCommonResponsive.module.css +2 -6
  155. package/lib/setup/header/Button/HeaderButton.module.css +2 -4
  156. package/lib/setup/header/Link/HeaderLink.module.css +3 -9
  157. package/lib/setup/header/Search/Search.module.css +2 -10
  158. package/lib/setup/header/Views/Views.module.css +1 -4
  159. package/lib/setup/helptips/Description/HelpTipsDescription.module.css +2 -1
  160. package/lib/setup/helptips/Link/HelpTipsLink.module.css +2 -2
  161. package/lib/setup/helptips/ListGroup/ListGroup.module.css +2 -6
  162. package/lib/setup/table/TableData/SetupTableData.module.css +2 -4
  163. package/lib/setup/table/TableHead/SetupTableHead.module.css +1 -6
  164. package/lib/setup/table/TableRow/SetupTableRow.module.css +2 -7
  165. package/lib/version2/GlobalNotification/GlobalNotification.module.css +7 -12
  166. package/lib/version2/errorstate/V2_ErrorStates.module.css +5 -5
  167. package/lib/version2/lookup/AlertHeader/css/AlertHeaderNew.module.css +8 -23
  168. package/lib/version2/lookup/AlertLookup/AlertLookupNew.module.css +9 -10
  169. package/lib/version2/lookup/alertLookupCommonNew.module.css +6 -4
  170. package/lib/version2/notification/DesktopNotification/DesktopNotification.module.css +8 -11
  171. package/lib/version2/notification/DesktopNotificationHeader/DesktopNotificationHeader.module.css +10 -22
  172. package/package.json +14 -14
@@ -86,21 +86,19 @@
86
86
  width: var(--zd_size40) ;
87
87
  }
88
88
 
89
- [dir=ltr] .medium .attachright {
90
- padding: var(--zd_size5) var(--zd_size25) var(--zd_size5) var(--zd_size10) ;
91
- }
92
-
93
- [dir=rtl] .medium .attachright {
94
- padding: var(--zd_size5) var(--zd_size10) var(--zd_size5) var(--zd_size25) ;
89
+ .medium .attachright {
90
+ padding-block: var(--zd_size5) ;
91
+ padding-inline: var(--zd_size10) var(--zd_size25) ;
95
92
  }
96
93
 
97
94
  .small .attachright {
98
- padding: 0 var(--zd_size10) 0 var(--zd_size10) ;
95
+ padding-block:0 ;
96
+ padding-inline: var(--zd_size10) ;
99
97
  }
100
98
 
101
99
  .footer {
102
100
  font-size: 0 ;
103
- margin-top: var(--zd_size3) ;
101
+ margin-block-start: var(--zd_size3) ;
104
102
  }
105
103
 
106
104
  .medium .atatchName {
@@ -183,7 +181,8 @@
183
181
  height: 2px;
184
182
  /* Variable:Ignore */
185
183
  width: 2px;
184
+ margin-inline: var(--zd_size6) ;
185
+ margin-block:0 ;
186
186
  background-color: var(--zdt_dot_text);
187
187
  border-radius: 50%;
188
- margin: 0 var(--zd_size6) ;
189
- }
188
+ }
@@ -1,7 +1,5 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
@@ -63,6 +61,14 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
63
61
 
64
62
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
65
63
 
64
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
65
+
66
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
67
+
68
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
69
+
70
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
71
+
66
72
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
67
73
 
68
74
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -121,10 +127,50 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
121
127
  _this.handleMenuValidation = _this.handleMenuValidation.bind(_assertThisInitialized(_this));
122
128
  _this.getPreviewIconData = _this.getPreviewIconData.bind(_assertThisInitialized(_this));
123
129
  _this.renderIframe = _this.renderIframe.bind(_assertThisInitialized(_this));
130
+ _this.updateItem = _this.updateItem.bind(_assertThisInitialized(_this));
124
131
  return _this;
125
132
  }
126
133
 
127
134
  _createClass(AttachmentViewer, [{
135
+ key: "updateItem",
136
+ value: function updateItem(idOrIndex, changes) {
137
+ var _this2 = this;
138
+
139
+ if (!changes || _typeof(changes) !== 'object') {
140
+ return false;
141
+ }
142
+
143
+ var data = this.state.data;
144
+ var targetIdx = typeof idOrIndex === 'number' ? idOrIndex : data.findIndex(function (item) {
145
+ return item && item.id === idOrIndex;
146
+ });
147
+
148
+ if (targetIdx < 0 || targetIdx >= data.length) {
149
+ return false;
150
+ }
151
+
152
+ this.setState(function (prevState) {
153
+ var nextData = prevState.data.slice();
154
+ nextData[targetIdx] = _objectSpread(_objectSpread({}, nextData[targetIdx]), changes);
155
+ var nextDataList = prevState.dataList;
156
+
157
+ if (targetIdx < prevState.dataList.length) {
158
+ nextDataList = prevState.dataList.slice();
159
+ nextDataList[targetIdx] = _objectSpread(_objectSpread({}, nextDataList[targetIdx]), changes);
160
+ }
161
+
162
+ return {
163
+ data: nextData,
164
+ dataList: nextDataList
165
+ };
166
+ }, function () {
167
+ if (_this2.state.selectedIndex === targetIdx) {
168
+ _this2.handleMenuValidation();
169
+ }
170
+ });
171
+ return true;
172
+ }
173
+ }, {
128
174
  key: "isImageFileType",
129
175
  value: function isImageFileType(fileName) {
130
176
  var extension = ((0, _Attachment.getExtensionFromFileName)(fileName) || '').toLowerCase();
@@ -159,11 +205,14 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
159
205
  }, {
160
206
  key: "componentDidUpdate",
161
207
  value: function componentDidUpdate(prevProps, prevState) {
208
+ var _previewObj$previewDa, _prevState$data$;
209
+
162
210
  var previewObj = this.props.previewObj;
163
211
  var selectedIndex = this.state.selectedIndex;
164
212
  var indexChanged = previewObj.selectedIndex != prevProps.previewObj.selectedIndex;
213
+ var attachmentPreviewUrlChanged = ((_previewObj$previewDa = previewObj.previewData[0]) === null || _previewObj$previewDa === void 0 ? void 0 : _previewObj$previewDa.viewUrl) !== ((_prevState$data$ = prevState.data[0]) === null || _prevState$data$ === void 0 ? void 0 : _prevState$data$.viewUrl); // Triggers an update if the previewed attachment is edited by the Attachment Annotator.
165
214
 
166
- if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged) {
215
+ if (previewObj.previewData.length != prevProps.previewObj.previewData.length || indexChanged || attachmentPreviewUrlChanged) {
167
216
  var objChanged = previewObj.previewData.some(function (value, index) {
168
217
  return (0, _General.shallowDiff)(value, prevProps.previewObj[index]);
169
218
  });
@@ -182,14 +231,14 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
182
231
  }
183
232
  }
184
233
 
185
- if (prevState.selectedIndex != selectedIndex) {
234
+ if (prevState.selectedIndex != selectedIndex || attachmentPreviewUrlChanged) {
186
235
  this.handleMenuValidation();
187
236
  }
188
237
  }
189
238
  }, {
190
239
  key: "handleMenuValidation",
191
240
  value: function handleMenuValidation() {
192
- var _this2 = this;
241
+ var _this3 = this;
193
242
 
194
243
  var _this$state = this.state,
195
244
  data = _this$state.data,
@@ -209,7 +258,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
209
258
  var isViewURLValid = fileSourceValidation.isViewURLValid,
210
259
  canZoom = fileSourceValidation.canZoom;
211
260
 
212
- _this2.setState({
261
+ _this3.setState({
213
262
  isPreviewAttachmentValid: isViewURLValid,
214
263
  canZoom: canZoom,
215
264
  canOpenInNewTab: isViewURLValid
@@ -219,14 +268,14 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
219
268
  }, {
220
269
  key: "togglePViewList",
221
270
  value: function togglePViewList() {
222
- var _this3 = this;
271
+ var _this4 = this;
223
272
 
224
273
  this.setState(function (prevState) {
225
274
  return {
226
275
  isPViewListOpen: !prevState.isPViewListOpen
227
276
  };
228
277
  }, function () {
229
- _this3.focusSelectedImg(_this3.state.selectedIndex);
278
+ _this4.focusSelectedImg(_this4.state.selectedIndex);
230
279
  });
231
280
  }
232
281
  }, {
@@ -320,7 +369,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
320
369
  }, {
321
370
  key: "changeSelectedIndex",
322
371
  value: function changeSelectedIndex(index) {
323
- var _this4 = this;
372
+ var _this5 = this;
324
373
 
325
374
  var _this$state2 = this.state,
326
375
  data = _this$state2.data,
@@ -335,7 +384,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
335
384
  this.setState({
336
385
  selectedIndex: index
337
386
  }, function () {
338
- _this4.focusSelectedImg(index);
387
+ _this5.focusSelectedImg(index);
339
388
  });
340
389
  }
341
390
  }, {
@@ -399,7 +448,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
399
448
  }, {
400
449
  key: "imgPreviewView",
401
450
  value: function imgPreviewView(downloadUrl) {
402
- var _this5 = this;
451
+ var _this6 = this;
403
452
 
404
453
  var _this$state3 = this.state,
405
454
  dataList = _this$state3.dataList,
@@ -478,7 +527,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
478
527
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
479
528
  className: _AttachmentViewerModule["default"].imgRef,
480
529
  id: "imgPreviewRef".concat(i)
481
- }, selectedIndex == i && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _this5.isAudioFileType(name) ? /*#__PURE__*/_react["default"].createElement("audio", _extends({
530
+ }, selectedIndex == i && /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, _this6.isAudioFileType(name) ? /*#__PURE__*/_react["default"].createElement("audio", _extends({
482
531
  controls: true,
483
532
  className: _AttachmentViewerModule["default"].zoomIn,
484
533
  "data-id": "".concat(dataId, "_audioPreview"),
@@ -486,7 +535,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
486
535
  }, audioProps), /*#__PURE__*/_react["default"].createElement("source", {
487
536
  src: previewurl || viewUrl,
488
537
  type: "audio/".concat(extension)
489
- })) : _this5.isVideoFileType(name) ? /*#__PURE__*/_react["default"].createElement("video", _extends({
538
+ })) : _this6.isVideoFileType(name) ? /*#__PURE__*/_react["default"].createElement("video", _extends({
490
539
  controls: true,
491
540
  className: _AttachmentViewerModule["default"].zoomIn,
492
541
  "data-id": "".concat(dataId, "_videoPreview"),
@@ -494,31 +543,32 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
494
543
  }, videoProps), /*#__PURE__*/_react["default"].createElement("source", {
495
544
  src: viewUrl,
496
545
  type: "video/".concat(extension)
497
- })) : _this5.isImageFileType(name) || children ? /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
546
+ })) : _this6.isImageFileType(name) || children ? /*#__PURE__*/_react["default"].createElement(_AttachmentImage["default"], _extends({
498
547
  customClass: {
499
548
  customImageClass: "".concat(_AttachmentViewerModule["default"].img, " ").concat(_AttachmentViewerModule["default"].altText, " ").concat(canZoom || retainZoom ? isZoomed ? "".concat(_AttachmentViewerModule["default"].zoomedImg, " ").concat(_AttachmentViewerModule["default"].zoomOutCursor) : "".concat(_AttachmentViewerModule["default"].normalImg, " ").concat(_AttachmentViewerModule["default"].zoomInCursor) : '', " ").concat(customImageClass),
500
549
  customChildrenClass: customChildrenClass
501
550
  },
502
551
  src: viewUrl,
503
- onClick: isPreviewAttachmentValid ? isZoomed ? _this5.zoomOut.bind(_this5, i) : function (e) {
504
- return _this5.zoomIn(e, i, true);
552
+ onClick: isPreviewAttachmentValid ? isZoomed ? _this6.zoomOut.bind(_this6, i) : function (e) {
553
+ return _this6.zoomIn(e, i, true);
505
554
  } : undefined,
506
555
  alt: name,
507
556
  dataId: dataId,
508
557
  id: "img".concat(i),
509
558
  isCover: false
510
- }, imageProps), children) : type === "document" && previewurl != null ? _this5.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/_react["default"].createElement("div", {
559
+ }, imageProps), children) : type === "document" && previewurl != null ? _this6.renderIframe(previewurl) : typeof renderUnSupportedElement === 'function' ? renderUnSupportedElement(data) : /*#__PURE__*/_react["default"].createElement("div", {
511
560
  className: _AttachmentViewerModule["default"].previewNone
512
561
  }, /*#__PURE__*/_react["default"].createElement("div", {
513
562
  className: _AttachmentViewerModule["default"].fileTypeImg
514
- }, _this5.getPreviewIconData(name, '70')), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
563
+ }, _this6.getPreviewIconData(name, '70')), /*#__PURE__*/_react["default"].createElement(_Typography["default"], {
515
564
  $ui_size: "20",
516
565
  $ui_weight: "semibold"
517
566
  }, previewUnsupportedText), downloadUrl ? /*#__PURE__*/_react["default"].createElement(_Link["default"], {
518
567
  href: downloadUrl,
568
+ download: true,
569
+ downloadName: name,
519
570
  className: _AttachmentViewerModule["default"].downloadLink,
520
- hasReload: true,
521
- download: true
571
+ hasReload: true
522
572
  }, /*#__PURE__*/_react["default"].createElement(_Button["default"], {
523
573
  palette: "primaryFilled",
524
574
  text: downloadText
@@ -528,7 +578,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
528
578
  }, {
529
579
  key: "render",
530
580
  value: function render() {
531
- var _this6 = this;
581
+ var _this7 = this;
532
582
 
533
583
  var _this$state4 = this.state,
534
584
  isPViewListOpen = _this$state4.isPViewListOpen,
@@ -543,7 +593,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
543
593
  i18nKeys = _this$props2.i18nKeys,
544
594
  isActive = _this$props2.isActive,
545
595
  dataId = _this$props2.dataId,
546
- customProps = _this$props2.customProps;
596
+ customProps = _this$props2.customProps,
597
+ showCount = _this$props2.showCount,
598
+ renderCustomIcons = _this$props2.renderCustomIcons;
547
599
  var _customProps$avatarPr = customProps.avatarProps,
548
600
  avatarProps = _customProps$avatarPr === void 0 ? {} : _customProps$avatarPr;
549
601
  var totalLen = data.length;
@@ -585,7 +637,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
585
637
  "data-title": selectedAttachment.name,
586
638
  dataId: "attachName",
587
639
  id: ariaId
588
- }, selectedAttachment.name), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
640
+ }, selectedAttachment.name), showCount && /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
589
641
  flexible: true,
590
642
  className: _AttachmentViewerModule["default"].count,
591
643
  dataId: "attachCountContainer"
@@ -597,9 +649,13 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
597
649
  align: uptoTablet ? 'bottom' : 'center',
598
650
  wrap: "wrap",
599
651
  isCover: false
600
- }, canZoom ? isZoomed ? /*#__PURE__*/_react["default"].createElement("div", {
652
+ }, typeof renderCustomIcons === 'function' && renderCustomIcons({
653
+ selectedAttachment: selectedAttachment,
654
+ selectedIndex: selectedIndex,
655
+ totalLen: totalLen
656
+ }), canZoom ? isZoomed ? /*#__PURE__*/_react["default"].createElement("div", {
601
657
  className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
602
- onClick: _this6.zoomOut.bind(_this6, selectedIndex),
658
+ onClick: _this7.zoomOut.bind(_this7, selectedIndex),
603
659
  "data-id": "zoomOut",
604
660
  "data-test-id": "zoomOut",
605
661
  "data-title": i18nKeys.zoomOutText
@@ -614,7 +670,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
614
670
  })) : /*#__PURE__*/_react["default"].createElement("div", {
615
671
  className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
616
672
  onClick: function onClick(e) {
617
- return _this6.zoomIn(e, selectedIndex);
673
+ return _this7.zoomIn(e, selectedIndex);
618
674
  },
619
675
  "data-id": "zoomIn",
620
676
  "data-test-id": "zoomIn",
@@ -647,6 +703,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
647
703
  className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu
648
704
  }, /*#__PURE__*/_react["default"].createElement(_Link["default"], {
649
705
  href: downloadUrl,
706
+ downloadName: selectedAttachment.name,
650
707
  target: "_parent",
651
708
  hasReload: true,
652
709
  download: true,
@@ -663,7 +720,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
663
720
  }
664
721
  }))) : null, /*#__PURE__*/_react["default"].createElement("div", {
665
722
  className: uptoTablet ? _AttachmentViewerModule["default"].mobileMenu : _AttachmentViewerModule["default"].menu,
666
- onClick: _this6.closeAttachmentViewer,
723
+ onClick: _this7.closeAttachmentViewer,
667
724
  "data-id": "closeAttach",
668
725
  "data-test-id": "closeAttach",
669
726
  "data-title": i18nKeys.closeText
@@ -684,7 +741,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
684
741
  alignBox: "row"
685
742
  }, /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
686
743
  className: "".concat(_AttachmentViewerModule["default"].arrowBox, " ").concat(uptoTablet ? _AttachmentViewerModule["default"].mbleArrowBox : _AttachmentViewerModule["default"].nrmlArrowBox, " ").concat(selectedIndex === 0 ? _AttachmentViewerModule["default"].hidden : ''),
687
- onClick: _this6.changeSelectedIndex.bind(_this6, selectedIndex - 1),
744
+ onClick: _this7.changeSelectedIndex.bind(_this7, selectedIndex - 1),
688
745
  "data-title": i18nKeys.previousText,
689
746
  "data-title-position": "left"
690
747
  }, /*#__PURE__*/_react["default"].createElement("button", {
@@ -700,12 +757,12 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
700
757
  tabindex: "0",
701
758
  "aria-describedby": ariaId,
702
759
  isShrink: false,
703
- eleRef: _this6.setImgBoxRef,
760
+ eleRef: _this7.setImgBoxRef,
704
761
  scroll: "both",
705
762
  flexible: true
706
- }, _this6.imgPreviewView(downloadUrl)), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
763
+ }, _this7.imgPreviewView(downloadUrl)), /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
707
764
  className: "".concat(_AttachmentViewerModule["default"].arrowBox, " ").concat(uptoTablet ? _AttachmentViewerModule["default"].mbleArrowBox : _AttachmentViewerModule["default"].nrmlArrowBox, " ").concat(totalLen === selectedIndex + 1 ? _AttachmentViewerModule["default"].hidden : ''),
708
- onClick: _this6.changeSelectedIndex.bind(_this6, selectedIndex + 1),
765
+ onClick: _this7.changeSelectedIndex.bind(_this7, selectedIndex + 1),
709
766
  "data-title": i18nKeys.nextText,
710
767
  "data-title-position": "right"
711
768
  }, /*#__PURE__*/_react["default"].createElement("button", {
@@ -745,7 +802,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
745
802
  alignBox: "row",
746
803
  scroll: "horizontal",
747
804
  eleRef: function eleRef(el) {
748
- return _this6.imgListCont = el;
805
+ return _this7.imgListCont = el;
749
806
  },
750
807
  className: _AttachmentViewerModule["default"].listContainer
751
808
  }, data.map(function (item, index) {
@@ -759,7 +816,7 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
759
816
  _item$customProps = item.customProps,
760
817
  customProps = _item$customProps === void 0 ? {} : _item$customProps;
761
818
  var thumbnail = item.thumbnail;
762
- var isImageFileType = _this6.isImageFileType(name) || thumbnail;
819
+ var isImageFileType = _this7.isImageFileType(name) || thumbnail;
763
820
  var _customClass$customIm2 = customClass.customImageClass,
764
821
  customImageClass = _customClass$customIm2 === void 0 ? '' : _customClass$customIm2,
765
822
  _customClass$customCh2 = customClass.customChildrenClass,
@@ -767,9 +824,9 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
767
824
  return /*#__PURE__*/_react["default"].createElement(_Layout.Box, {
768
825
  className: "".concat(_AttachmentViewerModule["default"].imgItem, " ").concat(index === selectedIndex ? _AttachmentViewerModule["default"].selected : '', " ").concat(isImageFileType ? '' : _AttachmentViewerModule["default"].previewIconDiv),
769
826
  key: index,
770
- onClick: _this6.changeSelectedIndex.bind(_this6, index),
827
+ onClick: _this7.changeSelectedIndex.bind(_this7, index),
771
828
  eleRef: function eleRef(el) {
772
- return _this6["img_".concat(index)] = el;
829
+ return _this7["img_".concat(index)] = el;
773
830
  },
774
831
  dataId: "attachPreviewList",
775
832
  "data-title": name
@@ -782,10 +839,10 @@ var AttachmentViewer = /*#__PURE__*/function (_Component) {
782
839
  customChildrenClass: "".concat(_AttachmentViewerModule["default"].crsrPointer, " ").concat(customChildrenClass)
783
840
  },
784
841
  dataId: dataId
785
- }, customProps), children) : _this6.getPreviewIconData(name, '40'));
842
+ }, customProps), children) : _this7.getPreviewIconData(name, '40'));
786
843
  }))))), totalLen !== 1 && /*#__PURE__*/_react["default"].createElement(_IconButton["default"], {
787
844
  dataId: "attachToggle",
788
- onClick: _this6.togglePViewList,
845
+ onClick: _this7.togglePViewList,
789
846
  iconName: "ZD-GN-hideTab",
790
847
  iconSize: "14",
791
848
  hoverType: "border",
@@ -1,10 +1,11 @@
1
1
  .header {
2
- height: var(--zd_size40) ;
2
+ height: var(--zd_size48) ;
3
3
  position: relative;
4
4
  z-index: 1;
5
+ padding-block:0 ;
6
+ padding-inline: var(--zd_size15) ;
5
7
  composes: alignVertical from '~@zohodesk/components/es/common/common.module.css';
6
8
  background-color: var(--zdt_attachmentviewer_header_bg);
7
- padding: 0 var(--zd_size15) ;
8
9
  border-bottom: 1px solid var(--zdt_attachmentviewer_header_border);
9
10
  }
10
11
 
@@ -22,9 +23,10 @@
22
23
  }
23
24
 
24
25
  .count {
26
+ padding-block:0 ;
27
+ padding-inline: var(--zd_size10) ;
25
28
  position: absolute;
26
29
  composes: xMiddle from '~@zohodesk/components/es/common/common.module.css';
27
- padding: 0 var(--zd_size10) ;
28
30
  }
29
31
 
30
32
  .title,
@@ -33,29 +35,21 @@
33
35
  font-size: var(--zd_font_size15) ;
34
36
  }
35
37
 
36
- [dir=ltr] .menuBar {
37
- padding-left: var(--zd_size5) ;
38
- }
39
-
40
- [dir=rtl] .menuBar {
41
- padding-right: var(--zd_size5) ;
38
+ .menuBar {
39
+ padding-inline-start: var(--zd_size5) ;
42
40
  }
43
41
 
44
42
  .mbleMenuBar {
43
+ margin-block-start: var(--zd_size8) ;
45
44
  align-self: baseline;
46
- margin-top: var(--zd_size8) ;
47
45
  }
48
46
 
49
- [dir=ltr] .menu+.menu {
50
- margin-left: var(--zd_size22) ;
51
- }
52
-
53
- [dir=rtl] .menu+.menu {
54
- margin-right: var(--zd_size22) ;
47
+ .menu+.menu {
48
+ margin-inline-start: var(--zd_size22) ;
55
49
  }
56
50
 
57
51
  .mobileMenu+.mobileMenu {
58
- margin-bottom: var(--zd_size22) ;
52
+ margin-block-end: var(--zd_size22) ;
59
53
  }
60
54
 
61
55
  .menuIcon {
@@ -85,9 +79,10 @@
85
79
  }
86
80
 
87
81
  .preview {
82
+ margin-block: var(--zd_size20) ;
83
+ margin-inline:0 ;
88
84
  composes: posrel from '~@zohodesk/components/es/common/common.module.css';
89
85
  text-align: center;
90
- margin: var(--zd_size20) 0 ;
91
86
  }
92
87
 
93
88
  .zoomIn {
@@ -128,15 +123,8 @@
128
123
  width: 100% ;
129
124
  overflow: hidden;
130
125
  transition: height var(--zd_transition3);
131
- background-color: var(--zdt_attachmentviewer_footer_bg)
132
- }
133
-
134
- [dir=ltr] .footer {
135
- padding-right: var(--zd_size68)
136
- }
137
-
138
- [dir=rtl] .footer {
139
- padding-left: var(--zd_size68)
126
+ padding-inline-end: var(--zd_size68) ;
127
+ background-color: var(--zdt_attachmentviewer_footer_bg);
140
128
  }
141
129
 
142
130
  .footerHeight {
@@ -148,7 +136,8 @@
148
136
  }
149
137
 
150
138
  .listContainer {
151
- padding: 0 var(--zd_size18) ;
139
+ padding-block:0 ;
140
+ padding-inline: var(--zd_size18) ;
152
141
  }
153
142
 
154
143
  .imgItem {
@@ -168,12 +157,8 @@
168
157
  border-color: var(--zdt_attachmentviewer_hover_border);
169
158
  }
170
159
 
171
- [dir=ltr] .imgItem+.imgItem {
172
- margin-left: var(--zd_size12) ;
173
- }
174
-
175
- [dir=rtl] .imgItem+.imgItem {
176
- margin-right: var(--zd_size12) ;
160
+ .imgItem+.imgItem {
161
+ margin-inline-start: var(--zd_size12) ;
177
162
  }
178
163
 
179
164
  .image, .crsrPointer {
@@ -335,21 +320,15 @@
335
320
 
336
321
  .author {
337
322
  max-width: var(--zd_size200) ;
338
- }
339
-
340
- [dir=ltr] .author {
341
- padding-left: var(--zd_size15) ;
342
- }
343
-
344
- [dir=rtl] .author {
345
- padding-right: var(--zd_size15) ;
323
+ padding-inline-start: var(--zd_size15) ;
346
324
  }
347
325
 
348
326
  .authorName {
327
+ margin-block:0 ;
328
+ margin-inline: var(--zd_size10) ;
349
329
  font-size: var(--zd_font_size15) ;
350
330
  color: var(--zdt_attachmentviewer_title_text);
351
331
  composes: dotted from '~@zohodesk/components/es/common/common.module.css';
352
- margin: 0 var(--zd_size10) ;
353
332
  }
354
333
 
355
334
  .btn {
@@ -361,7 +340,7 @@
361
340
  }
362
341
 
363
342
  .fileTypeImg {
364
- margin-bottom: var(--zd_size30) ;
343
+ margin-block-end: var(--zd_size30) ;
365
344
  }
366
345
 
367
346
  .previewNone {
@@ -373,7 +352,7 @@
373
352
 
374
353
  .downloadLink {
375
354
  display: inline-block;
376
- padding-top: var(--zd_size15) ;
355
+ padding-block-start: var(--zd_size15) ;
377
356
  }
378
357
 
379
358
  .previewIconDiv {
@@ -385,4 +364,4 @@
385
364
  color: var(--zdt_attachmentviewer_title_text);
386
365
  padding: var(--zd_size2) ;
387
366
  margin: auto ;
388
- }
367
+ }
@@ -19,6 +19,7 @@ var AttachmentViewer_defaultProps = {
19
19
  isActive: false,
20
20
  dataId: 'AttachmentViewer',
21
21
  i18nKeys: {},
22
- customProps: {}
22
+ customProps: {},
23
+ showCount: true
23
24
  };
24
25
  exports.AttachmentViewer_defaultProps = AttachmentViewer_defaultProps;
@@ -56,6 +56,8 @@ var AttachmentViewer_propTypes = {
56
56
  renderUnSupportedElement: _propTypes["default"].func,
57
57
  customProps: _propTypes["default"].shape({
58
58
  avatarProps: _propTypes["default"].exact(_propTypes2.propTypes)
59
- })
59
+ }),
60
+ showCount: _propTypes["default"].bool,
61
+ renderCustomIcons: _propTypes["default"].func
60
62
  };
61
63
  exports.AttachmentViewer_propTypes = AttachmentViewer_propTypes;
@@ -5,7 +5,8 @@
5
5
  }
6
6
 
7
7
  .dragtag {
8
- margin: 0 var(--zd_size10) ;
8
+ margin-block:0 ;
9
+ margin-inline: var(--zd_size10) ;
9
10
  }
10
11
 
11
12
  .audioHid {
@@ -24,12 +25,8 @@
24
25
  font-size: var(--zd_font_size11) ;
25
26
  }
26
27
 
27
- [dir=ltr] .timerBox {
28
- margin-left: var(--zd_size6) ;
29
- }
30
-
31
- [dir=rtl] .timerBox {
32
- margin-right: var(--zd_size6) ;
28
+ .timerBox {
29
+ margin-inline-start: var(--zd_size6) ;
33
30
  }
34
31
 
35
32
  .rightBox,
@@ -143,4 +140,4 @@ input::-moz-focus-inner, input::-moz-focus-outer {
143
140
  border-radius: 4px;
144
141
  }
145
142
 
146
- /* End of audio range styles */
143
+ /* End of audio range styles */
@@ -13,7 +13,7 @@ var _propTypes = require("./props/propTypes");
13
13
 
14
14
  var _useDotProvider = _interopRequireDefault(require("./hooks/useDotProvider"));
15
15
 
16
- var _excluded = ["tag", "themeAppearance", "themeColor", "baseZoomUnit", "baseFontUnit", "zoomUnitVariable", "fontUnitVariable", "themeAppearanceAttr", "themeColorAttr", "providerRef", "onAssetsDownloadSuccess", "getAssetsPromises", "children"];
16
+ var _excluded = ["tag", "themeAppearance", "themeColor", "baseZoomUnit", "baseFontUnit", "zoomUnitVariable", "fontUnitVariable", "excludeFeatures", "themeAppearanceAttr", "themeColorAttr", "providerRef", "onAssetsDownloadSuccess", "getAssetsPromises", "children"];
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
19
 
@@ -38,6 +38,7 @@ var DotProvider = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
38
38
  baseFontUnit = props.baseFontUnit,
39
39
  zoomUnitVariable = props.zoomUnitVariable,
40
40
  fontUnitVariable = props.fontUnitVariable,
41
+ excludeFeatures = props.excludeFeatures,
41
42
  themeAppearanceAttr = props.themeAppearanceAttr,
42
43
  themeColorAttr = props.themeColorAttr,
43
44
  providerRef = props.providerRef,
@@ -74,6 +75,7 @@ var DotProvider = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
74
75
  baseFontUnit: baseFontUnit,
75
76
  zoomUnitVariable: zoomUnitVariable,
76
77
  fontUnitVariable: fontUnitVariable,
78
+ excludeFeatures: excludeFeatures,
77
79
  getProviderElement: getProviderElement,
78
80
  onAssetsDownloadSuccess: onAssetsDownloadSuccess,
79
81
  getAssetsPromises: getAssetsPromises